Skip to content

Reorder threads by drag, PR hover previews, diff folder tree, and 13 more navigation and writing wins - #1776

Merged
currentbits merged 29 commits into
mainfrom
feat/reorder-pr-hover-diff-tree-and-more
Oct 30, 2026
Merged

currentbits merged 29 commits into
mainfrom
feat/reorder-pr-hover-diff-tree-and-more

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Sixteen improvements for keeping many threads organised and reviewable: put threads in your own order, preview PRs on hover, review diffs as a folder tree, and a set of navigation, writing and robustness wins.

Sidebar and navigation (#1769, #1770)

  • Drag threads into your own order. This works within the pinned and active sections, and the order is saved. Dropping into a different section is refused. Alt+Shift+↑/↓ moves the focused thread from the keyboard. New threads still appear where they did before.
  • Threads with an unsent draft show a small pencil marker in the sidebar.
  • New shortcuts: ⌘⇧P toggles pin and ⌘⇧A settles or restores the current thread. All of these can be remapped in the shortcuts settings. ⌘⇧S was already taken by unstash.
  • Alt+↑/↓ jumps to the previous or next turn in the transcript, and PageUp/PageDown page through it. In the composer, Alt+↑ still edits the last queued message.

Pull requests and links (#1771)

  • Hover a PR badge, a PR row or a PR link in a reply to see its title, state, check counts, review decision and +/- lines. It's fetched on hover, cached for 60s, and fails quietly.
  • owner/repo#123 and #123 in agent replies become links. Bare #123 needs at least 2 digits and a GitHub project. Code spans, URLs and colours like #123abc are left alone. github.com links get a small GitHub mark.
  • ⌘K and sidebar search find a thread by its linked PR number or title.

Diffs (#1772)

  • A Tree/List toggle in the Changes panel and the PR code tab. Tree groups files under collapsible folders, merging single-child folder chains, with per-folder counts. List stays the default.
  • The Changes panel header shows the total +/-, and respects Hide tests.
  • Every file has a copy-path button. Alt-click copies the absolute worktree path, and the file context menu has the same option.

Robustness (#1773)

  • Huge pasted or captured images are downscaled to 4096px and 4MB, under Claude's limits, instead of being rejected at 20MB. The chip says "resized from W×H". Images dropped from Finder are still passed by path, unchanged.
  • Closing a terminal that's running something asks first ("Close terminal? npm is still running."). Idle shells close straight away.
  • The crash screen has a "Copy error report" button that copies the version, platform, pane, message, stack and component stack. It also shows the stack in a collapsible section.

Writing (#1774)

  • Regenerate a thread's title from its menu or the chat header, or many at once from sidebar multi-select. It uses the thread's first message plus its recent messages, at most 2 at a time.
  • Settings → Git → Pull requests has instructions for commit messages and for PR titles and bodies. They take precedence over the default style, and the repo's PR template still applies.

Projects and runs (#1775)

  • Each project can default new threads to a worktree or the current checkout, or follow the global setting.
  • "Background: N running" expands to list each background shell, monitor, subagent and workflow agent by name, with elapsed time. It clears when the run ends.

Checks (run locally on the merged branch, electron suite in a CI-matching environment)

  • npm run typecheck and the preload sync check: clean
  • npm run test:renderer: 3497 pass, 0 fail
  • npm run test:electron: 5435 pass, 0 fail
  • npm run test:core: 38 pass. npm run test:memory: 246 pass.
  • npx vite build: succeeds

Closes #1769, closes #1770, closes #1771, closes #1772, closes #1773, closes #1774, closes #1775.

🤖 Generated with Claude Code

Willem and others added 28 commits October 30, 2026 19:08
ThreadCard shows a quiet pencil glyph in the meta line, title "Unsent
draft", when a thread has non-whitespace composer text that hasn't
been sent. composerSession.setDraftText is now the single write path
for draft text (draftsRef aliases keptDrafts) and notifies a small
listener set only when the non-empty state flips, so sidebar rows
subscribe via useSyncExternalStore instead of polling localStorage
per row per render.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Builds a directory tree from a flat file list for the upcoming Tree
toggle: single-child chains compress into one row, dirs sort before
files, and each directory carries a recursive file count and +/- sum.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…1773)

electron/attachments.js: saveImage, savePng, and the HEIC->JPEG conversion
path now run an oversize image through nativeImage (resize + re-encode,
JPEG stepping quality/size down, PNG kept first when alpha may matter)
before falling back to today's MAX_IMAGE_BYTES rejection. Target is 4096px
longest side / 4MB, safe under Claude's ~5MB/8000px API limits with
headroom for the other providers. nativeImage is injected via
setNativeImage so the pure step-down plan (planDownscaleSteps,
imageNeedsDownscale) and the full save paths are testable under plain
node. Chips show a quiet "resized from WxH" note, mirroring the existing
HEIC "converted from" note.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Regenerates a thread's title from its first user message plus a
digest of its latest few messages, via the same fm completion path
and sanitization/cap as the automatic one-shot title. Always an
explicit action (menu item, bulk action), so it overwrites a
user-set title too. Runs at most 2 threads concurrently; trashed
threads are skipped and one thread's failure never stops the rest.

Wires the IPC channel through ipcChannels.ts, CoderApi, the
threads:regenerateTitle handler, webScopes (steer), and the dev
fixture, plus a useCoder action that applies successful titles
locally.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
thread.togglePin defaults to mod+shift+p, thread.toggleSettle to
mod+shift+a (mod+shift+s is already composer.unstash). Both call the
same threads.setPinned / threads.setSettled IPCs as the thread action
menu, toggling off the current effective state (same resolution as
the sidebar's settle computation). Since both are mod chords they
still fire while a text field is focused; only an open dialog blocks
them. Settle reuses the existing undo toast; pin has none to reuse.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Git pane and PR Code tab: a shared List/Tree toggle (coder.diffTreeView,
same pattern as the shared Hide tests setting) renders buildFileTree
instead of the flat list, with collapsible directory rows showing a
file count and summed +/-. The Changes panel file list also gets a
summed +/- total next to its file count, respecting the hide-tests
filter. Every file row (both views, both panels) gets a copy-path
icon button; the Changes panel's context menu gets a matching "Copy
path" item, and Alt-click on its button copies the absolute worktree
path instead of the repo-relative one.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Row menu (src/threadActionMenu.ts, ThreadCard) and the chat header menu
(ThreadView) both get a "Regenerate title" item next to Rename; the
sidebar multi-select toolbar gets a "Regenerate titles" bulk action
(BatchBar). Affected rows show "Regenerating..." in place of the title
while in flight, and the toolbar reports success/failure counts.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
turn.prev/turn.next default to alt+arrowup/alt+arrowdown, deliberately
sharing the composer's alt+arrowup "edit last queued" chord: the
settings conflict checker already treats a shared shipped default as
intentional (same pattern as transcript.find/diff.find on mod+f), and
useTurnNavigation backs off whenever the composer textarea owns focus
so the two never fire for the same keypress.

currentRailTurn is TurnRail's scrollspy heuristic pulled out so the
shortcuts find "current" the same way the rail's own highlight does,
then step to the neighboring turn via the existing scroll-to-turn
jump. PageUp/PageDown page the transcript body by ~90% of its height
outside any editable element; the composer textarea keeps native
paging.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
electron/terminal.js: foregroundCommand/isBusy best-effort check whether
anything other than the login shell is running under a session's pid (POSIX:
any live child via `ps`; Windows ConPTY has no cheap query, so it is always
busy there). Wired through a new terminal:isBusy IPC channel (ipc-devserver.js,
ipcChannels.ts, preload regenerated, webScopes terminal:observe) that the
per-tab close button in TerminalPane.tsx calls on click: idle shells close
immediately, a running command shows "Close terminal? <command> is still
running." with Close/Cancel, using the same confirm-dialog shape and
useModalFocus as the rest of the app.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Two new AppSettings strings, normalized/validated exactly like
titleInstructions (#1765): trimmed, capped at ~1000 chars, default
empty. When set, they are appended to the commit message prompt
(electron/commitmsg.js buildPrompt) and the PR title/body prompt
(buildPrPrompt) as a "Follow these instructions from the user:"
block that takes precedence over the default style; the repo's PR
template still applies on top.

Mirrors the #1765 settings plumbing in store-normalize.js,
store-settings-methods.js, the dev/browser settings fixture, and the
AppSettings type, plus the auto-settle/budget-spend snapshot tests.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Two textareas in the Pull requests section (Commit message
instructions, PR title and body instructions) save on blur, mirroring
the thread title instructions field. Distinct key prefixes avoid a
React duplicate-key collision when both fields are empty.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
src/components/ErrorBoundary.tsx: componentDidCatch now keeps
ErrorInfo.componentStack in state, and the fallback gains a collapsed
<details> stack trace plus a "Copy error report" button that writes a
plain-text report (app version from the existing __BUILD_SHA__ seam,
platform, pane name, error.message, error.stack, componentStack) to the
clipboard, with the same "Copied" label-flip idiom used elsewhere (e.g.
Markdown's code-block Copy button). formatErrorReport is exported and
unit-tested separately from the clipboard plumbing.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…sh (#1772)

Renderer tests for all three #1772 features in both the Git pane and
the PR Code tab: List/Tree toggle plus a directory collapse, the
summed +/- total respecting Hide tests, and copy-path (button,
Alt-click absolute path, and the Git pane's context menu item) with a
stubbed clipboard.

Along the way, fix a real regression from the Tree view change: the PR
Code tab's new file-chip wrapper reused TurnDiffPanel's `.fileBtn`
class, which TurnDiffPanel's own turn-diff file chips still render
with — stripping their pill styling. The PR tab's inner button is now
`.entryBtn`, leaving `.fileBtn` untouched for its original caller.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Projects already carry per-project defaults (threadDefaults); worktree was
the one global-only setting. Add ProjectInfo.defaultWorktree (true/false
pins it, null/absent inherits settings.defaultWorktree), editable in
EditProjectModal as a 3-way select, and resolve the override through one
shared helper per layer (electron/services-shared.js resolveDefaultWorktree,
src/projectDefaults.ts) at every place a new thread's worktree choice
defaults: the plain "New thread" button (useCoderRuns), Ask's Start work
(ThreadView), and chat-initiated threads (electron/channels/index.js).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The working-strip label collapses background work into one rolling line
("N agents working in the background" or the current tool). Add a derived
list instead: deriveBackgroundJobs (src/backgroundJobs.ts) reads shells
(Bash run_in_background, paired with a later KillShell/BashOutput by the
shell id the launch echoes back) and a still-open BashOutput poll straight
from the transcript's tool-call messages, reuses thread.subagents for
in-session Agent/Task subagents (already tracked server-side; this only
adds a startedAt stamp in electron/runner-subagents.js), and reads running
workflow fan-out agents off detail.workflow.

ThreadView shows it as a compact "Background: N running" row under the
working indicator, expanding to each job's label and elapsed time; the
one-line label stays as the collapsed summary. Jobs disappear with the run
because the derivation only runs while the thread is working.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
New per-thread sortKey field (number | null, null by default) persisted
through every layer: ipc.ts/ipcChannels.ts, the regenerated preload,
electron/services-thread-state.js (plain field write, same shape and
bookkeeping-only updatedAt rule as setPinned), the ipc-threads.js handler,
the web scope allow-list, and the dev/fake coder implementations used by
tests. No ordering logic lives here yet - just the storage seam.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
src/threadOrder.ts is the pure fractional-ordering math: applyManualOrder
layers a persisted sortKey on top of a section's normal order (keyed
threads first ascending, unkeyed ones keep today's order), reorderSortKeys
turns a drop between two neighbors into a midpoint key or, when a neighbor
has no key or the gap has collapsed, a renumber of the whole section, and
moveNeighbors computes the one-step neighbors for a keyboard move.

buildFlatSidebar applies it to the pinned and active sections only -
settled/snoozed/archived keep today's ordering, unaffected.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Wires src/threadOrder.ts into the sidebar UI:

- ThreadCard's existing detach-drag (#519) grows a reorder sibling: the
  outer row now also reports dragover/drop, and draggable no longer
  requires desktop's canDetachThread() (reordering works on web too).
  A thin indicator line (data-drop-indicator, the existing --accent
  marker color) shows where the drop would land; the dragged row dims.
- src/components/sidebar/useThreadReorder.ts holds the drag state and
  calls onSetSortKey. Handlers are stable across renders (state read
  through a ref, not a closure dependency) so passing the same function
  to every card never defeats ThreadCard's memo (#617) while idle.
- Alt+Shift+ArrowUp/Down (new thread.moveUp/moveDown bindings) moves the
  selected thread one step within its section, through the same helper.
- Cross-section drag is refused: no patch, no indicator.
- Plumbed end to end: App.tsx handleSetSortKey -> Sidebar onSetSortKey.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Hovering a PR badge, PR list row, or linked PR for ~400ms shows title,
state, checks summary, review decision, +/- lines and author, fetched
through the existing git:prDetail IPC (extended with a checks rollup and
reviewDecision), cached ~60s and deduped per PR. Escape/mouse-out closes
it; keyboard focus opens it too; a failed fetch stays quiet.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
linkifyNode (PathLinks.tsx) now also turns qualified owner/repo#123 refs
and bare #123 (2+ digits) into links to github.com/<owner>/<repo>/issues/<n>.
Bare refs resolve against the thread's project GitHub remote (project.slug,
threaded through ThreadLinkContext); qualified refs work regardless. Skips
URLs, inline code and fenced code, and anything that looks like a file path
or a CSS hex color. A github.com link (synthesized or literal) gets a small
GitHub mark and, when it points at a PR or issue, the hover card from the
previous commit.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
_buildSearchSnapshot now folds each thread's linked PR numbers (both
"#482" and "482", from prNumber and prLinks) and PR titles into the
notes text handed to the search scan, so ⌘K and sidebar search match a
thread by its PR.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The ThreadCard draft subscription had no getServerSnapshot, so the
prRender tests that render the card to a string threw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 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-30T18:50:19.316794Z 24ec009 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.

@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: 24ec009151

ℹ️ 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/backgroundJobs.ts
Comment on lines +85 to +90
for (const m of messages) {
if (m.role !== "tool" || !m.tool) continue;
const { tool } = m;
const input = parseToolInput(tool.input);

if (tool.name === "Bash" && input?.run_in_background === true) {

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 Limit inferred shell jobs to the current run

When a previous turn launched a background shell without a later KillShell or matching BashOutput completion, starting another turn resurrects that historical command as a currently running job. ThreadView passes the entire transcript, and this loop never filters it against runStartedAt; the isWorking gate only hides stale entries between turns. For example, a completed sleep 1 from an earlier turn appears again throughout subsequent runs. Restrict inferred shell/monitor entries to the current run, or track their actual lifecycle explicitly.

Useful? React with 👍 / 👎.

// project.slug is "owner/repo" when derived from a git remote, a plain
// folder name otherwise (#1771) — the "/" is how a GitHub ref knows it
// has a real repo to resolve bare `#123` against.
const repoSlug = project?.slug && project.slug.includes("/") ? project.slug : null;

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 Verify the remote host before enabling bare GitHub references

For projects hosted on GitLab, Bitbucket, or a private Git server, this treats their slug as a GitHub repository and turns bare references such as #123 into links to an unrelated GitHub issue. slugFromRemoteUrl in electron/services-projects.js deliberately extracts owner/repo from arbitrary hosts, so the presence of / does not establish a GitHub remote. Gate bare-reference linking on verified remote-host information rather than the slug shape.

Useful? React with 👍 / 👎.

On fast macOS runners the Codex turn ends right after the decline and the
runner drains the queued redirect into the next turn before the assertion
reads thread.queued. Accept either state, and check the text is posted once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@currentbits
currentbits merged commit 08e7eb4 into main Oct 30, 2026
6 checks passed
@currentbits
currentbits deleted the feat/reorder-pr-hover-diff-tree-and-more branch October 30, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment