Public: anyone can read this; the crew can change it.
Talk opens on the conversation the person was in, at the place they left it #18322
Merged 11h 44m ago, live in production
Talk now opens on the conversation you were last in, at the turn you were reading. The place is kept per person on the server, so a refresh, a new tab or a new sign-in all land there. The new test, the other Talk and conversation tests and the type check pass.
-
Reviews
Changes requested — before the latest pushOne high finding, fix it first: the leave-beacon of the page you are leaving overwrites the conversation you just opened, so opening an older chat from the list and then /talk lands on the wrong chat (inline comment on talk_place.ts). Also: reloading /talk/<id> does not restore the scroll place (docs/features/talk-place.md says the place is kept for a refresh; make the doc say /talk only, or restore it), and a GET writes state (keepOpen in talkView); acceptable, but the doc should say so.
ApprovedApproved. The earlier high finding is met:
keepScrollnow only updates the turn of the conversation already kept, so a page's leave-beacon can no longer move the place back.POST /talk/placeanswers 404 for any other conversation, and the new test covers it. The doc now matches the code: only/talkrestores the scrolled place, and opening a conversation writes the place on a GET. The endpoint still checks identity, same-origin and body size throughreadForm, validates both ids, and ties the turn to its conversation. The SQL is parameterised and the migration is additive.Non-blocking: opening
/talk/<id>is a GET that writes, so a cross-site link or a prefetch can change which conversation/talkopens. The impact is low (it only moves a bookmark within the person's own conversations), but a POST from the list would remove it. -
Checks
shipped production is serving it deploy f698c54
-
History
- Direction: the scroll report only updates the turn of the conversation already open, so a page being left cannot move the place back (#18317) 7e7b497
- Talk place: a conversation named by its address opens at its end; the frame test names its conversation (#18317) 4813f14
- Talk place: one statement keeps and reads the place, so /talk stays within its SQL budget (#18317) f4522e8
- Talk place: the stream test names its conversation, as a person's open one is now the one they last visited (#18317) db7641e
- Talk place: the look is /talk (#18317) 78c3ec6
- Talk place: stamp the migration at its commit time and pin it (#18317) 4385d5e
- Direction: Talk opens on the conversation the person was in, at the place they left it (#18317) a3bef63
- Game door: a read-only switch and a one-hour write window the owner opens with a second factor (#18304) 1235063
- Full suite red: 2 files in check run 01m91f4z6qq7gd3712hjm33z1r (#18315) 1f9f7ad
- Tab forge: serve the forge as the tab's own page in the hosted shell, no frame (#18306) d162615
- Connections: a Minecraft name is a second kind of proven connection beside email (#18227) 5948687
- Access 5c: the tab forge and the Apple app's on-device mode present the same visitor to a shared forge, so apps made without a login arrive owned (#18275) ec352f4
- Tab forge: making an app is refused ("not from this forge's own page") (#18267) b869757
- The release was held: could not cut the tag v0.7.741 (#18299) 4d3523d
- Tab forge: a real-browser walk makes an app and edits a file without 'Failed to fetch' (#18307) c343cd7
- Game door: each player sees and reaches only the servers their forge grant allows (#18301) 37e3d90
- Report key: an admin makes, rotates and revokes it through the JSON API, in the settings page's words (#18289) ff66ea0
- Tab forge: the whole tab, the whole forge, and this machine put to work (#18290) 8089d62
- Apple crash reports: the app's owner sees the groups on the telemetry view, is told once per new group, and /privacy says what a report holds (#18302) c6bd3f3
- Tab forge: a write from the tab's own page passes the same-origin guard, a cross-site write is still refused (#18300) a9db6c9
8 earlier comments
Talk now opens on the conversation you were last in, at the turn you were reading. The place is kept per person on the server, so a refresh, a new tab or a new sign-in all land there. The new test, the other Talk and conversation tests and the type check pass. I did not run the full suite, and I did not run the two check rules named in the issue ("dead code" and "duplicate import") on their own.
What changed
- Stored place: a new table
talk_placeholds one row per person: their conversation and the top turn on screen.src/core/talk_place.tsreads and writes it. The row is deleted with the person or the conversation. - Which conversation opens:
openConversationnow returns the conversation you last opened, if it is still yours and not archived. Otherwise it picks your newest active one, else a new empty one. The terminal and the API's unnamed-conversation sends follow the same rule. - When it is kept: opening
/talkor/talk/<id>on the page keeps the place (pane and build fragments don't). So does opening a chat in the terminal.src/tui/screens/talk_chats.tsdoes that, so the terminal shows the same place. - Scroll place: the page sends the top turn to a new
POST /talk/placewhen you leave or stop scrolling. The server checks the id format, the same-origin rule, that the conversation is yours, and that the turn belongs to it. - Reopening: the page opens on that turn through the existing
pageAround. - Empty conversation: the box is focused with
autofocus, so it works without JavaScript. - Docs:
docs/features/talk-place.md. - Test:
test/talk-place.test.tsopens an older chat, reloads three times, signs in again and checks it is still there. It also covers the scroll place, bad input, another person's conversation or turn, a cross-origin post, and an archived or deleted conversation. It fails without the change.
Changed existing test
- Edit:
test/talk-links-click.test.tscreated a conversation and expected/talk/streamto open it as the newest. It now names the conversation withc=. - Why: the open conversation is now the one you last visited.
Left out
- Scroll resolution: scroll is kept as a turn, not pixels.
- Deleted conversation: it falls back to your newest remaining conversation, else a new empty one, rather than always a new empty one.
- New conversations: conversations made by the API or the crew do not take your place; only opening one does.
- Autofocus on phones:
autofocuson an empty Talk may bring up the keyboard.
Reused: pageAround, the existing readForm same-origin and scope check, and the migration pin tooling. The gate's similarity notes (keepOpen against recordInstalled, the test mk) are not reuses I can use here.
Try: open an older chat at /talk/<id>, scroll, then open /talk in a new tab. It lands on that chat at that turn. A fresh account's /talk has the box focused.
[
{"go":"/talk","look":"Open an older chat from the list, scroll up a few turns, then open /talk in a new tab","expect":"The page opens on that chat, with the turn you were reading at the top"},
{"go":"/talk","look":"Sign out, sign in again, open /talk","expect":"Same chat, same place"},
{"go":"/talk","look":"Press New on an account with no conversations","expect":"An empty conversation opens with the message box focused"}
]
🤖 Generated with Claude Code
I pushed a fix for the failing page-budget test. /talk was at 65 SQL statements against a budget of 64, because opening a conversation ran one statement to keep the place and a second to read it back. One statement now does both: keepOpen returns the stored scroll turn, so /talk is back to one extra statement over the original.
The type check passes. test/pages-budget.test.ts, test/talk-place.test.ts and test/talk-links-click.test.ts pass (20 tests, none failing). I did not re-run the full suite; the forge's check does that on this push.
The pull's behaviour is unchanged:
/talkopens on the last conversation at the turn left.POST /talk/placevalidates its input.- An empty Talk has the box focused.
🤖 Generated with Claude Code
Talk now opens on the conversation the person last visited, at the turn they left. I've pushed a fix for the failing check, but I couldn't confirm it. This sandbox has no Chromium, so talk-preview-frame and the three talk-phone suites were skipped here. The forge's run of the check is the first real test of the fix. tsc and test/talk-place.test.ts pass locally.
Cause. Two behaviours of the place feature clashed with the browser tests:
talk-preview-frame: the test made a new conversation and then opened bare/talk./talknow opens the last-visited conversation, which was an earlier test's, so the frame didn't show the app. The test now opens/talk/<id>for the conversation it made.talk-phone-360,-375and-390: I haven't confirmed why these failed. My best explanation is that they open/talk/<id>repeatedly in one session, and a repeat visit jumped to the saved turn instead of the end of the chat. A saved turn is now restored only on bare/talk, so a conversation named by its address always opens at its end. Treat this as a guess until the check runs.
Not done. Reloading /talk/<id> no longer returns to your scroll place. I narrowed it because bare /talk is what the issue asks for. The empty-conversation autofocus is kept, in case it also shifts the phone layout.
Try it. Open a long conversation, scroll up, then open /talk in a new tab. It lands on that conversation at the same turn.
I fixed the high finding: opening an older chat from the list and then going to /talk now lands on that chat. I haven't run it in a browser (none starts in this sandbox), but the new test covers the case you described. tsc and test/talk-place.test.ts pass, and the pull is pushed.
- The overwrite: a page's leave-beacon only updates the turn for the conversation that is already the saved place. It no longer sets the conversation.
POST /talk/placereturns 404 when the place is a different conversation, so only opening a conversation moves the place. - The test: it opens A, then B, then posts A's beacon and expects 404.
/talkstill opens B. - Reload and the GET write: I made the doc match the code instead of restoring the scroll place on
/talk/<id>.docs/features/talk-place.mdnow says only/talkrestores the scrolled place, that/talk/<id>opens at its end, and that opening a conversation writes the place even though it is a GET. I took that route because restoring on/talk/<id>was what I narrowed last round so the phone tests open at the end. If you want the reload to restore the place, say so. I'd need to find another way to keep those tests at the end.
The commit line names #18317 and says No door for the terminal and how-to side.
The gate still reports two similarity notes on keepOpen and the test's mk helper. They are notes, not failures, and I left them alone.
Nothing needed changing, so I pushed nothing. The gate reads all 39 rules with 0 failures and 3 notes, and I checked each rule you listed:
- Both doors:
ok. The terminal side and the how-to (docs/features/talk-place.md) are already in the pull. - Dead code (every export under
src/has a caller or is allowed):ok. - Name the issue:
ok. Every commit carries(#18317). - Duplicate import:
ok. - Look pages: this is a note, not a failure. A commit line already names
/talk, and the gate says so. - Type check and tests:
bun x tsc --noEmitis clean.test/talk-place.test.tsandtest/talk-preview-frame.test.tsgive 11 pass, 3 skip, 0 fail.
Two notes are left that I chose not to act on:
- Comment width:
--fixrewrapped nothing. The long comment lines are in other files, and the nightly rewrap handles those on main. - Duplicate functions: the gate flags
keepOpenas 0.63 similar tolandedBetweeninsrc/flow/keeper_rate.ts. It also flags themkhelper intest/talk-place.test.tsas identical to the one intest/mcp-widgets.test.ts. Neither blocks the pull. The twokeepOpen/landedBetweenfunctions do different jobs. The test helper is a few lines local to that test file.
The sandbox blocked an outbound connection to apps.test:37339 while the tests ran. The tests passed regardless.
Review steps for the page change:
[{"go":"/talk","look":"Open a conversation, scroll up, then leave and return to /talk","expect":"It reopens on the same conversation at the place you left; a conversation named by its address opens at its end"}]
🤖 Generated with Claude Code
Talk now opens on the conversation you were last in, at the turn you were reading. The place is kept per person on the server, so a refresh, a new tab or a new sign-in all land there. The new test, the other Talk and conversation tests and the type check pass. I did not run the full suite, and I did not run the two check rules named in the issue ("dead code" and "duplicate import") on their own.
What changed
talk_placeholds one row per person: their conversation and the top turn on screen.src/core/talk_place.tsreads and writes it. The row is deleted with the person or the conversation.openConversationnow returns the conversation you last opened, if it is still yours and not archived. Otherwise it picks your newest active one, else a new empty one. The terminal and the API's unnamed-conversation sends follow the same rule./talkor/talk/<id>on the page keeps the place (pane and build fragments don't). So does opening a chat in the terminal.src/tui/screens/talk_chats.tsdoes that, so the terminal shows the same place.POST /talk/placewhen you leave or stop scrolling. The server checks the id format, the same-origin rule, that the conversation is yours, and that the turn belongs to it.pageAround.autofocus, so it works without JavaScript.docs/features/talk-place.md.test/talk-place.test.tsopens an older chat, reloads three times, signs in again and checks it is still there. It also covers the scroll place, bad input, another person's conversation or turn, a cross-origin post, and an archived or deleted conversation. It fails without the change.Changed existing test
test/talk-links-click.test.tscreated a conversation and expected/talk/streamto open it as the newest. It now names the conversation withc=.Left out
autofocuson an empty Talk may bring up the keyboard.Reused:
pageAround, the existingreadFormsame-origin and scope check, and the migration pin tooling. The gate's similarity notes (keepOpenagainstrecordInstalled, the testmk) are not reuses I can use here.Try: open an older chat at
/talk/<id>, scroll, then open/talkin a new tab. It lands on that chat at that turn. A fresh account's/talkhas the box focused.🤖 Generated with Claude Code
Closes #18317