Repository navigation
fix: link the feature gallery's contents to authored sections and keep option cards' first box on upgrade - #6396
Merged
Merged
Conversation
…option card's first box on upgrade #6315 moved two feature-gallery parts that ask nothing of their own, the evidence widgets and the interactive sample, from `<section role="group">` to `lf-group`. A heading inside an `lf-group` titles no element (`titledElement` reads only `section` and `article`), so the contents lent each of those `h2`s a generated id instead of linking to the part's authored id. Both are plain parts of the page again, `<section>`s, so the contents links them by their own ids. The same change's `lf-group` worked example is the first to show a live, one-line labeled option card at working density. The pick mark the runtime adds floats over a 22px state band (`--lf-card-state-height`), so the card grew from a 20.3px line to 22px on upgrade. The card's content now holds that band before the mark arrives; once the mark is there its float holds the same height, so the presented card does not change. Behavior changed: an unupgraded labeled option card in a live group is at least the state band tall. Closes #6388
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the two nightly journey failures that #6315 caused. The feature gallery's "On this page" contents linked two rows to generated heading ids, and the new
lf-groupworked example's option cards grew 2px on upgrade. Before this change both tests fail on main, and after it both pass locally:tests/journeys/test_render_navigation.py::test_the_feature_gallery_exercises_its_core_journeystests/journeys/test_widget_quality.py::test_bundled_widgets_meet_the_widget_quality_checks[default]Contents. #6315 changed two gallery parts from
<section role="group">tolf-group: "Evidence widgets" (#bg-default-presentation) and "Interactive sample on this page" (#bg-inline-sample-section). Neither part asks a question of its own. #6315 also settled that a heading names only asectionorarticleit opens (titledElementinbrowser/runtime/addressable-names.js), so a heading never names a Leaf element. That leaves theh2inside each group as its own destination, and the contents lent it anlf-bg-contents-section-Nid. This change makes both parts plain<section>s again, so the contents links them by their authored ids.leaf page checkon the gallery stays clean.Option card. A labeled option in a live group gets a pick mark from the runtime. The mark floats over a 22px state band (
--lf-card-state-height). At working density a one-line card's line is 20.3px, so the card grew from 40.3px to 42px once the mark arrived. I checked this outside the gallery: the group isn't a flex box before or after upgrade, so the growth comes from the card itself, not fromlf-group. #6315 added the first worked example with that card shape. Inpackages/default/styles/options.css, the card's content box now holds the band's height before the mark arrives. After upgrade the float already holds that height, so the presented card doesn't change.leaf-dev stillsforship-option-references,alert-options-in-pane,settled-option,plan-option-card-picked,ideas-askandhub-choicereports 6 of 6 states unchanged against main. The 47 option-layout tests intests/browser/test_render_options.py(-k "height or row or card or box") pass.Left open, not changed here: on any page, a question
lf-groupwhose heading is a contents row gets a lent heading id rather than the group's authored id. That follows from #6315's naming rule. Whether the contents should prefer an enclosinglf-group's id is a design call for that rule, not something this fix decides.Closes #6388 — automated triage