kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Learn page titles come from the core composable

Open rtibblesbot opened this issue 2 months ago • 3 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

11 Learn components set their tab title with vue-meta's metaInfo. Only TopicsContentPage defines a titleTemplate, so only pages it wraps get the " - Kolibri" suffix and the "Error - Kolibri" title. For #4922 they should register through the core composable.

Complexity: Medium Target branch: develop

The Change

  • Each Learn component that uses metaInfo registers the same title with the core composable instead.
  • TopicsContentPage's titleTemplate and its kolibriTitleMessage and errorPageTitle strings are removed.
  • Learn pages with a visible <h1> opt out of the hidden H1.
  • Each registered title message moves out of the component's $trs into a createTranslator object, passed to the composable directly.

Out of Scope

  • Focus after navigation: sibling "Focus moves to the page's H1 after each route change".
  • Title wording: #4466.

Acceptance Criteria

General

  • [ ] Every Learn tab title is its develop title, with " - Kolibri" appended where develop lacks it.
  • [ ] An errored Learn page's tab title is "Error - Kolibri".
  • [ ] Every Learn page has exactly one H1.
  • [ ] grep -rn metaInfo kolibri/plugins/learn finds nothing.
  • [ ] No title passed to the composable is read from a component's $trs, and no caller uses getCurrentInstance.

References

AI usage

The assigner chose the approach and scope in #4922; Claude Code chose this split and drafted the issue from a survey of the code.

rtibblesbot avatar Sep 26 '26 09:09 rtibblesbot

Plan: The 11 Learn metaInfo components register their titles with kolibri/composables/usePageTitle; TopicsContentPage's titleTemplate goes.

  • [ ] Resource viewer — TopicsContentPage + ContentPage
  • [ ] Browse pages — Library, NoResource, Topics, Bookmarks
  • [ ] Classes and quizzes
  • [ ] Self-review the produced code

Assumptions — the issue did not settle these; say so if one is wrong.

  • DO NOT TRANSLATE joiners become parts arrays; if wrong, move them verbatim and RTL titles lose their separator marks.
  • OtherLibraries' "Other libraries" <h1> becomes an <h2>; if wrong, logged-in Library keeps two H1s.
  • HomePage gets no title or H1, since it has no metaInfo; if wrong, it needs a new title string (#4466 wording).
  • CourseUnitView quizzes keep two H1s (no metaInfo); if wrong, demote the course renderers' "Question N of M" <h1>.
  • Custom-channel TopicsPage keeps zero H1 (no shell, full-page iframe); if wrong, that branch needs its own hidden <h1>.
  • Library search results have zero H1, left to #15467; if wrong, Library must drop hasVisibleHeading and demote its visible <h1>s.
  • AllClassesPage reads isUserLoggedIn once at setup; if sign-in can happen without a reload, the guest H1 count goes stale.

@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

rtibblesbot avatar Oct 03 '26 22:10 rtibblesbot

rtibbles Blocked — these cannot be assumed either way:

  • Does "every Learn page has exactly one H1" cover pages this branch does not touch? Both fail today, on develop too: - HomePage has no H1; the fix registers coreStrings.homeLabel$, adding a "Home - Kolibri" tab title develop never set. - CourseUnitView quizzes have two H1s; the fix demotes "Question N of M" in courses/QuizRenderer and courses/PrePostTestRenderer to <h2>.

@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

rtibblesbot avatar Oct 03 '26 22:10 rtibblesbot

Yes, if your "fix doesn't touch it" it means your fix has not been comprehensive enough yet?

rtibbles avatar Oct 04 '26 16:10 rtibbles