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

A Talk reply reads cleanly while it streams: long code blocks scroll in their own box with Copy, long links wrap, and the reader's place holds #15919

Merged opened this

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

Merged

A long code line in a Talk reply now scrolls in its own box, a long URL wraps inside the column, and the stream-follow rule is a pure function with a test. I did not take the 360 px and 1280 px screenshots, so that item is open.

Notes

shipped production is serving it deploy b03b44b

opened this

A long code line in a Talk reply now scrolls in its own box, a long URL wraps inside the column, and the stream-follow rule is a pure function with a test. I did not take the 360 px and 1280 px screenshots, so that item is open. bun test test/talk-page.test.ts, bun x tsc --noEmit, bun scripts/gate.ts --fix and bun scripts/design-lint.ts are green; I did not run the full suite.

  • Code blocks: the code already scrolled sideways in its own box and already got a Copy button, so the existing styles and Copy button stay as they were. I added tabindex=0 to each code block so a keyboard user can scroll it.
  • Long links: a new rule .talk-body a { word-break: break-all; } makes a URL longer than the column break instead of widening it.
  • Follow rule: the "within 120 px of the end" check moved out of the scroll handler into one function, follows(viewHeight, scrollY, pageHeight), defined in followJs in src/web/pages/talk_client.ts and inlined into the script. Scrolled further up, the view stays put and the "jump to latest" button shows; the stuck logic is unchanged.
  • Tests: new tests in test/talk-page.test.ts cover a turn with a 300-character code line and a 180-character URL, and follows at the bottom, near the bottom and scrolled up. The existing script size cap went from 17,600 to 17,800 bytes for the new function and tabindex; the stylesheet cap is unchanged.
  • Not done: nothing else changed.

The pre-push hook refused the push without a commit saying how to try the change, so I added an empty "Try:" commit.

To try it, open /talk and ask for a reply with a very long code line and a very long URL. The code scrolls inside its box, the URL wraps, and scrolling up mid-stream keeps your place.

[
  {"go": "/talk", "look": "a reply with a 300-character code line and a 200-character URL, at 360 px and at 1280 px", "expect": "the code scrolls sideways inside its box with a Copy button, the URL wraps, and the page itself never scrolls sideways"},
  {"go": "/talk", "look": "scroll up while a reply streams", "expect": "the view stays where it is and the jump-to-latest button shows; at the bottom it follows"}
]

🤖 Generated with Claude Code

Closes #15815

Show 10 earlier items

7 earlier comments
commented

<!-- look-pages 29c41c2efb99 --> Look pages for 29c41c2, from the gate:

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

I fixed the slow Talk layout tests and pushed. I couldn't run the layout tests here, because the sandbox has no working Chromium, so the forge's check is their first real run.

Cause. test/talk-layout.test.ts starts a browser for every page it measures. My separate long-line test added two more launches, about 1.7 s each when run alone. That made the file crowd the 2 s budget, and a neighbouring test, "a first visit…", took 2.09 s and failed.

Fix. I removed my separate test. The long-line measurement now rides on page loads the file already makes. The 360 px phone test and the 1280 px laptop test each check three things:

  • The 300-character code line scrolls inside its own box.
  • The box is no wider than the screen.
  • The 200-character link's right edge stays on screen.

The existing fits check, which was already there, still covers the page not widening. No browser launches were added.

Still failing. /llms.txt stays under its byte budget for each role fails again. It is the same failure on main that I reported before, still tracked as #15879.

tsc --noEmit and scripts/gate.ts --fix are clean.

Pull description: Talk replies with a very long code line or URL stay inside the column. Code boxes scroll sideways and take the keyboard (tabIndex = 0). Links break only when they can't fit (overflow-wrap: anywhere). The follow rule is one named function, follows(viewHeight, scrollY, pageHeight), pinned by a test: a streaming reply follows only within 120 px of the end. The layout test measures the long code line and link at 360 and 1280 px inside the existing phone and laptop page loads. The script-size ceiling in test/talk-page.test.ts is 19,100 bytes. To try it, open /talk, ask for a reply with a very long code line and URL, and scroll up while it streams. The view stays put, and "jump to latest" shows.

commented

The feedback is the gate's automated look-pages note. It asks for no change, so I made no commit and pushed nothing.

The note says the forge will picture /talk, because this pull changes src/web/pages/talk_client.ts. That is correct: /talk is the one page the change touches. The inferred page needs no override, so I added no Looks: or No look: line.

The pull description is unchanged:

Talk replies with a very long code line or URL stay inside the column. Code boxes scroll sideways and take the keyboard (tabIndex = 0). Links break only when they can't fit (overflow-wrap: anywhere). The follow rule is one named function, follows(viewHeight, scrollY, pageHeight), pinned by a test: a streaming reply follows only within 120 px of the end. The layout test measures the long code line and link at 360 and 1280 px inside the existing phone and laptop page loads. The script-size ceiling in test/talk-page.test.ts is 19,100 bytes. /llms.txt stays under its byte budget fails on main too (#15879) and is not touched here. To try it, open /talk, ask for a reply with a very long code line and URL, and scroll up while it streams. The view stays put, and "jump to latest" shows.

[
  {"go": "/talk", "look": "A reply holding a 300-character code line and a 200-character link", "expect": "The code scrolls sideways inside its own box with Copy, the link wraps, and the page does not scroll sideways at 360 or 1280 px"},
  {"go": "/talk", "look": "Scroll up while a reply streams", "expect": "The view stays put and 'jump to latest' shows; scrolled to within 120 px of the end, the view follows", "ask": "Does the view hold when you scroll up mid-stream?"}
]
commented

I changed nothing and pushed nothing. No check of the pull's head is recorded as failed, and I found no defect in the pull. The forge will check the head again by itself.

The pull description stays as it was:

Talk replies with a very long code line or URL stay inside the column. Code boxes scroll sideways and take the keyboard (tabIndex = 0). Links break only when they can't fit (overflow-wrap: anywhere). The follow rule is one named function, follows(viewHeight, scrollY, pageHeight), pinned by a test: a streaming reply follows only within 120 px of the end. The layout test measures the long code line and link at 360 and 1280 px inside the existing phone and laptop page loads. The script-size ceiling in test/talk-page.test.ts is 19,100 bytes.

/llms.txt stays under its byte budget fails on main too (#15879) and this pull doesn't touch it. The layout tests couldn't run in my sandbox, which has no Chromium, so only the forge's check measures them.

To try it, open /talk, ask for a reply with a very long code line and URL, and scroll up while it streams. The view stays put, and "jump to latest" shows.

commented

I split the slow Talk layout test into two tests. I couldn't run the layout measurement here, so the 2 s fix is untested.

What changed. The check "a first visit, the conversation empty, keeps the composer on screen at a tablet and a laptop" loaded the page twice in one test, 900×1100 and then 1280×800. That took 2.09 s against the 2 s per-test budget. In test/talk-layout.test.ts it is now one test per size, "…at a tablet" and "…at a laptop". Each has the same assertions and does one page load, so each should come in at about half the time.

What I chose not to do. I didn't add the file to SLOW in scripts/gate.ts, since the test can simply be faster. The assertions are unchanged, so nothing about the layout behaviour moved.

Checks I ran. bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix raised nothing. bun test test/talk-layout.test.ts skips all 8 tests in this sandbox because no Chromium starts, so the forge's check on this push is the first real measurement.

How to try it. Run bun test test/talk-layout.test.ts on a machine with Chromium and look at the two first-visit timings.

commented

I merged main into the branch and pushed it. The merge went through without any conflicts for me to resolve. Git took main's side of src/http/mcp/tools/read_file.ts and src/web/render/kinds.ts on its own. Against main, the pull now changes only src/web/pages/talk_client.ts, test/talk-page.test.ts and test/talk-layout.test.ts, so nothing of main's in those two files was overwritten.

  • Tests that ran: talk-page, render-kinds and mcp-read-file pass (95 tests).
  • test/talk-layout.test.ts: all 8 tests skipped here because no Chromium starts in this sandbox. The forge's check will run them.
  • Gate and types: bun scripts/gate.ts --fix and bun x tsc --noEmit ran without errors, and the working tree stayed clean.
  • Wider suite not run: scripts/fast.ts selected 2,263 test files, so I ran only the files above. The forge's check runs the rest.

The behaviour change itself is unchanged: a Talk reply still reads cleanly while it streams.

commented

<!-- look-pages 9d9c613d3f31 --> Look pages for 9d9c613, from the gate:

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

Nothing in the code changed for this feedback. The look-pages comment is the gate's note that it will picture /talk, because src/web/pages/talk_client.ts changed. /talk is the page this pull changes, so I added no Looks: or No look: override. I pushed nothing new.

What the pull does: a Talk reply now reads cleanly while it streams.

  • Long code blocks scroll in their own box and have a Copy button.
  • Long links wrap instead of widening the reply.
  • The reader's scroll position holds as new text arrives.

What to look at: src/web/pages/talk_client.ts.

How to try it: open /talk on the preview, https://lab--15919--forge-trevato-apps.open-platform.sh. Ask for a long code block and a very long URL. Scroll up while the reply streams, and the view should stay where you left it.

[
  {"go": "/talk", "look": "Ask for a reply with a long code block", "expect": "The block scrolls inside its own box and has a Copy button"},
  {"go": "/talk", "look": "Ask for a reply containing a very long URL", "expect": "The link wraps and the page does not scroll sideways"},
  {"go": "/talk", "look": "Scroll up while a reply streams", "expect": "The view stays where you left it and does not jump to the bottom"}
]
Approved

Earlier asks: (1) a layout measurement of the long code line and link at 360 and 1280 px is met. It now rides on the existing phone and laptop page loads, so it adds no browser launches. (2) overflow-wrap: anywhere on links, so only a link that cannot fit breaks, is met. (3) A test that fails without pre.tabIndex = 0 is met. It is a string match, which is acceptable here. The follow rule is now one pure function with a test at the bottom, near the bottom and scrolled up. The change stays on the Talk page and adds no dependency. The pull stays on its one purpose and does not touch the pipeline work. Two things I would do next, both non-blocking. Non-blocking: give pre:focus-visible an explicit outline using the accent token, so a keyboard user can see which code box has focus. Non-blocking: run the Chromium layout test on a machine that has it. It has not run in the author sandbox, so the forge check is its first real run.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs