Panel: edit-page sidebar scrolls with the page and pins when its end is in view - #2740
Draft
glennjacobs wants to merge 1 commit into
Draft
glennjacobs wants to merge 1 commit into
glennjacobs wants to merge 1 commit into
Conversation
…nd is in view Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
On the edit pages the right-hand column was
position: sticky; top: 60px. When the column is taller than the viewport that pins it at the top and it only scrolls once the main column reaches its end, so cards lower down (including any an add-on injects into the sidebar zones) go unseen.This adds a
StickySidebarcomponent and uses it on all seven edit pages (products, variants, brands, collections, product types, customers, product options):topis set to the negative overflow, so the column scrolls with the page straight away and pins when its last card reaches the bottom of the viewport.The height is measured live with a
ResizeObserver(plus window resize), so nothing is hard-coded and cards added by add-ons at runtime are accounted for. The component is exported from@lunarphp/panelfor add-on pages.Split out of #2732 at review; #2732 will rebase onto this.
Test plan
npx vitest runinpackages/panel(343 passed, 3 new cases: fits, overflows, resize)npm run type-check,npm run build(compiled bundle committed)vendor/bin/pest tests/panel/Unit/PageScaffoldTest.php🤖 Generated with Claude Code