From 99661a9ef3e1fdb65a37062f6250307e7a2d484c Mon Sep 17 00:00:00 2001 From: Jerred Shepherd Date: Thu, 26 Nov 2026 14:15:54 -0800 Subject: [PATCH] feat(tracker): shared ConsoleShell, header bar, banners and buttons Why Tracker kept its own frame on top of console-ui: a hand-composed ShellFrame and Sidebar, its own page header, a phone bottom bar with a More sheet, and its own banner, error and empty markup. Its element defaults sat in a top-level `tracker.elements` layer, which CSS orders after all of console-ui's `ui` layer, so Tracker's bare `button`, field and heading rules outranked console-ui's components. Every other console navigates through ConsoleShell's top bar and drawer, so Tracker looked and moved differently on a phone. This is T1 of the console-ui plan (FM-263) and fixes AI-941 items 1 and 6. What - Shell: Tracker renders console-ui's ConsoleShell (switcher mark "T", Workspace, Views, Teams and Projects groups declared once, a footer with identity, Settings and shortcuts above the theme row). The sidebar and top-bar search buttons open Tracker's own palette through a command-palette store that mirrors the shell's overlay state. - Phone: the bottom navigation and More sheet are gone; the shell's top bar and drawer replace them, and New issue moves into the top bar. Drawer links, and the footer's identity and shortcut buttons, shut the drawer first. Saved-view actions always show on touch screens. - Header: every page starts with console-ui's HeaderBar (title, live indicator, New issue). The forum's header is now its only h1 and the page shows an intro line with New post (AI-941 #1); issue and forum thread pages keep their own h1 and the bar's title is plain text. - Panel fill: console-ui's panel is a flex column and Tracker's main fills it, so detail.css's `calc(100dvh - 67px)` is gone (AI-941 #6). - Pieces: the read-only notice is a Banner, ErrorNotice is an error Banner with role=alert, empty states are State, and the shell, forum, identity form and empty-list buttons are console-ui Buttons. - Cascade: bare element defaults live in console-ui's reserved `ui.app` layer, between its reset and components, so console-ui's pieces win over them; the headings, `kbd`, `pre` and phone sizes that were unlayered join it. Tracker declares no layer names of its own. Class-qualified rules (the action buttons' edge) are unlayered at element specificity. Fields take console-ui's one focus ring. Letter-spacing, the theme-preview hex colours (now token values set per preview) and the pill radius are gone. - Theme: the store uses the shared `ops-theme` key and keeps the theme-color metas itself. A preference saved under the old `tracker.theme` key moves onto `ops-theme` once on load (unit tested), and the pre-paint script reads both keys during the move. - Uses console-ui's `sidebarFooter` as a function of the drawer's `close`, HeaderBar `titleAs="p"` for pages that own their h1, and the flex-column `.ui-panel` (all from CU1-CU4; this commit changes no console-ui code). - Conformance allowlist: 26 entries / 251 violations to 19 / 232; every change is a reduction, no new entries. Verification - bun install --frozen-lockfile; bunx turbo run build typecheck test lint --filter=@shepherdjerred/tracker --filter=@shepherdjerred/console-ui: 17/17 tasks passed (console-ui 638 tests, Tracker 290 tests). - bun --bun vitest run src/client/conformance.test.ts (Tracker): passed. - Tracker Playwright (bun run test:e2e): 218 passed (desktop and mobile), including the axe accessibility suite. - Pre-commit hooks passed. - Not run: CI, deployment, live acceptance. Co-Authored-By: Claude Opus 5.5 --- packages/tracker/README.md | 34 ++- packages/tracker/e2e/accessibility.spec.ts | 9 +- packages/tracker/e2e/data.spec.ts | 4 + packages/tracker/e2e/platform.spec.ts | 6 +- packages/tracker/e2e/tracker.spec.ts | 8 +- packages/tracker/e2e/views.spec.ts | 8 +- packages/tracker/index.html | 12 +- .../src/client/conformance-allowlist.json | 44 +-- packages/tracker/src/client/forum/forum.tsx | 32 +- .../tracker/src/client/issues/activity.tsx | 9 +- .../tracker/src/client/issues/issue-view.tsx | 34 ++- packages/tracker/src/client/main.tsx | 8 +- .../tracker/src/client/pages/settings.tsx | 26 +- .../src/client/saved-views/views-nav.tsx | 2 +- packages/tracker/src/client/shell/app.tsx | 170 ++++++----- .../tracker/src/client/shell/navigation.tsx | 223 +++++--------- .../tracker/src/client/shell/palette-store.ts | 10 + .../tracker/src/client/shell/shell-actions.ts | 2 +- packages/tracker/src/client/styles/base.css | 275 +++++++----------- .../tracker/src/client/styles/controls.css | 2 +- packages/tracker/src/client/styles/detail.css | 23 +- packages/tracker/src/client/styles/forum.css | 25 +- packages/tracker/src/client/styles/layout.css | 70 +---- .../tracker/src/client/styles/overlays.css | 52 ---- packages/tracker/src/client/styles/pages.css | 31 +- .../tracker/src/client/styles/planning.css | 10 +- packages/tracker/src/client/styles/tokens.css | 4 +- packages/tracker/src/client/ui/theme.test.ts | 30 ++ packages/tracker/src/client/ui/theme.ts | 50 +++- packages/tracker/src/client/ui/ui.tsx | 23 +- 30 files changed, 513 insertions(+), 723 deletions(-) create mode 100644 packages/tracker/src/client/shell/palette-store.ts create mode 100644 packages/tracker/src/client/ui/theme.test.ts diff --git a/packages/tracker/README.md b/packages/tracker/README.md index 5b2e1a25767..905252d25fb 100644 --- a/packages/tracker/README.md +++ b/packages/tracker/README.md @@ -92,17 +92,29 @@ where its top edge sat in the viewport. ## Look and shell The browser client uses `@shepherdjerred/console-ui`, the shared look of Hub, -Delivery, Go link and Flags: its `ShellFrame` and `Sidebar` (app switcher, -search, Workspace, Views, Teams and Projects groups, identity, settings, -shortcuts and the theme row), its `--ui-*` colour tokens, Inter and Berkeley -Mono, and its 28px controls. `src/client/styles/tokens.css` adds only -non-colour tokens (shadows, backdrop, the accent selection tint and motion). -`src/client/styles/base.css` puts element defaults in a console-ui's -`ui.app` cascade layer, below its components; Tracker's own class -rules are unlayered and win over both. The theme preference uses console-ui's -theme store under `tracker.theme`, applied before first paint by -`index.html`. At 900px and below console-ui hides the sidebar; Tracker's page -header and phone bottom navigation take over. +Delivery and the other consoles. Its `ConsoleShell` draws the frame: app +switcher, the search button that opens Tracker's palette, the Workspace, +Views, Teams and Projects groups, and a footer with identity, settings, +shortcuts and the theme row. At 900px and below the same navigation moves +into the shell's phone top bar and drawer, and New issue moves into the top +bar. Every page starts with a `HeaderBar` (title, live indicator, New issue); +the issue and forum thread pages draw their own `

`, so their header +title is plain text. Banners, empty and error states and the shell's +buttons are console-ui's `Banner`, `State` and `Button`. + +`src/client/styles/base.css` puts Tracker's bare element defaults (`button`, +fields, headings, `kbd`, `pre`) in console-ui's reserved `ui.app` cascade +layer, which console-ui orders between its tokens and its components, so +console-ui's pieces keep their look over them. Tracker declares no layer +order and no layer names of its own: a top-level app layer would come after +all of `ui` and outrank the components. Every Tracker class rule is +unlayered and wins over both; it styles only Tracker's own classes, which +the per-app conformance scan and its shrinking allowlist enforce. +`src/client/styles/tokens.css` adds only non-colour tokens (shadows, +backdrop, the accent selection tint and motion). The theme preference uses +console-ui's theme store on the shared `ops-theme` key, applied before first +paint by `index.html`. A preference saved under the old `tracker.theme` key is +moved onto `ops-theme` once on load (`src/client/ui/theme.ts`). ## Browser controls diff --git a/packages/tracker/e2e/accessibility.spec.ts b/packages/tracker/e2e/accessibility.spec.ts index 24b3285178e..7c79568fb15 100644 --- a/packages/tracker/e2e/accessibility.spec.ts +++ b/packages/tracker/e2e/accessibility.spec.ts @@ -209,9 +209,12 @@ const surfaces: { name: string; open: (page: Page) => Promise }[] = [ name: "the browser identity dialog", open: async (page) => { await page.goto("/issues"); - const more = page.getByRole("button", { name: "More", exact: true }); - if (await more.isVisible()) { - await more.click(); + const menu = page.getByRole("button", { + name: "Open navigation", + exact: true, + }); + if (await menu.isVisible()) { + await menu.click(); } await page.getByRole("button", { name: /^Acting as /u }).click(); await expect( diff --git a/packages/tracker/e2e/data.spec.ts b/packages/tracker/e2e/data.spec.ts index f9ea89c4e60..4e84b1699ee 100644 --- a/packages/tracker/e2e/data.spec.ts +++ b/packages/tracker/e2e/data.spec.ts @@ -196,6 +196,10 @@ test("unsent text survives navigation and a reload, and is cleared once sent", a await page.goto(`/issues/${identifier}`); const box = page.getByPlaceholder("Leave a comment…"); await box.fill(draft); + // A phone keeps the navigation in the top bar's drawer. + if (info.project.name === "mobile") { + await page.getByRole("button", { name: "Open navigation" }).click(); + } await page .getByRole("navigation") .getByRole("link", { name: "Issues", exact: true }) diff --git a/packages/tracker/e2e/platform.spec.ts b/packages/tracker/e2e/platform.spec.ts index 544927d3a55..3733f79b719 100644 --- a/packages/tracker/e2e/platform.spec.ts +++ b/packages/tracker/e2e/platform.spec.ts @@ -140,7 +140,9 @@ test("settings is reachable through the navigation on every layout", async ({ }, info) => { await page.goto("/issues"); if (info.project.name === "mobile") { - await page.getByRole("button", { name: "More", exact: true }).click(); + await page + .getByRole("button", { name: "Open navigation", exact: true }) + .click(); await expect( page.getByRole("dialog").getByRole("link", { name: "Actors" }), ).toBeVisible(); @@ -163,7 +165,7 @@ test("an explicit theme is applied before the app loads and tints the browser ch }) => { await page.emulateMedia({ colorScheme: "light" }); await page.addInitScript(() => { - globalThis.localStorage.setItem("tracker.theme", "dark"); + globalThis.localStorage.setItem("ops-theme", "dark"); }); await page.route("**/assets/*.js", (route) => route.abort()); await page.goto("/issues"); diff --git a/packages/tracker/e2e/tracker.spec.ts b/packages/tracker/e2e/tracker.spec.ts index 9ba77b4631f..0ec9ea931fb 100644 --- a/packages/tracker/e2e/tracker.spec.ts +++ b/packages/tracker/e2e/tracker.spec.ts @@ -25,10 +25,10 @@ async function prepareBoard(page: Page, title: string) { name: `Move ${identifier ?? ""}`, exact: true, }); - // The mobile bottom nav is fixed over the viewport's lower edge. The - // minimum scroll that marks the handle "in view" leaves that handle - // underneath the nav, so a touch there hits the nav and the card never - // starts dragging. Center it in the scrollport, above the nav. + // The phone top bar sticks over the viewport's upper edge. The minimum + // scroll that marks the handle "in view" can leave that handle underneath + // the bar, so a touch there hits the bar and the card never starts + // dragging. Center it in the scrollport, clear of the bar. await handle.evaluate((element) => { element.scrollIntoView({ block: "center", inline: "center" }); }); diff --git a/packages/tracker/e2e/views.spec.ts b/packages/tracker/e2e/views.spec.ts index 4f54f2c9b27..24fe3f19bc1 100644 --- a/packages/tracker/e2e/views.spec.ts +++ b/packages/tracker/e2e/views.spec.ts @@ -11,14 +11,14 @@ import { test.afterEach(({ request }) => removeScratchIssues(request)); -/** Where the saved views are listed: the sidebar, or the phone's More sheet. */ +/** Where the saved views are listed: the sidebar, or the phone's drawer. */ async function viewsList(page: Page, mobile: boolean) { if (mobile) { await page - .getByRole("navigation", { name: "Mobile navigation" }) - .getByRole("button", { name: "More" }) + .getByRole("banner") + .getByRole("button", { name: "Open navigation" }) .click(); - return page.getByRole("dialog", { name: "More" }); + return page.getByRole("dialog", { name: "Navigation" }); } return page.getByRole("complementary", { name: "Tracker" }); } diff --git a/packages/tracker/index.html b/packages/tracker/index.html index 8a961f5401a..0cc24f5729c 100644 --- a/packages/tracker/index.html +++ b/packages/tracker/index.html @@ -24,11 +24,15 @@ />