Repository navigation
Long threads load in pages and render lighter, safer file restores, and triage polish - #1792
Conversation
Settling (not un-settling) the currently open thread now selects the next thread in buildFlatSidebar's eligible order (pinned/active/ working/snoozed); the last item falls back to the previous one, and a lone thread leaves selection unchanged. Settling a different thread from the sidebar does not move selection. Undo re-selects the settled thread. One shared fix in App.tsx's handleSetSettled covers the ⌘⇧A shortcut, the sidebar card's settle button, and ThreadView's settle action. Adds the pure nextThreadAfterSettle helper next to stepVisibleId in sidebarSelection.ts. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…the same checkout Crew/orchestrator workers can share a worktree, and threads without their own worktree share the project checkout. rewindThread only checked whether THIS thread was running, so a sibling thread actively writing in the same directory could race a restoreFiles hard reset. Add siblingRunningSameCheckout (effective cwd = worktreePath || project.path) and gate it at every file-mutating entry point: rewindThread's restoreFiles branch, undoRewindThread's restore, and restoreCheckpoint itself (covers git:restoreCheckpoint and the thrash-detector rollback). Conversation-only rewind (no restoreFiles) is unaffected. Co-Authored-By: Claude Sonnet 5 <[email protected]>
notificationOptions now accepts an optional {event, platform}: for a
done/failed/waiting transition ("waiting" covers both an approval
prompt and a question card, same mapping threadNotifyState already
uses), macOS gets a status glyph prefixed onto the title (checkmark /
cross / dot) since Electron's Notification `icon` field is documented
to be ignored there for the app's own icon; Windows/Linux get a
generated 48x48 status-color PNG via the returned iconBuffer.
The PNG is hand-built with node:zlib (deflate) and a small CRC32 table
at call time, no image dependency and nothing committed to the repo.
notify.js stays electron-free so its tests keep running under plain
`node --test`; main.js's notifyThreadComplete turns iconBuffer into a
NativeImage via the electron it already has. Calling without `event`
(e.g. ciFailedNotification) is unchanged.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ry streamed token (#1787) ChangesPanel and TurnDiffPanel were plain function components mounted from ThreadView, which re-renders on every stream tick. Wrap both in React.memo and stabilize the two props ThreadView was recreating inline on every render (onCommitAndPr, onComment's diff-comment handler, TurnDiffPanel's onModeChange) with useCallback so the memo actually holds. Added a render- count regression test (same ThreadCard/#617 .type-probe pattern already used in sidebar.test.tsx) that mounts ThreadView with the Changes panel open, pushes several streamed-token updates, and asserts the render count does not grow. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…chose resumeInterruptedRuns shipped opt-in (#1512 I3) and normalizeSettings wrote false into every stored settings object, so an unset value was indistinguishable from an explicit false. Add resumeInterruptedRunsSet, a marker setSettings stamps the moment a user actually patches this key (either direction). normalizeSettings now defaults the flag to true unless that marker is present, so a never-touched store (or one that only ever saw the old backfilled false) heals to on, while an explicit true or false survives every reload. The once-only autoResumedAt cap per thread is unchanged. Updates the full-settings snapshot tests (auto-settle-settings, budget-spend), the auto-resume default/opt-out tests, the dev/browser settings fixture, and the SettingsModal renderer test/fixture default. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The tail window (#564/#1475) already bounds mounted DOM to ~120 entries regardless of thread length, and React's own commit cost per streamed append stays sub-millisecond at any n (measured 500/3000/8000-message synthetic threads). The real unbounded-growth path is a reader who clicks "Show earlier" repeatedly without returning to the bottom: the window keeps growing (mounted rows go from 104 to 1664+ after 15 clicks on an 8000-message thread in testing), and every one of those mounted rows used to cost full browser layout/paint even while scrolled far out of view. Add a `.settledRow` class (content-visibility: auto + contain-intrinsic- size) to message rows and finished tool-call groups, skipping it only for the row the live turn is currently writing into (streaming message, running tool, thinking card) so active updates never thrash containment. This is the same native technique already used for long file lists (FilesPane.module.css); it keeps every row mounted, so find, selection, jump-to-turn, and revealMessageId continue to work exactly as before. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…#1786) threads:get now returns only the newest page of messages by default (electron/store.js getMessagesPage, 300-message default) plus hasOlderMessages/totalMessageCount; a new threads:getOlderMessages fetches the previous page by cursor. Plumbed through ipc-threads.js, the shared ipcChannels.ts table (regenerated preload.js), ipc.ts types, webScopes.js, the browser-dev fixture (src/dev/threads.ts) and the renderer test fixture (test/support/fakeCoder.ts), sharing the slice logic via a new src/shared/messagePaging.ts helper on the TS side. Streaming pushes (runner.js pushDetail) keep requesting the full array (limit: Infinity) so the existing firstChanged tail-diff still only ships new messages; mergeThreadPatch now always carries hasOlderMessages/ totalMessageCount forward from the open detail instead of trusting a patch's value, since a streamed patch is never page-aware. Renderer: useCoder exposes loadOlderMessages (prepends the previous page) and ensureFullHistory (fetches everything once, for a feature that needs a message outside the loaded page). ThreadView wires a "Load older messages" control once its local tail window is exhausted, and triggers ensureFullHistory when a reveal target (useTranscriptFind zero hits, or a ⌘K jump) isn't in the loaded page. Co-Authored-By: Claude Sonnet 5 <[email protected]>
New pref (src/uiPrefs.ts, Settings General Display) defaults off. When on, each file's diff body starts collapsed in the Changes panel, the PR code tab, and turn diffs, behind a shared per-file collapse header (chevron, file path) exported from TurnDiffPanel.tsx. Clicking the header toggles it; selecting a file from the list/tree always expands it. Large-diff hiding is unaffected: it still gates whether a patch exists before collapse applies. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ight Investigated the rollback/send race for #1788: rewindThread (restoreFiles) and restoreCheckpoint never marked the thread busy in the runner's `active` map, so startRun's only guard (`active.has(threadId)`) let a message sent mid-restore spawn a turn into the worktree while `git reset --hard` was still running, or land that turn's own post-turn checkpoint on a half-restored tree. A real window, confirmed with an injected slow restore. Add a dedicated per-thread `restoringThreads` set and `withRestoreHold`, separate from `active` on purpose: Stop only ever inspects `active` and unconditionally terminalizes whatever it finds there, so folding the hold into `active` would let Stop clear it early (there is no process to kill for a restore, the git calls are already near-instant) and reopen the same race. startRun now refuses with a clear message while the hold is up. restoreCheckpoint takes the hold for its whole mutation (covers git:restoreCheckpoint and the thrash-detector rollback); undoRewindThread's own hard reset takes it directly. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Electron: store.getMessagesPage (newest page, before-cursor paging, limit: Infinity, unknown cursor/thread boundary cases), services getThreadDetail/getOlderMessages, and the threads:get / threads:peek / threads:getOlderMessages IPC handlers end to end. Updates the two hand-rolled fake stores in threadReport.test.js that lacked getMessagesPage. Renderer: mergeThreadPatch preserves hasOlderMessages/totalMessageCount across a streamed tail patch (threadPatch.test.ts); ThreadView renders the "Load older messages" control once the local tail window is exhausted, prepends the fetched page, and falls back to onEnsureFullHistory when a reveal target isn't in the loaded page (threadView.test.tsx). Co-Authored-By: Claude Sonnet 5 <[email protected]>
…sing QuestionPrompt/permission/plan cards used to mount the instant thread.pendingQuestion or detail.pendingPermission appeared, snapping focus inside the scrolled transcript away from whatever the user was mid-typing. Composer now reports last-keystroke/focus/emptiness to ThreadView via onComposerActivity; a card that arrives within 1.5s of the last keystroke, while the composer is focused and non-empty, is held back behind a compact notice on the composer's status lip instead, until 1.5s of no typing or a click on the notice. The underlying pendingPermission/pendingQuestion data is untouched by the defer, so a held-back card still counts as "open" for the #1762 decline-and-redirect send path. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…urst Consecutive user messages with no agent output between them (queued follow-ups, steer messages, quick corrections) used to render as N separate bubbles. userMessageBursts (src/components/thread/messages.tsx) is a pure helper over the same DisplayEntry[] row list ThreadView already builds: it tags each user message first/middle/last/single, breaking the run on any non-user row (tool group, worklog, or a non-user message). ThreadView wires the position into MessageBlock via data-burst; CSS tightens the vertical gap and flattens the touching corners within a burst. Each message keeps its own Copy/Edit/Pin on hover; only the last message's footer carries a shared time for the group. Co-Authored-By: Claude Sonnet 5 <[email protected]>
# Conflicts: # test/threadView.test.tsx
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 412142b095
ℹ️ 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".
| messages: page.messages, | ||
| hasOlderMessages: page.hasOlder, | ||
| totalMessageCount: page.totalCount, |
There was a problem hiding this comment.
Reconcile paged messages with full-transcript patch offsets
For threads exceeding 300 messages, this returns a suffix while runner.pushDetail still computes messagesFrom against the full transcript. mergeThreadPatch interprets that offset relative to the loaded suffix: updating message 499 in a 500-message thread returns null and triggers reloadDetail, which fetches another default page on every streaming push and discards any additionally loaded history. A shrinking patch with an offset within the page length can instead silently retain the wrong messages. Carry and account for the page's absolute offset, or otherwise establish a consistent patch base before merging.
Useful? React with 👍 / 👎.
| return api.threads | ||
| .peek(threadId, { limit: Infinity }) |
There was a problem hiding this comment.
Use a JSON-safe limit for full-history requests
In the browser/web-access client, src/wireClient.ts serializes invocation arguments with JSON.stringify, so Infinity becomes null. Store.getMessagesPage then falls back to the default 300-message limit rather than returning the full history. Consequently, searching for or revealing an older message cannot load it through this fallback, and the returned detail still reports older history. Use a finite sufficiently large limit or an explicit JSON-safe full-history option.
Useful? React with 👍 / 👎.
| // back: fetch the rest of the transcript once and let the next render's | ||
| // hits recompute over it (#1786). | ||
| useEffect(() => { | ||
| if (!session.open || !session.query.trim() || hits.length > 0) return; |
There was a problem hiding this comment.
Fetch older search results even when the loaded page has matches
When a query matches both the newest page and unloaded history, this early return prevents the older matches from ever being fetched. The find bar reports only the loaded matches, and its next/previous controls wrap within that incomplete set, so users cannot reach older occurrences without manually loading the transcript first. Request full history for an active nonempty query whenever older messages remain, rather than only when the loaded page has zero hits.
Useful? React with 👍 / 👎.
Long threads load and render faster, file restores are safer, and settling, notifications and question cards fit a many-threads workflow better.
Long threads (#1785, #1786, #1787)
content-visibility: auto). Nothing is unmounted, so find, selection and jumps keep working. The live streaming row is excluded. This matters most after repeated "Show earlier".Safety (#1788)
Triage (#1789, #1790)
Known limits (listed rather than silently cut)
Checks (run locally on the merged branch, electron suite in a CI-matching environment)
npm run typecheckand the preload sync check: cleannpm run test:renderer: 3605 pass, 0 failnpm run test:electron: 5489 pass, 0 failnpm run test:core: 38 pass.npm run test:memory: 246 pass.npx vite build: succeedsCloses #1785, closes #1786, closes #1787, closes #1788, closes #1789, closes #1790.
🤖 Generated with Claude Code