Skip to content

SAV/Backport #1333: admin-sidebar gutter via CSS var (no logged-in reload shift)#1351

Open
jr-rk wants to merge 1 commit into
customer/savfrom
sav/fe-admin-sidebar-ssr-padding
Open

SAV/Backport #1333: admin-sidebar gutter via CSS var (no logged-in reload shift)#1351
jr-rk wants to merge 1 commit into
customer/savfrom
sav/fe-admin-sidebar-ssr-padding

Conversation

@jr-rk

@jr-rk jr-rk commented Jul 3, 2026

Copy link
Copy Markdown

Backport of #1333 (originally landed on customer/vsb-tuo) to sav. 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-wrapper left gutter came from the @slideSidebarPadding animation, whose width is read from a browser-only CSS-variable store; on the server that store is empty so it rendered padding-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 small sidebarPaddingState$) whose padding-left resolves 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 via transition: padding-left, gated behind ds-admin-sidebar-animate (enabled only after first browser paint) so the initial SSR→CSR gutter resolution doesn't animate.

This branch

Older DSpace 7.6.1 root.component (fields sidebarVisible/slideSidebarOver). Gutter resolves from this theme's --ds-collapsed-sidebar-width / --ds-total-sidebar-width.

Translate-not-transplant: re-derived against this branch's root.component generation, not a cherry-pick.

Verification

Refs: dataquest-dev/dspace-customers#717, #1333

… 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.6.1 generation, 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>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9f8121e0-dc52-4be3-a465-b3c844bf67de

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jr-rk jr-rk changed the title Backport #1333: admin-sidebar gutter via CSS var (no logged-in reload shift) SAV/Backport #1333: admin-sidebar gutter via CSS var (no logged-in reload shift) Jul 3, 2026
@jr-rk jr-rk self-assigned this Jul 3, 2026
@jr-rk jr-rk requested a review from milanmajchrak July 3, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant