Pages with a visible H1 keep exactly one H1 while loading
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
A page that registers hasVisibleHeading: true has no H1 while its content is loading, because the visible <h1> renders only after load and the core suppresses the hidden one. For #4922, every page should have exactly one H1 at all times.
Complexity: Medium Target branch: develop
Context
usePageTitletakeshasVisibleHeadingonce, at registration.AppBarPageandImmersivePagethen render no hidden<h1>.- Many Coach pages render their
<h1>behindv-if="!pageLoading"orv-if="!loading", e.g.CourseSummaryPage,UnitDetailPage,CoachImmersivePagecontent. - Repro: Jest-render
CoachImmersivePage :loading="true"inside a component registering{ hasVisibleHeading: true }: 0 H1s. Withloading=false: 1. develop(vue-meta) rendered no hidden H1 at all, so this is a gap in the new mechanism, not a regression.
The Change
- A page with a visible
<h1>has exactly one H1 in every state, including while loading. - The core decides when the hidden
<h1>stands in, so pages need no loading-specific code.
Acceptance Criteria
General
- [ ] While Coach > Plan > Courses > <course> is loading, the page has one H1; after load it still has one.
- [ ] Pages without a registered
hasVisibleHeadingare unchanged.
Testing
- [ ] A Jest test covers a page with a visible heading in its loading and loaded states.
References
usePageTitle.js:hasVisibleHeadingandpageHeading.AppBarPage/index.vue#L41-L46: where the hidden<h1>renders.
AI usage
Claude Code found this while reviewing the #15394 branch and drafted the issue; the loading-state repro was run in Jest.
Plan: A page registering hasVisibleHeading: true has exactly one H1 in every state, including while loading (#15467).
- [ ] Shells render the hidden H1 until the page's own H1 renders
- [ ] Coach course page loading state
- [ ] Self-review the produced code
Assumptions — the issue did not settle these; say so if one is wrong.
- Coach course-page AC waits on #15476 registering
CourseSummaryPage; if this merges first, the live check moves to that PR. - Unflagged pages with their own H1 keep two H1s, per "unchanged"; if one H1 is wanted there too, detection applies to all registrations.
- An H1 counts only inside the shell's
#main; a page H1 rendered elsewhere (teleported panel) would leave the hidden one in place. - Focus on the hidden H1 is lost when it unmounts after load; #15398 (PR #15485) owns refocusing, else it needs a hand-off here.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
- Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
- Ran the project's full test suite and linter before committing
- For UI changes: captured live screenshots to verify rendering
- For backend changes: verified with example API/CLI output