Skip to content

setupTab loading spinner#156

Merged
Kitenite merged 2 commits intomainfrom
jade-canyon-28
Nov 27, 2025
Merged

setupTab loading spinner#156
Kitenite merged 2 commits intomainfrom
jade-canyon-28

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Nov 27, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Fixed setup tab completion and auto-close behavior to function properly across workspace tabs, even when not actively displayed.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 27, 2025

Walkthrough

The PR modifies the TabsContent component to render all Setup-type tabs in the DOM simultaneously, keeping them mounted but hidden when inactive, instead of rendering only the active tab. A memoized filter collects Setup tabs matching the current workspace, and each tab is conditionally displayed based on whether its ID matches the active tab ID.

Changes

Cohort / File(s) Summary
TabsContent Rendering Refactor
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx
Introduces memoized filter to collect all Setup-type tabs by workspace ID; replaces single active tab rendering with all setup tabs wrapped in conditionally hidden containers; adds comments documenting the mounted-tabs pattern to preserve completion and auto-close behavior

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Single file modified with localized, consistent logic changes
  • Memoization pattern is straightforward and follows established React patterns
  • Conditional rendering logic is clear and easy to validate
  • Primary concern: verify memoization dependency array is correct to avoid stale filters

Possibly related PRs

  • fix worktree setup #146: Introduces SetupTabView handling for the active tab; this PR extends that foundation by rendering all setup tabs while keeping them mounted.
  • conditional render #152: Previously simplified to single-tab rendering; this PR reverses that approach by rendering all Setup-type tabs with conditional visibility.
  • keep terminal tabs rendered #147: Also implements a kept-mounted pattern for non-active tabs to preserve UI state and behavior across tab switches.

Poem

🐰 Tabs now dance in DOM's delight,
All mounted, some hidden from sight,
Setup tabs complete their dance,
Auto-close gets its second chance, 🎭
Performance and behavior, just right!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning The pull request has no description provided by the author, missing all required sections from the template. Add a comprehensive pull request description following the template, including: clear description of changes, related issue links, type of change classification, testing details, and any additional context needed for review.
Title check ❓ Inconclusive The title 'setupTab loading spinner' is too vague and does not clearly describe the actual changes made to the file. The PR actually modifies how setup tabs are rendered and kept mounted, but the title only mentions a loading spinner which is not the primary focus of the changes. Consider a more descriptive title such as 'Keep setup tabs mounted for completion and auto-close behavior' or 'Render all setup tabs while keeping inactive ones hidden' to better reflect the core changes.
✨ 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 jade-canyon-28

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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

🧹 Nitpick comments (2)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx (2)

34-41: Setup tabs filtering logic is correct.

The memoization correctly filters setup tabs by workspace. The type predicate combines type narrowing with workspace filtering, which is functionally correct and concise.

If you prefer a stricter separation of concerns, you could split the type predicate from the workspace filter:

-	const setupTabs = useMemo(() => {
-		if (!activeWorkspaceId) return [];
-		return allTabs.filter(
-			(tab): tab is SetupTab =>
-				tab.type === TabType.Setup && tab.workspaceId === activeWorkspaceId,
-		);
-	}, [allTabs, activeWorkspaceId]);
+	const setupTabs = useMemo(() => {
+		if (!activeWorkspaceId) return [];
+		return allTabs
+			.filter((tab): tab is SetupTab => tab.type === TabType.Setup)
+			.filter(tab => tab.workspaceId === activeWorkspaceId);
+	}, [allTabs, activeWorkspaceId]);

This makes the type predicate purely about type narrowing, with workspace filtering as a separate step. However, the current implementation is acceptable and more concise.


49-54: Hidden setup tabs in empty state work as designed.

The logic correctly keeps setup tabs mounted (but hidden) when there's no active tab, allowing them to complete and auto-close as intended.

For improved accessibility, consider adding aria-hidden="true" to hidden setup tabs so they're excluded from the accessibility tree:

-				{setupTabs.map((tab) => (
-					<div key={tab.id} className="hidden">
-						<SetupTabView tab={tab} />
-					</div>
-				))}
+				{setupTabs.map((tab) => (
+					<div key={tab.id} className="hidden" aria-hidden="true">
+						<SetupTabView tab={tab} />
+					</div>
+				))}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c1c25e and dec1638.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx,js,jsx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Biome formatting, linting, and import organization at the root level for all code files

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Avoid using any type; use type-safe approaches instead, unless necessary
Ensure TypeScript type checking passes across all packages using bun run typecheck

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx
apps/**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

apps/**/*.{tsx,ts}: Structure React applications with one folder per component following the pattern: ComponentName/ComponentName.tsx with index.ts barrel export
Co-locate component dependencies (hooks, utils, constants, tests, stories) next to the file using them

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx
apps/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use one component per file; do not create multi-component files

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx
apps/desktop/src/renderer/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Define keyboard shortcuts using the centralized system in apps/desktop/src/renderer/lib/shortcuts.ts with Arc Browser-inspired shortcut definitions

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx
apps/desktop/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

For Electron interprocess communication, ALWAYS use tRPC as defined in src/lib/trpc

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx
apps/desktop/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

apps/desktop/**/*.{ts,tsx}: Please use alias as defined in tsconfig.json when possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary

Files:

  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx
🧬 Code graph analysis (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx (5)
apps/desktop/src/renderer/stores/tabs/types.ts (1)
  • SetupTab (27-32)
apps/desktop/src/shared/types.ts (1)
  • TabType (23-30)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/useTabContentDrop.ts (1)
  • useTabContentDrop (6-36)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/EmptyTabView.tsx (1)
  • EmptyTabView (1-18)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/SetupTabView.tsx (1)
  • SetupTabView (8-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (2)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/index.tsx (2)

3-3: LGTM!

The SetupTab type import enables type-safe filtering in the setupTabs memoization.


61-69: Conditional rendering logic is correct and achieves the intended behavior.

The implementation successfully keeps all setup tabs mounted while conditionally showing only the active one. The logic correctly handles:

  • Active setup tabs (visible with full dimensions)
  • Inactive setup tabs (hidden but mounted for background completion)
  • Non-setup active tabs (setup tabs hidden while Single/Group tabs render normally)

The performance trade-off of keeping all setup tabs mounted is intentional and necessary for the completion/auto-close functionality.

As per coding guidelines, consider adding aria-hidden="true" to hidden containers for accessibility:

-			{setupTabs.map((tab) => (
-				<div
-					key={tab.id}
-					className={tabToRender.id === tab.id ? "h-full w-full" : "hidden"}
-				>
-					<SetupTabView tab={tab} />
-				</div>
-			))}
+			{setupTabs.map((tab) => (
+				<div
+					key={tab.id}
+					className={tabToRender.id === tab.id ? "h-full w-full" : "hidden"}
+					aria-hidden={tabToRender.id !== tab.id}
+				>
+					<SetupTabView tab={tab} />
+				</div>
+			))}

Display a spinning loader icon next to setup tab titles to indicate
the setup process is running.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Kitenite Kitenite changed the title jade canyon 28 setupTab loading spinner Nov 27, 2025
@Kitenite Kitenite merged commit c235eb3 into main Nov 27, 2025
2 of 5 checks passed
@Kitenite Kitenite deleted the jade-canyon-28 branch November 27, 2025 02:03
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