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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions docs/ui-conventions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# UI conventions

One page of rules for anything that adds or changes UI. Most problems found in the
2026-11-23 UI audit were inconsistencies between features, so new work should follow
these rules instead of inventing a local variant. If a rule doesn't fit, change it here
first.

## Names

| Thing | Call it | Not |
|---|---|---|
| The home view with every cluster | **the atlas** ("Back to atlas") | Universe, Explore, Universe View |
| A top-level grouping (Backend, Security…) | **field** | domain (code and data still say `domain`) |
| A field nested in another (Generative AI) | **sub-field** | subdomain |
| Nodes inside a field | **members** (same noun in the panel and the hover card) | connections |
| X-Ray statuses | Found in code · Listed as a dependency · Guessed from related files · Related to the stack | Confirmed / Declared / Inferred |

Counts always use thousands separators: `n.toLocaleString("en-US")` (3,122, not 3122).

## Panels

- **Left side** (beside the rail, `left: 72px`, same width and padding): tool panels the
reader opens from the toolbar. Fields, Stack, Roles, Apps, Guided paths, Learning map,
Outline.
- **Right side**: what is selected. Node details, Repo X-Ray results.
- **Bottom centre**: a followed path's step card.
- **Modal**: only Keyboard shortcuts and the shared report card. Nothing else dims the atlas.
- **Phones** (≤ 640 px): left-side tool panels become bottom sheets (max 58% height) so
the map stays visible above them.
- Panels are opaque (`background: var(--panel)`); atlas text must never show through.
- When a panel highlights nodes, the camera frames them inside the space the panel
leaves (`frameNodes` / `usableRect` in `graph-canvas/framing.ts`). Add new panels to
`OVERLAY_SELECTORS` there and to the heading `panels` list in `headings.ts`.

## Toolbar

- Labels never change with state. Show "open" with `aria-pressed="true"`, not with a
different word ("Exit compare", "← Back to Explore").
- 1101 px and up: every tool has a label. 701–1100 px: the five main tools keep labels and
the utilities move under **More**. Phones: icons only, with `aria-label`.

## Buttons and links

- One primary (filled) button per panel at most: the action most people want next
(Open report card, Start with Python).
- A whole list row is the button. Don't repeat an "Open" button on every row; use a
trailing `→` chevron for "opens in place".
- `↗` only for links that leave TechAtlas (GitHub, official sites, Wikipedia).
- "Copy link" is a bordered button like its neighbours, never bare text.
- Lists that switch items have one stepper (← prev · n / N · next →) and one breadcrumb
at the top ("← All roles"). No extra `<select>`.

## Headings and type

- One visible or visually hidden `<h1>` per view. Panel titles are `<h2>`; sections in a
panel are `<h3>`, sub-groups `<h4>`.
- Section titles in panels are UPPERCASE small caps (CSS `text-transform`); group titles
under them are sentence case. Write the text itself in sentence case.
- `font-variant-numeric: tabular-nums` only on elements that hold numbers in columns,
never on whole panels (Inter's `tnum` widens hyphens: "X - Ray").

## Keyboard and focus

- A group of buttons is one tab stop with arrow keys inside (`data-arrow-nav` +
`arrowNav` / `arrowNavGrid` from `util/arrowNav.ts`). The field names on the map work
the same way.
- Opening a panel from the toolbar moves focus to its heading; closing it returns focus
to the button (`util/usePanelFocus.ts`).
- Esc closes the top-most panel.

## Map labels

- Field names are DOM buttons placed by `placeHeadings`; node names are drawn by
`drawNodeLabel`, which never lets two labels overlap and skips a label that has no room
(hover still shows it). Field names avoid node names that were drawn.
- Sub-field names appear from the first zoom step in (camera ratio < 0.85); at the overview
fit, hovering a sub-field names it.

## Themes

Every new colour needs a light-theme value. Check both themes before merging: the
`e2e/visual-themes.spec.ts` suite screenshots six key states in dark and light.
40 changes: 21 additions & 19 deletions frontend/e2e/overview-visual-proof.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,11 @@ async function measure(page: Page, vpName: string): Promise<Metrics> {
id: (el.textContent ?? "") });
});
const visibleDomainLabels = boxes.length;
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d")!;
ctx.font = "12px Inter, system-ui, sans-serif";
for (const v of visible) {
if (!v.label) continue;
boxes.push({ x: v.cx + v.r + 2, y: v.cy - 7, w: ctx.measureText(v.label).width, h: 14, id: v.id });
}
// Node labels are placed around their node (right, left, above…), so read the boxes
// the label drawer actually used in the last frame instead of assuming "right of".
const placed = ((window as unknown as { __ta_labels?: () => { x0: number; y0: number; x1: number; y1: number; id: string }[] })
.__ta_labels?.() ?? []);
for (const b of placed) boxes.push({ x: b.x0, y: b.y0, w: b.x1 - b.x0, h: b.y1 - b.y0, id: b.id });
let priorityLabelCollisions = 0;
for (let i = 0; i < boxes.length; i++) for (let j = i + 1; j < boxes.length; j++) {
if (overlap(boxes[i], boxes[j])) priorityLabelCollisions++;
Expand Down Expand Up @@ -425,16 +423,19 @@ test.describe("Overview interaction regressions", () => {

test("node detail previews one canonical connection and opens its neighbor", async ({ page }) => {
await gotoOverview(page, { width: 1440, height: 900 });
await page.getByRole("button", { name: "Domains", exact: true }).click();
await page.getByRole("button", { name: "Fields", exact: true }).click();
await page.locator(".legend-item").filter({ hasText: "Backend Development" }).first().click();
const details = page.getByRole("region", { name: "Node details" });
await expect(details).toBeVisible();
const row = details.getByRole("button", { name: /Show connection with/ }).first();
// A field lists its members; hovering a row previews that one connection, clicking it
// opens the member.
const row = details.getByRole("region", { name: "Members" }).getByRole("button", { name: /^Open / }).first();
await expect(row).toBeVisible();
await row.click();
await row.hover();
await expect.poll(async () => (await countVisible(page)).edges).toBe(1);
await details.getByRole("button", { name: /^Open / }).first().click();
await expect(page.getByRole("region", { name: "Node details" })).toBeVisible();
const name = ((await row.getAttribute("aria-label")) ?? "").replace(/^Open /, "").replace(/ \(.*\)$/, "");
await row.click();
await expect(page.getByRole("region", { name: "Node details" }).getByRole("heading", { name })).toBeVisible();
});

test("mobile near-node tap selects a dense graph node", async ({ page }) => {
Expand Down Expand Up @@ -474,7 +475,7 @@ test.describe("Overview interaction regressions", () => {

test("mobile domain focus stays above the detail sheet", async ({ page }) => {
await gotoOverview(page, { width: 390, height: 844 });
await page.getByRole("button", { name: "Show domain legend" }).click();
await page.getByRole("button", { name: "Show fields" }).click();
await page.locator(".legend-item").filter({ hasText: "Robotics & Autonomous Systems" }).first().click();
await page.waitForTimeout(650);
const p = await page.evaluate(() => {
Expand Down Expand Up @@ -669,6 +670,7 @@ test.describe("High-end atlas controls", () => {
test("guided path follows real nodes and shareable selection", async ({ page }) => {
await gotoOverview(page, { width: 1440, height: 900 });
await page.getByRole("button", { name: "Guided paths" }).click();
await page.getByRole("region", { name: "Guided paths" }).getByRole("button", { name: /^How a web request works/ }).first().click();
await expect(page.getByRole("region", { name: "Guided path" })).toContainText("DNS");
await expect(page).toHaveURL(/\/concept\/dns/);
await page.getByRole("button", { name: "Next" }).click();
Expand All @@ -677,8 +679,8 @@ test.describe("High-end atlas controls", () => {

test("theme, rail, and data explanation are accessible", async ({ page }) => {
await gotoOverview(page, { width: 1440, height: 900 });
await page.getByRole("button", { name: "Filters", exact: true }).click();
await expect(page.getByRole("region", { name: "Graph filters" })).toBeVisible();
await page.getByRole("button", { name: "Fields", exact: true }).click();
await expect(page.getByRole("region", { name: "Fields" })).toBeVisible();
await page.getByRole("button", { name: "Switch to light theme" }).click();
await expect(page.locator("html")).toHaveAttribute("data-theme", "light");
await page.screenshot({ path: "screenshots/light-theme-1440x900.png" });
Expand Down Expand Up @@ -719,17 +721,17 @@ test("hovering a node opens a short preview", async ({ page }) => {

test("filters and camera survive a shared URL", async ({ page }) => {
await gotoOverview(page, { width: 1440, height: 900 });
await page.getByRole("button", { name: "Filters", exact: true }).click();
await page.getByRole("region", { name: "Graph filters" }).getByLabel("Technologies").check();
await page.getByRole("button", { name: "Fields", exact: true }).click();
await page.getByRole("region", { name: "Fields" }).getByLabel("Technologies").check();
await expect(page).toHaveURL(/type=technology/);
await page.evaluate(() => {
const sigma = (window as unknown as { __ta_sigma?: any }).__ta_sigma;
sigma.getCamera().setState({ ratio: .55 });
});
await expect.poll(() => new URL(page.url()).searchParams.get("zoom")).toBe("0.5500");
await page.reload();
await page.getByRole("button", { name: "Filters", exact: true }).click();
await expect(page.getByRole("region", { name: "Graph filters" }).getByLabel("Technologies")).toBeChecked();
await page.getByRole("button", { name: "Fields", exact: true }).click();
await expect(page.getByRole("region", { name: "Fields" }).getByLabel("Technologies")).toBeChecked();
});

test("fullscreen hides the chrome and the atlas fills the window", async ({ page }) => {
Expand Down
33 changes: 17 additions & 16 deletions frontend/e2e/smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test("graph renders, a node can be selected, and the detail panel opens", async

// 1) The app left the loading state and the header shows a real node count
// (proves /graph loaded AND buildGraph did not throw).
await expect(page.getByText(/\d+ nodes · \d+ edges/)).toBeVisible({ timeout: 20_000 });
await expect(page.getByText(/[\d,]+ nodes · [\d,]+ edges/)).toBeVisible({ timeout: 20_000 });

// 2) Sigma mounted a WebGL canvas inside the graph application region.
const canvas = page.locator(".graph-canvas canvas").first();
Expand Down Expand Up @@ -41,7 +41,7 @@ test("the Tailwind node (slug tailwind-css) opens without a 404", async ({ page
const errors: string[] = [];
page.on("pageerror", (e) => errors.push(String(e)));
await page.goto("/");
await expect(page.getByText(/\d+ nodes · \d+ edges/)).toBeVisible({ timeout: 20_000 });
await expect(page.getByText(/[\d,]+ nodes · [\d,]+ edges/)).toBeVisible({ timeout: 20_000 });

const search = page.getByLabel("Search the technology graph");
await search.click();
Expand All @@ -59,7 +59,7 @@ test("the Tailwind node (slug tailwind-css) opens without a 404", async ({ page

test("deep link under the base path loads the right node", async ({ page }) => {
await page.goto("/technology/fastapi");
await expect(page.getByText(/\d+ nodes · \d+ edges/)).toBeVisible({ timeout: 20_000 });
await expect(page.getByText(/[\d,]+ nodes · [\d,]+ edges/)).toBeVisible({ timeout: 20_000 });
const panel = page.locator(".details");
await expect(panel).toBeVisible();
await expect(panel.getByRole("heading", { name: "FastAPI" })).toBeVisible();
Expand All @@ -69,7 +69,7 @@ test("selecting a second node (via search) updates the panel — no stale highli
// Regression for the selection-highlight bug: a selection coming from search must
// update the graph/panel, and switching to another node must swap cleanly.
await page.goto("/");
await expect(page.getByText(/\d+ nodes · \d+ edges/)).toBeVisible({ timeout: 20_000 });
await expect(page.getByText(/[\d,]+ nodes · [\d,]+ edges/)).toBeVisible({ timeout: 20_000 });

const search = page.getByLabel("Search the technology graph");
const panel = page.locator(".details");
Expand Down Expand Up @@ -97,13 +97,13 @@ const SCANNER_CONFIGURED =

test("Repo X-Ray is visible and an example scan loads without a backend", async ({ page }) => {
await page.goto("/");
await expect(page.getByText(/\d+ nodes · \d+ edges/)).toBeVisible({ timeout: 20_000 });
await expect(page.getByText(/[\d,]+ nodes · [\d,]+ edges/)).toBeVisible({ timeout: 20_000 });
await page.getByRole("button", { name: "Repo X-Ray" }).click();
const panel = page.getByRole("region", { name: "Repo X-Ray" });
await expect(panel.getByLabel("GitHub repository URL")).toHaveCount(SCANNER_CONFIGURED ? 1 : 0);
await panel.getByRole("button", { name: /X-ray django\/django/ }).click();
await expect(panel.getByRole("link", { name: "django/django" })).toBeVisible();
await expect(panel.getByText("Example scan")).toBeVisible();
await expect(panel.getByText("Example scan", { exact: true })).toBeVisible();
// The example is in the URL, so the result can be shared.
await expect(page).toHaveURL(/[?&]xray=django-django/);
});
Expand All @@ -112,7 +112,7 @@ test("An ?xray= link opens straight onto that example scan", async ({ page }) =>
await page.goto("./?xray=bevyengine-bevy");
const panel = page.getByRole("region", { name: "Repo X-Ray" });
await expect(panel.getByRole("link", { name: "bevyengine/bevy" })).toBeVisible({ timeout: 20_000 });
await panel.getByRole("button", { name: "Back to Universe" }).first().click();
await panel.getByRole("button", { name: "Close Repo X-Ray and go back to the atlas" }).click();
await expect(page).not.toHaveURL(/xray=/);
});

Expand All @@ -126,9 +126,9 @@ test("About page has a direct static route", async ({ page }) => {

test("Guided paths library: search, start a path, step through, share", async ({ page }) => {
await page.goto("/");
await expect(page.getByText(/\d+ nodes · \d+ edges/)).toBeVisible({ timeout: 20_000 });
await expect(page.getByText(/[\d,]+ nodes · [\d,]+ edges/)).toBeVisible({ timeout: 20_000 });
await page.getByRole("button", { name: "Guided paths" }).click();
const library = page.getByRole("dialog", { name: "Guided paths" });
const library = page.getByRole("region", { name: "Guided paths" });
await expect(library.getByText("Start here")).toBeVisible();
await library.getByLabel("Search guided paths").fill("kubernetes");
await expect(library.getByText(/matching path/)).toBeVisible();
Expand All @@ -147,14 +147,14 @@ test("Guided paths library: search, start a path, step through, share", async ({

test("Guided paths closes an open Stack, Roles or Apps panel", async ({ page }) => {
await page.goto("/");
await expect(page.getByText(/\d+ nodes · \d+ edges/)).toBeVisible({ timeout: 20_000 });
await expect(page.getByText(/[\d,]+ nodes · [\d,]+ edges/)).toBeVisible({ timeout: 20_000 });
const guided = page.getByRole("button", { name: "Guided paths" });
await expect(guided).toHaveCount(1);
for (const [button, region] of [["Stack recommender", "Stack recommender"], ["Role paths", "Role paths"], ["Famous apps", "Famous apps"]]) {
await page.getByRole("button", { name: button, exact: true }).click();
await expect(page.getByRole("region", { name: region })).toBeVisible();
await guided.click();
const library = page.getByRole("dialog", { name: "Guided paths" });
const library = page.getByRole("region", { name: "Guided paths" });
await expect(library).toBeVisible();
await expect(page.getByRole("region", { name: region })).toHaveCount(0);
await page.keyboard.press("Escape");
Expand All @@ -164,7 +164,7 @@ test("Guided paths closes an open Stack, Roles or Apps panel", async ({ page })

test("Famous apps: pick an app, its stack lists atlas nodes, and a technology links back", async ({ page }) => {
await page.goto("/");
await expect(page.getByText(/\d+ nodes · \d+ edges/)).toBeVisible({ timeout: 20_000 });
await expect(page.getByText(/[\d,]+ nodes · [\d,]+ edges/)).toBeVisible({ timeout: 20_000 });
await page.getByRole("button", { name: "Famous apps", exact: true }).click();
const panel = page.getByRole("region", { name: "Famous apps" });
await panel.getByLabel("Filter apps").fill("elixir");
Expand Down Expand Up @@ -211,12 +211,13 @@ test("Roles have emojis, ?role= opens the list, and ] steps to the next role", a
await expect(page).toHaveURL(/[?&]role=backend-engineer/);
});

test("On a phone the toolbar scrolls behind a → button instead of running off-screen", async ({ page }) => {
test("On a phone every tool is reachable without the page running off-screen", async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
await page.goto("/");
await expect(page.getByText(/\d+ nodes · \d+ edges/)).toBeAttached({ timeout: 20_000 });
const more = page.getByRole("button", { name: "Scroll atlas modes right" });
await expect(more).toBeVisible();
await expect(page.getByText(/[\d,]+ nodes · [\d,]+ edges/)).toBeAttached({ timeout: 20_000 });
// The utilities live under "More"; the main tools stay in the toolbar.
const more = page.getByRole("button", { name: "More tools" });
await expect(more).toBeInViewport();
await more.click();
await expect(page.getByRole("button", { name: /Switch to (light|dark) theme/ })).toBeInViewport();
const width = await page.evaluate(() => document.documentElement.scrollWidth);
Expand Down
7 changes: 5 additions & 2 deletions frontend/e2e/stackview-regression.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ async function visibleEdges(page: Page) {
});
}

// The switch reads "Grouped by field" (Stack View) and "On the atlas" (Universe View).
const VIEW_LABEL = { "Stack View": "Grouped by field", "Universe View": "On the atlas" } as const;
async function switchView(page: Page, view: "Stack View" | "Universe View") {
await page.locator(".xray-viewswitch, .xray-panel").getByRole("button", { name: view }).first().click();
await page.locator(".xray-viewswitch").getByRole("button", { name: VIEW_LABEL[view] }).first().click();
await page.waitForTimeout(900);
}

Expand Down Expand Up @@ -383,7 +385,8 @@ test.describe("Stack View rendering regressions", () => {
// Run two different scans and exit each, then compare.
await runScan(page, pick({ frontend: 4, databases: 2 }));
// "Analyze Another" reopens the URL input without leaving the X-Ray panel.
await page.getByRole("button", { name: "Analyze Another" }).click();
await page.getByLabel("More actions").click();
await page.getByRole("button", { name: "Scan another repository" }).click();
await rescan(page, pick({ aiml: 5, cloud: 3 }));
await switchView(page, "Universe View");
const after = await coordSnapshot(page);
Expand Down
Loading
Loading