TUL/Fix SSR overlay never revealing after reload (add id="main-content")#1358
Merged
Merged
Conversation
The SSR anti-flicker overlay (src/index.html) is removed event-driven only once AppComponent.dsAppHasRenderedContent() finds dsApp.querySelector( '#main-content') (src/app/app.component.ts:197). TUL's root template rendered <main class="main-content"> WITHOUT that id (it predates the upstream skip-to-main-content commit that other branches carry, so backport #1310 shipped a selector precondition this template never satisfied). The event-driven reveal could therefore never fire, and the overlay was removed only by the 10s settle cap (ssrOverlaySettleMaxMs) on EVERY hard reload: during that window the opaque snapshot masks the live app while clicks pass through (pointer-events:none) and navigate invisibly -> the page looks frozen and "does not respond after reload". Fix: add id="main-content" to <main>, matching zcu-pub/vsb-tuo and the selector AppComponent already expects. The custom theme reuses this base template (themes/custom/app/root/root.component.ts), so one edit covers all themes; app.component.ts is left byte-identical to the other customer branches (no local selector hardening) to keep backports clean. Adds a root.component.spec regression test that renders the real template and asserts #main-content exists — app.component.spec fabricated its own <ds-app> with the id, which masked this divergence from the unit suite. Co-Authored-By: Claude Fable 5 <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.
Problem description
On the TUL instance the home page froze for ~10 s on every hard reload ("stránka nereaguje po reloade") — the same SSR anti-flicker fix (#1287 → TUL #1310, #1354) works correctly on ZCU. This backport shipped a selector precondition TUL's template never satisfied.
Root cause
The SSR anti-flicker overlay (
src/index.html) is removed event-driven only onceAppComponent.dsAppHasRenderedContent()findsdsApp.querySelector('#main-content') !== null(app.component.ts:197).TUL's root.component.html:8 rendered
<main class="main-content">withoutid="main-content"— TUL's template predates the upstream skip-to-main-content commit that added the id (which zcu-pub/vsb-tuo carry as<main class="my-cs" id="main-content">). So:race(settled$, timer(ssrOverlaySettleMaxMs=10000))always resolves via the 10 s cap → the overlay is removed 10 s after the auth/theme gate opens, on every reload.pointer-events:none, so clicks pass through and navigate invisibly while the visible page never updates → perceived "page not responding".Why tests didn't catch it:
app.component.spec.tsfabricates its own<ds-app>containing<main id="main-content">, so the overlay unit tests passed on TUL despite the real template lacking the id.Empirical confirmation (Playwright, pre-fix, live dev-5): overlay removed at 14.6 s after navigation start (gate-open + 10 s cap),
hasMainContent: false, and a click during the mask changed the URL to/community-listwhile the overlay stayed up →visibleResponse: false.Fix
Add
id="main-content"to<main>insrc/app/root/root.component.html— matching zcu-pub/vsb-tuo and the selectorAppComponentalready expects. Thecustomtheme reuses this base template (themes/custom/app/root/root.component.ts), so one edit covers all themes.app.component.tsis left byte-identical to the other customer branches (no local selector hardening) to keep future overlay backports clean, per reviewer consensus.Adds a
root.component.spec.tsregression test that renders the real root template and assertsmain#main-contentexists — this fails on pre-fix TUL and prevents a silent re-drop in future merges.Analysis
Verified by a 4-way analyst panel (root-cause / divergence-sweep / UX / fix-critic): the missing id is the only overlay-affecting divergence vs. the working branches (no carousels or sub-600 ms DOM churn on TUL's home/admin pages that could defeat the settle window; #1354 gutter backport is complete; auth/theme gate behaves like ZCU). Fix verdict: APPROVE.
Manual Testing
/homehard reload — overlay lifts event-driven, no 10 s freezeCopilot review