Skip to content

feat(keyboard): remappable shortcuts, palette > filter, back/forward history, ⌘Z undo (#1506 H2) - #1507

Merged
currentbits merged 18 commits into
mainfrom
coder/1506-h2-keybindings-palette-history-undo-14fdc7
Oct 6, 2026
Merged

currentbits merged 18 commits into
mainfrom
coder/1506-h2-keybindings-palette-history-undo-14fdc7

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Item H2 of #1506.

What changed

  1. Remappable shortcuts. Every app shortcut comes from one table in src/keybindings.ts (id, label, default, scope).
    • A new Settings › Keyboard pane takes a JSON override (e.g. {"palette.command": "mod+e"}), with invalid-entry and conflict warnings plus Reset.
    • The keyboard sheet, palette hints and sidebar/inspector tooltips all render from the table.
    • Nothing changes without an override. Gestures and ranges (⌘-click, ⌘1…9, Esc-Esc, Ctrl-C stop, ⌘Enter) are listed as fixed.
  2. Palette > filter: actions only, labelled "Actions", with no transcript search.
  3. Back/forward thread history: ⌘[ and ⌘] on mac, Alt+← and Alt+→ elsewhere, plus the mouse side buttons.
    • The stack holds 50 per window and skips deleted threads.
    • ⌘ only on mac, because Ctrl+[ is the composer's vim Escape.
  4. ⌘Z undo of settle, snooze and archive (and their reverses) for 10 s, via a toast or ⌘Z.
    • Never fires in inputs, the composer, the terminal or dialogs.
    • Uses the existing setters with the saved prior state. Batch actions undo as one.

Behaviour changes:

  • Row archive now shows an Undo toast.
  • The archive toast lasts 10 s (was 6).
  • Alt no longer triggers ⌘J, ⌘⇧Enter or ⌘⇧C.

Verified independently, on current main merged with this branch:

  • typecheck exits 0 and vite build passes.
  • test:renderer passes 2818 of 2818.
  • test:electron passes 4225 of 4225.
  • Keyboard settings screenshot reviewed (remap plus conflict warning).

🤖 Generated with Claude Code

Willem and others added 16 commits October 6, 2026 16:17
Each provider's own read-only status command, verified on this machine
against the installed CLIs: claude auth status --json, codex login status
(stderr), cursor-agent status --format json, opencode auth list. grok,
kimi and muse have no status command and report unknown. An API key in
the env turns a codex/cursor 'signed out' into unknown.

The boot providers:list kicks the probe in the background; later lists
(picker, Settings > Agents) await a 30s rate-limited re-probe.
ProviderInfo.auth carries the result.

terminal:signIn types the login command from a fixed table into a fresh
'signin' shell: the thread's, or a dedicated home-directory shell.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…icker (#1501)

Settings > Agents gets a Providers section (installed, signed in, Sign
in). The model picker flags a signed-out harness under its group label.
Sign in opens the open thread's Terminal pane on the login shell, or a
dedicated terminal sheet when no thread is on screen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1501)

projects:discoverRecent reuses the cli-sessions walkers (claude, codex,
grok, kimi) and the OpenCode db (read-only) to find where the user worked
lately, maps linked worktrees to their main checkout, and groups the
checkouts by git remote. The newest checkout of the three most recent
groups active in the last 14 days is pre-selected. Already-added projects,
the home dir and temp dirs are left out. Cursor (lossy dir names) and Muse
(cwd buried in nested records) are not scanned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Project step lists discovered repos by remote, recent ones ticked,
with one Add button; the folder picker becomes the secondary action.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…irst (#1501)

A reveal that lands before terminal.list now still adds its split, is
bound to its thread, and an empty list opens only the revealed shell.
Sign in closes Settings before the dedicated sheet opens: two modal focus
traps recursed. The dev fixture seeds mixed sign-in states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…inal-cleanup-ebd61c' into g1-resolve

# Conflicts:
#	electron/ipc-devserver.js
Lazy per-directory listing that drops gitignored entries unless asked,
a whole-tree list for the filter, and a read-only preview with a 1 MB
cap, binary sniff and image data URLs. Both reuse resolveUnderRoot and
add a realpath check so a symlink in the checkout cannot read outside
it. Remote projects are refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ard (#1506)

Every app shortcut now reads its chord from src/keybindings.ts. Users
override chords by id as JSON in Settings › Keyboard, which warns on
conflicts and resets. The keyboard sheet and palette hints render from
the table with platform modifiers. mod still matches ⌘ or Ctrl, so
nothing changes for anyone who has not customised.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Files pane picks reuse the review-comment chip. An `excerpt` flag keeps
them in the prompt without a note (blank diff comments are still
dropped), and the chip shows an 'Add a note' hint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
⌘[ / ⌘] on mac and Alt+←/→ elsewhere (Ctrl+[ stays vim Escape), plus
the mouse side buttons. Steps skip deleted threads; the terminal keeps
its own keys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A one-slot undo holds the IPC call that restores the previous state,
shown as a 10 s toast with Undo. ⌘Z reverses it, or the archive toast,
but never inside text inputs, the composer or the terminal. Sidebar
batches join into one entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A lazy tree of the thread checkout: directories load on expand, a
toggle shows gitignored entries, a fuzzy filter searches the whole
tree, and arrows/Enter/Home/End drive it. The preview shows highlighted
read-only text (lazy highlighter), rendered markdown with a source
toggle, images, and too-large/binary states. Click and shift-click line
numbers, then Add to prompt to send the range as a composer chip.
Open in uses the editor the worktree menu remembers.

Loaded with lazyNamed, so only a small stub lands in the main chunk.
Remote projects say Files is not available.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also give Apply the base button style, and pin the clock in the snooze
undo test since snooze presets depend on the hour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s-first-run-discove-b9aca6

feat: provider sign-in status with one-click Sign in; onboarding finds recent repos (#1501 G1)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T15:15:35.577002Z 2289917 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Willem added 2 commits October 6, 2026 17:11
# Conflicts:
#	src/App.tsx
#	src/components/ThreadView.tsx
…e-history-undo-14fdc7' into HEAD

# Conflicts:
#	src/components/SettingsModal.module.css

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2289917c56

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/app/useUndoLast.ts
Comment on lines +29 to +32
const next =
cur && cur.verb === verb && now - cur.at < BURST_MS
? { ...cur, count: cur.count + 1, at: now, reverse: [...cur.reverse, reverse] }
: { key: now, verb, count: 1, at: now, reverse: [reverse] };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve every item in a batch undo

When a batch archive or settle has IPC completions more than 500 ms apart, this time-based grouping starts a new entry and discards the reversals accumulated for earlier items. Sidebar.runBatchArchive and runBatchSettle cannot preserve the batch boundary here—the App handlers return immediately and only call offerUndo when each request later completes—so one Cmd/Ctrl+Z may restore only the last part of a slow batch. Pass an explicit batch identity or register the batch as one undo entry instead of inferring it from completion timing.

Useful? React with 👍 / 👎.

Comment thread src/App.tsx
Comment on lines +728 to +732
void setSettled(threadId, override).then(() =>
offerUndoOnly(override === "settled" ? "Settled" : "Unsettled", () =>
setSettled(threadId, prev),
),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate undo registration on successful mutations

If settling or snoozing fails, these .then() callbacks still run because useCoderThreadActions.setSettled and setSnoozed catch the error and resolve normally. The UI consequently reports the action as completed and offers an undo for a state change that never happened; the same issue affects unarchive because handleSetArchivedUndoable discards the boolean result. Propagate a success result and only call offerUndoOnly after a successful mutation.

Useful? React with 👍 / 👎.

Comment thread src/keybindings.ts
Comment on lines +257 to +261
export function matchesChord(e: KeyLike, chord: Chord): boolean {
const key = e.key.toLowerCase();
// Option on mac turns letters into symbols (⌥F is "ƒ"); fall back to code.
const code = (e.code ?? "").toLowerCase().replace(/^(key|digit)/, "");
if (key !== chord.key && !(e.altKey && code === chord.key)) return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize Space before matching custom chords

A user can apply a valid-looking override such as {"palette.command":"mod+space"}, and the formatter even displays it as “Space,” but browser keyboard events report that key as " ", not "space". Because the code fallback is only considered while Alt is pressed, ordinary mod+space can never match. Normalize e.key === " " to the parser's space token (or consistently match by code).

Useful? React with 👍 / 👎.

Comment thread src/keybindings.ts
Comment on lines +262 to +267
if (e.altKey !== chord.alt) return false;
if (chord.shift ? !e.shiftKey : e.shiftKey && !shiftAgnostic(chord.key)) {
return false;
}
if (chord.mod) return e.metaKey || e.ctrlKey;
return e.metaKey === chord.meta && e.ctrlKey === chord.ctrl;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce literal modifiers when mod is also present

The parser accepts combinations such as mod+ctrl+k or mod+meta+k, but this early return ignores the literal ctrl and meta flags whenever mod is set. For example, mod+ctrl+k fires on plain Cmd+K on macOS even though Ctrl is not held. Either reject mod combined with ctrl/meta during validation or require all specified modifiers here.

Useful? React with 👍 / 👎.

Comment on lines 120 to 123
useEffect(() => {
if (!open || mode !== "command" || trimmed.length < 2) {
if (!open || mode !== "command" || actionsOnly || trimmed.length < 2) {
setContentHits(null);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear remote loading when entering actions-only mode

If a two-character thread search has set remoteLoading and the user changes the query to an actions-only query before that search finishes, cleanup prevents the old request's finally from clearing the flag while this new early-return path also leaves it set. An actions-only query with no matching action then displays “Searching…” indefinitely even though no search is running; clear remoteLoading in this branch.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant