Skip to content

Fix terminal scrolling#90

Closed
Kitenite wants to merge 1 commit intomainfrom
terminal-not-scrolling-qiwr
Closed

Fix terminal scrolling#90
Kitenite wants to merge 1 commit intomainfrom
terminal-not-scrolling-qiwr

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Nov 16, 2025

Auto-committed for PR creation

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • New Features

    • Enabled mouse mode support for improved terminal interaction and scrolling.
  • Bug Fixes

    • Improved terminal resizing and rendering calculations for better display accuracy.
    • Enhanced terminal scrollbar positioning and viewport handling.
    • Added cleanup for terminal event listeners to prevent memory leaks.
  • Style

    • Refactored code formatting and import organization across multiple components for improved consistency.

Auto-committed for PR creation
@Kitenite Kitenite changed the title Work in progress Fix terminal scrolling Nov 16, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 16, 2025

Walkthrough

Extensive 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

Cohort / File(s) Summary
tmux and window management
apps/desktop/src/main/lib/tmux-manager.ts, apps/desktop/src/main/lib/window-manager.ts, apps/desktop/src/main/lib/window-state-manager.ts, apps/desktop/src/main/lib/workspace-ipcs.ts, apps/desktop/src/main/lib/worktree-manager.ts
Formatting, whitespace, and import consolidation; tmux mouse mode enabled; no control-flow changes.
Context providers and hooks
apps/desktop/src/renderer/contexts/AppProviders.tsx, apps/desktop/src/renderer/contexts/SidebarContext.tsx, apps/desktop/src/renderer/contexts/TabContext.tsx, apps/desktop/src/renderer/contexts/TaskContext.tsx, apps/desktop/src/renderer/contexts/WorkspaceContext.tsx, apps/desktop/src/renderer/contexts/WorktreeOperationsContext.tsx, apps/desktop/src/renderer/contexts/index.ts
Import reordering, provider return reformatting, multiline type annotations expanded, hook dependency list updated in WorktreeOperationsContext.
Terminal and viewport styling
apps/desktop/src/renderer/globals.css
Replaces xterm sizing approach with explicit scrollbar-friendly viewport positioning and relative positioning for screen container.
Main screen and layout components
apps/desktop/src/renderer/screens/main/MainScreen.tsx, apps/desktop/src/renderer/screens/main/components/AppFrame/AppFrame.tsx, apps/desktop/src/renderer/screens/main/components/Layout/NewLayoutMain.tsx
Consolidates context hook imports; reformats JSX returns; modifies placeholder render guard (removes loading condition from guard).
Diff and task UI components
apps/desktop/src/renderer/screens/main/components/DiffView/DiffContent.tsx, apps/desktop/src/renderer/screens/main/components/DiffView/DiffContentArea.tsx, apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal.tsx, apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/... (CreatingView, TaskForm, TaskList, types, useTaskData, useTaskForm, utils)
Formatting, import reorganization, TaskList props expanded for state wiring, type export reordering.
Task tab components
apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/AddTaskButton.tsx, apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/ModeToggle.tsx, apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/TaskTabs.tsx, apps/desktop/src/renderer/screens/main/components/Layout/TaskTabs/WorktreeTabButton.tsx
Multiline prop formatting and conditional className reflow; no logic changes.
Main content and terminal components
apps/desktop/src/renderer/screens/main/components/MainContent/TabContent.tsx, apps/desktop/src/renderer/screens/main/components/MainContent/TabGroup.tsx, apps/desktop/src/renderer/screens/main/components/MainContent/Terminal.tsx
Import reordering; Terminal.tsx updates fit logic to use custom resize calculation reading xterm core dimensions and container padding; applies history write callback for scroll behavior.
Content area and plan view
apps/desktop/src/renderer/screens/main/components/MainContentArea/MainContentArea.tsx, apps/desktop/src/renderer/screens/main/components/MainContentArea/index.ts, apps/desktop/src/renderer/screens/main/components/PlanView/PlanView.tsx
Import reordering; MainContentArea/index.ts removes public re-export; PlanViewProps changes from interface to type alias.
Sidebar and mode carousel
apps/desktop/src/renderer/screens/main/components/Sidebar/Sidebar.tsx, apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeCarousel/* (ModeCarousel, AnimatedBackground, ModeContent, ModeHeader, ModeNavigation, constants, hooks, index, types), apps/desktop/src/renderer/screens/main/components/Sidebar/components/ModeSwitcher/*
Import reorganization; trailing blank lines removed; export reordering and removals (AnimatedBackground, ModeContent/index removed from public exports); minified type/mode export declarations.
Worktree list and tab item components
apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/... (WorktreeList, WorktreeItem, WorktreeItemArborist, TabItem), apps/desktop/src/renderer/screens/main/components/Sidebar/components/WorktreeList/components/NewTabButton/index.ts
Formatting and import consolidation; NewTabButton/index.ts removes public re-export; WorktreeItemArborist normalizes react-arborist imports.
Overlay and modal components
apps/desktop/src/renderer/screens/main/components/SidebarOverlay/..., apps/desktop/src/renderer/screens/main/components/WorkspaceSelectionModal/...
Index files remove public re-exports of SidebarOverlay and WorkspaceSelectionModal; minor JSX formatting.
Main screen utilities and types
apps/desktop/src/renderer/screens/main/constants.ts, apps/desktop/src/renderer/screens/main/hooks/useDiffData.ts, apps/desktop/src/renderer/screens/main/hooks/useSidebar.ts, apps/desktop/src/renderer/screens/main/hooks/useTabs.ts, apps/desktop/src/renderer/screens/main/hooks/useTasks.ts, apps/desktop/src/renderer/screens/main/hooks/useWorkspace.ts, apps/desktop/src/renderer/screens/main/hooks/useWorktrees.ts
Formatting and blank line removal; useTasks.ts adds cleanup effect for IPC progress listener on unmount.
Main screen types and utilities
apps/desktop/src/renderer/screens/main/types.ts, apps/desktop/src/renderer/screens/main/utils.ts
Indentation adjustments; enrichWorktreesWithTasks signature updated for pendingWorktrees parameter.
Shared IPC channels
apps/desktop/src/shared/ipc-channels.ts, apps/desktop/src/shared/ipc-channels/... (deep-link, external, index, proxy, tab, terminal, types, window, workspace, worktree)
Trailing blank line removals and minor import reordering; no functional changes to type definitions.
Website components
apps/website/src/app/components/HeroSection/HeroSection.tsx, apps/website/src/app/components/HeroSection/components/HeroCanvas/components/LitBackground/LitBackground.tsx, apps/website/src/app/page.tsx
Import reordering; FeaturesSection wired with onOpenWaitlist callback; GEOMETRY_CONFIG import consolidated.
UI dropdown component
packages/ui/src/components/dropdown-menu.tsx
Indentation and formatting adjustments across all subcomponents; no behavioral 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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Areas requiring extra attention:

  • apps/desktop/src/renderer/screens/main/components/MainContent/Terminal.tsx — Core resize logic refactored from fitAddon.proposeDimensions() to custom calculation; verify xterm cell dimensions and padding calculation are correct for various terminal sizes and container states.
  • apps/desktop/src/renderer/screens/main/hooks/useTasks.ts — New cleanup effect added for IPC progress listeners; confirm cleanup callbacks properly deregister listeners on unmount to prevent dangling references.
  • apps/desktop/src/renderer/screens/main/components/Layout/NewLayoutMain.tsx — Placeholder render guard modified (loading condition removed); verify intended behavior when loading is true but other error conditions are false.
  • apps/desktop/src/renderer/screens/main/components/Layout/AddTaskModal/TaskList.tsx — TaskListProps expanded significantly with additional state/callbacks; confirm all new props are properly wired and used.
  • Multiple index.ts files removing public re-exports — Verify downstream imports or consumers are updated to import directly from component files rather than barrel files (affects AnimatedBackground, ModeContent, NewTabButton, SidebarOverlay, WorkspaceSelectionModal).

Possibly related PRs

  • carousel #74 — Modifies the same Sidebar ModeCarousel area (files, exports, and index reorganization around ModeCarousel, AnimatedBackground, and barrel exports).
  • Tabs creation and management #78 — Touches the same task/IPC listener code (useTasks, AddTaskModal) and modifies terminal/task creation behavior with branch management and progress tracking.
  • open new window #59 — Restructures tmux-manager.ts (same module as this PR's mouse mode enablement) to add per-terminal window tracking and register/unregister APIs.

Poem

🐰 Twitching nose at tangled imports so fine,
Hopping through contexts, each line in a line.
Mouse mode in tmux! The scrollbars align—
Cleanup the listeners, let terminals shine.
When exports reorder and formats align,
A rabbit reviews and says "Code looks divine!" 🌟

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is almost entirely an unfilled template with placeholders; no concrete details about changes, type of change, testing, or related issues are provided. Complete the description by filling in concrete details: describe the terminal scrolling fix, select the type of change, document testing steps, link any related issues, and remove the 'Auto-committed' note.
Docstring Coverage ⚠️ Warning Docstring coverage is 17.50% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Fix terminal scrolling' is specific and directly related to the primary change (Terminal.tsx modifications implementing a custom resize calculation and scroll-to-bottom fix).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch terminal-not-scrolling-qiwr

Comment @coderabbitai help to get the list of available commands and usage tips.

@Kitenite Kitenite closed this Nov 16, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the result variable to resolve type inference issues.

The result variable from the IPC handler lacks an explicit type annotation, preventing TypeScript from properly narrowing result.changes to the expected DiffLine[] type. Although the IPC response type definition in apps/desktop/src/shared/ipc-channels/worktree.ts defines 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: async mkdir with sync writeFileSync.

mkdir from "node:fs/promises" returns a Promise, but it’s called without await just before writeFileSync. 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: Tmux mouse option not applied to restored sessions.

Verification confirms the concern: in ensureSessionExists (line 122), applySessionSettings is called only when a session is newly created (if (hasSession.status !== 0)). When sessions are restored from disk in initialize() (line 102), the session already exists, so applySessionSettings is skipped and the mouse setting 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 generated id={targetBranchSelectId} from useId(), 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: Replace ipcRenderer.removeListener() with off() and fix component prop mismatches

Four critical CI-blocking type errors:

  1. Lines 723, 773: window.ipcRenderer.removeListener() does not exist on your exposed IPC API. Use off() instead:
-			window.ipcRenderer.removeListener(
-				"worktree-setup-progress",
-				progressHandler,
-			);
+			window.ipcRenderer.off("worktree-setup-progress", progressHandler);
  1. Lines 1005–1010: PlanView accepts no props (type PlanViewProps = {}). Update to:
-							<PlanView
-								currentWorkspace={currentWorkspace}
-								selectedWorktreeId={selectedWorktreeId}
-								onTabSelect={handleTabSelect}
-								onTabCreated={handleTabCreated}
-							/>
+							<PlanView />
  1. Lines 950–955, 1028–1033: Sidebar now only accepts isDragging? and onDiffModeChange?. Remove all other props (workspaces, currentWorkspace, onTabSelect, onWorktreeCreated, onWorkspaceSelect, etc.) to match the new interface.

  2. Lines 1063–1075, 1094–1107: TabGroup and TabContent props are out of sync. Simplify to match MainContentArea pattern:

    • TabGroup: only pass groupTab
    • TabContent: only pass tab and groupTabId
🧹 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 handleMove and renderNode to use TreeNodeData in 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

  • findTabRecursive correctly handles both top‑level and group tabs and returns the parent for group children, matching how selectedTab/parentGroupTab are consumed elsewhere.
  • enrichWorktreesWithTasks cleanly combines pending worktrees and real worktrees into a single WorktreeWithTask[], deriving status from Worktree fields and using formatRelativeTime for lastUpdated. This keeps task metadata consistent with the underlying worktree state.

You now have another enrichWorktreesWithTasks implementation in NewLayoutMain.tsx based on MOCK_TASKS. To avoid drift, it would be better to have a single canonical implementation (likely this one in utils.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 internals

The new customFit logic that:

  • reads the container’s bounding rect,
  • subtracts any .xterm-screen padding, and
  • derives cols/rows from the rendered cell width/height,

is sound and should give more stable sizing with scrollbars than relying on FitAddon.fit(). Using the term.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 to FitAddon.proposeDimensions() or another public API if _core stops matching this shape.

Also applies to: 347-352, 510-514

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 04bcd04 and 3a58f7c.

📒 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:

  1. Update the PR description with concrete details about what this PR addresses
  2. Clarify the actual scope: Is this a formatting/refactoring PR or a terminal scrolling bug fix?
  3. Provide context on related files and the overall PR objective
  4. 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 WorktreeChannels moved) 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, consistent data-slot attributes for testing/styling hooks, safe className merging via cn(), 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 with showCloseButton={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.ts that removes the public re-export of WorkspaceSelectionModal, 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 FeaturesSection component correctly accepts the onOpenWaitlist prop with the expected () => void signature, 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 availableWidth calculation makes the subtraction components clearer without changing the logic.


54-59: LGTM: Nested ternary is now more readable.

The reformatted finalWidth calculation 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.error call 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 shouldExcludeFile condition still correctly skips both filePath and (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.push strings 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 disableDrop predicate 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 workingDirectory improve 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 windowManager import has been centralized at the top of the file, which improves code organization and eliminates duplication.


630-632: LGTM! Formatting adjustment.

The detectMainBranch call 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:

  • .xterm positioned relative as container (100% height/width)
  • .xterm-viewport with overflow-y: auto and absolute positioning (0,0,0,0) creates the scrollable area
  • .xterm-screen positioned 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:

  1. Single terminal scrolling with mouse wheel
  2. Scrollbars function in mosaic/split layouts (multiple terminals via TabGroup component)
  3. tmux mouse mode integration works correctly
  4. 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 solid

Cloning refreshedWorkspace.worktrees into a new array and guarding on worktrees.length > 0 before 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.taskData into the task field (lines 243‑248) produces consistent metadata for pending worktrees and preserves the existing shape.
  • Typing addTaskModalInitialMode as "list" | "new" and defaulting to "list" is correct and matches the modal usage.
  • The extra guard on refreshedWorkspace.worktrees && refreshedWorkspace.worktrees.length > 0 before 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/selectedFile plus onDiffModeChange keep Sidebar and main content in sync without prop‑drilling workspace/worktree state.
  • useDiffData is correctly gated on sidebarMode === "changes" && !!selectedWorktreeId, avoiding unnecessary IPC when in tabs mode.
  • The “changes” branch uses DiffContentArea with full diff controls; the non‑changes branch reuses the same placeholder guard pattern as elsewhere and passes only the new minimal props to TabGroup and TabContent, 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 useWorktrees hook signature fully accepts all eight parameters being passed from WorktreeOperationsContext. The UseWorktreesProps interface (lines 4–12 in useWorktrees.ts) defines each parameter, and all are actively used throughout the hook's implementation in handlers like handleDeleteWorktree and handleUpdateWorktree. 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 type for 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 cloneTabsFromWorktreeId at 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 useState formatting 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.

Comment on lines 30 to 39
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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
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.

Comment on lines 16 to 20
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

Comment on lines +6 to 15
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";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

@Kitenite Kitenite deleted the terminal-not-scrolling-qiwr branch November 19, 2025 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant