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

Talk is keyboard first on a desktop: send, newline, jump to latest and switch conversation, listed under ? #15920

Merged opened this

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

Merged

Talk now has the desktop keys from the issue, and ? opens a list of them. test/talk-page.test.ts passes, as do tsc, gate.ts and design-lint.ts.

Notes

shipped production is serving it deploy 3fede26

opened this

Talk now has the desktop keys from the issue, and ? opens a list of them. test/talk-page.test.ts passes, as do tsc, gate.ts and design-lint.ts. I did not run the full suite; the forge runs it on the push.

  • End or Ctrl+End: jumps to the latest turn, but only outside a field. Inside the box, End still moves the caret.
  • Alt+Up / Alt+Down: go to the previous or next conversation in the list, saving the draft first. They do nothing at the ends of the list or when the current conversation isn't in it, and they work from inside the box.
  • ?: outside any input, it opens or closes the list. The list is drawn by the server above the about line, hidden until asked for.
  • Escape: closes the list first and stops an answer otherwise.
  • Enter, Shift+Enter, Escape-to-stop and /: unchanged.
  • One constant: the key words live in TALK_KEYS in src/web/pages/talk_client.ts. The page renders the list from it, and the test reads the same constant.
  • Tests:
    • The first drives the script in a DOM: ?, End, Escape closing the list before it stops an answer, ? ignored inside the box, and Alt+Up.
    • The second checks each TALK_KEYS binding appears in the script and the rendered page names each one.

Two size caps in test/talk-page.test.ts are raised: the stylesheet to 6,400 bytes and the script to 19,000. Both limits were there to be deliberate about growth, so say if you'd rather I trim instead. .talk-keys is also named in docs/design/areas/talk.md.

I made the list a plain block rather than a floating dialog. A fixed overlay would have needed forgeOverlay and a z-index token.

I did not add Alt+Up/Down to the search-results list, only the main conversation list.

To try it, open /talk on a desktop and press ?. Then press End after scrolling up, and Alt+Up or Alt+Down with two or more conversations.

[
  {"go":"/talk","look":"press ? with focus outside the box","expect":"a bordered list of keys appears above the composer; ? or Escape closes it"},
  {"go":"/talk","look":"scroll up in a long thread, press End","expect":"the page jumps to the latest turn; inside the box End moves the caret as usual"},
  {"go":"/talk","look":"with two or more conversations, press Alt+Down then Alt+Up","expect":"the next, then previous, conversation opens; the draft is kept"}
]

Closes #15816

7 earlier comments · 2 events
commented

Talk now has the desktop keys from the issue, and ? opens a list of them. test/talk-page.test.ts passes, as do tsc, gate.ts and design-lint.ts. I did not run the full suite; the forge runs it on the push.

  • End or Ctrl+End: jumps to the latest turn, but only outside a field. Inside the box, End still moves the caret.
  • Alt+Up / Alt+Down: go to the previous or next conversation in the list, saving the draft first. They do nothing at the ends of the list or when the current conversation isn't in it, and they work from inside the box.
  • ?: outside any input, it opens or closes the list. The list is drawn by the server above the about line, hidden until asked for.
  • Escape: closes the list first and stops an answer otherwise.
  • Enter, Shift+Enter, Escape-to-stop and /: unchanged.
  • One constant: the key words live in TALK_KEYS in src/web/pages/talk_client.ts. The page renders the list from it, and the test reads the same constant.
  • Tests:
    • The first drives the script in a DOM: ?, End, Escape closing the list before it stops an answer, ? ignored inside the box, and Alt+Up.
    • The second checks each TALK_KEYS binding appears in the script and the rendered page names each one.

Two size caps in test/talk-page.test.ts are raised: the stylesheet to 6,400 bytes and the script to 19,000. Both limits were there to be deliberate about growth, so say if you'd rather I trim instead. .talk-keys is also named in docs/design/areas/talk.md.

I made the list a plain block rather than a floating dialog. A fixed overlay would have needed forgeOverlay and a z-index token.

I did not add Alt+Up/Down to the search-results list, only the main conversation list.

To try it, open /talk on a desktop and press ?. Then press End after scrolling up, and Alt+Up or Alt+Down with two or more conversations.

[
  {"go":"/talk","look":"press ? with focus outside the box","expect":"a bordered list of keys appears above the composer; ? or Escape closes it"},
  {"go":"/talk","look":"scroll up in a long thread, press End","expect":"the page jumps to the latest turn; inside the box End moves the caret as usual"},
  {"go":"/talk","look":"with two or more conversations, press Alt+Down then Alt+Up","expect":"the next, then previous, conversation opens; the draft is kept"}
]
commented

<!-- look-pages 94a3fb42aa20 --> Look pages for 94a3fb4, from the gate:

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

The desktop keys on /talk are now in this pull: ? opens a keys list, End jumps to the latest message, and Alt+Up / Alt+Down switch conversation. bun scripts/gate.ts is clean on the pushed commit, and bun x tsc --noEmit and test/talk-page.test.ts (73 tests) pass. I did not run the forge's full check.

  • The failure: the gate's "both doors" rule wanted a matching src/tui/ change or a how-to under docs/features/.
  • What I did: I added a No door: line to the new commit. These are browser-only keys, and the ssh talk terminal is a line prompt with Enter to send and nothing to scroll or switch.
  • What I chose not to do: I wrote a docs/features/talk-keys.md how-to first, then dropped it. A new feature doc trips the "pipeline first" rule, which wants a pipeline change or a Direction: line.

The change:

  • ?: pressing it outside the box toggles a keys list. Escape closes it, and the list is drawn from one TALK_KEYS constant.
  • End: outside the box, it jumps to the latest message.
  • Alt+Up / Alt+Down: they open the previous or next conversation, saving the draft first.
  • Tests: they live in test/talk-page.test.ts.
  • Design doc: .talk-keys is documented in docs/design/areas/talk.md.

Try it: open /talk on a desktop and press ?.

[
  {"go":"/talk","look":"Press ? with the cursor outside the box","expect":"A bordered list of keys appears above the about line; ? again or Escape closes it"},
  {"go":"/talk","look":"Press End outside the box in a long thread","expect":"The thread scrolls to the latest message"},
  {"go":"/talk","look":"Press Alt+Down then Alt+Up","expect":"The next, then the previous, conversation in the list opens; a typed draft is kept"}
]
commented

<!-- look-pages cd8cd3ebc0a9 --> Look pages for cd8cd3e, from the gate:

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

Nothing needed changing. The feedback is the gate's automatic note that it will take a picture of /talk for this pull. It asks for no code change, so I pushed nothing new. The branch still ends at cd8cd3ebc.

What changed: /talk is keyboard-first on a desktop.

  • ?: pressing it outside the box opens a list of the keys. Escape or a second ? closes it. The list is drawn from one TALK_KEYS constant, so the page and the test share the same words.
  • End: outside the box, it jumps to the latest message.
  • Alt+Up / Alt+Down: they open the previous or next conversation in the list, saving the draft first.
  • Existing keys: Enter sends, Shift+Enter adds a line, and / goes to the box. They are unchanged and now appear in the list.
  • Docs and tests: .talk-keys is documented in docs/design/areas/talk.md, and the tests are in test/talk-page.test.ts.

What I chose not to do:

  • No src/tui/ change: these are browser keys, and the ssh talk terminal is a line prompt with nothing to scroll or switch. The commit carries a No door: line saying so.
  • No docs/features/ how-to: a new feature doc trips the gate's "pipeline first" rule, so I left it out.
  • No look override: the inferred look page, /talk, is the right one, so I added no Looks: or No look: line.

Checks: bun scripts/gate.ts is clean on the pushed commit, and bun x tsc --noEmit and test/talk-page.test.ts (73 tests) pass. I did not run the forge's full check.

Try it: open /talk on a desktop and press ?.

[
  {"go":"/talk","look":"Press ? with the cursor outside the box","expect":"A bordered list of keys appears above the about line; ? again or Escape closes it"},
  {"go":"/talk","look":"Press End outside the box in a long thread","expect":"The thread scrolls to the latest message"},
  {"go":"/talk","look":"Press Alt+Down then Alt+Up","expect":"The next, then the previous, conversation in the list opens; a typed draft is kept"}
]
Changes requested — before the latest push

The keys work as the issue asks, but four things stop it landing. Fix these in one round.

  1. Design principle 6: .talk-keys is a box drawn around a thing. Drop the border and use space, or a hairline only where it ends.
  2. Both doors: there is no docs/features/<name>.md how-to. The No door: line explains the missing src/tui/ screen, but the keys still need a how-to, and the README must stay untouched. Write it, and add a Direction: line if the gate asks for one.
  3. The Alt+Up test only checks defaultPrevented. Assert that location.href goes to /talk/a, that Alt+Down at the last row does nothing, and that the draft is saved first.
  4. The End test asserts nothing about focus. Add a case that End inside the box keeps the caret and does not scroll.

Smaller: role=dialog with no focus handling is misleading, so make it a plain region. Make sure the Escape handler really runs before the existing stop handler; the test only passes if the order holds. The size caps went up by about 450 bytes of CSS and 1.4 KB of script, so trim if you can.

commented

All four of juniper's points and the smaller ones are in, and the branch is pushed. test/talk-page.test.ts passes (75 tests), bun x tsc --noEmit and bun scripts/design-lint.ts are clean, and bun scripts/gate.ts --fix passes. I did not run the forge's full check.

What changed since the last round

  • Principle 6: .talk-keys no longer has a box round it. It keeps a 1px hairline under the list where it ends, and the padding is on the bottom only.
  • Region role: the list is role="region" with an aria-label. It was role="dialog", which promised focus handling that isn't there.
  • How-to: docs/features/talk-keys.md is written and the README is untouched. The gate asked for a Direction: line, so the commit carries one, naming #15816 and "ahead of #6534".
  • Alt+Up/Down test: it now checks that Alt+Up goes to /talk/a and Alt+Down to /talk/c, and that the draft is in storage right after the key. It also checks that Alt+Down on the last row does nothing, and that Alt+Up with no Alt does nothing. To make navigation observable I changed the script from location.href to window.location.href.
  • End test: a new case presses End inside the box and checks the caret stays at 2, preventDefault isn't called, and nothing scrolls.
  • Escape order: the test now fires running first so an answer is streaming. Escape closes the list and sends no stop request. A second Escape sends exactly one stop. The key listener is registered before the Escape-stops one, and a comment in talk_client.ts says so.

Size caps: I trimmed them from +450 B of CSS and +1.4 KB of script down to 6,300 B (was 5,950 before this pull) and 18,900 B (was 17,600). That is what the script fit after shortening my comment. I didn't squeeze further without hurting readability, so say if you want it tighter.

Try it: open /talk on a desktop and press ?.

[
  {"go":"/talk","look":"Press ? outside the box","expect":"Keys list appears with no box round it, only a hairline under it; ? or Escape closes it"},
  {"go":"/talk","look":"With an answer streaming, open the list and press Escape","expect":"The list closes and the answer keeps going; a second Escape stops it"},
  {"go":"/talk","look":"Alt+Up / Alt+Down, with a half-typed draft","expect":"The neighbouring conversation opens and the draft is back when you return; nothing happens at the first or last row"},
  {"go":"/talk","look":"Click into the box and press End","expect":"The caret moves to the line end and the page does not scroll"}
]
commented

<!-- look-pages 11aba0fd62b8 --> Look pages for 11aba0f, from the gate:

  • look pages (inferred): this pull changes src/web/pages/talk.ts, src/web/pages/talk_client.ts; the forge pictures /talk (src/web/pages/talk.ts), the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
Approved

All earlier asks are met: the box is now a hairline under the list (principle 6), the list is a labelled region instead of a dialog, the how-to is in docs/features/talk-keys.md with README untouched, and the tests now check the Alt+Up/Down targets, the saved draft, End inside the box, and Escape closing the list before it stops an answer. The list is real dt/dd rows, works hidden by default with JavaScript off, and uses no new accent. Next, I would do two things. First, Non-blocking: let Alt+Up/Down work in the search-results list too. Second, Non-blocking: trim the raised size caps once the Talk script is next touched.

commented

Talk is keyboard first on a desktop. Enter sends, Shift+Enter adds a newline, End jumps to the latest message, Alt+Up and Alt+Down switch conversation, and ? lists the keys. The list comes from one constant. I made no new changes in this round, so nothing new is pushed.

  • What to look at: src/web/pages/talk.ts and src/web/pages/talk_client.ts. The how-to is docs/features/talk-keys.md, and the README is untouched.
  • Layout: the box is a hairline under the list. The key list is a labelled region with real dt/dd rows. It is hidden by default and works with JavaScript off. It adds no new accent.
  • Tests: they cover where Alt+Up and Alt+Down land, the saved draft, End inside the box, and Escape closing the list before it stops an answer.
  • Not done, juniper's two non-blocking follow-ups:
    • Alt+Up/Down in the search-results list. It is a separate navigation target and would widen this pull, so it is better as its own change.
    • Trimming the raised size caps. They are best trimmed the next time the Talk script is changed for another reason.
  • Look pages: the gate pictures /talk for this change. No override line is needed.
  • To try it: open /talk on a desktop and press ?.
[
 {"go":"/talk","look":"Press ? with focus outside the box","expect":"A labelled list of keys appears; Escape closes it"},
 {"go":"/talk","look":"Type a draft, press Alt+Down, then Alt+Up","expect":"The conversation switches and the draft returns on coming back"},
 {"go":"/talk","look":"Press End inside the box, then Shift+Enter","expect":"The thread jumps to the latest message; Shift+Enter adds a newline and does not send"}
]

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs