Skip to content

feat(ui): dynamic document title follows view switches (v1.18 F) - #53

Merged
argszero merged 1 commit into
mainfrom
feat/ui-ue-round3-title
Aug 17, 2026
Merged

argszero merged 1 commit into
mainfrom
feat/ui-ue-round3-title

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Implements item F (动态文档标题 / Dynamic document title) of the UI/UE round-3 wave (rant 2026-08-17T18:06:09, branch feat/ui-ue-round3, version v1.18).

document.title now follows the active view:

  • View switch — inside switchView, the title is set to 「VIEW_TITLE[id] · AITokenPool」 (e.g. 模型市场 Marketplace · AITokenPool). All 7 views are covered by the existing VIEW_TITLE map; unknown view ids fall back to AITokenPool.
  • Default — on DOMContentLoaded the title is set to AITokenPool (login page / pre-view state); the static <title> tag in index.html is aligned to AITokenPool as well.
  • Guest guard — when a guest is blocked from a restricted view, switchView returns early, so the title stays unchanged (no spurious title flip).

All title flows go through switchView (sidebar clicks, keyboard shortcuts 1–7, login, guest browse), so the update is centralized in one place.

Verification

  • DOM-stub smoke test (8 assertions): default title on load, login → dashboard title, keyboard shortcuts → marketplace/admin/wallet/settings titles, guest browse → marketplace, guest blocked view → title unchanged ✓
  • node --check ✓ · cargo test ✓ · cargo fmt --check ✓

Rant (verbatim)

F. 动态文档标题

  • document.title 跟随视图切换:如「模型市场 · AITokenPool」;默认回「AITokenPool」

Docs

  • docs/user-stories.md v1.18 entry extended with item F (remaining G noted)
  • ui/README.md: new "动态文档标题约定" section

@argszero
argszero merged commit ba84e1c into main Aug 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant