Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions packages/tracker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<h1>`, 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

Expand Down
9 changes: 6 additions & 3 deletions packages/tracker/e2e/accessibility.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,12 @@ const surfaces: { name: string; open: (page: Page) => Promise<void> }[] = [
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(
Expand Down
4 changes: 4 additions & 0 deletions packages/tracker/e2e/data.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
6 changes: 4 additions & 2 deletions packages/tracker/e2e/platform.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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");
Expand Down
8 changes: 4 additions & 4 deletions packages/tracker/e2e/tracker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
});
Expand Down
8 changes: 4 additions & 4 deletions packages/tracker/e2e/views.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
}
Expand Down
12 changes: 8 additions & 4 deletions packages/tracker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@
/>
<script>
// Apply the saved theme before first paint. The console-ui theme store
// in src/client/ui/theme.ts is its only writer; "system" leaves
// data-theme unset so prefers-color-scheme decides. The colours are
// console-ui's light and dark --ui-bg.
// in src/client/ui/theme.ts is its only writer, on the shared
// ops-theme key; "system" leaves data-theme unset so
// prefers-color-scheme decides. The old tracker.theme key is read until
// theme.ts has moved it. The colours are console-ui's light and dark
// --ui-bg.
try {
const theme = localStorage.getItem("tracker.theme");
const theme =
localStorage.getItem("ops-theme") ??
localStorage.getItem("tracker.theme");
if (theme === "light" || theme === "dark") {
document.documentElement.dataset.theme = theme;
const color = theme === "dark" ? "#111210" : "#ecede6";
Expand Down
44 changes: 7 additions & 37 deletions packages/tracker/src/client/conformance-allowlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,13 @@
{
"rule": "bare-element-selector",
"file": "src/client/styles/base.css",
"count": 27,
"count": 7,
"reason": "Baseline for the layer rule: move element defaults into @layer ui.app and drop other app layer names."
},
{
"rule": "colour-literal",
"file": "src/client/styles/base.css",
"count": 1,
"reason": "Baseline at CU1. Tracker moves onto the shared pieces in T1\u2013T7."
},
{
"rule": "local-copy",
"file": "src/client/styles/base.css",
"count": 6,
"reason": "Baseline at CU1. Tracker moves onto the shared pieces in T1\u2013T7."
},
{
"rule": "token-redefinition",
"file": "src/client/styles/base.css",
"count": 1,
"count": 3,
"reason": "Baseline at CU1. Tracker moves onto the shared pieces in T1\u2013T7."
},
{
Expand Down Expand Up @@ -50,25 +38,19 @@
{
"rule": "bare-element-selector",
"file": "src/client/styles/forum.css",
"count": 20,
"count": 19,
"reason": "Baseline for the layer rule: move element defaults into @layer ui.app and drop other app layer names."
},
{
"rule": "bare-element-selector",
"file": "src/client/styles/layout.css",
"count": 4,
"reason": "Baseline for the layer rule: move element defaults into @layer ui.app and drop other app layer names."
},
{
"rule": "local-copy",
"file": "src/client/styles/layout.css",
"count": 2,
"reason": "Baseline at CU1. Tracker moves onto the shared pieces in T1\u2013T7."
"reason": "Baseline for the layer rule: move element defaults into @layer ui.app and drop other app layer names."
},
{
"rule": "shared-class-patch",
"file": "src/client/styles/layout.css",
"count": 4,
"count": 2,
"reason": "Baseline at CU1. Tracker moves onto the shared pieces in T1\u2013T7."
},
{
Expand All @@ -86,21 +68,15 @@
{
"rule": "bare-element-selector",
"file": "src/client/styles/overlays.css",
"count": 27,
"count": 21,
"reason": "Baseline for the layer rule: move element defaults into @layer ui.app and drop other app layer names."
},
{
"rule": "bare-element-selector",
"file": "src/client/styles/pages.css",
"count": 39,
"count": 38,
"reason": "Baseline for the layer rule: move element defaults into @layer ui.app and drop other app layer names."
},
{
"rule": "colour-literal",
"file": "src/client/styles/pages.css",
"count": 11,
"reason": "Baseline at CU1. Tracker moves onto the shared pieces in T1\u2013T7."
},
{
"rule": "bare-element-selector",
"file": "src/client/styles/planning.css",
Expand Down Expand Up @@ -136,11 +112,5 @@
"file": "src/client/styles/tokens.css",
"count": 11,
"reason": "Baseline at CU1. Tracker moves onto the shared pieces in T1\u2013T7."
},
{
"rule": "theme-store-key",
"file": "src/client/ui/theme.ts",
"count": 1,
"reason": "Baseline at CU1. Tracker moves onto the shared pieces in T1\u2013T7."
}
]
32 changes: 15 additions & 17 deletions packages/tracker/src/client/forum/forum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { ForumKindSchema } from "#shared/forum.ts";
import { api, type BootstrapData } from "#client/data/api.ts";
import { useCurrentActor } from "#client/data/identity.ts";
import { useShell } from "#client/shell/shell-context.ts";
import { Empty, ErrorNotice, Modal } from "#client/ui/ui.tsx";
import { Button, State } from "@shepherdjerred/console-ui";
import { ErrorNotice, Modal } from "#client/ui/ui.tsx";
import { expiryDelay, type ForumScopeItem, type Post } from "./data.ts";
import { ActiveNoticesStrip } from "./forum-notices-strip.tsx";
import {
Expand Down Expand Up @@ -262,9 +263,10 @@ function ForumFeedResults({
</div>
)}
{items.length === 0 && (
<Empty title="No posts match these filters">
<p>Try broadening your search or switching status to All history.</p>
</Empty>
<State kind="empty">
No posts match these filters. Try broadening your search or switching
status to All history.
</State>
)}
</>
);
Expand Down Expand Up @@ -379,7 +381,6 @@ export function Forum() {
if (!bootstrap.forumEnabled) {
return (
<div className="reading-page forum-page">
<h1 tabIndex={-1}>Forum</h1>
<p className="muted">The forum is currently disabled.</p>
</div>
);
Expand All @@ -397,25 +398,22 @@ export function Forum() {

return (
<div className="reading-page forum-page" ref={keyboardRef}>
{/* The header bar above titles the page; this is its intro line. */}
<div className="forum-header">
<div className="forum-header-copy">
<h1 tabIndex={-1}>Forum</h1>
<p className="muted">
Coordinate across sessions — notices, questions, discussions, and
decisions.
</p>
</div>
<button
type="button"
className="primary"
<p className="muted">
Coordinate across sessions — notices, questions, discussions, and
decisions.
</p>
<Button
variant="primary"
disabled={!bootstrap.writesEnabled}
onClick={() => {
setCreating(true);
}}
>
<Plus size={15} aria-hidden="true" />
<Plus aria-hidden="true" />
New post
</button>
</Button>
</div>
<ForumFilterBar
filters={filters}
Expand Down
9 changes: 5 additions & 4 deletions packages/tracker/src/client/issues/activity.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Link } from "react-router";
import { ActorChip, Empty } from "#client/ui/ui.tsx";
import { State } from "@shepherdjerred/console-ui";
import { ActorChip } from "#client/ui/ui.tsx";
import type { EventData } from "#client/data/api.ts";
import { RelativeTime } from "#client/ui/time.tsx";

Expand All @@ -12,9 +13,9 @@ export function ActivityList({
}) {
if (events.length === 0)
return (
<Empty title="No activity yet">
<p>Changes will appear here as work moves forward.</p>
</Empty>
<State kind="empty">
No activity yet. Changes will appear here as work moves forward.
</State>
);
return (
<ol className="activity-list">
Expand Down
34 changes: 18 additions & 16 deletions packages/tracker/src/client/issues/issue-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Suspense, lazy, useCallback, useRef, useState } from "react";
import { NavLink, useParams, useSearchParams } from "react-router";
import { LayoutGrid, List, Plus, Search } from "lucide-react";
import type { BootstrapData } from "#client/data/api.ts";
import { Empty, ErrorNotice } from "#client/ui/ui.tsx";
import { Button, State } from "@shepherdjerred/console-ui";
import { ErrorNotice } from "#client/ui/ui.tsx";
import {
BoardSkeleton,
ListSkeleton,
Expand Down Expand Up @@ -162,21 +163,22 @@ export function IssueView() {
/>
</Suspense>
) : list.items.length === 0 ? (
<Empty title="A little room to think">
<p>
No issues match this view. Create an issue or adjust your
filters.
</p>
<button
onClick={() => {
create();
}}
disabled={!bootstrap.writesEnabled}
>
<Plus size={14} />
Create issue
</button>
</Empty>
<State
kind="empty"
action={
<Button
onClick={() => {
create();
}}
disabled={!bootstrap.writesEnabled}
>
<Plus aria-hidden="true" />
Create issue
</Button>
}
>
No issues match this view. Create an issue or adjust your filters.
</State>
) : (
<IssueList />
)}
Expand Down
8 changes: 4 additions & 4 deletions packages/tracker/src/client/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { GlobalActivity } from "#client/pages/activity-page.tsx";
import { Projects } from "#client/pages/projects.tsx";
import { Forum } from "#client/forum/forum.tsx";
import { ForumThreadPage } from "#client/forum/forum-thread.tsx";
import { Empty } from "#client/ui/ui.tsx";
import { State } from "@shepherdjerred/console-ui";
import { SettingsSkeleton } from "#client/ui/skeleton.tsx";
import { useShell } from "#client/shell/shell-context.ts";
import { viewHandle } from "#client/shell/route.ts";
Expand Down Expand Up @@ -58,9 +58,9 @@ function SettingsPage() {
}
function NotFound() {
return (
<Empty title="Nothing lives at this address">
<Link to="/issues">Back to issues</Link>
</Empty>
<State kind="empty" action={<Link to="/issues">Back to issues</Link>}>
Nothing lives at this address.
</State>
);
}

Expand Down
Loading