Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/web-accent-means-selection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

The browser review page now reserves its accent color for your position and focus, so pressed toggles, checked segments, resting note cards, and the minimap viewport use a neutral "on" style instead.
5 changes: 5 additions & 0 deletions .changeset/web-file-headers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

The browser review page's file headers dim the directory so the file name reads first, say what kind of change a file is in a quiet chip ("new", "renamed, no content changes", "binary", "too large") instead of a body sentence, hide `+0 −0`, fold any file from a chevron (viewed files start folded, with no extra row), copy the file's path from a button shown on hover, and draw the Viewed checkbox as a bordered control that turns green when checked.
5 changes: 5 additions & 0 deletions .changeset/web-note-threads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

The browser review page draws each note thread as one card with an avatar, author, and role per message, names lines in words ("line 13", "lines 14–16"), turns Reply, Edit, and Delete into icon buttons with a "Reply…" row at the foot of each thread, and rings the active note in the accent color.
5 changes: 5 additions & 0 deletions .changeset/web-page-command-keybindings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

A `[keybindings]` entry for one of the browser review page's own commands (`hunk.web.*`, such as `"hunk.web.toggleViewed" = "x"`) now reaches the page: its hints, command palette, and help overlay show the new key, the new key runs the command, and the default it replaced no longer does. Page commands that ship without a key, such as `hunk.web.toggleHideViewed`, can be given one the same way. The terminal accepts these entries without reporting an unknown command and binds nothing for them. The page's Ctrl/Cmd+K and Ctrl/Cmd+P shortcuts stay fixed, and an entry for either is reported as not remappable.
5 changes: 5 additions & 0 deletions .changeset/web-quieter-minimap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

The browser review minimap is now a slim strip of faint file blocks with thin change ticks, and viewed files fade back.
5 changes: 5 additions & 0 deletions .changeset/web-readability-fixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

The browser review page now groups digits in line counts, sorts the empty command palette into category sections with key-cap shortcuts, draws one "unchanged lines" row in split view, and uses icons instead of text glyphs for its close buttons and disclosure arrows.
5 changes: 5 additions & 0 deletions .changeset/web-review-bar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

The browser review page now has a review bar along the bottom with viewed progress, a "Next unviewed" button, key hints that follow your `[keybindings]`, the note count, and a button that copies every visible note as Markdown for an agent or issue.
5 changes: 5 additions & 0 deletions .changeset/web-sidebar-review-state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

The browser review page's files sidebar now shows review state at a glance: note counts as a comment icon, viewed files dimmed with a check, a refresh mark on files changed since they were viewed, viewed counts on folders, and the file count and an icon Tree / Flat switch in its header.
5 changes: 5 additions & 0 deletions .changeset/web-summary-strip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

The browser review page now opens with a one-line summary above the review (size, what most of the changes are, and file roles) and its side panel starts closed until you open it, on Notes when the review has notes; the Overview tab also drops empty rows and says what "Meaningful" leaves out.
5 changes: 5 additions & 0 deletions .changeset/web-toolbar-one-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

The browser review page's toolbar is now one compact row of icon controls that stays on one line in narrow windows, with wrapping, line numbers, agent notes, hidden viewed files, and the theme moved into a new View menu and a Commands button that opens the command palette.
53 changes: 47 additions & 6 deletions docs/keybindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ Rules worth knowing:
The [browser review](https://hunk.dev/docs/workflows/browser-review/) (`hunk diff --web`) answers to the same
command ids and reads the same `[keybindings]` table, except chords that use Ctrl, Cmd, Alt,
Tab, or a function key: those stay with the browser. `hunk.app.openInBrowser` (File menu, unbound)
opens the current terminal review there. The page adds its own `hunk.web.*` commands, listed in its
command palette, among them `hunk.web.toggleViewed` (`V`, mark the selected file viewed) and
`hunk.web.toggleHideViewed` (unbound, hide viewed files in that browser).
opens the current terminal review there. The page adds its own `hunk.web.*` commands, which
the same table remaps; see [In the browser review page](#in-the-browser-review-page).

Chords are `ctrl`, `alt`/`option`, `cmd`/`meta`, and `shift` joined with `+`
around a base key: a character (`"y"`, `"["`), an uppercase letter for its
Expand Down Expand Up @@ -229,7 +228,49 @@ that uses Ctrl, Cmd, or Alt, Tab, and the function keys to the browser, so `ctrl
`ctrl+u` do nothing there (`d` and `u` still page), and it ignores keys typed into a field.
A symbol typed through AltGr or Option (`]` on German and Nordic layouts) counts as the
character, so `[` `]` `{` `}` navigate there too. A focused control keeps its own keys (Space on
a checkbox, the scroll keys in the side panel), and toggles such as `V` ignore key auto-repeat.
It does not read `[keybindings]` yet; the host's resolved keymap reaches it with the shared
review state. Which commands the page implements is listed in
a checkbox, the scroll keys in the side panel), and toggles such as the viewed mark ignore key
auto-repeat. Which commands the page implements is listed in
[`web-review-client.md`](web-review-client.md#commands-and-keyboard).

The page does not read your config itself. The session that hosts the review resolves
`[keybindings]` and sends the page the result with the review's shared state, so the page's
hints, command palette, and help overlay (`?`) show the keys you chose. The session resolves
the table when it starts, so restart it to pick up a config change.

The page also has commands of its own, under `hunk.web.*` ids. They remap in the same table
and by the same rules:

```toml
[keybindings]
"hunk.web.toggleViewed" = "x" # replaces the default V
"hunk.web.toggleHideViewed" = "H" # ships unbound; this gives it a key
"hunk.web.showNotes" = false # unbind it
```

| Command id | Does | Default keys |
| --------------------------- | ------------------------------------------------ | ------------ |
| `hunk.web.copyLocationLink` | Copy a link to this hunk or note | _(none)_ |
| `hunk.web.copyReviewLink` | Copy the review link | _(none)_ |
| `hunk.web.filesAsList` | Show files as a flat list | _(none)_ |
| `hunk.web.filesAsTree` | Show files as a tree | _(none)_ |
| `hunk.web.showNotes` | Show every note in the review | `N` |
| `hunk.web.showOverview` | Show the review overview | `O` |
| `hunk.web.toggleHideViewed` | Hide or show viewed files | _(none)_ |
| `hunk.web.toggleMinimap` | Toggle the minimap | _(none)_ |
| `hunk.web.togglePreview` | Toggle the rendered view of the selected file | _(none)_ |
| `hunk.web.toggleSidePanel` | Toggle the side panel | `p` |
| `hunk.web.toggleViewed` | Mark the selected file viewed, or clear its mark | `V` |
| `hunk.web.useSessionTheme` | Use the session's theme | _(none)_ |

Three things differ from the commands above:

- **They bind in the page only.** A terminal has nothing to run for a `hunk.web.*` id, so an
entry for one binds no key there and takes none away from a terminal command.
- **A key is exclusive within the page.** A key you give a page command is taken from any
command that held it by default in the page, and a key you give another command is taken from
the page command that shipped with it. Giving `hunk.web.toggleViewed` the key `w` moves `w`
off line wrapping in the page, while the terminal keeps `w` for line wrapping.
- **Two shortcuts are fixed.** `hunk.web.commandPalette` (Ctrl+K, Cmd+K on macOS) and
`hunk.web.goToFile` (Ctrl+P, Cmd+P) are chords the page claims from the browser. They are
outside the chord grammar the page binds, so they are not remappable: an entry for either is
reported and ignored.
4 changes: 3 additions & 1 deletion docs/module-boundaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ Other workspaces are bounded units rather than one tier in that stack:
leaves it shares with the terminal (`core/run/commandInputs.ts` for the layout vocabulary and
the auto-split threshold, `core/documents/highlightRenderOptions.ts` for Pierre's highlight
options), and the command vocabulary on a closed import set (`core/run/commandCatalog.ts`,
`core/run/keyChordLabels.ts`, and the chord grammar in `extension-api/keys.ts`), and the
`core/run/webLocalCommandCatalog.ts` for the page's own `hunk.web.*` commands, which the host
reads to resolve their `[keybindings]`, `core/run/keyChordLabels.ts`, and the chord grammar in
`extension-api/keys.ts`), and the
STML parser (`core/stml/parse.ts`, with the `lib/terminalText.ts` sanitizer it runs) on a
closed set of its own. Nothing in the CLI imports it (`cli-never-imports-web-client`).

Expand Down
56 changes: 36 additions & 20 deletions docs/web-review-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ packages/hunk/src/web/
main.tsx entry; starts the session for this page's address
app/ReviewApp.tsx composes the page; owns view preferences, theme, and commands
app/Toolbar.tsx title, counts, totals, status; layout/wrap/line-number toggles
app/ReviewBar.tsx bottom bar: viewed progress, next unviewed, key hints, notes, copy
app/ThemeMenu.tsx the theme button and its listbox
app/ReviewControls.tsx shared filter field, refresh, copy review link
app/useReviewInteraction.tsx composers, note commands, shared toggles, refresh
app/useReviewTools.tsx palette, go-to-file, help, deep links and history
commands/webLocalCommands.ts the page's own hunk.web.* commands and their chords
commands/webLocalCommands.ts the page's Ctrl/Cmd chords; re-exports its hunk.web.* commands
palette/paletteEntries.ts palette rows and help sections from the command tables
palette/PickerDialog.tsx the combobox + listbox dialog both pickers use
palette/HelpOverlay.tsx the keyboard help dialog
Expand Down Expand Up @@ -373,7 +374,8 @@ imports; a page fetches only the languages and themes it shows. The largest sing
- **Keymap.** Chords are the shared grammar (`extension-api/keys.ts`) and labels the shared
`core/run/keyChordLabels.ts`, which the terminal's `ui/lib/keymap.ts` now re-exports (audit
F3). The page starts from the catalog's default chords; the host's resolved keymap from the
shared-state route replaces them through the same `WebKeymap` shape. `keyboard.ts` maps a DOM
shared-state route replaces them through the same `WebKeymap` shape, and carries the page's
own remappable `hunk.web.*` commands beside the catalog's. `keyboard.ts` maps a DOM
`KeyboardEvent` onto the grammar's structural key event (Caps Lock `G` is `G`, never `g`) and
masks what the browser owns: every Ctrl, Cmd, or Alt chord (so `ctrl+d`/`ctrl+u` stay the
browser's and `d`/`u` page), Tab, and the function keys. A printable symbol typed through
Expand Down Expand Up @@ -404,13 +406,18 @@ imports; a page fetches only the languages and themes it shows. The largest sing

## Palette, help, go-to-file, and deep links

- **Page-only commands.** `commands/webLocalCommands.ts` declares what only a page can do under
`hunk.web.*` ids: the palette (`Ctrl+K`, `⌘K` on macOS), go to file (`Ctrl+P` / `⌘P`), copy
review link, copy link to this hunk or note, use session theme, and files as a tree or a
list. The rule: a command with a terminal meaning goes in the shared catalog and is
classified in `webCommandTable.ts`; only a command with none is declared here. These ids never
reach the catalog, the host keymap, or a review action. The two dialog chords are the only
modified chords the page claims from the browser (`Ctrl+P` would print).
- **Page-only commands.** `core/run/webLocalCommandCatalog.ts` declares what only a page can
do under `hunk.web.*` ids: the palette (`Ctrl+K`, `⌘K` on macOS), go to file (`Ctrl+P` /
`⌘P`), copy review link, copy link to this hunk or note, use session theme, and files as a
tree or a list. The rule: a command with a terminal meaning goes in the shared catalog and is
classified in `webCommandTable.ts`; only a command with none is declared there. These ids
never reach the catalog or a review action. The declaration lives in `core/run` because the
host reads it: `app/review/sharedState.ts` folds the user's `[keybindings]` over the
remappable ones beside the catalog and publishes them in the review's keymap, and the
terminal surfaces read the names to accept an entry for one without binding it. The two
dialog chords are the only modified chords the page claims from the browser (`Ctrl+P` would
print); they are matched in `commands/webLocalCommands.ts`, never enter the keymap, and are
not remappable.
- **Palette.** Lists exactly the implemented catalog commands (host-only and terminal-only ones
never are) and the page's own, each with its title, category, and the chord the page binds
(`paletteEntries.ts`). Fuzzy subsequence matching; recently run commands lead (ids kept in
Expand Down Expand Up @@ -441,14 +448,17 @@ imports; a page fetches only the languages and themes it shows. The largest sing

- **Panel.** A right-hand panel docked beside the stream: tabs (ARIA tabs pattern), a close
button, and a left-edge resizer (260–640 px). Open state, width, and tab persist per browser
under `hunk.review.panel`; without a stored choice it opens at 1400 px and wider and stays
hidden below, where the stream needs the room. The toolbar's last button toggles it; the
stream's width for `auto` layout subtracts it.
- **Commands.** The panel's commands are page commands in `commands/webLocalCommands.ts`, so the
palette and help list them: `p` toggles the panel and `O` shows the Overview. A page command
may declare plain `keys` in the shared chord grammar; `panel/panelCommands.ts` binds those
through the page's keymap (merged under any chord the host resolved), and a test keeps them
off every catalog default.
under `hunk.review.panel`; without a stored choice it stays closed at every width, and
opens on Notes when the review has notes, else Overview. The summary strip above the stream
(`overview/SummaryStrip.tsx`, outside the scrolling stream so its geometry is untouched) has
an Overview button that opens it. The toolbar's last button toggles it; the stream's width
for `auto` layout subtracts it.
- **Commands.** The panel's commands are page commands in `core/run/webLocalCommandCatalog.ts`,
so the palette and help list them: `p` toggles the panel and `O` shows the Overview. A page
command may declare plain `keys` in the shared chord grammar; `panel/panelCommands.ts` binds
every remappable page command through the page's keymap, using the chords the host resolved
for it (the shipped ones only for a keymap that carries no entry for the id), and a test
keeps the shipped chords off every catalog default.
- **Overview.** Every figure is `selectReviewOverview` (`core/review/overview.ts`) over the
visible files and the shared state's notes and viewed marks: totals with a `≥` lower-bound
mark, "meaningful" totals beside them (tests, docs, and generated files excluded by the path
Expand Down Expand Up @@ -551,9 +561,15 @@ the shared-state snapshot lists only marks that still match each file's `content
content the reader did not see.
- **Composers.** Opening a composer (`c`, reply, edit, a gutter pick) first shows that file's
diff: a rendered Markdown file returns to Diff and a collapsed viewed file expands.
- **Progress.** The toolbar shows "12 of 47 viewed" over the files the shared filter leaves
visible, counted by `countReviewViewedFiles` in `core/review/overview.ts`, which the Overview
tab uses too.
- **Progress.** The review bar along the bottom shows "12 of 47 viewed" over the files the
shared filter leaves visible, counted by `countReviewViewedFiles` in `core/review/overview.ts`,
which the Overview tab uses too. Beside it, "Next unviewed" names the first file after the
selected one (wrapping) not marked viewed (`viewed/nextUnviewed.ts`) and opens it through
the sidebar's jump. The bar also shows key hints read from the page keymap by command id
(`app/reviewBarHints.ts`; hidden from assistive technology, since help is the accessible
list), the note count, which opens the Notes tab, and "Copy notes for agent", which copies
the visible notes as Markdown (`notes/notesMarkdown.ts`). Its actions are page-local, so they
work after the session ends.
- **Changed since viewed.** The snapshot cannot say a file _was_ viewed before its content
changed, so the page remembers per session and per browser the content each file was last
seen marked at (`viewed/viewedFiles.ts`, `localStorage` key `hunk.review.viewed.<session>`,
Expand Down
Loading
Loading