fix(a11y): set document.title from the page title every route hands AppLayout (MAPPS-287) #298

Merged
YousifShkara merged 1 commit from fix/MAPPS-287-per-route-doc-titles into main 2026-06-21 09:23:03 +02:00
Owner

AppLayout already took a title prop and rendered it in the top bar, but document.title was never touched - every tab read "Mokosh Platform" regardless of route, which broke browser history, bookmarks, tab identification, and the title-announcement screen readers make on navigation. Add a use_effect in AppLayout that mirrors props.title into document.title on every render, formatted as <page> | Mokosh Platform when the page supplies a title and plain Mokosh Platform otherwise (matches Bunyip's pattern). Re-runs on every render so a detail page that swaps Loading... for the record name on its first paint propagates the change without a route change.

#MAPPS-287

`AppLayout` already took a `title` prop and rendered it in the top bar, but `document.title` was never touched - every tab read "Mokosh Platform" regardless of route, which broke browser history, bookmarks, tab identification, and the title-announcement screen readers make on navigation. Add a `use_effect` in `AppLayout` that mirrors `props.title` into `document.title` on every render, formatted as `<page> | Mokosh Platform` when the page supplies a title and plain `Mokosh Platform` otherwise (matches Bunyip's pattern). Re-runs on every render so a detail page that swaps `Loading...` for the record name on its first paint propagates the change without a route change. #MAPPS-287
fix(a11y): set document.title from the page title every route hands AppLayout (MAPPS-287)
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 1m16s
9817c1423f
`AppLayout` already took a `title` prop and rendered it in the top bar, but `document.title` was never touched - every tab read "Mokosh Platform" regardless of route, which broke browser history, bookmarks, tab identification, and the title-announcement screen readers make on navigation. Add a `use_effect` in `AppLayout` that mirrors `props.title` into `document.title` on every render, formatted as `<page> | Mokosh Platform` when the page supplies a title and plain `Mokosh Platform` otherwise (matches Bunyip's pattern). Re-runs on every render so a detail page that swaps `Loading...` for the record name on its first paint propagates the change without a route change.

#MAPPS-287
YousifShkara deleted branch fix/MAPPS-287-per-route-doc-titles 2026-06-21 09:23:04 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!298
No description provided.