Olivero sets inconsitent classes between its menu and book tree templates for active trail.

Split from #3260592: Change Bartik-specific tests to Olivero (or appropriate alternative) in preparation for making Olivero the default

templates/navigation/menu.html.twig: *   - in_active_trail: TRUE if the link is in the active trail.
templates/navigation/menu.html.twig:            item.in_active_trail ? 'menu__item--active-trail',
templates/navigation/menu.html.twig:            item.in_active_trail ? 'menu__link--active-trail',
templates/navigation/book-tree.html.twig:          item.in_active_trail ? 'menu-item--active-trail',
templates/navigation/book-tree.html.twig:          item.in_active_trail ? 'menu__link--active-trail',

Steps to reproduce

Proposed resolution

Make both classes consistent.

Either do so in a way that doesn't require test changes when Olivero is the default theme, or if not, adjust the test coverage here.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#8 3276618-8.patch3.09 KBeojthebrave
#5 3276618-5.patch872 bytesmherchel
#2 3276618.patch638 bytescatch

Comments

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review
StatusFileSize
new638 bytes

This just makes it the same as the book one, which would mean no test changes or Olivero special casing in the menu active trail test.

We might want a follow-up to continue the work in #3248309: AssertBreadcrumbTrait should not rely on Classy so that MenuActiveTrailTrait doesn't rely on the standard profile, which would allow Olivero to diverge without breaking any tests.

If we don't do this here, then I think #3219959: Update standard profile so Olivero is the default theme should just change the assertion in that trait without special casing Olivero (as in, just switch from one to the other), but in that case, I think this issue ought to bring the book classes into line.

catch’s picture

mherchel’s picture

The patch in #2 works, but .menu-item is not a proper CSS BEM block. We should remove that instead and standardize on the .menu CSS BEM block

New patch incoming shortly

mherchel’s picture

StatusFileSize
new872 bytes
catch’s picture

I thought you might say that, this is fine, but it means we need to resolve #3276652: AssertMenuActiveTrailTrait should not rely on classy/bartik, or at least make the trait hard code Olivero markup instead of Bartik/classy markup, before Olivero can be stable then, to avoid test failures.

gábor hojtsy’s picture

Issue tags: +Portland2022
eojthebrave’s picture

StatusFileSize
new3.09 KB

Here's a version of the patch from #5 that updates AssertMenuActiveTrailTrait with an or statement so that it'll work with either the CSS class from classy. This is at least a stop-gap measure to work around this issue until we can come up with a better long term solution in #3276652: AssertMenuActiveTrailTrait should not rely on classy/bartik

catch’s picture

Status: Needs review » Reviewed & tested by the community

OK I think that is reasonable, basically we're hard-coding two themes instead of one, but it means contrib tests that rely on classy won't be broken (which they would be if we just changed the assertions to match Olivero), and it's not obvious how to change this test to be stark-compatible without changing the assertions a lot. #3276652: AssertMenuActiveTrailTrait should not rely on classy/bartik is already open for that.

gábor hojtsy’s picture

  • 5f09291 committed on 10.0.x
    Issue #3276618 by catch, mherchel, eojthebrave, Gábor Hojtsy: Olivero...

  • 06fb03e committed on 9.4.x
    Issue #3276618 by catch, mherchel, eojthebrave, Gábor Hojtsy: Olivero...
gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Looks good. We discussed this in person, and this was the only sensible backwards compatible way to approach this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.