Commit 0572103
fix(ssr-overlay): render admin-sidebar gutter on the server so logged-in reload doesn't shift
Follow-up to the anti-flicker overlay: with the overlay in place, an authenticated user's hard reload
still showed the content visibly jump right by the admin-sidebar width at the moment the snapshot was
removed. Root cause is independent of the overlay (the overlay just makes it a visible "reveal"):
RootComponent computes the @slideSidebarPadding (outer-wrapper padding-left) from
`cssService.getVariable('--ds-admin-sidebar-fixed-element-width')`, but that store is only populated in
the browser (AppComponent.storeCSSVariables -> getComputedStyle). On the server the variable never
resolves, `skipWhile(!val)` blocks forever, and the SSR HTML renders `outer-wrapper { padding-left: 0 }`.
The browser then resolves the real width and applies `padding-left: 55px`, so the whole authenticated
page (and the SSR snapshot, which is just that server HTML) jumps right by the sidebar width on reveal.
Fix: on the server, fall back to the compiled default sidebar width (see $ds-admin-sidebar-* in
src/styles/_bootstrap_variables.scss) so the SSR layout already reserves the gutter; in the browser keep
waiting for the real, theme-overridable value. Non-admins are unaffected (state stays 'hidden' -> 0).
Verified locally (authenticated admin, real UA, throttled hard reload):
- SSR HTML outer-wrapper inline style is now `padding-left:55px` (was `padding-left:0`).
- snapshot vs settled `#main-content` x = 55px in both -> horizontal shift at reveal = 0px (was 55px).
Refs: dspace-customers#725, PR #1321
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 3079e57 commit 0572103
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
53 | 63 | | |
54 | | - | |
| 64 | + | |
55 | 65 | | |
56 | 66 | | |
57 | 67 | | |
58 | | - | |
| 68 | + | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
| |||
0 commit comments