Commit dce52f0
fix(ssr-overlay): drop anti-flicker overlay after content paints (not on isStable or bare auth gate) (#1318)
The SSR anti-flicker overlay (PR #1288) is removed by AppComponent. Two prior
approaches each fixed one symptom and reintroduced the other:
- #1288 waited for ApplicationRef.isStable: no flicker, but admin sessions keep
the zone busy (authz/widgets, polling, AAI scripts) so isStable fires many
seconds late (or hits the 15s fallback), leaving the live, already-rendered page
masked & non-interactive (dspace-customers#725).
- #1317 switched to the loader-swap gate (!isAuthenticationBlocking &&
!isThemeLoading) + a single requestAnimationFrame: fast/interactive, but the
gate only un-hides <router-outlet> and one rAF runs before paint, so the
snapshot is dropped over an empty <ds-app> -> the flicker returned.
Neither signal means "the routed content is painted AND the app is interactive":
isStable over-waits (couples removal to unrelated background async); the auth/theme
gate under-waits (decoupled from actual content paint).
This keeps #1317's decoupling from isStable but, after the gate opens, waits across
animation frames until the real <ds-app> is actually laid out (height >= 200px AND
its #main-content host present) before removing the overlay, capped at ~3s
(MAX_FRAMES) so background async can never hold it open. The 15s fallback in
index.html stays as the catastrophic-error net.
Verified (DSpace 7.6.5 backend, CPU 4x, hard reload, admin session):
- #1288: TTI 15963ms (page masked ~13s) #1317: ds-app height 0 at removal (217ms flash)
- fix: TTI ~3.1-3.4s, ds-app height 5281px at removal, gap <= 0 (no flash), 3x deterministic;
anon reload also no-flicker; 0 CORS and 0 SSR/hydration/NG0 console errors.
Verification videos are linked in the PR description.
Refs: dspace-customers#725, PR #1288, PR #1317
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 96ab415 commit dce52f0
1 file changed
Lines changed: 74 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
104 | 114 | | |
105 | 115 | | |
106 | 116 | | |
| |||
116 | 126 | | |
117 | 127 | | |
118 | 128 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
126 | 172 | | |
127 | 173 | | |
128 | 174 | | |
129 | | - | |
130 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
131 | 188 | | |
132 | 189 | | |
133 | 190 | | |
| |||
0 commit comments