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

Talk on a phone, still wrong after #16552 landed: conversation history loads… #16561

Closed opened this in answer to
Closed without merging

I could not reproduce the reversal in a browser, and I did not run any of the new Chromium tests. This sandbox refuses Chromium, so the four #16552 tests and my two new ones all skip here. I also could not get a signed-in 360 px session on production.

Notes

stopped closed without shipping deploy 8cfea60

opened this

I could not reproduce the reversal in a browser, and I did not run any of the new Chromium tests. This sandbox refuses Chromium, so the four #16552 tests and my two new ones all skip here. I also could not get a signed-in 360 px session on production. I did check the code and the server's HTML, and I fixed the one thing that behaves like a reversal.

What I found

  • Server order is correct. listTurns takes the newest 50 and reverses them, so a page reads oldest to newest. The chat list is ORDER BY pinned_at IS NULL, updated_at DESC, so newest first. Nothing in the markup, CSS or client script reverses either one.
  • "Earlier" was the likely culprit for reading 1. It was a plain link to ?before=<id>. That opens a separate page holding the older 50, and the page then scrolls to its own end, so you land on the newest of the older messages and read upward. Each further "Earlier" repeats that, so the history seems to arrive backwards and you lose your place. This is my best explanation, not something I saw happen.
  • Reading 2 (chat list) is unconfirmed. Nothing in the code points to a cause, and only a browser run would tell.
  • #16552's phone tests probably never ran in the check. test/talk-phone.test.ts was a plain .test.ts file, which the gate runs but where no Chromium starts, so its browser tests skip. The check's looks lane only picks up *.looks.test.ts. I could not read the check's own log from here, so confirm the lane ran with a Chromium on the first push.
  • The push check may not run tests at all. forge.json's check.run is only gate.ts plus tsc; only fast, full and verify run tests. The check never ran those four tests, so green meant nothing for #16552's fixes.

What changed

  • src/web/pages/talk.ts and src/web/pages/talk_client.ts: "Earlier" now fetches the older page and puts its turns above the log, oldest first. It keeps the message you were reading where it is, using that message's position before and after the insert. It shows "Latest" through the existing jump button and does not touch the live stream. Without the script, or if the fetch fails, the link still opens the older page. I reused decorate, sc, draw and the existing stuck flag.
  • test/talk-phone.test.ts is renamed test/talk-phone.looks.test.ts so the looks lane runs it, and the scripts/phone-persona/brief.md reference is updated. I added two phone-width browser tests in it. Both use a 120-message chat. One checks oldest-to-newest order and that the chat opens at the newest. The other checks that "Earlier" prepends in order and the reading position holds to within 2 px.
  • New test/talk-history-order.test.ts runs in the gate with no browser. It checks that the latest page is 70..119 in order, "Earlier" is 20..69 in order, the link carries data-earlier, and the chat list is newest first. The old no-browser test moved here, because the looks lane is outside the gate.
  • gate.ts, tsc and design-lint are clean. test/talk-history-order.test.ts, talk-page, talk-layout and client-size pass. The fast tier named too many test files to run here.

Not done

  • No second-guessing of the chat list ordering or its scroll-to-top without browser evidence.
  • I did not change forge.json's check.run; making the push check run tests is a separate call for a person.
  • Nothing for the owner's further mobile notes; those belong in separate issues under #16442.

How to try it Open a chat with more than 50 messages on a phone. It opens at the newest message. Scroll to the top and tap "Earlier": older messages appear above, in order, and the view stays on the message you were reading.

[{"go":"/talk","look":"a chat with more than 50 messages at 360px; it opens at the newest, oldest above","expect":"newest message at the bottom, in view"},{"go":"/talk","look":"scroll to the top and tap Earlier","expect":"older messages appear above in order; the message you were reading has not moved; Latest shows"},{"go":"/talk?chats=1","look":"the chat list at 360px","expect":"newest chat first, page at the top"}]

🤖 Generated with Claude Code

Closes #16560

2 earlier comments
commented

I could not reproduce the reversal in a browser, and I did not run any of the new Chromium tests. This sandbox refuses Chromium, so the four #16552 tests and my two new ones all skip here. I also could not get a signed-in 360 px session on production. I did check the code and the server's HTML, and I fixed the one thing that behaves like a reversal.

What I found

  • Server order is correct. listTurns takes the newest 50 and reverses them, so a page reads oldest to newest. The chat list is ORDER BY pinned_at IS NULL, updated_at DESC, so newest first. Nothing in the markup, CSS or client script reverses either one.
  • "Earlier" was the likely culprit for reading 1. It was a plain link to ?before=<id>. That opens a separate page holding the older 50, and the page then scrolls to its own end, so you land on the newest of the older messages and read upward. Each further "Earlier" repeats that, so the history seems to arrive backwards and you lose your place. This is my best explanation, not something I saw happen.
  • Reading 2 (chat list) is unconfirmed. Nothing in the code points to a cause, and only a browser run would tell.
  • #16552's phone tests probably never ran in the check. test/talk-phone.test.ts was a plain .test.ts file, which the gate runs but where no Chromium starts, so its browser tests skip. The check's looks lane only picks up *.looks.test.ts. I could not read the check's own log from here, so confirm the lane ran with a Chromium on the first push.
  • The push check may not run tests at all. forge.json's check.run is only gate.ts plus tsc; only fast, full and verify run tests. The check never ran those four tests, so green meant nothing for #16552's fixes.

What changed

  • src/web/pages/talk.ts and src/web/pages/talk_client.ts: "Earlier" now fetches the older page and puts its turns above the log, oldest first. It keeps the message you were reading where it is, using that message's position before and after the insert. It shows "Latest" through the existing jump button and does not touch the live stream. Without the script, or if the fetch fails, the link still opens the older page. I reused decorate, sc, draw and the existing stuck flag.
  • test/talk-phone.test.ts is renamed test/talk-phone.looks.test.ts so the looks lane runs it, and the scripts/phone-persona/brief.md reference is updated. I added two phone-width browser tests in it. Both use a 120-message chat. One checks oldest-to-newest order and that the chat opens at the newest. The other checks that "Earlier" prepends in order and the reading position holds to within 2 px.
  • New test/talk-history-order.test.ts runs in the gate with no browser. It checks that the latest page is 70..119 in order, "Earlier" is 20..69 in order, the link carries data-earlier, and the chat list is newest first. The old no-browser test moved here, because the looks lane is outside the gate.
  • gate.ts, tsc and design-lint are clean. test/talk-history-order.test.ts, talk-page, talk-layout and client-size pass. The fast tier named too many test files to run here.

Not done

  • No second-guessing of the chat list ordering or its scroll-to-top without browser evidence.
  • I did not change forge.json's check.run; making the push check run tests is a separate call for a person.
  • Nothing for the owner's further mobile notes; those belong in separate issues under #16442.

How to try it Open a chat with more than 50 messages on a phone. It opens at the newest message. Scroll to the top and tap "Earlier": older messages appear above, in order, and the view stays on the message you were reading.

[{"go":"/talk","look":"a chat with more than 50 messages at 360px; it opens at the newest, oldest above","expect":"newest message at the bottom, in view"},{"go":"/talk","look":"scroll to the top and tap Earlier","expect":"older messages appear above in order; the message you were reading has not moved; Latest shows"},{"go":"/talk?chats=1","look":"the chat list at 360px","expect":"newest chat first, page at the top"}]

🤖 Generated with Claude Code

commented

<!-- look-pages 8cfea60e4ad7 --> Look pages for 8cfea60, 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

From the conductor: folded into the phone-notes pull with credit (your keep-place approach for Earlier, measured after the copy buttons draw); closing this one in its favour.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs