Repository navigation
1.0.76
What's Changed
Fix session rendering performance for very long sessions (#182)
Addresses UI lag in sessions with many messages by memoizing session components and stabilizing callback references.
- Memoized 10 session components with
React.memo:AssistantCanvas,CodeBlock,CompactionPill,CopyMessageButton,ForkMessageButton,MarkdownRenderer,MessageRenderer,ReasoningBlock,SubtaskCard,UserBubble— prevents unnecessary re-renders when parent state changes but individual message props haven't changed - Hoisted
remarkPluginsarray inMarkdownRendererto module scope (remarkPluginsConfig) soReact.memoshallow comparison works correctly (previously a new[remarkGfm]array was created every render, defeating memoization) - Stabilized fork handler in
SessionViewby replacing directmessagesdependency with amessagesRef— prevents theuseCallbackfrom being recreated on every new message, which previously caused allMessageRenderercomponents (and their children) to receive a newonForkprop and re-render
Fix git changes tab auto-refresh race condition and watcher lifecycle (#181)
Fixes the git changes tab failing to auto-refresh due to race conditions in the worktree watcher lifecycle and incorrect safety-net poll suppression.
Worktree watcher reference counting & race fix (worktree-watcher.ts)
- Added reference counting (
refCount) toWatcherEntry— when multiple consumers watch the same worktree path, the watcher is kept alive until all consumers unwatch. Previously, the firstunwatchWorktree()call would tear down the watcher even if other consumers still relied on it. - Fixed race condition in
unwatchWorktree()— the map entry is now deleted synchronously before the async watcher.close()calls. This prevents a concurrentwatchWorktree()from seeing a stale entry viawatchers.has(), returning early (thinking it's already watching), and then having the entry removed by the in-flight cleanup — leaving no watcher at all. - Reordered cleanup sequence — debounce timers are now cleared before the map deletion, preventing a timer from firing between delete and clearTimeout and emitting a spurious status event.
- Forced refCount reset in
cleanupWorktreeWatchers()— on shutdown, refCount is forced to 1 before callingunwatchWorktree()so all watchers are fully closed regardless of outstanding references.
Safety-net poll filtering (useWindowFocusRefresh.ts)
- Scoped
onStatusChangedto active worktree paths — the focus-refresh hook now only resets its "last event" timer when the incoming git status event matches one of the currently active worktree paths. Previously, a healthy watcher on worktree B would reset the timer, suppressing the safety-net poll for a broken watcher on worktree A.
Add auto-pull before worktree creation (#179)
- Adds automatic pulling from origin before creating worktrees to ensure they start with the latest changes
- Implements new
autoPullBeforeWorktreesetting (enabled by default) in Settings > General - Adds
pullBaseBranch()method to git-service that gracefully handles pull operations - Shows loading toasts during pull operations and info toasts when commits are pulled
- Returns pull info in worktree creation results for UI feedback
Virtualize git changes file lists for large repo performance (#178)
Virtualizes the file lists in ChangesView and GitStatusPanel using @tanstack/react-virtual, preventing the browser from choking when repositories contain 10,000+ changed/untracked files.
Key changes
- ChangesView (file-tree): Replace
.map()rendering of conflict/staged/modified/untracked file sections with a single flattened virtual list usinguseVirtualizer. Only visible rows get DOM nodes. Adds a discriminated unionFlatChangeItemtype for headers vs file rows, withROW_HEIGHTandHEADER_HEIGHThoisted to module-level constants. Restores visual group separators (border-t) lost during the refactor. - ChangesView — MemberChanges (connection mode): Replace three
GroupHeader+.map()sections with a single virtualized flat list per member, matching the main ChangesView pattern. EachMemberChangesinstance gets its own virtualizer with a 300px max-height scroll container. Removes the now-unusedGroupHeadercomponent. - GitStatusPanel: Replace
.map()rendering across 4CollapsibleSectiongroups with a single flat virtualized list. Same pattern: discriminated unionFlatStatusItem, collapsedSetstate,flatItemsuseMemo, anduseVirtualizerwith absolute positioning.FileItemis wrapped inmemo()and the staticstatusColorsmap is hoisted to module scope to avoid re-creation on every render. - Tests: Updated
changes-view.test.tsto match the new virtualized DOM structure.
Files changed
| File | Change |
|---|---|
src/renderer/src/components/file-tree/ChangesView.tsx |
Virtualized main file list + MemberChanges |
src/renderer/src/components/git/GitStatusPanel.tsx |
Virtualized file list + memo optimizations |
test/phase-11/session-10/changes-view.test.ts |
Test adjustments for new structure |
Remove auto-expand projects in connection mode (#177)
This PR removes the automatic expansion of all projects when entering connection mode, simplifying the UI behavior.
Changes
- Removed
expandAllProjectsfunction fromuseProjectStorethat was expanding all project IDs - Removed useEffect hook in
LeftSidebar.tsxthat triggered auto-expansion whenconnectionModeActivebecame true - Cleaned up type definitions by removing the
expandAllProjectsmethod from the store interface
Rationale
The auto-expand behavior was adding unnecessary complexity to connection mode. Users can manually expand projects as needed, giving them more control over the UI state.
Fix: Use preferred terminal setting for all Open in Terminal actions (#176)
- Bug fix: The "Open in Terminal" actions for worktrees and connections were hardcoded to always launch Terminal.app (macOS) or cmd.exe (Windows), completely ignoring the user's preferred terminal configured in Settings
- Refactor: Consolidated duplicated terminal-launch logic from three separate IPC handlers (
connection-handlers.ts,worktree-handlers.ts,settings-handlers.ts) into a sharedlaunchTerminal()helper function - New shared function: Added
openPathWithPreferredTerminal()insettings-handlers.tsthat reads the user's preferred terminal from the database and delegates tolaunchTerminal(), making it reusable across all handlers
Changes by file
src/main/ipc/settings-handlers.ts
- Added
launchTerminal(targetPath, terminalId, customCommand?)— centralized platform-specific terminal launch logic (macOS, Windows, Linux) with support for custom terminal commands - Added
openPathWithPreferredTerminal(path)— readsdefaultTerminalandcustomTerminalCommandfrom the app settings DB, then callslaunchTerminal() - Simplified the existing
settings:openWithTerminalIPC handler to delegate tolaunchTerminal()instead of containing its own copy of the logic
src/main/ipc/worktree-handlers.ts
- Replaced ~65 lines of hardcoded terminal-launch logic in
worktree:openInTerminalwith a single call toopenPathWithPreferredTerminal() - Removed unused
spawn,platformimports
src/main/ipc/connection-handlers.ts
- Replaced ~50 lines of hardcoded terminal-launch logic in
connection:openInTerminalwith a single call toopenPathWithPreferredTerminal() - Removed unused
spawn,existsSync,platformimports
Net impact
- 3 files changed, 133 insertions, 208 deletions (net −75 lines)
- Eliminates code duplication across three handlers
- All "Open in Terminal" actions now respect the user's preferred terminal setting
Warn on merge/archive when source worktree has uncommitted changes (#175)
- Dirty-check before merge and archive: When merging or archiving a branch that is checked out in a worktree with uncommitted changes, the user now sees a confirmation dialog listing the affected files with a diff stat (additions/deletions/binary) before proceeding.
- New
MergeConfirmDialogcomponent: A newMergeConfirmDialoginsrc/renderer/src/components/worktrees/shows uncommitted file changes with color-coded icons (added/deleted/modified) and stat counts, warning that these changes won't be included in the merge. ArchiveConfirmDialogintegration: The existingArchiveConfirmDialogis now also used inGitPushPullto warn before archiving a worktree with dirty files.GitPushPullrefactored: ThehandleMergeandhandleArchiveWorktreefunctions now first callwindow.gitOps.getDiffStat()to check for uncommitted changes; if dirty files exist, confirmation dialogs are shown before proceeding. The actual operations are extracted intodoMergeanddoArchiveWorktreehelpers.