Repository navigation
test(sidebar): catch unequal heights in shared PC control rows - #1732
Conversation
Group controls by vertical overlap and compare their tops and heights. Exercise a one-line button beside a deterministically wrapped label, allowing its neighbours to stretch. Limit the Rename row claim to the tested wide sidebar rather than a universal 300px threshold. Refs #1424
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Merging without a CodeRabbit review: CodeRabbit hit its review limit, so no review ran. The merge pass reviewed it instead. A gate reviewer, on a different model from the author's, ran the build and all 14 demo scenarios. With |
…val readable in every theme (#1891) Fixes #1424 Fixes #1416 Fixes #1585 These three are grouped because they share `DESIGN.md` and the danger-button styles. The parts already fixed on main are left alone: - #1424 items 1 and 2: fixed by #1732 and #1422. - #1416 items 1, 3 and 4: fixed by #1422. ## Changes - **#1424 item 3, hover feedback:** a hovered danger button keeps its tint and its `--status-blocked` border, and draws that border twice as thick (an inset ring in the same color). Before, ConfirmDialog, DevicesPanel and Remove PC showed no hover at all. The change keeps the danger color, as the issue asked, and does not bring back the neutral fill. The design precedent is T3 Code's `destructive-outline` button ([button.tsx](https://github.com/pingdotgg/t3code/blob/main/apps/web/src/components/ui/button.tsx)), which DESIGN.md already cites in this paragraph: on hover it strengthens its border and tint in the destructive color (`border-destructive/32`, `bg-destructive/4`) instead of switching to a neutral fill. This ring does the same with herdr's danger tokens; no code is borrowed. - **#1424 item 4, DESIGN.md:** a one-line PC control is `--touch-target` tall on a coarse pointer, where Rename keeps its own line. - **#1416 item 2, contrast:** a pending PC removal keeps its full strength instead of being dimmed to 0.85. - Measured as drawn over the panel's `--bg-elevated`, any dimming that still reads as dimmed fails some theme. Tokyo Night dark is the worst: 3.89:1 at 0.85, 4.18:1 at 0.9, and only 0.97 reaches 4.5:1. - Its neighbours still dim to 0.55 while it runs, and the button is disabled with `aria-busy`. - The removal regression now measures the pending removal in every theme block of its mode, not just the two defaults: text at 4.5:1 or above, border at 3:1 or above. - `DESIGN.md` says so in place of "only lightly dimmed". - **#1585, DESIGN.md:** the New tab button lives in a mouse-driven window wider than 640px, the composer's `(max-width: 640px), (pointer: coarse)` query. Settings does not offer the toggle on a touch screen or a narrow window. `settings.test.ts` keeps only the behavioural checks. ## Verification - `bun test src/lib/settings.test.ts`: passes. - `bun run typecheck`: passes. - `bun scripts/sidebar-machine-removal-demo-regression.ts` (through `dori heavy`): PASS for dark and light. The pending removal measured in all 22 theme blocks has text at 4.78:1 at the lowest (Tokyo Night dark, Solarized light) and borders at 4.78:1 or above. Hover draws the inset ring in the button's own border color. - `bun scripts/sidebar-machine-layout-demo-regression.ts`: PASS in all 14 scenarios, among them desktop 240px and 520px sidebars, a 320px phone, a 390px phone and an 844×390 landscape, in dark and light, and in Korean, Japanese and Chinese. I looked at the screenshots for desktop 240 dark (armed), phone 320 light (armed) and the dark pending removal: the pending Confirm remove PC stays at full strength and readable while Rename and Disconnect dim beside it, and the phone panel fits a 320px drawer. - Code review: `omo-native-code-reviewer` ran the regression and caught that 0.9 still failed Tokyo Night (4.18:1); the pending removal now keeps full strength. Its LOWs are applied: the ring uses `--hairline`, and the check asserts that hover draws the button's own border color, inset. It found no clash with focus rings or other `.btn` box-shadows, confirmed the DESIGN.md wording against `Composer.tsx` and `SettingsDialog.tsx`, and found that the settings-test trim loses no behaviour check. - `bun run check fast` (through `dori heavy`) on cf9d7a7: `status: success`, verification `verified`. The pending-removal treatment follows T3 Code's outlined destructive button, as DESIGN.md already cites for PC removal: the warning stays fully legible while the action runs, and only the unrelated controls dim. No code is borrowed. Co-authored-by: mp <mp@local>
Change
scripts/sidebar-machine-layout-demo-regression.tsgrouped the PC control buttons into rows by their top edge and required a shared bottom edge. On main before #1422,align-items: endgave a one-line button beside a wrapped one the same bottom but a different top, so they landed in separate groups and the check passed anyway. Buttons are now grouped by vertical overlap and must share both top and height, with a mixed-label case that exercises a wrapped label. The "Rename shares the field's row from 300 px" claim, which had little room, is no longer stated as universal.Items 3 (danger-button hover, a design call) and 4 (
DESIGN.md, held by other open PRs) are left open.Refs #1424
Validation
bun run buildthenbun scripts/sidebar-machine-layout-demo-regression.ts: 14 scenarios pass.align-items: endrestored locally (not committed), the new check fails: 34 px and 68.5 px buttons in one row.bun run check fast: pass.