Conversation
Auto-committed for PR creation
WalkthroughExtensive formatting and organizational refactoring across the desktop and web app, including tmux mouse mode enablement, context and import reorganization, CSS viewport adjustments for terminal scrollbars, and scattered minor functional refinements like cleanup listeners and conditional rendering updates. Changes
Sequence Diagram(s)sequenceDiagram
participant Terminal as Terminal Component
participant XTerm as XTerminal Core
participant Container as DOM Container
participant Effect as useEffect Hook
Effect->>Terminal: Component mounts
Terminal->>Container: Get container dimensions
Container-->>Terminal: Return size & padding
Terminal->>XTerm: Read cell dimensions from core
XTerm-->>Terminal: Return width & height per cell
Terminal->>Terminal: Calculate available space<br/>(container - padding)
Terminal->>Terminal: Derive cols/rows from<br/>cell dimensions
Terminal->>XTerm: Resize terminal to cols/rows
Terminal->>XTerm: Write history with callback
XTerm-->>Terminal: Scroll to bottom on complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Areas requiring extra attention:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
apps/desktop/src/renderer/screens/main/hooks/useDiffData.ts (1)
148-156: Add explicit type annotation for theresultvariable to resolve type inference issues.The
resultvariable from the IPC handler lacks an explicit type annotation, preventing TypeScript from properly narrowingresult.changesto the expectedDiffLine[]type. Although the IPC response type definition inapps/desktop/src/shared/ipc-channels/worktree.tsdefines changes with the correct structure (type: "added" | "removed" | "modified" | "unchanged"), the untyped result causes type inference failures during assignment.Add an explicit type cast or import the response type from the IPC channel definitions. For example, at line 128-147 in
apps/desktop/src/renderer/screens/main/hooks/useDiffData.ts:const result = await window.ipcRenderer.invoke( "worktree-get-git-diff-file", // ... ) as { success: boolean; changes?: Array<{ type: "added" | "removed" | "modified" | "unchanged"; oldLineNumber: number | null; newLineNumber: number | null; content: string }> };Or better, import and use the IPC response type directly from
apps/desktop/src/shared/ipc-channels/worktree.ts.apps/desktop/src/main/lib/tmux-manager.ts (2)
641-645: Potential race: asyncmkdirwith syncwriteFileSync.
mkdirfrom"node:fs/promises"returns a Promise, but it’s called withoutawaitjust beforewriteFileSync. This can race and occasionally fail if the directory isn’t created before the write.You can either await the Promise or switch to the sync API here. For example:
-import { mkdir } from "node:fs/promises"; +import { mkdirSync } from "node:fs"; … - const dir = dirname(this.sessionRegistryPath); - if (!existsSync(dir)) { - mkdir(dir, { recursive: true }); - } + const dir = dirname(this.sessionRegistryPath); + if (!existsSync(dir)) { + mkdirSync(dir, { recursive: true }); + }
182-189: Tmuxmouseoption not applied to restored sessions.Verification confirms the concern: in
ensureSessionExists(line 122),applySessionSettingsis called only when a session is newly created (if (hasSession.status !== 0)). When sessions are restored from disk ininitialize()(line 102), the session already exists, soapplySessionSettingsis skipped and themousesetting is never applied. This means restored sessions won't have mouse mode enabled for scroll handling, creating inconsistent behavior between new and restored sessions.Consider invoking
applySessionSettings(or at least the mouse setting) when reattaching restored sessions, or separating session-initialization settings from mouse-mode configuration if mouse handling should apply universally.apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/WorktreeItem/WorktreeItem.tsx (1)
1159-1167: Label/select ID mismatch breaks programmatic association.The label uses
htmlFor="target-branch"but the<select>gets a generatedid={targetBranchSelectId}fromuseId(), so screen readers won’t associate them. Wire them up with the same id.Apply this diff:
- <label - htmlFor="target-branch" + <label + htmlFor={targetBranchSelectId} className="text-sm font-medium text-gray-200" > Target Branch </label> <select - id={targetBranchSelectId} + id={targetBranchSelectId} value={targetWorktreeId} onChange={(e) => handleTargetWorktreeChange(e.target.value)}apps/desktop/src/renderer/screens/main/components/Layout/NewLayoutMain.tsx (1)
699-707: ReplaceipcRenderer.removeListener()withoff()and fix component prop mismatchesFour critical CI-blocking type errors:
- Lines 723, 773:
window.ipcRenderer.removeListener()does not exist on your exposed IPC API. Useoff()instead:- window.ipcRenderer.removeListener( - "worktree-setup-progress", - progressHandler, - ); + window.ipcRenderer.off("worktree-setup-progress", progressHandler);
- Lines 1005–1010:
PlanViewaccepts no props (type PlanViewProps = {}). Update to:- <PlanView - currentWorkspace={currentWorkspace} - selectedWorktreeId={selectedWorktreeId} - onTabSelect={handleTabSelect} - onTabCreated={handleTabCreated} - /> + <PlanView />
Lines 950–955, 1028–1033:
Sidebarnow only acceptsisDragging?andonDiffModeChange?. Remove all other props (workspaces,currentWorkspace,onTabSelect,onWorktreeCreated,onWorkspaceSelect, etc.) to match the new interface.Lines 1063–1075, 1094–1107:
TabGroupandTabContentprops are out of sync. Simplify to matchMainContentAreapattern:
TabGroup: only passgroupTabTabContent: only passtabandgroupTabId
🧹 Nitpick comments (4)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/WorktreeItem/WorktreeItemArborist.tsx (1)
38-62: Consider extracting a type alias for the repeated tree node shape.The explicit type annotations improve type safety, which is good. However, the tree node shape
{ id: string; name: string; tab: Tab; children?: Array<...> }is repeated across multiple functions. Consider defining a type alias at the top of the file to reduce verbosity and improve maintainability:+type TreeNodeData = { + id: string; + name: string; + tab: Tab; + children?: TreeNodeData[]; +}; + // Convert Tab[] to react-arborist format -function convertTabsToTreeData( - tabs: Tab[], -): Array<{ - id: string; - name: string; - tab: Tab; - children?: Array<{ id: string; name: string; tab: Tab }>; -}> { +function convertTabsToTreeData(tabs: Tab[]): TreeNodeData[] { return tabs.map((tab) => { - const node: { - id: string; - name: string; - tab: Tab; - children?: Array<{ id: string; name: string; tab: Tab }>; - } = { + const node: TreeNodeData = { id: tab.id, name: tab.name, tab,Then update
handleMoveandrenderNodeto useTreeNodeDatain place of the inline type declarations.Also applies to: 157-169, 181-184, 347-363
apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/WorktreeItem/WorktreeItem.tsx (1)
584-588: Repeated “unknown error” copy could be centralized (optional).The fallback message
"An unknown error occurred while …"is duplicated across multiple dialogs (remove, merge, settings). Not a blocker, but if you expect future i18n or copy tweaks, consider extracting a small helper or shared constant to keep the messaging consistent and easier to update.Also applies to: 693-699, 662-666
apps/desktop/src/renderer/screens/main/utils.ts (1)
8-28: Tab lookup helper and worktree task enrichment look good; consider deduplication
findTabRecursivecorrectly handles both top‑level and group tabs and returns the parent for group children, matching howselectedTab/parentGroupTabare consumed elsewhere.enrichWorktreesWithTaskscleanly combines pending worktrees and real worktrees into a singleWorktreeWithTask[], deriving status fromWorktreefields and usingformatRelativeTimeforlastUpdated. This keeps task metadata consistent with the underlying worktree state.You now have another
enrichWorktreesWithTasksimplementation inNewLayoutMain.tsxbased onMOCK_TASKS. To avoid drift, it would be better to have a single canonical implementation (likely this one inutils.ts) and reuse it from any consumers that need enriched worktrees.Also applies to: 58-105
apps/desktop/src/renderer/screens/main/components/MainContent/Terminal.tsx (1)
211-262: Custom fit + history scroll behavior look correct; watch private xterm internalsThe new
customFitlogic that:
- reads the container’s bounding rect,
- subtracts any
.xterm-screenpadding, and- derives
cols/rowsfrom the rendered cell width/height,is sound and should give more stable sizing with scrollbars than relying on
FitAddon.fit(). Using theterm.write(history, () => term.scrollToBottom())callback is also an appropriate way to ensure the viewport ends at the latest output after replaying history.The only caveat is the reliance on
(term as any)._core._renderService.dimensions.css.cell, which is an internal xterm.js API and could change in future xterm releases. If you plan to upgrade xterm regularly, consider wrapping this in a small helper that can fall back toFitAddon.proposeDimensions()or another public API if_corestops matching this shape.Also applies to: 347-352, 510-514
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (87)
apps/desktop/src/main/lib/tmux-manager.ts(1 hunks)apps/desktop/src/main/lib/window-manager.ts(4 hunks)apps/desktop/src/main/lib/window-state-manager.ts(1 hunks)apps/desktop/src/main/lib/workspace-ipcs.ts(2 hunks)apps/desktop/src/main/lib/worktree-manager.ts(1 hunks)apps/desktop/src/renderer/contexts/AppProviders.tsx(2 hunks)apps/desktop/src/renderer/contexts/SidebarContext.tsx(0 hunks)apps/desktop/src/renderer/contexts/TabContext.tsx(2 hunks)apps/desktop/src/renderer/contexts/TaskContext.tsx(2 hunks)apps/desktop/src/renderer/contexts/WorkspaceContext.tsx(1 hunks)apps/desktop/src/renderer/contexts/WorktreeOperationsContext.tsx(2 hunks)apps/desktop/src/renderer/contexts/index.ts(1 hunks)apps/desktop/src/renderer/globals.css(1 hunks)apps/desktop/src/renderer/screens/main/MainScreen.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/AppFrame/AppFrame.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/DiffView/DiffContent.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/DiffView/DiffContentArea.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal.tsx(3 hunks)apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/CreatingView.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/TaskForm.tsx(4 hunks)apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/TaskList.tsx(4 hunks)apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/index.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/types.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/useTaskData.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/useTaskForm.ts(2 hunks)apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/utils.ts(3 hunks)apps/desktop/src/renderer/screens/main/components/Layout/NewLayoutMain.tsx(8 hunks)apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/AddTaskButton.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/ModeToggle.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/TaskTabs.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/WorktreeTabButton.tsx(3 hunks)apps/desktop/src/renderer/screens/main/components/MainContent/TabContent.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/MainContent/TabGroup.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/MainContent/Terminal.tsx(3 hunks)apps/desktop/src/renderer/screens/main/components/MainContentArea/MainContentArea.tsx(3 hunks)apps/desktop/src/renderer/screens/main/components/MainContentArea/index.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/PlanView/PlanView.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/Sidebar.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/ModeCarousel.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/AnimatedBackground.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/index.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/index.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/ModeHeader.tsx(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/index.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/ModeNavigation.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/index.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/constants.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useModeDetection.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollProgress.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollSnap.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/index.ts(1 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeSwitcher/ModeSwitcher.tsx(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeSwitcher/index.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/WorktreeList.tsx(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/NewTabButton/index.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/WorktreeItem/WorktreeItem.tsx(6 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/WorktreeItem/WorktreeItemArborist.tsx(9 hunks)apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/WorktreeItem/components/TabItem/TabItem.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/SidebarOverlay/SidebarOverlay.tsx(1 hunks)apps/desktop/src/renderer/screens/main/components/SidebarOverlay/index.ts(0 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceSelectionModal/WorkspaceSelectionModal.tsx(2 hunks)apps/desktop/src/renderer/screens/main/components/WorkspaceSelectionModal/index.ts(0 hunks)apps/desktop/src/renderer/screens/main/constants.ts(1 hunks)apps/desktop/src/renderer/screens/main/hooks/useDiffData.ts(2 hunks)apps/desktop/src/renderer/screens/main/hooks/useSidebar.ts(0 hunks)apps/desktop/src/renderer/screens/main/hooks/useTabs.ts(0 hunks)apps/desktop/src/renderer/screens/main/hooks/useTasks.ts(8 hunks)apps/desktop/src/renderer/screens/main/hooks/useWorkspace.ts(1 hunks)apps/desktop/src/renderer/screens/main/hooks/useWorktrees.ts(2 hunks)apps/desktop/src/renderer/screens/main/types.ts(1 hunks)apps/desktop/src/renderer/screens/main/utils.ts(2 hunks)apps/desktop/src/shared/ipc-channels.ts(0 hunks)apps/desktop/src/shared/ipc-channels/deep-link.ts(0 hunks)apps/desktop/src/shared/ipc-channels/external.ts(0 hunks)apps/desktop/src/shared/ipc-channels/index.ts(1 hunks)apps/desktop/src/shared/ipc-channels/proxy.ts(0 hunks)apps/desktop/src/shared/ipc-channels/tab.ts(1 hunks)apps/desktop/src/shared/ipc-channels/terminal.ts(0 hunks)apps/desktop/src/shared/ipc-channels/types.ts(0 hunks)apps/desktop/src/shared/ipc-channels/window.ts(0 hunks)apps/desktop/src/shared/ipc-channels/workspace.ts(0 hunks)apps/desktop/src/shared/ipc-channels/worktree.ts(0 hunks)apps/website/src/app/components/HeroSection/HeroSection.tsx(1 hunks)apps/website/src/app/components/HeroSection/components/HeroCanvas/components/LitBackground/LitBackground.tsx(1 hunks)apps/website/src/app/page.tsx(1 hunks)packages/ui/src/components/dropdown-menu.tsx(1 hunks)
💤 Files with no reviewable changes (29)
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/WorktreeList.tsx
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/ModeHeader.tsx
- apps/desktop/src/shared/ipc-channels/window.ts
- apps/desktop/src/renderer/contexts/SidebarContext.tsx
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeSwitcher/index.ts
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/index.ts
- apps/desktop/src/shared/ipc-channels.ts
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeHeader/index.ts
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/NewTabButton/index.ts
- apps/desktop/src/renderer/screens/main/hooks/useSidebar.ts
- apps/desktop/src/shared/ipc-channels/worktree.ts
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/index.ts
- apps/desktop/src/shared/ipc-channels/types.ts
- apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/useTaskData.ts
- apps/desktop/src/renderer/screens/main/components/SidebarOverlay/index.ts
- apps/desktop/src/shared/ipc-channels/workspace.ts
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/index.ts
- apps/desktop/src/renderer/screens/main/components/MainContentArea/index.ts
- apps/desktop/src/renderer/screens/main/hooks/useTabs.ts
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeSwitcher/ModeSwitcher.tsx
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollSnap.ts
- apps/desktop/src/shared/ipc-channels/terminal.ts
- apps/desktop/src/renderer/screens/main/components/WorkspaceSelectionModal/index.ts
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useScrollProgress.ts
- apps/desktop/src/shared/ipc-channels/proxy.ts
- apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/constants.ts
- apps/desktop/src/shared/ipc-channels/deep-link.ts
- apps/desktop/src/shared/ipc-channels/external.ts
🧰 Additional context used
🧬 Code graph analysis (11)
apps/desktop/src/renderer/screens/main/components/PlanView/PlanView.tsx (4)
packages/api/src/index.ts (1)
RouterOutputs(9-9)apps/desktop/src/renderer/contexts/WorkspaceContext.tsx (1)
useWorkspaceContext(48-56)apps/desktop/src/renderer/contexts/index.ts (2)
useWorkspaceContext(5-5)useTabContext(3-3)apps/desktop/src/renderer/contexts/TabContext.tsx (1)
useTabContext(51-57)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/ModeCarousel.tsx (1)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeContent/ModeContent.tsx (1)
ModeContent(11-24)
apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/WorktreeItem/WorktreeItemArborist.tsx (1)
apps/desktop/src/shared/types.ts (1)
Tab(44-56)
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/TaskForm.tsx (2)
packages/ui/src/components/select.tsx (1)
Select(177-177)packages/ui/src/components/button.tsx (1)
Button(61-61)
apps/desktop/src/renderer/screens/main/utils.ts (3)
apps/desktop/src/shared/types.ts (2)
Tab(44-56)Worktree(58-68)apps/desktop/src/renderer/screens/main/types.ts (1)
PendingWorktree(17-28)apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/utils.ts (1)
formatRelativeTime(5-19)
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal.tsx (1)
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/useTaskData.ts (1)
useTaskData(6-70)
apps/desktop/src/renderer/screens/main/components/Sidebar/Sidebar.tsx (3)
apps/desktop/src/renderer/contexts/WorkspaceContext.tsx (1)
useWorkspaceContext(48-56)apps/desktop/src/renderer/contexts/TabContext.tsx (1)
useTabContext(51-57)apps/desktop/src/renderer/contexts/WorktreeOperationsContext.tsx (1)
useWorktreeOperationsContext(57-65)
apps/desktop/src/renderer/contexts/WorkspaceContext.tsx (2)
apps/desktop/src/shared/types.ts (1)
Workspace(70-82)apps/desktop/src/renderer/screens/main/hooks/useWorkspace.ts (1)
useWorkspace(9-199)
apps/desktop/src/renderer/contexts/WorktreeOperationsContext.tsx (3)
apps/desktop/src/shared/types.ts (1)
Worktree(58-68)apps/desktop/src/renderer/contexts/WorkspaceContext.tsx (1)
useWorkspaceContext(48-56)apps/desktop/src/renderer/contexts/TabContext.tsx (1)
useTabContext(51-57)
apps/desktop/src/renderer/screens/main/hooks/useTasks.ts (2)
apps/desktop/src/shared/types.ts (1)
Worktree(58-68)apps/desktop/src/renderer/screens/main/types.ts (1)
PendingWorktree(17-28)
apps/desktop/src/renderer/screens/main/components/MainContentArea/MainContentArea.tsx (5)
apps/desktop/src/renderer/screens/main/types.ts (1)
AppMode(30-30)apps/desktop/src/renderer/contexts/WorktreeOperationsContext.tsx (1)
useWorktreeOperationsContext(57-65)apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/types.ts (1)
SidebarMode(4-4)apps/desktop/src/renderer/screens/main/hooks/useDiffData.ts (1)
useDiffData(12-199)apps/desktop/src/renderer/screens/main/components/Sidebar/Sidebar.tsx (1)
Sidebar(22-406)
🪛 GitHub Actions: CI
apps/desktop/src/renderer/screens/main/components/PlanView/PlanView.tsx
[error] 178-178: Cannot find name 'onTabSelect'. Did you mean 'onselect'?
[error] 179-179: Cannot find name 'onTabCreated'.
[error] 189-189: Cannot find name 'onTabSelect'. Did you mean 'onselect'?
[error] 190-190: Cannot find name 'onTabCreated'.
[error] 200-200: Cannot find name 'onTabSelect'. Did you mean 'onselect'?
[error] 201-201: Cannot find name 'onTabCreated'.
[error] 211-211: Cannot find name 'onTabSelect'. Did you mean 'onselect'?
[error] 212-212: Cannot find name 'onTabCreated'.
[error] 222-222: Cannot find name 'onTabSelect'. Did you mean 'onselect'?
[error] 223-223: Cannot find name 'onTabCreated'.
apps/desktop/src/renderer/screens/main/hooks/useDiffData.ts
[error] 135-135: Type '"added" | "deleted" | "modified" | "renamed" | "unchanged"' is not assignable to type '"added" | "deleted" | "modified" | "renamed"'.
apps/desktop/src/renderer/screens/main/components/MainContent/TabContent.tsx
[error] 60-60: Type 'string | null' is not assignable to type 'string | undefined'. Type 'null' is not assignable to type 'string | undefined'.
apps/desktop/src/renderer/screens/main/components/Sidebar/Sidebar.tsx
[error] 228-228: Cannot find name 'onWorktreeCreated'.
[error] 308-308: Cannot find name 'onWorktreeCreated'.
apps/desktop/src/renderer/screens/main/components/Layout/NewLayoutMain.tsx
[error] 723-723: TS2339: Property 'removeListener' does not exist on type '{ invoke: ...; on: (channel: string, listener: (...args: any[]) => void) => void; }'.
[error] 773-773: TS2339: Property 'removeListener' does not exist on type '{ invoke: ...; on: (channel: string, listener: (...args: any[]) => void) => void; }'.
[error] 951-951: Type '{ workspaces: Workspace[]; currentWorkspace: Workspace | null; onTabSelect: (worktreeId: string, tabId: string) => void; onWorktreeCreated: () => Promise; ... 4 more ...; onCollapse: () => void; }' is not assignable to type 'IntrinsicAttributes & SidebarProps'. Property 'workspaces' does not exist on type 'IntrinsicAttributes & SidebarProps'.
[error] 1006-1006: Type '{ currentWorkspace: Workspace | null; selectedWorktreeId: string | null; onTabSelect: (worktreeId: string, tabId: string) => void; onTabCreated: (worktreeId: string, tab: Tab) => void; }' is not assignable to type 'IntrinsicAttributes'. Property 'currentWorkspace' does not exist on type 'IntrinsicAttributes'.
[error] 1029-1029: Type '{ workspaces: Workspace[]; currentWorkspace: Workspace | null; onTabSelect: (worktreeId: string, tabId: string) => void; onWorktreeCreated: () => Promise; ... 4 more ...; onCollapse: () => void; }' is not assignable to type 'IntrinsicAttributes & SidebarProps'. Property 'workspaces' does not exist on type 'IntrinsicAttributes & SidebarProps'.
[error] 1066-1066: Type '{ key: string; groupTab: Tab; workingDirectory: string; workspaceId: string; worktreeId: string | undefined; selectedTabId: string | undefined; onTabFocus: (tabId: string) => void; workspaceName: string; mainBranch: string; }' is not assignable to type 'IntrinsicAttributes & ScreenLayoutProps'. Property 'workingDirectory' does not exist on type 'IntrinsicAttributes & ScreenLayoutProps'.
[error] 1081-1081: Type '{ key: string; groupTab: Tab; workingDirectory: string; workspaceId: string; worktreeId: string | undefined; selectedTabId: string | undefined; onTabFocus: (tabId: string) => void; workspaceName: string; mainBranch: string; }' is not assignable to type 'IntrinsicAttributes & ScreenLayoutProps'. Property 'workingDirectory' does not exist on type 'IntrinsicAttributes & ScreenLayoutProps'.
[error] 1096-1096: Type '{ tab: Tab; workingDirectory: string; workspaceId: string; worktreeId: string | undefined; worktree: Worktree; groupTabId: string; selectedTabId: string | undefined; onTabFocus: (tabId: string) => void; workspaceName: string; mainBranch: string; }' is not assignable to type 'IntrinsicAttributes & TabContentProps'. Property 'workingDirectory' does not exist on type 'IntrinsicAttributes & TabContentProps'.
🔇 Additional comments (70)
apps/desktop/src/renderer/screens/main/components/DiffView/DiffContent.tsx (1)
158-166: Approved: formatting reflow with no functional changes.The conditional className expression for the status badge has been reflowed for improved readability. The ternary logic and resulting Tailwind classes remain identical—this is purely a cosmetic change.
apps/desktop/src/renderer/screens/main/components/SidebarOverlay/SidebarOverlay.tsx (2)
13-15: Formatting change is benign.The removal of the blank line at line 14 is a minor whitespace adjustment with no functional impact on the component logic or behavior.
1-27: PR description and WIP status require clarification.This PR is marked as "Work in Progress" and the description contains only a template with unfilled placeholders. Additionally, the PR branch is named
terminal-not-scrolling-qiwr(suggesting a terminal scrolling issue), but the AI summary describes "extensive formatting and organizational refactoring" across desktop and web apps including "CSS viewport adjustments for terminal scrollbars." This single file shows only a minor whitespace change with no connection to the stated terminal issue.Before proceeding with review:
- Update the PR description with concrete details about what this PR addresses
- Clarify the actual scope: Is this a formatting/refactoring PR or a terminal scrolling bug fix?
- Provide context on related files and the overall PR objective
- Indicate if this PR is ready for review or still under development
apps/desktop/src/renderer/screens/main/constants.ts (1)
5-177: Formatting-only changes with no functional impact.The indentation updates maintain consistency throughout the MOCK_TASKS array without altering data values, object structure, or export behavior.
apps/desktop/src/shared/ipc-channels/tab.ts (1)
5-10: Import formatting looks good.The multi-line import organization improves readability and appears consistent with project formatting standards.
apps/desktop/src/shared/ipc-channels/index.ts (1)
8-15: Import reordering is clean.The reorganized imports (with
WorktreeChannelsmoved) are logically sound. Since these are type-only imports, the ordering has no runtime impact. The interface definitions and public API remain unchanged.apps/desktop/src/renderer/screens/main/components/DiffView/DiffContentArea.tsx (1)
52-57: ✅ Clean formatting improvements enhance readability.The multiline reformatting of conditional checks (lines 52–57, 64–65, 72–76) improves readability without altering logic or control flow. The conditions remain logically sound, dependency arrays are correct, and observer cleanup is properly implemented.
Also applies to: 64-65, 72-76
packages/ui/src/components/dropdown-menu.tsx (1)
7-260: Clean formatting and consistent component composition.All 15 dropdown menu components follow a uniform, well-structured pattern: proper TypeScript typing with
ComponentProps, consistentdata-slotattributes for testing/styling hooks, safe className merging viacn(), and correct prop spreading. The formatting refinement is thorough and maintains readability throughout. No functional changes, no issues with exports, types, or rendering logic.apps/desktop/src/renderer/screens/main/components/WorkspaceSelectionModal/WorkspaceSelectionModal.tsx (3)
32-32: Dialog is intentionally non-closable via UI. Approved formatting change.The
onOpenChange={() => {}}no-op combined withshowCloseButton={false}confirms the dialog is intentionally non-closable from the user interface. The formatting cleanup on line 32 is acceptable.Also applies to: 35-35
41-43: Text wrapping is a minor formatting improvement. Approved.The multi-line wrapping of "Select Workspace" improves code readability without altering the rendered output or component behavior.
1-20: Verify barrel export changes mentioned in AI summary.The AI summary references a change to
apps/desktop/src/renderer/screens/main/components/WorkspaceSelectionModal/index.tsthat removes the public re-export ofWorkspaceSelectionModal, effectively making it non-importable via the barrel. This is a breaking change if external code depends on importing from the directory barrel.Confirm whether this is intentional and document the migration path for affected imports, or reconsider if the export should remain.
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/AnimatedBackground/AnimatedBackground.tsx (1)
22-22: LGTM! Good formatting practice.Adding the trailing comma follows JavaScript/TypeScript best practices and will make future diffs cleaner if this array is extended.
apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/WorktreeItem/components/TabItem/TabItem.tsx (3)
148-154: Code formatting change improves readability without altering logic.The className ternary expression has been reformatted across multiple lines. The conditional logic and styling behavior remain identical to the previous version.
61-125: Event handler implementations are solid.All handlers properly manage event propagation, state transitions, and callback guards. The rename flow (enter via double-click or context menu, exit via Enter/Escape/blur, validate name) is well-structured.
127-207: State management and conditional rendering are correct.Derived state prevents invalid UI states (e.g., "Group" menu item only shows when multiple tabs are selected). Icon selection and edit mode toggling are implemented cleanly.
apps/website/src/app/components/HeroSection/components/HeroCanvas/components/LitBackground/LitBackground.tsx (1)
9-17: LGTM! Clean import organization.The import reorganization groups config imports together and sequences shader imports afterward, improving readability without affecting functionality.
apps/website/src/app/components/HeroSection/HeroSection.tsx (1)
1-3: LGTM! Consistent import ordering.The import reordering follows alphabetical conventions, improving code organization without any functional changes.
apps/website/src/app/page.tsx (2)
4-5: LGTM: Import organization.The new component imports are properly structured and follow the existing pattern. The import reordering improves organization without any functional impact.
Also applies to: 10-10
12-21: Code changes approved.The
FeaturesSectioncomponent correctly accepts theonOpenWaitlistprop with the expected() => voidsignature, and it's properly wired in the button's onClick handler. The state management and callback pattern are clean and type-safe.apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/TaskTabs.tsx (2)
50-51: LGTM: Formatting improves readability.The multi-line formatting of the
availableWidthcalculation makes the subtraction components clearer without changing the logic.
54-59: LGTM: Nested ternary is now more readable.The reformatted
finalWidthcalculation with proper indentation and line breaks makes the min/max clamping logic easier to follow while preserving the exact same behavior.apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/ModeToggle.tsx (1)
14-18: LGTM: Consistent className formatting.The className template literals are now consistently formatted across both buttons, with the conditional expressions on separate lines for clarity. No functional changes.
Also applies to: 25-29
apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/AddTaskButton.tsx (1)
18-23: LGTM: Standard multi-line props formatting.Splitting the Button props across multiple lines follows React best practices and improves readability. No functional changes.
apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/WorktreeTabButton.tsx (3)
40-44: LGTM: Improved className readability.The reformatted conditional className expression is easier to read with the ternary branches on separate lines. No functional changes.
62-65: LGTM: Clearer conditional rendering.The multi-line formatting of the task title conditional makes the two display options more distinct. No functional changes.
80-84: LGTM: Consistent formatting pattern.The close button's conditional className follows the same multi-line formatting pattern as the rest of the file. No functional changes.
apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/WorktreeItem/WorktreeItemArborist.tsx (1)
8-23: LGTM! Import reorganization is clean.The consolidation of lucide-react imports and separation of type/value imports from react-arborist improve readability without affecting functionality.
apps/desktop/src/renderer/screens/main/hooks/useDiffData.ts (1)
109-114: Formatting change approved; no logic alteration.The refactoring of the conditional check across multiple lines (lines 109-112) improves readability without changing behavior.
apps/desktop/src/renderer/screens/main/types.ts (1)
5-13: Type definitions unchanged; formatting-only diff.UITask and PendingWorktree keep the same fields and types; the updated indentation just improves readability and is safe to ship as-is.
Also applies to: 18-27
apps/desktop/src/main/lib/window-state-manager.ts (1)
135-138: Expanded error log is fine; behavior unchanged.Reformatting the
console.errorcall with a clear prefix string preserves behavior and improves log readability.apps/desktop/src/main/lib/worktree-manager.ts (1)
857-860: Diff file exclusion condition unchanged; formatting-only.The reflowed
shouldExcludeFilecondition still correctly skips bothfilePathand (when present)oldPath; no behavioral change here.apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/WorktreeItem/WorktreeItem.tsx (4)
79-105: Merge warning builder remains clear; formatting-only change.The reflowed
warnings.pushstrings still produce the same combined warning text and keep the “proceed anyway” message explicit; no behavior changes here.
524-529: Tree height clamping logic looks good.The
Math.max(TREE_MIN_HEIGHT, Math.min(TREE_MAX_HEIGHT, calculatedHeight))expression is unchanged behavior-wise and still correctly clamps the tree height into the configured min/max range.
991-1005: Group-tab button styling refactor is safe.Rewrapped Tailwind className interpolation for the group-tab button keeps the same selected/hover styling and just improves readability; no issues here.
1099-1105: Drop-prevention rule for group tabs unchanged.The reflowed
disableDroppredicate still correctly prevents dropping a group tab into another group tab; behavior is preserved.apps/desktop/src/renderer/screens/main/components/AppFrame/AppFrame.tsx (1)
6-6: LGTM! Formatting cleanup.The return statement has been condensed to a single line without any functional changes. Both multi-line and single-line JSX are acceptable styles.
apps/desktop/src/renderer/screens/main/components/MainContent/TabGroup.tsx (2)
10-10: LGTM! Import reordering.The hook imports have been reordered alphabetically, which improves consistency without affecting functionality.
20-26: LGTM! Formatting improvements.The added whitespace and multi-line formatting for
workingDirectoryimprove code readability without changing behavior.apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/components/ModeNavigation/ModeNavigation.tsx (1)
39-43: LGTM! Template literal formatting.The className has been reformatted to a multi-line template literal for improved readability. The conditional logic remains unchanged.
apps/desktop/src/renderer/contexts/WorkspaceContext.tsx (1)
6-56: LGTM! Consistent formatting throughout.The entire file has been reformatted with consistent indentation and line breaks. The public API, types, and behavior remain unchanged.
apps/desktop/src/main/lib/window-manager.ts (1)
10-13: LGTM! Type and formatting refinements.The parameter types and function signatures have been reformatted for better readability. No functional changes to the window management logic.
Also applies to: 59-59, 81-84, 116-119
apps/desktop/src/main/lib/workspace-ipcs.ts (2)
13-13: LGTM! Import consolidation.The
windowManagerimport has been centralized at the top of the file, which improves code organization and eliminates duplication.
630-632: LGTM! Formatting adjustment.The
detectMainBranchcall has been reformatted to multi-line for consistency. No functional changes.apps/desktop/src/renderer/screens/main/hooks/useWorkspace.ts (1)
95-96: LGTM! Concise formatting.The IPC invocation has been condensed to a single-line chain for brevity. The behavior remains unchanged.
apps/desktop/src/renderer/globals.css (1)
138-156: Verify terminal scrolling behavior across different layouts and input methods.The xterm.js scrollbar positioning fix is technically correct:
.xtermpositioned relative as container (100% height/width).xterm-viewportwithoverflow-y: autoand absolute positioning (0,0,0,0) creates the scrollable area.xterm-screenpositioned relative for normal content flow- ResizeObserver in Terminal.tsx properly handles container resize with debounce to prevent corruption
- customFit() accounts for padding when calculating terminal dimensions
No conflicting CSS rules found elsewhere in the codebase.
Please manually verify:
- Single terminal scrolling with mouse wheel
- Scrollbars function in mosaic/split layouts (multiple terminals via TabGroup component)
- tmux mouse mode integration works correctly
- No layout shifts or visual artifacts during terminal resize
apps/desktop/src/renderer/screens/main/hooks/useWorktrees.ts (1)
46-51: Worktree cloning and post‑deletion selection logic look solidCloning
refreshedWorkspace.worktreesinto a new array and guarding onworktrees.length > 0before selecting the first worktree are both correct, side‑effect‑free updates that keep React state immutable and avoid null access after deletions.Also applies to: 188-202
apps/desktop/src/renderer/screens/main/components/Layout/NewLayoutMain.tsx (1)
233-251: Task enrichment and minor state/selection tweaks look good
- Mapping
PendingWorktree.taskDatainto thetaskfield (lines 243‑248) produces consistent metadata for pending worktrees and preserves the existing shape.- Typing
addTaskModalInitialModeas"list" | "new"and defaulting to"list"is correct and matches the modal usage.- The extra guard on
refreshedWorkspace.worktrees && refreshedWorkspace.worktrees.length > 0before auto‑selecting a worktree after deletion is defensive and avoids undefined access.- The prefixed log message for worktree creation failures improves observability without behavior change.
No issues here.
Also applies to: 292-294, 531-534, 759-762
apps/desktop/src/renderer/screens/main/components/MainContentArea/MainContentArea.tsx (1)
1-5: New MainContentArea diff/terminal split is coherent and context‑aligned
sidebarMode/selectedFileplusonDiffModeChangekeep Sidebar and main content in sync without prop‑drilling workspace/worktree state.useDiffDatais correctly gated onsidebarMode === "changes" && !!selectedWorktreeId, avoiding unnecessary IPC when in tabs mode.- The “changes” branch uses
DiffContentAreawith full diff controls; the non‑changes branch reuses the same placeholder guard pattern as elsewhere and passes only the new minimal props toTabGroupandTabContent, matching their refactored APIs.I don’t see functional or type‑safety issues in this new structure.
Also applies to: 23-25, 28-55, 56-72, 76-155
apps/desktop/src/renderer/screens/main/hooks/useTasks.ts (3)
44-59: LGTM - Proper cleanup logic added.The cleanup effect correctly removes the IPC listener on unmount, clears any pending timeouts, and resets the progress handling state. This prevents memory leaks and ensures stale event handlers don't fire after the component unmounts.
230-249: LGTM - Defensive cleanup with graceful delay.The finally block properly stops handling progress events and schedules cleanup with a 100ms delay to ensure any queued IPC events are processed before removing the listener. This is a good defensive programming practice.
4-5: LGTM - Formatting improvements.The multi-line type annotations and consistent spacing improve readability without changing functionality.
Also applies to: 14-17, 27-29, 37-39, 51-54, 69-69, 134-137, 146-146, 232-232, 237-237, 241-244
apps/desktop/src/renderer/contexts/WorktreeOperationsContext.tsx (2)
6-6: LGTM - Formatting improvements.Import reordering and multi-line formatting enhance readability without affecting functionality.
Also applies to: 10-13, 20-22, 28-38, 60-62
40-48: Hook signature verified—no issues found.The
useWorktreeshook signature fully accepts all eight parameters being passed from WorktreeOperationsContext. TheUseWorktreesPropsinterface (lines 4–12 in useWorktrees.ts) defines each parameter, and all are actively used throughout the hook's implementation in handlers likehandleDeleteWorktreeandhandleUpdateWorktree. The expanded dependency list is intentional and properly integrated.apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/ModeCarousel.tsx (1)
94-96: LGTM - Concise formatting.Consolidating props to a single line improves readability for this simple component usage.
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/types.ts (1)
1-2: LGTM - Import reordering.Import ordering change with no functional impact.
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/CreatingView.tsx (1)
2-2: LGTM - Import consolidation.Proper import consolidation and whitespace cleanup with no functional changes.
Also applies to: 16-16
apps/desktop/src/renderer/contexts/TabContext.tsx (1)
2-2: LGTM - Concise formatting.Inline provider return and import consolidation improve readability without changing behavior.
Also applies to: 48-48
apps/desktop/src/renderer/contexts/TaskContext.tsx (1)
5-5: LGTM - Type imports and formatting improvements.Proper use of
import typefor type-only imports and concise provider formatting align with best practices.Also applies to: 7-7, 53-53
apps/desktop/src/renderer/screens/main/MainScreen.tsx (1)
4-10: LGTM - Import consolidation.Consolidating all context hook imports from a single source improves maintainability and aligns with the broader context reorganization in this PR.
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/useTaskForm.ts (1)
1-98: LGTM! Formatting improvements enhance readability.The changes are primarily formatting adjustments (import reordering, multiline reformatting). The explicit reset of
cloneTabsFromWorktreeIdat line 54 makes the logic clearer, even though line 57 already handles the reset case.apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/hooks/useModeDetection.ts (1)
39-39: LGTM! Cleaner conditional formatting.The consolidated single-line guard is more concise while maintaining the same logic.
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal.tsx (1)
1-269: LGTM! Formatting improvements throughout.All changes are formatting adjustments (hook destructuring, conditional simplification, prop formatting) with no functional impact.
apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/index.ts (1)
1-2: LGTM! Export organization update.Reordering exported types has no functional impact.
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/TaskForm.tsx (1)
1-221: LGTM! JSX formatting improvements.All changes are formatting adjustments (multiline label text, prop formatting) with no functional impact.
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/utils.ts (1)
1-115: LGTM! Formatting and organization improvements.All changes are formatting adjustments (import reordering, multiline return statements, function signature formatting) with no functional impact.
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/index.ts (1)
1-5: LGTM! Export organization update.Reordering exported types has no functional impact.
apps/desktop/src/renderer/contexts/AppProviders.tsx (1)
3-20: LGTM! Formatting-only changes.The import reorganization and
useStateformatting are cosmetic improvements with no functional impact.apps/desktop/src/renderer/contexts/index.ts (1)
3-10: LGTM! Export reorganization is cosmetic.The reordering of exports and multi-line formatting improve consistency without affecting functionality.
apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/TaskList.tsx (2)
13-13: LGTM! Formatting improvements only.The type import repositioning and multi-line JSX formatting enhance readability without any functional changes.
Also applies to: 91-94, 106-108, 146-149
1-156: Note: Functional changes mentioned in the AI summary are not present in the reviewed files.The AI summary references tmux mouse mode, CSS viewport adjustments, cleanup listeners, and conditional rendering updates. However, the three files provided for review contain only formatting and import/export reorganization changes. If these functional changes exist, they must be in other files not included in this review batch.
| const { selectedWorktreeId, selectedTabId, handleTabFocus } = useTabContext(); | ||
|
|
||
| const selectedWorktree = currentWorkspace?.worktrees?.find( | ||
| (wt) => wt.id === selectedWorktreeId, | ||
| ); | ||
|
|
||
| const workingDirectory = selectedWorktree?.path || currentWorkspace?.repoPath || ""; | ||
|
|
||
| const workingDirectory = | ||
| selectedWorktree?.path || currentWorkspace?.repoPath || ""; | ||
| const workspaceId = currentWorkspace?.id || ""; | ||
| const worktreeId = selectedWorktreeId ?? undefined; |
There was a problem hiding this comment.
Fix TypeScript type error: null vs undefined.
The pipeline reports a type error at line 60 where worktreeId (which can be null) is passed to a prop expecting string | undefined. The issue is that selectedWorktreeId from useTabContext is typed as string | null, but line 39's nullish coalescing may not be sufficient if TypeScript still infers the type as including null.
Apply this fix to ensure proper type conversion:
const { currentWorkspace } = useWorkspaceContext();
-const { selectedWorktreeId, selectedTabId, handleTabFocus } = useTabContext();
+const { selectedWorktreeId: rawWorktreeId, selectedTabId, handleTabFocus } = useTabContext();
const selectedWorktree = currentWorkspace?.worktrees?.find(
(wt) => wt.id === selectedWorktreeId,
);
const workingDirectory =
selectedWorktree?.path || currentWorkspace?.repoPath || "";
const workspaceId = currentWorkspace?.id || "";
-const worktreeId = selectedWorktreeId ?? undefined;
+const selectedWorktreeId = rawWorktreeId ?? undefined;
+const worktreeId = selectedWorktreeId;Or more simply, ensure the type is properly converted:
-const worktreeId = selectedWorktreeId ?? undefined;
+const worktreeId: string | undefined = selectedWorktreeId ?? undefined;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const { selectedWorktreeId, selectedTabId, handleTabFocus } = useTabContext(); | |
| const selectedWorktree = currentWorkspace?.worktrees?.find( | |
| (wt) => wt.id === selectedWorktreeId, | |
| ); | |
| const workingDirectory = selectedWorktree?.path || currentWorkspace?.repoPath || ""; | |
| const workingDirectory = | |
| selectedWorktree?.path || currentWorkspace?.repoPath || ""; | |
| const workspaceId = currentWorkspace?.id || ""; | |
| const worktreeId = selectedWorktreeId ?? undefined; | |
| const { selectedWorktreeId, selectedTabId, handleTabFocus } = useTabContext(); | |
| const selectedWorktree = currentWorkspace?.worktrees?.find( | |
| (wt) => wt.id === selectedWorktreeId, | |
| ); | |
| const workingDirectory = | |
| selectedWorktree?.path || currentWorkspace?.repoPath || ""; | |
| const workspaceId = currentWorkspace?.id || ""; | |
| const worktreeId: string | undefined = selectedWorktreeId ?? undefined; |
🤖 Prompt for AI Agents
In apps/desktop/src/renderer/screens/main/components/MainContent/TabContent.tsx
around lines 30 to 39, selectedWorktreeId is typed as string | null but
worktreeId must be string | undefined; fix by explicitly mapping null to
undefined and giving worktreeId the correct type, e.g. declare worktreeId with a
string | undefined annotation and assign selectedWorktreeId ?? undefined (or use
a conditional selectedWorktreeId === null ? undefined : selectedWorktreeId) so
TypeScript no longer infers a possible null.
| export const PlanView: React.FC<PlanViewProps> = () => { | ||
| const { currentWorkspace } = useWorkspaceContext(); | ||
| const { selectedWorktreeId, handleTabSelect, handleTabCreated } = useTabContext(); | ||
| const { selectedWorktreeId, handleTabSelect, handleTabCreated } = | ||
| useTabContext(); | ||
| // Initialize with mock tasks and add some variety to statuses |
There was a problem hiding this comment.
Fix onTabSelect / onTabCreated name mismatch breaking PlanView
useTabContext exposes handleTabSelect and handleTabCreated, and you already use those names for <TaskPage>. The Kanban columns still refer to onTabSelect/onTabCreated, which are undefined and cause the TS errors.
Update the column props to use the correct handlers:
<KanbanColumn
title="Backlog"
tasks={tasksByStatus.backlog}
onTaskClick={setViewingTask}
statusColor="bg-neutral-500"
currentWorkspace={currentWorkspace}
selectedWorktreeId={selectedWorktreeId}
- onTabSelect={onTabSelect}
- onTabCreated={onTabCreated}
+ onTabSelect={handleTabSelect}
+ onTabCreated={handleTabCreated}
onUpdateTask={handleUpdateTask}
/>
...
<KanbanColumn
title="Todo"
tasks={tasksByStatus.todo}
onTaskClick={setViewingTask}
statusColor="bg-blue-500"
currentWorkspace={currentWorkspace}
selectedWorktreeId={selectedWorktreeId}
- onTabSelect={onTabSelect}
- onTabCreated={onTabCreated}
+ onTabSelect={handleTabSelect}
+ onTabCreated={handleTabCreated}
onUpdateTask={handleUpdateTask}
/>
...
<KanbanColumn
title="Pending"
tasks={tasksByStatus.planning}
onTaskClick={setViewingTask}
statusColor="bg-yellow-500"
currentWorkspace={currentWorkspace}
selectedWorktreeId={selectedWorktreeId}
- onTabSelect={onTabSelect}
- onTabCreated={onTabCreated}
+ onTabSelect={handleTabSelect}
+ onTabCreated={handleTabCreated}
onUpdateTask={handleUpdateTask}
/>
...
<KanbanColumn
title="Needs Feedback"
tasks={tasksByStatus["needs-feedback"]}
onTaskClick={setViewingTask}
statusColor="bg-orange-500"
currentWorkspace={currentWorkspace}
selectedWorktreeId={selectedWorktreeId}
- onTabSelect={onTabSelect}
- onTabCreated={onTabCreated}
+ onTabSelect={handleTabSelect}
+ onTabCreated={handleTabCreated}
onUpdateTask={handleUpdateTask}
/>
...
<KanbanColumn
title="Completed"
tasks={tasksByStatus.completed}
onTaskClick={setViewingTask}
statusColor="bg-green-600"
currentWorkspace={currentWorkspace}
selectedWorktreeId={selectedWorktreeId}
- onTabSelect={onTabSelect}
- onTabCreated={onTabCreated}
+ onTabSelect={handleTabSelect}
+ onTabCreated={handleTabCreated}
onUpdateTask={handleUpdateTask}
/>This will resolve all the “Cannot find name 'onTabSelect' / 'onTabCreated'” errors and keep PlanView consistent with the context API.
Also applies to: 171-225
🤖 Prompt for AI Agents
In apps/desktop/src/renderer/screens/main/components/PlanView/PlanView.tsx
around lines 16-20 (and also apply changes in the Kanban column areas at
~171-225), the column props still reference onTabSelect/onTabCreated which are
undefined; replace those props with the correct context handler names
handleTabSelect and handleTabCreated (e.g., pass handleTabSelect to the column
onSelect prop and handleTabCreated to the column onCreate prop) so the Kanban
columns use the exported handlers from useTabContext and the TypeScript errors
go away.
| useSidebarContext, | ||
| useTabContext, | ||
| useWorkspaceContext, | ||
| useWorktreeOperationsContext, | ||
| useSidebarContext, | ||
| } from "../../../../contexts"; | ||
| import { useDiffData } from "../../hooks"; | ||
| import { FileTree } from "../DiffView"; | ||
| import type { FileDiff } from "../DiffView/types"; | ||
| import { | ||
| CreateWorktreeModal, | ||
| WorktreeList, | ||
| } from "./components"; | ||
| import { CreateWorktreeModal, WorktreeList } from "./components"; | ||
| import { ModeCarousel, type SidebarMode } from "./components/ModeCarousel"; |
There was a problem hiding this comment.
Fix stale onWorktreeCreated references after switching to context
Sidebar now gets handleWorktreeCreated from useWorktreeOperationsContext, but handleSubmitWorktree and handleScanWorktrees still call an undefined onWorktreeCreated(), which breaks the build.
Update both call sites to use the context function:
- // Reset modal state and close
+ // Reset modal state and close
setShowWorktreeModal(false);
setTitle("");
setBranchName("");
setSourceBranch("");
setCloneTabsFromWorktreeId("");
setDescription("");
setSetupStatus(undefined);
setSetupOutput(undefined);
- onWorktreeCreated();
+ handleWorktreeCreated();
...
if (result.success) {
if (result.imported && result.imported > 0) {
- onWorktreeCreated();
+ handleWorktreeCreated();
}This aligns Sidebar with the new WorktreeOperationsContext‑driven API and resolves the TS errors.
Also applies to: 26-32, 205-245, 295-318
🤖 Prompt for AI Agents
In apps/desktop/src/renderer/screens/main/components/Sidebar/Sidebar.tsx around
lines 6-15 (and also at the other affected ranges 26-32, 205-245, 295-318), the
component still calls the old onWorktreeCreated() handler which is undefined
after switching to WorktreeOperationsContext; replace those calls with the
context-provided handleWorktreeCreated (or the exact export name from
useWorktreeOperationsContext, e.g. handleWorktreeCreated) so
handleSubmitWorktree and handleScanWorktrees invoke the context function instead
of onWorktreeCreated, and remove any leftover onWorktreeCreated
references/imports to satisfy TypeScript and fix the build.
Auto-committed for PR creation
Description
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Summary by CodeRabbit
New Features
Bug Fixes
Style