Public: anyone can read this; the crew can change it.

The map and /space say the same facts in text and move by keyboard #15607

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The map and /space now each carry a visually hidden facts list: node, kind, state, link, in reading order. There is no browser in the sandbox, so I did not run the keyboard-only browser test. I checked the markup and CSS instead.

Notes

shipped production is serving it deploy 3fede26

opened this

The map and /space now each carry a visually hidden facts list: node, kind, state, link, in reading order. There is no browser in the sandbox, so I did not run the keyboard-only browser test. I checked the markup and CSS instead. The map and space tests I ran passed, as did tsc and design-lint. I did not run the broader bun scripts/fast.ts selection (about 2,374 files, too broad for the sandbox). The forge's check runs the full suite.

What changed

  • Facts list: src/web/node_facts.ts renders a dl.facts with a dt (kind and link) and a dd (state) per node. It is capped at 300 rows and says how many it left out. Its CSS is in mapCss and the space page.
  • Map: mapFacts() lists the nodes drawn, top level first and left to right, with the same state word as the card. The map's SVG nodes were already Tab-focusable links with a focus style, so the copy's links use tabindex="-1" to avoid a second Tab stop.
  • Space: spaceFacts() lists the issues the canvas draws, with state and pillar, linking to /issues/N. Its links are tabbable, and when one has focus the list shows itself as a scrollable box with a visible outline (forced-colors aware). That gives keyboard users a way to open an issue, since the canvas itself has none.
  • Page weight: the list is bounded by what is drawn (the 300-row cap), and no new SQL is read, so the page budget statements are unchanged.
  • Docs: .facts is named in docs/design/areas/map.md.

Tests

  • test/map-facts.test.ts: the list's rows equal the map's drawn nodes and start with the top level. It also covers escaping, the cap and the tabindex behaviour.
  • test/space-page.test.ts: the list's rows equal space.json issues up to the cap, every link is tabbable, and the focus-reveal CSS is present.

Left out

  • Browser test: no keyboard-only browser test, because the sandbox has none. A test that drives Tab and Enter in a real browser is still missing.
  • Space nodes other than issues: the space list covers issues only, not pillars or crew.

Try it

  • Open a repository's /map, press Tab to a node, then Enter.
  • Open /space and press Tab until the facts list appears.

I added a Try: commit message because the pre-push hook asked for one.

Closes #15592

7 earlier comments · 1 event
commented

The map and /space now each carry a visually hidden facts list: node, kind, state, link, in reading order. There is no browser in the sandbox, so I did not run the keyboard-only browser test. I checked the markup and CSS instead. The map and space tests I ran passed, as did tsc and design-lint. I did not run the broader bun scripts/fast.ts selection (about 2,374 files, too broad for the sandbox). The forge's check runs the full suite.

What changed

  • Facts list: src/web/node_facts.ts renders a dl.facts with a dt (kind and link) and a dd (state) per node. It is capped at 300 rows and says how many it left out. Its CSS is in mapCss and the space page.
  • Map: mapFacts() lists the nodes drawn, top level first and left to right, with the same state word as the card. The map's SVG nodes were already Tab-focusable links with a focus style, so the copy's links use tabindex="-1" to avoid a second Tab stop.
  • Space: spaceFacts() lists the issues the canvas draws, with state and pillar, linking to /issues/N. Its links are tabbable, and when one has focus the list shows itself as a scrollable box with a visible outline (forced-colors aware). That gives keyboard users a way to open an issue, since the canvas itself has none.
  • Page weight: the list is bounded by what is drawn (the 300-row cap), and no new SQL is read, so the page budget statements are unchanged.
  • Docs: .facts is named in docs/design/areas/map.md.

Tests

  • test/map-facts.test.ts: the list's rows equal the map's drawn nodes and start with the top level. It also covers escaping, the cap and the tabindex behaviour.
  • test/space-page.test.ts: the list's rows equal space.json issues up to the cap, every link is tabbable, and the focus-reveal CSS is present.

Left out

  • Browser test: no keyboard-only browser test, because the sandbox has none. A test that drives Tab and Enter in a real browser is still missing.
  • Space nodes other than issues: the space list covers issues only, not pillars or crew.

Try it

  • Open a repository's /map, press Tab to a node, then Enter.
  • Open /space and press Tab until the facts list appears.

I added a Try: commit message because the pre-push hook asked for one.

commented

<!-- look-pages d5bf5c5940a4 --> Look pages for d5bf5c5, from the gate:

  • look pages (inferred): this pull changes src/web/node_facts.ts, src/web/pages/map.ts, src/web/pages/space.ts; the forge pictures / (src/web/node_facts.ts), /docs (src/web/node_facts.ts), /explore (src/web/node_facts.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The map and /space now each carry a visually hidden list of the same facts as the drawing: node, kind, state, link, in reading order. Tab reaches every node and Enter opens it. I could not run a keyboard-only browser test because the sandbox has no browser, so that is still missing. The local gate, tsc and the map and space tests pass; the forge has not yet re-run its check on the new push.

What changed

  • Shared list: src/web/node_facts.ts renders a dl.facts with one dt (kind and link) and one dd (state) per node drawn. It is capped at 300 rows and says how many it left out. Its CSS ships with mapCss and the space page.
  • Map: mapFacts() lists the nodes drawn, top level first and left to right, with the same state word as the card. The SVG nodes were already focusable links, so the list's links use tabindex="-1" and do not add a second Tab stop.
  • Space: spaceFacts() lists the issues the canvas draws, with state and pillar, linking to /issues/N. Its links are tabbable. When one has focus the list shows itself as a scrollable box with a visible outline, honouring forced-colors. The canvas has no keyboard way to open an issue, so this list is it.
  • Page weight: the list is bounded by what is drawn, and no new SQL is read.

Fixes after the check and the review

  • Tests: test/map-facts.test.ts now builds a real app with three issues and one dependency instead of casting with as never. It checks that the list's rows equal the drawn nodes, that what is waited for comes first, and that titles are escaped. test/space-page.test.ts checks the space list's rows against space.json, capped, with every link tabbable.
  • Look pages: the inferred set was about 30 pages, because mapCss is imported by many routes. I named Looks: /preview-admin/sample/space in a commit. The map has no page of its own in app.looks. If you want a map page pictured, say which and I will name it.
  • Gate lines: I added No door: and Direction: lines in commits. The Direction line names #6534 as the item this goes ahead of, which was my pick from the gate's list, so correct it if another item fits better.

Left out

  • Browser test: there is still no keyboard-only browser test that drives Tab and Enter in a real browser.
  • Other space nodes: the space list covers issues only, not pillars or crew.

Try it

  • Open a repository's /map, press Tab to a node, then Enter.
  • Open /space and press Tab until the facts list appears.
commented

<!-- look-pages 1a1ef808bfac --> Look pages for 1a1ef80, from the gate:

  • look pages (named): this pull changes src/web/node_facts.ts, src/web/pages/map.ts, src/web/pages/space.ts; a commit names /preview-admin/sample/space
commented

The gate's comment lists the pages it will take looks of. It doesn't ask for a change, so I changed nothing and pushed nothing.

  • /preview-admin/sample/space: it answers 200 on this pull's preview, so the page the commit names exists.
  • Plain /space on the preview: it answers 404. I took that to be the route's owner/name form and didn't investigate further.
  • Local checks: I didn't re-run the tests, tsc or the gate, because the branch has no new changes.
Changes requested — before the latest push

The idea is right and the map half is sound: its list matches the drawn nodes, is escaped, and its links stay out of Tab. The space half is not usable by keyboard as shipped, and a few things in the list need fixing. All in one round:

  1. FIRST: /space puts up to 300 tabbable links in one run, ahead of the pillar list, with no way past them. A keyboard user has to press Tab up to 300 times to reach the content below. Put the list behind a skip link (Skip the issue list, a real <a href> to the pillars) that is the first stop, or make it a closed disclosure that opens on Enter. Add a test that a skip target exists.
  2. Principle 8 (plain words): 5 more not listed / cap 300 is jargon. Say 5 more issues are not listed here, and drop the dd that says cap.
  3. Principle 6 (few borders): the focus reveal is a bordered, rounded box around a list. Use the hairline or a background change only.
  4. Both doors / docs: no docs/features/<name>.md how-to for the keyboard path, and no word on whether the terminal already lists nodes in text. Add the how-to and say in the pull what the terminal does.
  5. Clean: as unknown as Space in spacePage hides a type mismatch. Type spaceOf's return instead of casting.
  6. Tests: the two factsCss toContain assertions check that a string exists, and would pass with the CSS broken. Remove them, or test the behaviour (the skip link, the tabindex on links).
  7. The pull description has no review block of {go,look,expect} steps, which a page change must end with.

Smaller: list-style on a dl does nothing; aria-label on a bare dl is not reliably announced, so give it a visible-to-AT heading or role="group"; "issue" is repeated on every row, so say it once in the label.

commented

The map and /space now say their issues in a hidden text list, and /space no longer puts 300 Tab stops in front of the pillars.

What changed

  • Space list (1): the list sits in a closed <details>, so Tab stops once on its summary, "Issues of <repo>: N in all, press Enter to list them". Enter opens it and Tab then walks the issue links. I chose the closed disclosure over a skip link because .space-list (the pillar list) is display:none when JS is on, so a skip link would have pointed at nothing. A test checks the details is closed, has a summary, and comes before the pillar list.
  • Plain words (2): the overflow row reads "5 more issues are not listed here" ("1 more issue is not listed here" for one), and the cap row is gone.
  • Borders (3): the focus reveal is a var(--muted) background only, with no border or radius. list-style is dropped. The reveal sits inside .space, which is fixed, and .map-canvas, which is relative, so the absolute position lands inside the canvas on both pages.
  • Docs and terminal (4): docs/features/map-by-keyboard.md is the new how-to. The terminal already lists these in text and needed no change. forge space lists every issue by pillar and state, with / to find one, and the roadmap screen lists the map's issues.
  • Typed spaceOf (5): spaceOf now returns Space, and the as unknown as Space cast in spacePage is gone. cachedMap is generic, with one documented cast at the untyped cache store. Three consumers that take Record<string, unknown> (the MCP map tool and two calls in the terminal space screen) now spread the value.
  • Tests (6): the two factsCss string assertions are removed. In their place, tests check the closed disclosure, no tabindex="-1" on the space's links, the plain-words text and the single-row overflow.
  • Announcing (smaller): each list is a role="group" with a label, wrapping a dl. Rows no longer repeat "issue"; the group label says it once.

Not done

  • Review block: I wrote the review block below but did not add it to the PR description. It is for the final description.
  • Tests not run: the tests that cover this change pass: map-facts, space-page, feature-orphans, feature-doors, mcp-map-space and tui-space. tsc and design-lint are clean. scripts/fast.ts named 3377 files, too broad to run here, so the forge's check runs the full suite on this push.
  • Gate note: the gate reports one comment line over 100 columns in src/web/pages/map.ts. I left it for the nightly rewrap, as the gate says to.
[
 {"go":"/keeper/forge/space","look":"Press Tab from the canvas through the bar and legend","expect":"One stop lands on 'Issues of forge: N in all, press Enter to list them'; a second Tab leaves it, not into 300 links"},
 {"go":"/keeper/forge/space","look":"Focus that summary and press Enter, then Tab","expect":"A list appears bottom-left on a plain background, no border; each Tab is one issue, Enter opens it; past 300 the last row says how many more issues are not listed here"},
 {"go":"/keeper/forge/map?view=graph","look":"Tab through the cards","expect":"Each card is one stop; the hidden list adds none"}
]
commented

<!-- look-pages 7ac5a612bbc0 --> Look pages for 7ac5a61, from the gate:

  • look pages (named): this pull changes src/web/map_snapshot.ts, src/web/node_facts.ts, src/web/pages/map.ts; a commit names /preview-admin/sample/space
commented

The gate's note needs no code change, and I pushed nothing new. It is informational: look pages (named) is the good outcome. It says a commit named /preview-admin/sample/space through its Looks: line, and that page is listed in app.looks in forge.json. The forge will take its picture at the pull's head, so the reviewer sees it beside main's.

This pull adds a hidden facts list to the map and /space. It makes each node reachable by Tab, and Enter opens it. The space's issue list is a closed disclosure with one Tab stop.

To try it, open a repository's /map and press Tab to a node, then Enter. Then open /space and Tab into the facts list.

I did not run the tests, tsc or the design lint again for this reply, since nothing changed.

Approved

Security read: no findings. Titles are escaped by the html template, hrefs are built from numeric issue numbers, the lists use the viewer-scoped cached map and space reads, and no new input, write or dependency was added. The first round is addressed: the space list is a closed details with one Tab stop, the overflow row uses plain words, there is a features how-to, spaceOf is typed, and the CSS-string tests are gone. The terminal already lists issues in text. Nit, not blocking: the focus reveal uses a --muted background tint; --bg with the focus outline alone would hold principle 4 more strictly.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs