feat(ui): rename nav items — "Sources" becomes "RAG", "Git sources" becomes "Sources"

Owner request (2026-08-28): the two admin-only nav items read like the
same thing, so they are relabeled — the document-catalog link
(#nav-sources, /sources.html) becomes "RAG" and the source-manager link
(#nav-git-sources, /git-sources.html) becomes "Sources".

Phase 48 (48_nav_rename_sources), label-only per the locked decision:
- all six pages (index, sources, git-sources, tuning, document, login):
  the two <a> texts swap; ids, hrefs, hidden defaults, is-active /
  aria-current placement, and nav order (Chat, RAG, Sources, Tuning)
  are byte-unchanged otherwise.
- header.js: comment/docstring label mentions only — the reveal-by-id
  logic is untouched (ship-hidden/reveal contract intact).
- test_git_sources_admin.py / test_mobile_hamburger_nav.py: the two
  suites that asserted the old label text are updated; comment-only
  label fixes in test_shared_header.py / test_nav_consistency.py.
- tests/e2e/test_nav_rename_sources.py: the story E2E (green in
  isolation) — renamed labels + unchanged hrefs/order/markers on all
  six pages, click navigation with the active marker, the anonymous
  ship-hidden contract, and regression guards for the untouched
  controls (#sync-label "Sync sources", viewer #doc-back "Sources").
- All eight surrounding header/nav suites stay green in isolation;
  unit+integration green, app/ coverage 99% (frontend-only change),
  ruff + pyright clean.

Note: per this phase file-level staging, the six page files and
header.js also carry the same-day in-flight owner rework that was
already in the working tree when phase 48 ran (mobile sign-in dropdown
copy, sync button ship-hidden on the Sources page); the label rename
itself is the two-text swap on each page.
This commit is contained in:
2026-08-28 12:33:18 -04:00
parent 03bead092c
commit 872a07cee7
17 changed files with 785 additions and 118 deletions
@@ -0,0 +1,49 @@
# Story: Nav rename — "Sources" becomes "RAG", "Git sources" becomes "Sources"
**Phase:** `48_nav_rename_sources` · **E2E:** `tests/e2e/test_nav_rename_sources.py`
## Narrative
As **the admin (owner)**, the two admin-only nav items are confusing:
"Sources" (the document catalog) and "Git sources" (the source manager)
read like the same thing. I want the navbar to say **"RAG"** for the
document catalog page and **"Sources"** for the source manager page, so
the labels say what each page *is*: RAG = the indexed knowledge base you
chat against; Sources = where that knowledge comes from.
- **Given** I am signed in as admin, on any of the six pages (chat,
sources, git-sources, tuning, document viewer, login)
- **When** I look at the primary nav
- **Then** the catalog link (`#nav-sources`, → `/sources.html`) is
labeled **"RAG"** and the manager link (`#nav-git-sources`, →
`/git-sources.html`) is labeled **"Sources"** — same ids, same hrefs,
same order, same admin-only ship-hidden/reveal contract as before.
## Acceptance criteria
1. All six pages (`frontend/index.html`, `sources.html`,
`git-sources.html`, `tuning.html`, `document.html`, `login.html`)
carry the swapped label text on `#nav-sources` ("RAG") and
`#nav-git-sources` ("Sources"). Element ids, `href`s, `hidden`
defaults, `is-active`/`aria-current` markers, and the nav order
(Chat, RAG, Sources, Tuning) are unchanged — this is a label-only
rename, and `header.js` logic (reveal by id) is untouched.
2. Anonymous visitors still see neither link (ship-hidden contract
unchanged); the admin sees both, as before.
3. Existing test assertions on the old label text are updated
(`test_git_sources_admin.py` nav-link text,
`test_mobile_hamburger_nav.py` `LINK_TEXTS`); assertions that are
NOT about these two nav items stay untouched (the document viewer's
"Sources" back button, the "Sync sources" button label, the
`/git-sources.html` page-`<h1>`/`<title>` marker).
4. Story E2E `tests/e2e/test_nav_rename_sources.py` proves: admin sees
"RAG" (→ `/sources.html`) and "Sources" (→ `/git-sources.html`) on
all six pages; clicking each lands on the right page with
`is-active`; anonymous sees both hidden.
5. Frontend-only: unit + integration green, `app/` coverage
unaffected, ruff + pyright clean, no CDN, one `--no-gpg-sign` commit.
## Playwright Mapping Rule
`tests/e2e/test_nav_rename_sources.py` — one story, one file, run in
isolation: the two relabeled nav items' full lifecycle (labels, hrefs,
admin reveal, anonymous hide, click-navigation with the current-page
marker) on the shared header, desktop viewport.