Bug 36337

Summary: Hiding lists with OpacPublic breaks styling for language list
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: RESOLVED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: minor    
Priority: P5 - low CC: david, dcook, jonathan.druart, lucas, schodkowy.omegi-0r
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 33244, 37833, 37841    
Bug Blocks:    
Attachments: Bug 36337: Hiding lists with OpacPublic breaks styling for language list
Bug 36337: Hiding lists with OpacPublic breaks styling for language list
Bug 36337: Hiding lists with OpacPublic breaks styling for language list
Bug 36337: Hiding lists with OpacPublic breaks styling for language list

Description Katrin Fischer 2024-03-17 16:59:41 UTC
Added from the comment on bug 33244:

Hello, [this patch] seems to have a side effect of the "Language" dropdown now being awkwardly placed on center-right (regardless of whether user is logged in our out). This is caused by the below CSS rules whose blame traces back to this patch, and removing them fixes the issue.

#members {
+    flex-grow: 1;
+     justify-content: flex-end;

Is this intentional change? I can only assume it's not, since I don't see any mention of this in the discussion.

Screenshots of the problem: https://imgur.com/a/hDZvn7B

It looks like this patch conditionally hides cart+lists. The CSS above then makes only language shown on the left, and the login on the right. But when things aren't hidden, it changes the original position.

Should I create a new bug about this?
Comment 1 Michał 2024-03-18 08:22:33 UTC
Thanks for creating the bug.

To clarify though: the issue shows up when the lists are NOT hidden (which is the default). They added the feature of hiding lists and fixed the styling when they're hidden, but in turn broke the styling when they're normally shown.
Comment 2 Michał 2024-03-19 07:23:19 UTC
So I see three possible ways of fixing it:

1. Somehow making it so that while lists are shown, the languages are on the right as they were, and if hidden, on the left (will probably require adding a new CSS class to toggle the behavior, as I couldn't figure out any CSS trick for this)

2. Reverting and making it so that languages are always on the right, while nothing is shown on the left if lists are disabled

3. Make languages always on the left

I wouldn't favor option #3 since that changes the UX and I think language belongs to the right next to user settings. In spirit of the original bug, I think they intended for #1 (to avoid keeping the space on left empty?). I personally think #2 might be the best? I mean there are many sites that have logo on the left and all toolbars on the right, it would look perfectly okay.

I could try taking a stab at making a patch, but I'd welcome some opinions on the above I guess...
Comment 3 Owen Leonard 2024-06-26 12:03:19 UTC
Created attachment 168139 [details] [review]
Bug 36337: Hiding lists with OpacPublic breaks styling for language list

This patch adjusts the CSS of elements in the OPAC header so that menu
items are correctly aligned with various combinations of the OpacPublic
and OpacLangSelectorMode system preferences.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

- View the header menu in the OPAC with these combinations of settings:
  - OpacPublic = On; OpacLangSelectorMode = Top;
  - OpacPublic = On; OpacLangSelectorMode = Footer;
  - OpacPublic = Off; OpacLangSelectorMode = Top;
  - OpacPublic = Off; OpacLangSelectorMode = Footer;
- With each configuration, test that the elements in the header (Logo,
  Cart/List menu, Language selctor, and user menu items) align
  correctly. The Cart/List menu items should always align to the left,
  the Language selector and user menu should aways align to the right.

Sponsored-by: Athens County Public Libraries
Comment 4 David Nind 2024-06-27 01:40:01 UTC
Created attachment 168186 [details] [review]
Bug 36337: Hiding lists with OpacPublic breaks styling for language list

This patch adjusts the CSS of elements in the OPAC header so that menu
items are correctly aligned with various combinations of the OpacPublic
and OpacLangSelectorMode system preferences.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

- View the header menu in the OPAC with these combinations of settings:
  - OpacPublic = On; OpacLangSelectorMode = Top;
  - OpacPublic = On; OpacLangSelectorMode = Footer;
  - OpacPublic = Off; OpacLangSelectorMode = Top;
  - OpacPublic = Off; OpacLangSelectorMode = Footer;
- With each configuration, test that the elements in the header (Logo,
  Cart/List menu, Language selctor, and user menu items) align
  correctly. The Cart/List menu items should always align to the left,
  the Language selector and user menu should aways align to the right.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2024-06-27 01:46:17 UTC
Testing notes (using KTD):

1. Need to have another language installed - see https://gitlab.com/koha-community/koha-testing-docker#translation-files
   . cd misc/translator/po
   . git fetch origin
   . git reset --hard origin/main
   . in the koha shell (ktd --shell), gulp po:update --lang fr-CA
   . exit from shell, and change to a root shell: ktd --root --shell
   . cd koha
   . koha-translate --install fr-CA --dev kohadev
   . restart_all

2. Enable the language for the OPAC:
   . OPACLanguages system preference - make sure languages are ticked
   . opaclanguagesdisplay system preference set to Allow

3. Regenerate the CSS: yarn build

4. Restart everything: restart_all
Comment 6 Jonathan Druart 2024-09-05 08:21:49 UTC
Not sure if this is this patch that needs to fix it, but I found a bad display when en and en-GB are selected: https://snipboard.io/iBNjEn.jpg (bottom left)
Comment 7 Owen Leonard 2024-09-05 11:37:46 UTC
(In reply to Jonathan Druart from comment #6)
> Not sure if this is this patch that needs to fix it, but I found a bad
> display when en and en-GB are selected

Bug 37841 - Switch OPAC language menu alignment in header and footer
Comment 8 Owen Leonard 2024-09-11 15:03:07 UTC
Created attachment 171339 [details] [review]
Bug 36337: Hiding lists with OpacPublic breaks styling for language list

This patch adjusts the CSS of elements in the OPAC header so that menu
items are correctly aligned with various combinations of the OpacPublic
and OpacLangSelectorMode system preferences.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

- View the header menu in the OPAC with these combinations of settings:
  - OpacPublic = On; OpacLangSelectorMode = Top;
  - OpacPublic = On; OpacLangSelectorMode = Footer;
  - OpacPublic = Off; OpacLangSelectorMode = Top;
  - OpacPublic = Off; OpacLangSelectorMode = Footer;
- With each configuration, test that the elements in the header (Logo,
  Cart/List menu, Language selctor, and user menu items) align
  correctly. The Cart/List menu items should always align to the left,
  the Language selector and user menu should aways align to the right.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Comment 9 Jonathan Druart 2024-09-12 07:29:37 UTC
Created attachment 171357 [details] [review]
Bug 36337: Hiding lists with OpacPublic breaks styling for language list

This patch adjusts the CSS of elements in the OPAC header so that menu
items are correctly aligned with various combinations of the OpacPublic
and OpacLangSelectorMode system preferences.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

- View the header menu in the OPAC with these combinations of settings:
  - OpacPublic = On; OpacLangSelectorMode = Top;
  - OpacPublic = On; OpacLangSelectorMode = Footer;
  - OpacPublic = Off; OpacLangSelectorMode = Top;
  - OpacPublic = Off; OpacLangSelectorMode = Footer;
- With each configuration, test that the elements in the header (Logo,
  Cart/List menu, Language selctor, and user menu items) align
  correctly. The Cart/List menu items should always align to the left,
  the Language selector and user menu should aways align to the right.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Katrin Fischer 2024-09-13 11:58:22 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 11 Lucas Gass (lukeg) 2024-11-18 16:05:36 UTC
Missing dependencies for 24.05.x
Comment 12 David Cook 2025-01-30 03:20:48 UTC
Looks like this is needed for 24.05 and 23.11 since bug 33244 caused the regression and they're both affected versions.

But then this fix was done in a way that depends on bug 35402 which makes it impossible to backport?

That's super frustrating...

I suppose the short-term workaround is just to hide div#header_langmenu. 

I imagine 24.05 and 23.11 specific fixes could be worked out if it becomes necessary...