Repository navigation
perf+fix: lazy-load heavy panes; deleting a thread ends its terminals (#1501 G4, #1183) - #1502
Conversation
…nd simulator panes (#1501 G4) Main chunk 1,055 kB -> 999 kB. Each pane suspends inside its own PaneWorkspace leaf, and ThreadView warms all five chunks on idle so the first open doesn't render a blank frame. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…#1183, #1501 G4) Moving a thread to Recently deleted kills its shells but keeps the saved scrollback, so a restore replays it like an app restart. Every permanent removal goes through services-shared purgeThread (delete, trash expiry, project removal, retention, orphan sweeps), which now also kills the shells and deletes <userData>/terminals/<thread>. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…' into g4-resolve # Conflicts: # src/components/ThreadView.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: 22702df686
ℹ️ 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".
| */ | ||
| function budgetPatch(patch) { | ||
| const omitted = new Map(); | ||
| if (patch.length <= PATCH_TRUNCATE) return { patch, omitted }; |
There was a problem hiding this comment.
Enforce the per-file cap before returning the whole patch
When the complete patch is between 60,001 and 100,000 characters, this early return bypasses FILE_PATCH_CAP, even if nearly all of the payload belongs to one file. Such a file is sent to and rendered by the client without patchOmitted: "large", so the new “Show anyway” protection only works when the aggregate patch also exceeds PATCH_TRUNCATE; apply the per-file check regardless of the total size.
Useful? React with 👍 / 👎.
| function purgeThread(threadId, logDir) { | ||
| killThread(threadId); | ||
| if (logDir) fs.rmSync(threadLogDir(logDir, threadId), { recursive: true, force: true }); |
There was a problem hiding this comment.
Make terminal-log removal best-effort during thread purge
If the terminal directory cannot be removed—for example because of a transient Windows lock, permissions, or filesystem failure—rmSync throws after store.removeThread() has already modified memory. Callers such as deleteThread, trash expiry, and project removal then abort before store.saveNow(), leaving the deletion partially applied or preventing unrelated cleanup because an auxiliary scrollback directory was unavailable; catch/log this cleanup failure rather than allowing it to fail the durable thread operation.
Useful? React with 👍 / 👎.
Item G4 of #1501.
1. Lazy panes. Changes/Git, the turn diff panel, Terminal, Browser and Simulator now load on first use via
lazyNamed. The sidebar, thread view and composer still load eagerly.2. Deleting a thread ends its terminals (#1183).
purgeThread: emptying the trash, the TTL expiry, project removal, retention cleanup and orphaned-worker cleanup. It now also kills shells and removes<userData>/terminals/<thread>/.Merge with #1500: I resolved the one conflict (the TurnDiffPanel render): G4's Suspense wrapper kept, with #1500's shared split setting (
setDiffSplit).Verified independently, on main merged with this branch and #1500:
vite buildpasses.Still open from #1183: a shell started before the worktree existed only warns ("Restart to move"), and there's no separate "Close session" action.
🤖 Generated with Claude Code