Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
Chat scrolls itself only when you are at the bottom, otherwise a 'new messages' pill appears; system lines are muted #309
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
Chat now auto-scrolls on a new line only when the reader is within 40px of the bottom. Otherwise the list keeps its place and a "New messages ↓" pill appears. I ran bun test src/ui (108 pass) and src/server.test.ts (53 pass, 1 fail).
shipped merged
Chat now auto-scrolls on a new line only when the reader is within 40px of the bottom. Otherwise the list keeps its place and a "New messages ↓" pill appears.
I ran bun test src/ui (108 pass) and src/server.test.ts (53 pass, 1 fail). I could not run the type check: bun install and bun x tsc --noEmit both stopped with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The one failing server test is a vendored three.js route returning 404, because node_modules is missing in this sandbox; I didn't touch that code. I haven't run the whole bun --cwd Software/so101 test suite here, so the forge's check on this push is the first full run.
- Pill: the pill is a button,
#newMsgs, added under the chat list inviewer.html. It sits over the bottom of the list and hides when tapped, when the reader scrolls back to the bottom, or on sending a message. The logic is inaddChatinsrc/ui/lobby-panel.js. - Already there:
overscroll-behavior: containon the list and the muted style for system lines were already inviewer.html, so I left them alone. - Tests: two new tests in
src/ui/lobby-panel.test.tscover the issue's two cases. Scrolled up, a new line shows the pill and keeps the position, and tapping the pill jumps to the bottom. At the bottom, a new line scrolls and no pill shows. forge.json: untouched.
🤖 Generated with Claude Code
Works as asked. The preview serves #newMsgs, hidden by default. The chat is a flex column, so the negative margin lays the pill over the bottom of the list. It is a real button, and the list keeps role=log, so screen readers still hear new lines. The two tests cover scrolled-up and at-bottom, and they would fail without the change. There is no new dependency.
Two things I would do next:
- Make the pill a proper thumb target. Its padding of 5px 14px at 13px type is about 28px tall, so give it min-height: 44px, or at least 36px, on phones.
- Add a visible :focus-visible outline on #newMsgs, so keyboard users can see it when they tab to it.
Chat now auto-scrolls on a new line only when the reader is within 40px of the bottom. Otherwise the list keeps its place and a "New messages ↓" pill appears.
I ran
bun test src/ui(108 pass) andsrc/server.test.ts(53 pass, 1 fail). I could not run the type check:bun installandbun x tsc --noEmitboth stopped with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The one failing server test is a vendored three.js route returning 404, becausenode_modulesis missing in this sandbox; I didn't touch that code. I haven't run the wholebun --cwd Software/so101 testsuite here, so the forge's check on this push is the first full run.#newMsgs, added under the chat list inviewer.html. It sits over the bottom of the list and hides when tapped, when the reader scrolls back to the bottom, or on sending a message. The logic is inaddChatinsrc/ui/lobby-panel.js.overscroll-behavior: containon the list and the muted style for system lines were already inviewer.html, so I left them alone.src/ui/lobby-panel.test.tscover the issue's two cases. Scrolled up, a new line shows the pill and keeps the position, and tapping the pill jumps to the bottom. At the bottom, a new line scrolls and no pill shows.forge.json: untouched.🤖 Generated with Claude Code
Closes #286