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

Migrated from github.com/Trevato/SO-ARM100

A stylesheet test proves the chat Report button is at least 44x44 px and its line keeps that room before and after 'Reported' - test only #425

Merged opened this

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

Merged

I added src/report-layout.test.ts, a stylesheet test for the chat Report button. It only reads the CSS, so no code or stylesheet changed; the test found no real gap.

Notes

shipped merged

opened this

I added src/report-layout.test.ts, a stylesheet test for the chat Report button. It only reads the CSS, so no code or stylesheet changed; the test found no real gap.

The test reads the <style> block in viewer.html and the ui/*.css files, flattens the @media blocks, and checks three things:

  • Button size: #chat .report has min-width and min-height of at least 44 px.
  • Line height: #chat .rep has min-height of at least 44 px.
  • No resizing by state or text: no rule for .report is keyed on :disabled, [disabled] or the text or label, and none caps the button's width or height below 44 px. The test also fails if a :disabled, ::before or ::after rule for the button sets any box property. So switching to "Reported" cannot change the button's box.

I tested it two ways: I dropped min-width to 40 px in viewer.html and the test failed, then I reverted that edit. I ran the new test with src/ui/lobby-panel.test.ts and 19 tests pass.

I did not run the full bun test, the first-visit gzip budget test, or tsc --noEmit (it hit a read-only tempdir error here). The forge's check runs those on this push.

🤖 Generated with Claude Code

Closes #419

commented

I added src/report-layout.test.ts, a stylesheet test for the chat Report button. It only reads the CSS, so no code or stylesheet changed; the test found no real gap.

The test reads the <style> block in viewer.html and the ui/*.css files, flattens the @media blocks, and checks three things:

  • Button size: #chat .report has min-width and min-height of at least 44 px.
  • Line height: #chat .rep has min-height of at least 44 px.
  • No resizing by state or text: no rule for .report is keyed on :disabled, [disabled] or the text or label, and none caps the button's width or height below 44 px. The test also fails if a :disabled, ::before or ::after rule for the button sets any box property. So switching to "Reported" cannot change the button's box.

I tested it two ways: I dropped min-width to 40 px in viewer.html and the test failed, then I reverted that edit. I ran the new test with src/ui/lobby-panel.test.ts and 19 tests pass.

I did not run the full bun test, the first-visit gzip budget test, or tsc --noEmit (it hit a read-only tempdir error here). The forge's check runs those on this push.

🤖 Generated with Claude Code

Approved

Test-only, and it matches the CSS on main: viewer.html:143-144 gives #chat .report min-width and min-height of 44px and #chat .rep a min-height of 44px. lobby-panel.js:240 always draws the button, so the line keeps its room and the test is true to the code. The #chat .report, #chat .modbtn rule is split on commas and matched exactly, so the plain-selector filter does find it. There is no behaviour change, no new dependency, and no security surface. I could not run the new file here, because my checkout lacks the branch head. The forge check covers it. Two things I would do next: (1) add a case that the Report button stays reachable at 360px, meaning no @media rule shrinks it. The flattening already walks @media, so max-width/width caps are covered, but padding:0 plus font-size is not. (2) Share the CSS-reading helper with the other stylesheet tests (e.g. lobby-panel.test.ts) instead of growing another regex rule parser. I did not request changes for either.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs