Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use components and icon helper with offcanvas, fix issues. #3521

Merged
merged 5 commits into from Mar 21, 2024

Conversation

EreMaijala
Copy link
Contributor

@EreMaijala EreMaijala commented Mar 15, 2024

This is a bit of continuation from #3484 to get us better prepared for #3222, but also fixes some layout issues with offcanvas menu search history.
The high number of changed files is because the offcanvas links were spread over quite a few files. I consolidated them to components to clean things up and make future work easier as well.

@sturkel89
Copy link
Contributor

@EreMaijala, am I just checking to make sure that everything is identical between test and dev in all three themes? Or are there specific improvements that should be visible to me?

I know that I'll have to set offcanvas = true in config.ini, and try it in English and in Hebrew/Arabic. Are there any other specific things you'd like me to look at?

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @EreMaijala -- one question and one suggestion.

return '';
}
?>
<a class="search-filter-toggle icon-link" href="#search-sidebar" data-toggle="vufind-offcanvas" title="<?=$this->transEscAttr('sidebar_expand') ?>">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the only difference between the two show templates is the href, would it make more sense to have a single component with an argument? Or am I missing some more significant difference between the two templates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link text is also different. I thought about a common template for them, but decided to keep the templates independent. I can add a common template they both use, if you think that's clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case, if we keep them separate, it's easier for customization. But of course harder for maintenance.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think there's a likely use case where somebody customizes one of these but not the other? It seems more likely that the user would want the same button behavior in both cases. Making the template more generic not only helps with that but also reduces the amount of redundant hard-coded strings in the template code (since the link is generated two different ways, and the text is currently repeated in both cases).

If somebody really did want to customize this differently in each situation, it would be possible to add a conditional based on the href.

All of these things make me lean toward a single template with parameters instead of two separate templates. But if you have a really strong use case for two templates, I can be persuaded otherwise. :-)

@EreMaijala
Copy link
Contributor Author

@EreMaijala, am I just checking to make sure that everything is identical between test and dev in all three themes? Or are there specific improvements that should be visible to me?

I know that I'll have to set offcanvas = true in config.ini, and try it in English and in Hebrew/Arabic. Are there any other specific things you'd like me to look at?

Everything else should be pretty much the same as before, but the alignment of the offcanvas account menu should be better in search history (when logged in).

Copy link
Contributor

@sturkel89 sturkel89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I compared test vs. dev in all themes and in both kinds of languages.

Everything is identical between test and dev except for two kinds of things - one an improvement, and the other something that I think needs a small additional tweak.

IMPROVEMENT

The layout of the My Account area looks much better in test.

Dev:
image

Test:
image

TWEAK NEEDED

Arrows in right to left languages seem to be pointing the wrong way in test. At least, a different logic is applied in those languages than in left to right languages than is applied in dev. See what you think:

Dev in English:
The arrows say: "look this way!"
image

image

Dev in Hebrew:
The arrows say: "look this way!"
image
image

TEST in English matches dev in English.

TEST in Hebrew:
These arrows look weird to me.
image
image

What do you think? I'm submitting this review as "request changes," but if the change is deliberate and is approved by a Hebrew- or Arabic-speaker, then please feel free to disregard my comments. :-)

@EreMaijala
Copy link
Contributor Author

@sturkel89 Good catch! I failed to take RTL into account. Should be fixed now.

@demiankatz Now the template is more complicated so I had no problem moving to a common base; refactored. :)

Copy link
Contributor

@sturkel89 sturkel89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the arrows are now correct in both RTL languages. That had been my only concern, so I think this is ready to merge. Thanks!

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @EreMaijala and @sturkel89!

@demiankatz demiankatz added this to the 10.0 milestone Mar 21, 2024
@demiankatz demiankatz merged commit 2c9f344 into vufind-org:dev Mar 21, 2024
7 checks passed
@demiankatz demiankatz deleted the dev-offcanvas-icons branch March 21, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants