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

/space has a legend for size, colour and distance, and a search that flies to a body by name #15646

Merged opened this

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

Merged

/space now has a one-line legend and a ?q= search that works without script. The 49 space tests pass, and tsc and the design lint are clean. scripts/gate.ts --fix printed nothing, and I didn't run the full suite.

Notes

shipped production is serving it deploy 3fede26

opened this

/space now has a one-line legend and a ?q= search that works without script. The 49 space tests pass, and tsc and the design lint are clean. scripts/gate.ts --fix printed nothing, and I didn't run the full suite.

  • Legend: LEGEND_LINE in space_model.ts is a single line above the existing Legend fold. It says size is one square per issue, colour is stronger ink nearer to moving, and distance is issues sitting by pillar in the order STATES gives. It is built from the same constants the fold uses.
  • Search without script: the Find box is now a GET form (name="q", kept in the box). ?q= renders the matching issues as links, using the same findBodies match as the client script. With no match it says "No issue matches" in both the status line and a heading. The query is cut to 200 characters, the list to 50 rows, and the output is escaped.
  • Search with script: if the page loads with ?q= and no # view in the address, the script flies to the first match after the plane loads. Enter in the box does the same, as it already did. A URL carrying both ?q= and a # view keeps the # view and does not fly.
  • Tests: test/space-page.test.ts has two new tests: ?q= returns the matching bodies and says "No issue matches" otherwise, and an injected <script> in q comes back escaped. The legend line is checked for the model's words.

I did not touch the existing finder, legend fold or the finder's keyboard shortcut. I left the fly-on-load path untested because it needs a browser. The pre-push hook required a "how to try it" commit, so there is an empty Try: commit on the branch.

[
  {"go":"/keeper/forge/space","look":"the line under the canvas controls","expect":"one line: Size, Colour, Distance, with the five states in order","ask":"Does it read at a glance?"},
  {"go":"/keeper/forge/space?q=login","look":"the heading and list below the pillars","expect":"a count and links to matching issues; with script the view flies to the first"},
  {"go":"/keeper/forge/space?q=zzqx","look":"the Find box status and the heading","expect":"\"No issue matches\""}
]

Closes #15591

6 earlier comments · 1 event
commented

/space now has a one-line legend and a ?q= search that works without script. The 49 space tests pass, and tsc and the design lint are clean. scripts/gate.ts --fix printed nothing, and I didn't run the full suite.

  • Legend: LEGEND_LINE in space_model.ts is a single line above the existing Legend fold. It says size is one square per issue, colour is stronger ink nearer to moving, and distance is issues sitting by pillar in the order STATES gives. It is built from the same constants the fold uses.
  • Search without script: the Find box is now a GET form (name="q", kept in the box). ?q= renders the matching issues as links, using the same findBodies match as the client script. With no match it says "No issue matches" in both the status line and a heading. The query is cut to 200 characters, the list to 50 rows, and the output is escaped.
  • Search with script: if the page loads with ?q= and no # view in the address, the script flies to the first match after the plane loads. Enter in the box does the same, as it already did. A URL carrying both ?q= and a # view keeps the # view and does not fly.
  • Tests: test/space-page.test.ts has two new tests: ?q= returns the matching bodies and says "No issue matches" otherwise, and an injected <script> in q comes back escaped. The legend line is checked for the model's words.

I did not touch the existing finder, legend fold or the finder's keyboard shortcut. I left the fly-on-load path untested because it needs a browser. The pre-push hook required a "how to try it" commit, so there is an empty Try: commit on the branch.

[
  {"go":"/keeper/forge/space","look":"the line under the canvas controls","expect":"one line: Size, Colour, Distance, with the five states in order","ask":"Does it read at a glance?"},
  {"go":"/keeper/forge/space?q=login","look":"the heading and list below the pillars","expect":"a count and links to matching issues; with script the view flies to the first"},
  {"go":"/keeper/forge/space?q=zzqx","look":"the Find box status and the heading","expect":"\"No issue matches\""}
]
commented

<!-- look-pages 18278b41fcf0 --> Look pages for 18278b4, from the gate:

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

/space now has a one-line legend for size, colour and distance. It also has a search that works as a plain ?q= GET form and flies to the first match when script is on.

  • Failed check: I fixed the "both doors" gate failure, and bun scripts/gate.ts no longer reports it. The terminal's space screen now opens with the same one-line legend, and docs/features/space.md describes the legend line and ?q=.
  • Tests: the 49 space tests passed, plus a new test in test/space-screen.test.ts for the terminal line, and tsc is clean. I did not run the full suite, because scripts/fast.ts said the diff was too broad to name tests.
  • Legend: one line above the Legend fold says size, colour and distance. It is built from the model's own wording in space_model.ts.
  • Search: /:owner/:name/space?q=login lists matching issues as links, or says "No issue matches", with no script needed. With script the view flies to the first match. The fly-on-load path is untested because it needs a browser. A URL that also carries a # view keeps that view and does not fly.
  • Left alone: the existing finder, legend fold and keyboard shortcut are unchanged.
  • Commits: the pre-push hook required a "how to try it" commit, so there is an empty Try: commit on the branch.
[
  {"go":"/keeper/forge/space","look":"the line under the canvas controls","expect":"one line: Size, Colour, Distance, with the five states in order"},
  {"go":"/keeper/forge/space?q=login","look":"the heading and list below the pillars","expect":"a count and links to matching issues; with script the view flies to the first"},
  {"go":"/keeper/forge/space?q=zzqx","look":"the Find box status and the heading","expect":"\"No issue matches\""}
]
commented

<!-- look-pages 19641b605ef6 --> Look pages for 19641b6, from the gate:

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

No security finding: q is trimmed, capped at 200, escaped by html``, the list is capped at 50, and it is a read-only GET. Two design changes first, then a test.

  1. Principle 1 (nothing explains itself twice): the page now says size, colour and distance twice, once in the new line and again in the Legend fold directly under it. Drop the line, or have it replace the fold's three paragraphs.
  2. Principle 2 and no layout shift: .space-found is not hidden under html.space-on as .space-list is. With script on, the full-screen canvas may stack the results list over or under it. Hide it when the script is on, or show the matches inside the existing panel. The script already flies to the first match.
  3. Tests: the fly-on-load path (finder.value && !location.hash) has no test. Add one that asserts the shipped script contains the guard. The terminal test only covers an empty space, so also assert that LEGEND_LINE precedes the first region.
  4. Tidy: indent the new <form> block, and squash the empty Try: commit.
commented

This pull now says size, colour and distance once on /space, and /space?q= flies to the first match on load. The changed tests (test/space-page.test.ts, test/space-screen.test.ts), tsc, gate and design-lint pass. I did not run the full suite.

  • Legend, said once: I dropped the one-line legend from the page. The Legend fold stays as the single place the page says it. LEGEND_LINE is now SIZE_SAYS, COLOUR_SAYS and DISTANCE_SAYS joined, so the terminal reuses the same sentences and nothing is retyped.
  • No stacking with the canvas: .space-found is now hidden under html.space-on, the same rule as .space-list. The matches show without script, and the script flies to the first one.
  • Tests added:
    • The page no longer has the legend line, and "one square is one issue" appears exactly once.
    • The hide rule for .space-found is in the shipped CSS.
    • The shipped script contains the finder && finder.value && !location.hash guard.
    • In the terminal, LEGEND_LINE comes before the first region.
  • Tidy: I indented the <form> block.
  • Not done, squashing the empty Try: commit: it needs a history rewrite and a force push, which this setup refuses. If you want it gone, squash on merge.

Review

[
  {"go": "/keeper/forge/space", "look": "the Legend fold is the only place size, colour and distance are written", "expect": "no separate one-line legend above it"},
  {"go": "/keeper/forge/space?q=login", "look": "the canvas flies to the first match", "expect": "no match list stacked over the canvas"},
  {"go": "/keeper/forge/space?q=login with script off", "look": "the page", "expect": "a list of matching issues as links"}
]
commented

<!-- look-pages b597664cfce7 --> Look pages for b597664, from the gate:

  • look pages (inferred): this pull changes src/web/pages/space.ts, src/web/space_client.ts, src/web/space_model.ts; the forge pictures / (src/web/space_model.ts), /docs (src/web/space_model.ts), /explore (src/web/space_model.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 only new feedback on the pull is the gate's automated look-pages note, which asks for no change. I changed nothing and pushed nothing since b597664. The release hold on trevato/forge didn't touch this change.

What changed

  • /space says size, colour and distance once, in the Legend fold. I dropped the separate one-line legend from the page. The terminal's LEGEND_LINE is now SIZE_SAYS, COLOUR_SAYS and DISTANCE_SAYS joined, so it reuses the fold's sentences.
  • /space?q= lists up to 50 matching issues as links without script. With script on, the list is hidden (html.space-on .space-found) and the canvas flies to the first match, so nothing stacks on the canvas.
  • Tests cover:
    • the legend appearing once on the page;
    • the hide rule;
    • the fly-on-load guard finder && finder.value && !location.hash;
    • LEGEND_LINE coming before the first region in the terminal.

What I chose not to do

  • I didn't squash the empty Try: commit. It needs a force push, which this setup refuses, so squash on merge if you want it gone.

How to try it

  • Open /keeper/forge/space and open the Legend fold.
  • Open /keeper/forge/space?q=login. The canvas flies to the first match.
  • With script off, the same URL shows the matches as a list of links.
[
  {"go": "/keeper/forge/space", "look": "the Legend fold", "expect": "size, colour and distance are written once, with no separate one-line legend above it"},
  {"go": "/keeper/forge/space?q=login", "look": "the canvas", "expect": "it flies to the first match, with no match list stacked over it"},
  {"go": "/keeper/forge/space?q=login with script off", "look": "the page", "expect": "a list of matching issues as links"}
]
Approved

Earlier asks are met: the legend is said once (the fold), the terminal reuses the model sentences, the found list is hidden under the canvas, and the how-to is in docs/features/space.md, not the README. q is trimmed, capped at 200 and escaped; the list is capped at 50 rows; the form is a GET, so no mutation or CSRF surface. Non-blocking: the fly-on-load and CSS tests assert on source strings rather than behaviour. Non-blocking: squash the empty Try: commit on merge.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs