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

Talk on mobile: the chat controls are buried at the top of the thread #14944

Merged opened this in answer to

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

Merged

scout/forge:scout/14943-talk-on-mobile-the-chat-controls-are-bur → main 5 commits fork 6 threads · 6 unresolved

  • Merged. scout/14943-talk-on-mobile-the-chat-controls-are-bur was merged into main as 3354774.

Review

Sign in to review this change.
4 files changed +88 −40
docs/design/areas/talk.md +2
@@ -51,3 +51,5 @@ Search (#8823) adds no component class: the form is a `.bar` with `.input` and `
5151 - `.talk-step` — a tool call drawn as one closed line; opened, its `key: value` lines, one per line, in the tool card's plain paragraph.
5252
5353 - `.talk-dictate`: the Dictate button in the compose bar (#13943). A `.btn` at the 44 px target, hidden until the script finds on-device speech recognition; while listening it is filled with the accent and reads "Stop dictating".
54
55 On a phone the conversations nav is pinned under the topbar (#14943): New stays in view, and `.talk-list` folds the search and the list under a "Conversations" summary.
src/web/pages/talk.ts +42 −39
@@ -310,45 +310,48 @@ function chats(ctx: Ctx, conversation: Conversation, showArchived: boolean, type
310310 ? html`<a class="small" href="${HERE}?archived=1">Archived (${put})</a>`
311311 : null}
312312 </div>
313 <form class="bar" method="get" action="${HERE}" role="search">
314 <input class="input" type="search" name="find" value="${typed}" maxlength="${FIND_CHARS}" aria-label="Search conversations" placeholder="Search conversations" />
315 ${btn("Search")}
316 </form>
317 ${found === undefined
318 ? null
319 : html`<ul class="list" aria-label="Search results">
320 ${found.length === 0
321 ? html`<li class="muted small">Nothing found for "${typed}".</li>`
322 : found.map((f) =>
323 row({
324 href: `${urlOf(f.conversation)}${f.turnId === undefined ? "" : `?turn=${f.turnId}#t-${f.turnId}`}`,
325 title: nameOf(f.conversation),
326 meta: html`${f.snippet}`,
327 ...(f.conversation.archivedAt === null ? {} : { trail: badge("archived") }),
328 }),
329 )}
330 </ul>`}
331 <ul class="list">
332 ${shown.length === 0
333 ? html`<li class="muted small">${showArchived ? "Nothing archived." : "No conversations yet."}</li>`
334 : shown.map((c, i) =>
335 html`${i === 0 && c.pinnedAt !== null ? html`<li class="muted small" data-pinned-heading>Pinned</li>` : null}${row({
336 href: urlOf(c),
337 title: nameOf(c),
338 meta: activityLine(activity.get(c.id)),
339 current: c.id === conversation.id,
340 ...(c.archivedAt === null
341 ? {
342 after: html`<form method="post" action="${urlOf(c)}/pin">
343 <input type="hidden" name="pinned" value="${c.pinnedAt === null ? "1" : "0"}" />
344 <input type="hidden" name="back" value="list" />
345 ${btn(c.pinnedAt === null ? "Pin" : "Unpin", { size: "sm", variant: "outline" })}
346 </form>`,
347 }
348 : {}),
349 })}`,
350 )}
351 </ul>
313 <details class="talk-list"${typed !== "" || showArchived ? html` open` : null}>
outdated

Principle 8 / works with JS off: the list ships open for every viewport and a script closes it on phones. Without JS the sticky nav stays open at up to 70dvh and eats the phone. Ship it closed and let CSS show it on wide screens (e.g. at min-width 64rem force the non-summary children visible with .talk-list::details-content{content-visibility:visible} or render the list outside a details for wide and use a CSS-only toggle), or at minimum cap the open height far lower. Also indent the new block to match the nav.

314 <summary class="small">Conversations</summary>
315 <form class="bar" method="get" action="${HERE}" role="search">
316 <input class="input" type="search" name="find" value="${typed}" maxlength="${FIND_CHARS}" aria-label="Search conversations" placeholder="Search conversations" />
317 ${btn("Search")}
318 </form>
319 ${found === undefined
320 ? null
321 : html`<ul class="list" aria-label="Search results">
322 ${found.length === 0
323 ? html`<li class="muted small">Nothing found for "${typed}".</li>`
324 : found.map((f) =>
325 row({
326 href: `${urlOf(f.conversation)}${f.turnId === undefined ? "" : `?turn=${f.turnId}#t-${f.turnId}`}`,
327 title: nameOf(f.conversation),
328 meta: html`${f.snippet}`,
329 ...(f.conversation.archivedAt === null ? {} : { trail: badge("archived") }),
330 }),
331 )}
332 </ul>`}
333 <ul class="list">
334 ${shown.length === 0
335 ? html`<li class="muted small">${showArchived ? "Nothing archived." : "No conversations yet."}</li>`
336 : shown.map((c, i) =>
337 html`${i === 0 && c.pinnedAt !== null ? html`<li class="muted small" data-pinned-heading>Pinned</li>` : null}${row({
338 href: urlOf(c),
339 title: nameOf(c),
340 meta: activityLine(activity.get(c.id)),
341 current: c.id === conversation.id,
342 ...(c.archivedAt === null
343 ? {
344 after: html`<form method="post" action="${urlOf(c)}/pin">
345 <input type="hidden" name="pinned" value="${c.pinnedAt === null ? "1" : "0"}" />
346 <input type="hidden" name="back" value="list" />
347 ${btn(c.pinnedAt === null ? "Pin" : "Unpin", { size: "sm", variant: "outline" })}
348 </form>`,
349 }
350 : {}),
351 })}`,
352 )}
353 </ul>
354 </details>
352355 </nav>
353356 <div class="talk-here bar">
354357 <strong>${nameOf(conversation)}${archived ? " (archived)" : ""}</strong>
src/web/pages/talk_client.ts +5
@@ -28,6 +28,10 @@ export const talkCss = /* css */ `
2828 .talk-pane { border-left: 1px solid var(--border); padding-left: 0.75rem; }
2929 }
3030 @media (max-width: 63.99rem) {
31 .talk-side { display: contents; }
32 .talk-chats { position: sticky; top: var(--topbar-h); background: var(--bg); border-bottom: 1px solid var(--border); margin: 0; padding: 0.25rem 0; max-height: 40dvh; overflow-y: auto; }
outdated

Pinned nav with max-height:70dvh leaves ~30% of a 360px phone for messages and composer when open (and with the soft keyboard up, less). Cap the open list to a small fixed height (about 40dvh) and keep the sticky bar itself to one row. Also .talk-side{display:contents} changes the box tree for everything inside it; confirm nothing else in .talk-side loses its spacing.

33 .talk-chats .btn, .talk-list summary { min-height: 2.75rem; display: inline-flex; align-items: center; }
34 .talk-list summary { cursor: pointer; }
3135 [data-pane]:not([data-pane="chat"]) :is(.talk, .talk-side), [data-pane="chat"] .talk-pane { display: none; }
3236 }
3337 .talk-crew { margin: 0.625rem 0; height: 1.5em; line-height: 1.5em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@@ -74,6 +78,7 @@ export const talkCss = /* css */ `
7478 .talk-files { justify-content: flex-end; }
7579 .talk-more { text-align: center; }
7680 .talk-chats, .talk-here { margin-bottom: 12px; }
81 @supports selector(::details-content) { @media (min-width: 64rem) { .talk-list > summary { display: none; } .talk-list::details-content { content-visibility: visible; } } }
7782 .talk-chats .row-meta, .talk-chats .row-title { overflow-wrap: anywhere; }
outdated

On a browser without ::details-content (Firefox before 143, Safari before 18.4, Chrome before 131), the desktop list ships closed and this rule hides the only summary that could open it. Desktop users on those browsers lose the conversation list and search, and no keyboard or mouse can reach them. Wrap both rules in @supports selector(::details-content) { ... }, so older browsers keep a visible, working Conversations summary. Add a test that the hide rule sits inside that @supports block.

7883 .talk-chats .row-meta { font-variant-numeric: tabular-nums; }
7984 .talk-turn:target { box-shadow: -2px 0 0 var(--muted); scroll-margin-top: 4rem; }
test/talk-page.test.ts +39 −1
@@ -294,7 +294,7 @@ describe("the page", () => {
294294
295295 test("the page's own bytes are held: stylesheet and script stay small", async () => {
296296 const { talkCss, talkJs } = await import("../src/web/pages/talk_client.ts");
297 expect(Buffer.byteLength(talkCss)).toBeLessThan(4_500);
297 expect(Buffer.byteLength(talkCss)).toBeLessThan(5_100);

Raising the CSS and JS byte caps to fit the change weakens the guard. Once the script fold is removed the JS cap should return to its old value; keep the CSS bump only if it is needed.

298298 expect(Buffer.byteLength(talkJs)).toBeLessThan(17_600);
299299 say(alice, "agent", "```ts\nlet x = 1;\n```");
300300 const page = await get("/talk", alice);
@@ -1272,3 +1272,41 @@ describe("the header's Talk button counts confirms waiting", () => {
12721272 expect(many).toContain('aria-label="Talk to the forge, 11 waiting"');
12731273 });
12741274 });
1275
1276 describe("narrow viewport controls (#14943)", () => {
1277 const sideNav = async (path: string) => {
1278 const html = await (await get(path, alice)).text();
1279 return html.slice(html.indexOf('<nav class="talk-chats"'), html.indexOf("</nav>"));
1280 };
1281 const listTag = (nav: string) => nav.match(/<details class="talk-list"[^>]*>/)![0];
1282
1283 test("New sits outside the fold; the fold ships closed with no script", async () => {
1284 const nav = await sideNav("/talk");
1285 const list = nav.indexOf('class="talk-list"');
outdated

expect(talkJs).toContain("data-talk-list") and the CSS regex test text, not behaviour. Add a test that the list renders open only when find or archived=1 is present (and closed otherwise), which would fail without the change.

1286 expect(list).toBeGreaterThan(0);
1287 expect(nav.indexOf('action="/talk/new"')).toBeLessThan(list);
1288 expect(listTag(nav)).not.toContain("open");
1289 });
1290
1291 test("the wide layout hides the summary only where ::details-content can show the list", async () => {
1292 const { talkCss } = await import("../src/web/pages/talk_client.ts");
1293 const guard = talkCss.indexOf("@supports selector(::details-content) {");
1294 expect(guard).toBeGreaterThan(-1);
1295 let depth = 0;
1296 let end = guard;
1297 for (let i = talkCss.indexOf("{", guard); i < talkCss.length; i++) {
1298 if (talkCss[i] === "{") depth++;
1299 else if (talkCss[i] === "}" && --depth === 0) { end = i; break; }
1300 }
1301 const inside = talkCss.slice(guard, end);
1302 expect(inside).toContain(".talk-list > summary { display: none; }");
1303 expect(inside).toContain(".talk-list::details-content { content-visibility: visible; }");
1304 const outside = talkCss.slice(0, guard) + talkCss.slice(end);
1305 expect(outside).not.toContain(".talk-list > summary { display: none; }");
1306 });
1307
1308 test("the fold opens from the server only for a search or the archive", async () => {
1309 expect(listTag(await sideNav("/talk?find=hello"))).toContain(" open");
1310 expect(listTag(await sideNav("/talk?archived=1"))).toContain(" open");
1311 });
1312 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs