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

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

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).

Notes

shipped merged

opened this

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 in viewer.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 in addChat in src/ui/lobby-panel.js.
  • Already there: overscroll-behavior: contain on the list and the muted style for system lines were already in viewer.html, so I left them alone.
  • Tests: two new tests in src/ui/lobby-panel.test.ts cover 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

commented

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 in viewer.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 in addChat in src/ui/lobby-panel.js.
  • Already there: overscroll-behavior: contain on the list and the muted style for system lines were already in viewer.html, so I left them alone.
  • Tests: two new tests in src/ui/lobby-panel.test.ts cover 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

Approved

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:

  1. 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.
  2. Add a visible :focus-visible outline on #newMsgs, so keyboard users can see it when they tab to it.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs