Public: anyone can read this; the crew can change it.
On a phone, Chats is a labelled 44 px button that opens the list at the top #16631
Check · Review · Land · Live done — Landed and live in production.
talk-chats-opener → main 0 commits 1 thread · 1 unresolved
5 files
changed +45
−8
docs/features/talk.md +1 −1
| @@ -20,7 +20,7 @@ The agent reaches the forge only through its MCP, as you. Its `tools/list` is th | ||
| 20 | 20 | |
| 21 | 21 | Reached from the Talk icon in every page's top bar, "Talk to the forge" in the palette (`Ctrl/Cmd+K`), `g t`, and the Talk button beside the tell box on home. Signed out, it sends you to /signin and back. It shows your own conversation (the last 50 turns, oldest at the top, opened on the newest; "Earlier" puts the 50 before them above, in order, and keeps the turn being read where it was, or opens them as a page of their own without the script) and a composer; Enter sends and Shift+Enter breaks a line. `/` jumps to the composer from anywhere on the page except inside a field (and with no Ctrl, Cmd or Alt held); the composer carries `aria-keyshortcuts="/"`. It is a web shortcut only: the terminal door (`ssh <forge> talk`, `forge talk`) takes its words as typed and has no shortcut keys, so `/` there is just a character. |
| 22 | 22 | |
| 23 | On a phone the composer is sticky and lifts above the on-screen keyboard (the script sets `--kb` from `visualViewport`); the head is one row (the list, the title, the model picker, Chat and Preview beside a preview, the menu and New) that never wraps, and a wide table scrolls inside its message, never the page. `test/talk-phone.test.ts` measures these at 360 and 390 px in Chromium with touch; in the forge's own check a missing Chromium fails it rather than skipping; the log is a `role=log` (polite, additions only) and the status line `role=status`, each already a polite live region, so a reply is announced once. | |
| 23 | On a phone the composer is sticky and lifts above the on-screen keyboard (the script sets `--kb` from `visualViewport`); the head is one row (Chats, a 44 px button named by its word that opens the chat list at its top on the newest chat, then the title, the model picker, Chat and Preview beside a preview, the menu and New) that never wraps, and a wide table scrolls inside its message, never the page. `test/talk-phone.test.ts` measures these at 360, 375 and 390 px in Chromium with touch; in the forge's own check a missing Chromium fails it rather than skipping; the log is a `role=log` (polite, additions only) and the status line `role=status`, each already a polite live region, so a reply is announced once. | |
| 24 | 24 | |
| 25 | 25 | A reply streams in over `GET /talk/stream?after=<turn id>` (server-sent events, one `turn` frame per stored turn, each carrying the server-rendered markup, and `live` frames for the block being written, see "Live" below). The stream ends with the turn (`done`), or after 40 seconds (`more`), well inside the edge's timeout; the page then reconnects from the last turn id it saw (`Last-Event-ID` works too). Without the script the composer is a plain form and a reload shows the answer. |
| 26 | 26 |
src/web/pages/talk.ts +1 −1
| @@ -502,7 +502,7 @@ function hereBar(ctx: Ctx, conversation: Conversation, context: Context | undefi | ||
| 502 | 502 | const item = (action: string, field: string, value: string, label: string, ic: "pin" | "history" | "trash"): Html => |
| 503 | 503 | html`<form method="post" action="${urlOf(conversation)}/${action}"><input type="hidden" name="${field}" value="${value}" /><button class="menu-item" type="submit">${icon(ic)}<span class="grow">${label}</span></button></form>`; |
| 504 | 504 | return html`<header class="talk-head"> |
| 505 | <a class="btn btn-icon talk-back" data-variant="ghost" href="${urlOf(conversation)}?chats=1" aria-label="Conversations" title="Conversations">${icon("comment")}</a> | |
| 505 | <a class="btn talk-back" data-variant="ghost" href="${urlOf(conversation)}?chats=1" title="All your chats, newest first">${icon("comment")}Chats</a> | |
| 506 | 506 | <h2 class="talk-title">${nameOf(conversation)}${archived ? " (archived)" : ""}</h2> |
| 507 | 507 | ${picker} |
| 508 | 508 | ${tabs} |
src/web/pages/talk_client.ts +3 −2
| @@ -88,10 +88,11 @@ body:has(.talk-page) .topbar { background: var(--bg); backdrop-filter: none; -we | ||
| 88 | 88 | .talk-rename { display: flex; gap: 8px; padding: 8px; } |
| 89 | 89 | .talk-rename .input { min-width: 0; flex: 1; font-size: 16px; } |
| 90 | 90 | .talk-tabs { flex: none; } |
| 91 | .talk-back { flex: none; min-height: 2.75rem; gap: 4px; padding-inline: 8px; } | |
| 91 | 92 | .talk-head .talk-tabs { padding-block: 0; } |
| 92 | 93 | [data-split] .talk-head > form { display: none; } |
| 93 | 94 | .talk-tabs a { min-height: 2.75rem; display: inline-flex; align-items: center; } |
| 94 | @media (max-width: 30rem) { .talk-tabs a { padding-inline: 6px; } .talk-head > .talk-fill { display: none; } } | |
| 95 | @media (max-width: 30rem) { .talk-tabs a { padding-inline: 6px; } .talk-head > .talk-fill, .talk-back .ico { display: none; } } | |
| 95 | 96 | .talk-body table { display: block; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; background: linear-gradient(to right, var(--bg) 30%, transparent) left / 24px 100% no-repeat local, linear-gradient(to left, var(--bg) 30%, transparent) right / 24px 100% no-repeat local, linear-gradient(to right, var(--border-strong), transparent) left / 8px 100% no-repeat scroll, linear-gradient(to left, var(--border-strong), transparent) right / 8px 100% no-repeat scroll; } |
| 96 | 97 | .talk-body :is(td, th) { overflow-wrap: normal; word-break: normal; } |
| 97 | 98 | .talk-body td code { white-space: nowrap; } |
| @@ -237,7 +238,7 @@ body:has(.talk-page) .topbar { background: var(--bg); backdrop-filter: none; -we | ||
| 237 | 238 | .talk-steer { border-radius: 999px; } |
| 238 | 239 | .talk-dictate[aria-pressed="true"] { background: var(--accent); color: var(--bg); } |
| 239 | 240 | .talk-foot { margin: 6px 16px 0; } |
| 240 | .talk-model { flex: 0 1 7rem; min-width: 4rem; margin: 0; display: flex; align-items: center; gap: 4px; } | |
| 241 | .talk-model { flex: 0 1 7rem; min-width: 3.25rem; margin: 0; display: flex; align-items: center; gap: 4px; } | |
| 241 | 242 | .talk-model select { width: 100%; min-width: 0; min-height: 2.5rem; font-size: 16px; text-overflow: ellipsis; } |
| 242 | 243 | .talk-status { margin: 4px 16px 0; min-height: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } |
| 243 | 244 | [data-answering] .talk-status { background: none; animation: none; color: transparent; } |
test/talk-page.test.ts +2 −1
| @@ -120,7 +120,8 @@ describe("the page", () => { | ||
| 120 | 120 | expect(html).not.toMatch(/data-shell[^>]*data-split/); |
| 121 | 121 | expect(html).not.toContain('class="talk-work"'); |
| 122 | 122 | expect(html).not.toContain(`class="seg talk-tabs"`); |
| 123 | expect(html).toMatch(/<a class="btn btn-icon talk-back" data-variant="ghost" href="\/talk\/[^"?]+\?chats=1" aria-label="Conversations"/); | |
| 123 | // Named by its own visible word (#16442): a phone finds "Chats", not an unlabelled icon. | |
| 124 | expect(html).toMatch(/<a class="btn talk-back" data-variant="ghost" href="\/talk\/[^"?]+\?chats=1"[^>]*>(<svg[\s\S]*?<\/svg>)?Chats<\/a>/); | |
| 124 | 125 | expect(html.indexOf('class="talk-chats"')).toBeLessThan(html.indexOf('class="talk-head')); |
| 125 | 126 | const listed = await (await get("/talk?chats=1", alice)).text(); |
| 126 | 127 | expect(listed).toContain(`data-pane="chat" data-view="list"`); |
test/talk-phone.test.ts +38 −3
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | /** |
| 2 | * Talk on a phone (#16442, #16560), measured in a real Chromium at 360 and 390 px with a finger: | |
| 2 | * Talk on a phone (#16442, #16560), measured in a real Chromium at 360, 375 and 390 px with a | |
| 3 | * finger: | |
| 3 | 4 | * the head is one row (the list, the title, the model picker, the tabs, the menu and New) and |
| 4 | 5 | * nothing in it wraps; the composer does not move as the status line or the tool-call count change; |
| 5 | 6 | * the chat list opens at its top on the newest chat; the "answering" line ends with the answer; a |
| @@ -44,7 +45,7 @@ if (skip) | ||
| 44 | 45 | "SKIPPING: no chromium that starts on this machine, so Talk on a phone is not measured", |
| 45 | 46 | ); |
| 46 | 47 | |
| 47 | const WIDTHS = [360, 390] as const; | |
| 48 | const WIDTHS = [360, 375, 390] as const; | |
| 48 | 49 | let dir: string; |
| 49 | 50 | let app: App; |
| 50 | 51 | let servers: Servers; |
| @@ -294,7 +295,7 @@ for (const width of WIDTHS) { | ||
| 294 | 295 | for (const k of m.kids) { |
| 295 | 296 | expect(k.right, seen).toBeLessThanOrEqual(width); |
| 296 | 297 | expect(k.bottom, seen).toBeLessThanOrEqual(top + 48); |
| 297 | if (/btn-icon|menu|FORM/.test(k.cls)) | |
| 298 | if (/btn-icon|talk-back|menu|FORM/.test(k.cls)) | |
| 298 | 299 | expect(Math.min(k.w, k.h), seen).toBeGreaterThanOrEqual(44); |
| 299 | 300 | } |
| 300 | 301 | // The title keeps at least a few letters. |
| @@ -311,6 +312,40 @@ for (const width of WIDTHS) { | ||
| 311 | 312 | 30_000, |
| 312 | 313 | ); |
| 313 | 314 | |
| 315 | test.skipIf(skip)( | |
| 316 | `${width} px: Chats is a labelled 44 px control in the head, and it opens the list at its top on the newest chat`, | |
| 317 | async () => { | |
| 318 | // Bob's Talk opens on his newest chat; the way to the others is in its head. | |
| 319 | const at = await phone( | |
| 320 | width, | |
| 321 | `/talk`, | |
| 322 | listToken, | |
| 323 | `(() => { | |
| 324 | const head = document.querySelector(".talk-head"), a = [...head.querySelectorAll("a")].find((x) => x.textContent.trim() === "Chats"); | |
| 325 | if (!a) return JSON.stringify({ found: false, head: head.innerText }); | |
| 326 | const r = a.getBoundingClientRect(), h = head.getBoundingClientRect(); | |
| 327 | return JSON.stringify({ found: true, href: a.getAttribute("href"), w: r.width, h: r.height, left: r.left, right: r.right, top: r.top, bottom: r.bottom, headTop: h.top, headBottom: h.bottom, shown: getComputedStyle(a).visibility === "visible" && r.width > 0 }); | |
| 328 | })()`, | |
| 329 | ); | |
| 330 | const seen = JSON.stringify(at); | |
| 331 | expect(at.found, seen).toBe(true); | |
| 332 | expect(at.shown, seen).toBe(true); | |
| 333 | expect(Math.min(at.w, at.h), seen).toBeGreaterThanOrEqual(44); | |
| 334 | expect(at.left, seen).toBeGreaterThanOrEqual(0); | |
| 335 | expect(at.right, seen).toBeLessThanOrEqual(width); | |
| 336 | expect(at.top, seen).toBeGreaterThanOrEqual(at.headTop); | |
| 337 | expect(at.bottom, seen).toBeLessThanOrEqual(at.headBottom); | |
| 338 | expect(at.href, seen).toEndWith("?chats=1"); | |
| 339 | const list = await phone(width, at.href, listToken, `(async () => { await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))); const first = document.querySelector(".talk-list .row"); const r = first.getBoundingClientRect(); return JSON.stringify({ y: scrollY, top: r.top, bottom: r.bottom, vh: innerHeight, text: first.textContent }); })()`); | |
| 340 | const said = JSON.stringify(list); | |
| 341 | expect(list.y, said).toBe(0); | |
| 342 | expect(list.top, said).toBeGreaterThanOrEqual(0); | |
| 343 | expect(list.bottom, said).toBeLessThanOrEqual(list.vh); | |
| 344 | expect(list.text, said).toContain("Chat number 19"); | |
| 345 | }, | |
| 346 | 30_000, | |
| 347 | ); | |
| 348 | ||
| 314 | 349 | test.skipIf(skip)( |
| 315 | 350 | `${width} px: the chat list opens at its top, the newest chat in view`, |
| 316 | 351 | async () => { |
new above
offline
Shrinking the picker to 3.25rem pays for the Chats label. Check that it is still readable and tappable at 360 px, and that its select is 44 px tall, not 2.5rem.