TUL/Backport #1333: admin-sidebar gutter via CSS var (no logged-in reload shift)#1354
Open
jr-rk wants to merge 1 commit into
Open
TUL/Backport #1333: admin-sidebar gutter via CSS var (no logged-in reload shift)#1354jr-rk wants to merge 1 commit into
jr-rk wants to merge 1 commit into
Conversation
… shift) Backport of #1333 (originally landed on customer/vsb-tuo). Problem: for an authenticated user, a hard reload shifted the whole page right by the admin-sidebar width when the SSR snapshot was removed. The .outer-wrapper left gutter was produced by the @slideSidebarPadding animation, whose width is read from a browser-only CSS-variable store; on the server that store is empty so it renders padding-left:0, then the browser resolves the real width and the page jumps. Fix: drive the gutter from a CSS class (ds-admin-sidebar-{hidden,unpinned,pinned}, set from a small sidebarPaddingState$) whose padding-left resolves from the admin-sidebar width custom properties in CSS. CSS resolves those identically on the server (the SSR snapshot) and the browser (the live app), so there is no shift and no hardcoded width. The pin/unpin slide is preserved via transition:padding-left, gated behind ds-admin-sidebar-animate (enabled only after the first browser paint) so the initial SSR->CSR gutter resolution does not animate. Translated to this branch's root.component (older DSpace 7.5 generation, empty root scss recreated, gutter var --ds-collapsed/total-sidebar-width), not a cherry-pick. Refs: dataquest-dev/dspace-customers#717, #1333 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Backport of #1333 (originally landed on
customer/vsb-tuo) totul. Part of the SSR anti-flicker family tracked in dataquest-dev/dspace-customers#717.Problem
For an authenticated user, a hard reload shifted the whole page right by the admin-sidebar width the moment the SSR snapshot was removed. (Anonymous users were fine — no admin sidebar, no gutter.) The
.outer-wrapperleft gutter came from the@slideSidebarPaddinganimation, whose width is read from a browser-only CSS-variable store; on the server that store is empty so it renderedpadding-left:0, then the browser resolved the real width and the page jumped.Fix
Drive the gutter from a CSS class (
ds-admin-sidebar-{hidden,unpinned,pinned}, set from a smallsidebarPaddingState$) whosepadding-leftresolves from the admin-sidebar width custom properties in CSS — resolved identically on the server (snapshot) and the browser (live app), so no shift and no hardcoded px. The pin/unpin slide is preserved viatransition: padding-left, gated behindds-admin-sidebar-animate(enabled only after first browser paint) so the initial SSR→CSR gutter resolution doesn't animate.This branch
Older DSpace 7.5
root.component; its root.scsswas empty and was recreated with just the gutter rules. Gutter resolves from--ds-collapsed-sidebar-width/--ds-total-sidebar-width.Translate-not-transplant: re-derived against this branch's
root.componentgeneration, not a cherry-pick.Verification
Refs: dataquest-dev/dspace-customers#717, #1333