fix(spa): tab title stuck on Loading… (re-render + unicode ellipsis) #403

Merged
vas2000-work merged 1 commit from fix/MAPPS-287-tab-title-stuck-loading into main 2026-07-01 22:29:34 +02:00
Owner

WIP - for review when you're back. Not urgent to merge.

Problem

On a ticket detail page the header shows the real record name ("T000001: QA-Login page returns 500 on submit") but the browser tab stays Loading… | Mokosh Platform - stuck even after the record loaded. (#402 shipped a first attempt but it didn't actually fix this; see below.)

Two causes

  1. AppLayout set document.title inside a use_effect that captured title by value and read no signal, so it fired once on mount and never re-ran when props.title advanced from the loading placeholder to the record name. The tab was frozen on whatever it was at first paint.
  2. The pages use the unicode-ellipsis placeholder "Loading…" (U+2026), not ASCII "Loading..." - so #402's equality check (== "Loading...") never matched anyway. (Confirmed: grep '"Loading…"' src/pages/*.rs - tickets/time all use U+2026.)

Fix

  • Set document.title directly in the component body (runs on every render, set_title is idempotent) so it advances to the record name as soon as it loads.
  • Treat both "Loading…" and "Loading..." (and empty) as "no title yet" → clean Mokosh Platform until the real title arrives.

Verify (after this builds + staging pulls :latest)

  • Open a ticket: tab should read T000001: … | Mokosh Platform, not Loading….
  • During the brief load it shows Mokosh Platform, never the placeholder.

Pairs with #402 (favicon/manifest, already merged). No dependency/lock changes.

**WIP - for review when you're back. Not urgent to merge.** ## Problem On a ticket detail page the header shows the real record name ("T000001: QA-Login page returns 500 on submit") but the browser **tab** stays `Loading… | Mokosh Platform` - stuck even after the record loaded. (#402 shipped a first attempt but it didn't actually fix this; see below.) ## Two causes 1. `AppLayout` set `document.title` inside a `use_effect` that captured `title` by value and read no signal, so it fired **once on mount** and never re-ran when `props.title` advanced from the loading placeholder to the record name. The tab was frozen on whatever it was at first paint. 2. The pages use the **unicode-ellipsis** placeholder `"Loading…"` (U+2026), not ASCII `"Loading..."` - so #402's equality check (`== "Loading..."`) never matched anyway. (Confirmed: `grep '"Loading…"' src/pages/*.rs` - tickets/time all use U+2026.) ## Fix - Set `document.title` **directly in the component body** (runs on every render, `set_title` is idempotent) so it advances to the record name as soon as it loads. - Treat **both** `"Loading…"` and `"Loading..."` (and empty) as "no title yet" → clean `Mokosh Platform` until the real title arrives. ## Verify (after this builds + staging pulls :latest) - Open a ticket: tab should read `T000001: … | Mokosh Platform`, not `Loading…`. - During the brief load it shows `Mokosh Platform`, never the placeholder. Pairs with #402 (favicon/manifest, already merged). No dependency/lock changes.
fix(spa): set tab title on every render so it advances past "Loading…"
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 2m20s
Create release / Create release from merged PR (pull_request) Has been skipped
29d39703ba
Follow-up to the initial title fix. On a ticket detail page the header showed the real record name while the tab stayed "Loading… | Mokosh Platform" - so the tab was stuck even after the record loaded. Two causes: (1) AppLayout set document.title inside a use_effect that captured the title by value and read no signal, so it fired once on mount and never re-ran when props.title advanced from the placeholder to the record name; (2) the pages use the unicode-ellipsis placeholder "Loading…" (U+2026), not ASCII "Loading...", so the earlier equality check never matched anyway. Set document.title directly in the component body (runs on every render, idempotent) and treat BOTH "Loading…" and "Loading..." (plus empty) as "no title yet" so the tab reads a clean "Mokosh Platform" until the real title arrives.

#MAPPS-287

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vas2000-work changed title from WIP: fix(spa): tab title stuck on Loading… (re-render + unicode ellipsis) to fix(spa): tab title stuck on Loading… (re-render + unicode ellipsis) 2026-07-01 22:29:24 +02:00
vas2000-work deleted branch fix/MAPPS-287-tab-title-stuck-loading 2026-07-01 22:29:34 +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!403
No description provided.