Repository navigation
feat(web): one-row toolbar with icon controls and a View menu - #1330
Conversation
[Medium impact] The changes affect the browser review page's toolbar and its view-setting workflow. Satisfy the filename requirement before merging; no blocking behavior defect was established. Findings
Fix with agent prompt### Issue 1
packages/hunk/src/web/app/ViewMenu.tsx:1
**New filenames break naming rule.** The repository guide requires dash-case for `.ts` and `.tsx` filenames. Rename `ViewMenu.tsx` to `view-menu.tsx` and update its imports. `ViewedProgress.tsx` and `Icon.tsx` also break this rule; the pattern appears elsewhere in this change.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThe browser review toolbar becomes a single row with icon controls and a View menu.
The new filenames need to follow the repository’s naming rule before merging. Reviews (1) · Last reviewed commit: "feat(web): one-row toolbar with icon con..." · Reviewed by Greptile |
| @@ -0,0 +1,290 @@ | |||
| /** @jsxImportSource react */ | |||
There was a problem hiding this comment.
New filenames break naming rule. The repository guide requires dash-case for
.ts and .tsx filenames. Rename ViewMenu.tsx to view-menu.tsx and update its imports. ViewedProgress.tsx and Icon.tsx also break this rule; the pattern appears elsewhere in this change.
Context Used: guidelines.mdc Cursor rule (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/hunk/src/web/app/ViewMenu.tsx
Line: 1
Comment:
**New filenames break naming rule.** The repository guide requires dash-case for `.ts` and `.tsx` filenames. Rename `ViewMenu.tsx` to `view-menu.tsx` and update its imports. `ViewedProgress.tsx` and `Icon.tsx` also break this rule; the pattern appears elsewhere in this change.
**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
The browser review page's toolbar was two rows of text buttons and wrapped to three at 800px. It is now one 44px row: layout, refresh, copy link, and the pane toggles are icon buttons, viewed progress is a ring, and the line and review toggles plus the theme picker live in a View menu that shows each shortcut. Adds the inline SVG icon module the rest of the page builds on. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…able The toolbar's Commands button named its key with a literal. It now reads the palette command's chord from the page's command table, the same source the help overlay and the palette use, so no control states a key of its own. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
465b2cc to
21ffd50
Compare
Problem
The browser review page's toolbar is two rows and about 76px tall. Nine text buttons (Refresh, Copy link, Hide viewed, Auto, Split, Unified, Wrap, Line numbers, the theme name) sit at the same weight as the review title. At 800px wide, the half-screen width this page is often used at, it wraps to three rows and takes 115px before any diff appears.
Approach
+A −D, connection status. Right: filter, viewed progress, layout, View menu, refresh, copy link, Commands, side-panel toggle.packages/hunk/src/web/icons/: anIconcomponent over inline SVG paths,currentColor,aria-hidden, no dependency. It replaces the☰and◨glyphs, and later PRs in the stack add to it.ViewMenu.tsx) holds Wrap long lines, Line numbers, Agent notes, Hide viewed files, and the theme row. Rows aremenuitemcheckboxand show their shortcut from the keymap. Agent notes calls the same path as theakey and is labelled "shared", like the filter, because it changes the terminal too. Menu semantics follow the existingThemeMenu.aria-liveregion).data-stateandrole="status"are unchanged.2/47 viewed; the old sentence stays as the accessible text under the same test id.Every icon-only control has an accessible name and a
titlewith its shortcut, using the existinghinted()pattern.Non-goals
No "Unchanged context" toggle: the only implemented command expands one hunk, and a page-wide switch would be new state. No changes below the toolbar.
Tests
test/web/review-shell.e2e.ts: the toolbar is one row (under 50px, nothing past its edges) at 1440px and at 800px; the View menu's arrow keys, Escape and focus return, outside click, Agent notes reaching the session's shared state; the Commands button opens the palette.review-keyboard,review-notes,review-accessibility,review-viewed,review-shell, andwebTestHarness.ts(chooseTestThemenow opens the menu). Wrap, line numbers, and hide viewed are asserted througharia-checked.bun run typecheck,bun run lint,bun run format:check,bun run deps:check: pass.bun test packages/hunk/src/web: 262 pass, 0 fail.bun run test:web: 115 passed, 7 skipped (the opt-in capture specs), 0 failed, including the axe suite.Checked at 1440px and 800px in
github-dark-defaultandgithub-light-defaultwith the opt-in capture suites, which gain captures of the open View menu. Platform: macOS only.A second commit reads the Commands button's shortcut from the page command table instead of naming the key, so no control in the toolbar states a key of its own.
Stack
2 of 9. Each PR is based on the one above it in this table and contains only its own change.
mainMerge order: 1 to 9, from the top of the table. After a PR merges, the next one's base becomes
main(GitHub retargets it when the merged branch is deleted; otherwise change the base by hand) and its diff still shows only its own change.This PR description was generated by Claude Code using Claude Fable 5.2