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

Migrated from github.com/Trevato/SO-ARM100

Each other person's chat line has an accessible 44 px Report button that sends {type:'report',id} and turns disabled 'Reported' only on the server's 'reported' frame - page module and test only #342

Merged opened this

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

Merged

The preview failed because the page's first-visit gzip budget was over by 2 bytes: 52,002 against the 52,000 limit. That was src/server.test.ts, "a first visit downloads under 52 KB gzipped". I trimmed the report code and CSS from #317 to get back under it, without shortening any existing comment.

Notes

shipped merged

opened this

The preview failed because the page's first-visit gzip budget was over by 2 bytes: 52,002 against the 52,000 limit. That was src/server.test.ts, "a first visit downloads under 52 KB gzipped". I trimmed the report code and CSS from #317 to get back under it, without shortening any existing comment.

I did not run the full suite this time. bun test src/server.test.ts src/ui/lobby-panel.test.ts passes except one test, "serves the model, its meshes and the vendored libraries": it returns a 404 here, and the same test failed in my last full run, before this fix. It did not appear among the failures in the forge's last deploy log. The type check could not run here either, because bun x tsc fails on the read-only temp dir. The forge's check on this push is the first time either runs.

  • Report button: src/ui/lobby-panel.js still shows the button on other people's lines only, never your own or a guest's. It still sends {type:"report",id}. It still turns disabled and reads "Reported" only on a reported frame, and an error frame leaves it alone.
  • Label: the aria-label is now "Report <author>". It stays the same after the click; the visible text changes to "Reported".
  • CSS: the .rep and .report rules in src/viewer.html are shorter. The line is still a flex row with min-height: 44px and a button of at least 44×44.
  • Test: the fake socket test in src/ui/lobby-panel.test.ts no longer fakes closest, and its "unchanged after an error" check now reads b.disabled === true.

🤖 Generated with Claude Code

Continues #342

2 earlier comments
commented

The preview failed because the page's first-visit gzip budget was over by 2 bytes: 52,002 against the 52,000 limit. That was src/server.test.ts, "a first visit downloads under 52 KB gzipped". I trimmed the report code and CSS from #317 to get back under it, without shortening any existing comment.

I did not run the full suite this time. bun test src/server.test.ts src/ui/lobby-panel.test.ts passes except one test, "serves the model, its meshes and the vendored libraries": it returns a 404 here, and the same test failed in my last full run, before this fix. It did not appear among the failures in the forge's last deploy log. The type check could not run here either, because bun x tsc fails on the read-only temp dir. The forge's check on this push is the first time either runs.

  • Report button: src/ui/lobby-panel.js still shows the button on other people's lines only, never your own or a guest's. It still sends {type:"report",id}. It still turns disabled and reads "Reported" only on a reported frame, and an error frame leaves it alone.
  • Label: the aria-label is now "Report <author>". It stays the same after the click; the visible text changes to "Reported".
  • CSS: the .rep and .report rules in src/viewer.html are shorter. The line is still a flex row with min-height: 44px and a button of at least 44×44.
  • Test: the fake socket test in src/ui/lobby-panel.test.ts no longer fakes closest, and its "unchanged after an error" check now reads b.disabled === true.

🤖 Generated with Claude Code

commented

The Report button now fits the first-visit gzip budget, which is what failed the preview in pull #339. The test said 52002 bytes against a 52000 limit; it now passes. src/server.test.ts and src/ui pass except one test, the safe-zone test that serves the model, meshes and vendored libraries, which gets a 404 here. It gets the same 404 with my changes removed, so it isn't from this change. I haven't confirmed that against the forge's own check.

The fix is commit 071945f, pushed to the branch.

  • Behaviour: what the button does is unchanged from #339. Signed-in users get a 44×44 Report button on other people's lines, never on their own or for guests. A click sends {type:"report",id}, and only a reported frame disables it and shows "Reported". An error frame leaves it alone.
  • Trimmed code: src/ui/lobby-panel.js has one done() helper and no longer builds the label twice. The CSS in src/viewer.html is shorter. No existing comments were touched.
  • Accessibility: aria-label now follows the state ("Report ann", then "Reported ann"). Before, a fixed "Report …" label would have hidden the changed text from the aria-live announcement.
  • Type check: I couldn't run it. bun x tsc and bun install both fail in this sandbox with ReadOnlyFileSystem on the temp dir, so the forge's check will be its first run.
  • Working tree oddity: midway through, the working tree changed under me. Edits I hadn't made appeared, and a commit with the same trim as mine landed on the branch. I checked the final content and tests against that commit, but I don't know where it came from.

🤖 Generated with Claude Code

commented

Nothing needed changing this run, and I pushed nothing.

Pull #342 is open for this branch at 071945f and mergeable against current main, which now includes the server half (#341).

I merged main into the branch in the working tree and ran src/server.test.ts and the src/ui tests. 169 pass and 1 fails. The failure is "serves the model, its meshes and the vendored libraries", which returns a 404 here. It failed the same way on main before my changes, so it doesn't come from this change. The first-visit gzip budget test passes on that merged tree. I then aborted the merge, so the branch is unchanged.

I still can't run the type check here, because bun x tsc fails on the read-only temp dir. The forge's check on pull #342 will be the first type check.

The pull is as #317 asks:

  • Button: signed-in users see a 44×44 Report button on other people's lines, never on their own or for guests. Its aria-label is "Report <author>".
  • Send: a click sends {type:"report",id}.
  • State change: only a reported frame for that id disables the button and makes it read "Reported", announced through aria-live. An error frame leaves it as it was.
  • Layout: the line reserves room for the button, so reporting shifts nothing.
  • Tests: src/ui/lobby-panel.test.ts covers the send shape, the button's absence on your own line and for guests, and a change only on reported.
Approved

Does what the issue asks, page module and test only. The preview serves the .report CSS. The button shows on other people's lines only, never for guests, and is 44px with an aria-label "Report <name>". It sends {type:report,id}, and only the server's reported frame disables it; an error frame leaves it alone. The line reserves the row, so nothing shifts. Tests cover the guard, the send shape and the error-vs-reported case. Next: (1) src/tty.ts has no report command, so the terminal door lacks it; open a follow-up issue for it. (2) A line already reported before a reload shows enabled again; the server could mark it in the chat history. Also drop the odd name prop on the button; it is only there to carry the author for the label.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs