Repository navigation
Sidebar: the released version below the menu's last item, never over it - #20
Merged
Merged
Conversation
The version badge sat after the menu's scrolling box, pinned to the bottom of the sidebar, so under a long menu it covered the end of the menu (recomaty-panel#650). It is now the last thing in the box (`adminata_sidebar_release` moved into `.adm-sidebar-nav`, after the menu and before the place script): - under a menu taller than the box it comes right after the last item and scrolls with the menu, out of sight until the menu is scrolled to its end; - under a shorter one it sits at the bottom of the sidebar: the box now takes the rest of the sidebar's height (`flex: 1 1 auto; min-height: 0`), and the badge's `margin-top: auto` takes the free space above it. Tests: the demo's browser environment (APP_ENV=browser, the Panther suites) gets a version, and DashboardPantherTest measures where the badge lands, folded in a 900 px window and unfolded in a 420 px one, before and after scrolling to the end; DemoSmokeTest pins it inside the box, after the menu and before the place script. The demo, the fixtures' content and the screenshot baselines show no version, as before. CHANGELOG entry updated (unreleased, same day).
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.
What this changes
The released version (
options.released_version, #18) no longer covers the end of a long menu (recomaty/recomaty-panel#650).adminata_sidebar_releasemoved into.adm-sidebar-nav, after the menu and before the place script (Sidebar: the menu keeps its place across page loads, from the first paint #19). Placed there, the script finds the box at its full height.What that gives, as asked:
flex: 1 1 auto; min-height: 0), and the badge'smargin-top: autotakes the free space above it.Contract
adminata_sidebar_releasekeeps its name and moves into the box;.adm-sidebar-navnow grows.side_bar_after_nav) still sees it there. That card'smt-autonow actually moves it down, as upstream intended.Gates
Run locally:
make lint: CS-Fixer andcheck-namesclean,lint:twigOK.make lint-js, stylelint and Vitest all pass (281/281).testTheReleasedVersionEndsTheSidebarWithoutCoveringTheMenu, which measures the badge on screen:when@browserdefault in the demo'spackages.yaml. The demo, the fixtures' content and the screenshot baselines show none.DemoSmokeTestpins the badge inside the box, after the menu and before the place script.JsFixtureDumperTestpasses aftermake js-fixtures, which re-dumped the fixtures for whitespace only.sidebar-place,markup,hygiene,accessibility,dashboard).margin-top: auto;position: sticky;CI: PHPStan and Rector are expected to fail exactly as on
main's nightly run (43 errors, 5 files); I compare before merging.Screenshots
The demo with
ADMINATA_DEMO_RELEASED_VERSION='v10.1.0+3·ab12cd3', 1920×1080. Its menu is short, so the version sits at the bottom of the sidebar (case b).Light:

Dark:

Case a (a long menu) can't be shown with the demo's five entries at 1080 px. The Panther test above covers it, and recomaty-panel's PR has screenshots of it (private repo, so they're not copied here).
Changelog
Unreleased→ Added: the released-version entry now says where the badge goes.— [Bober] 🦫