Skip to content

feat(desktop): add workspace settings section with project/workspace navigation#247

Merged
Kitenite merged 9 commits intomainfrom
lavender-river-34
Dec 3, 2025
Merged

feat(desktop): add workspace settings section with project/workspace navigation#247
Kitenite merged 9 commits intomainfrom
lavender-river-34

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Dec 3, 2025

Summary

  • Add new Workspace settings section showing workspace name (editable), branch info, worktree path, and scripts configuration
  • Enhance settings sidebar with hierarchical project/workspace list for navigation between workspaces
  • Add ConfigFilePreview component to display config.json template and link to scripts documentation

Test plan

  • Open settings and verify Workspace section is shown by default
  • Click on different workspaces in sidebar to switch between them
  • Verify workspace name can be edited inline
  • Verify branch info shows correctly with rebase status if applicable
  • Verify scripts section shows config file preview with correct path

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added workspace settings management with rename capability.
    • Configuration file preview for project scripts display.
    • Enhanced workspace details display showing branch and git status.
  • UI Improvements

    • Reorganized settings sidebar with dedicated workspace and project sections.
    • Integrated workspace and project information throughout the app.

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

…navigation

Add a new Workspace settings section that allows users to view and edit workspace details including name, branch, path, and scripts configuration. The settings sidebar now shows a hierarchical project/workspace list for easy navigation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
website Ready Ready Preview Comment Dec 3, 2025 2:00am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 3, 2025

Warning

Rate limit exceeded

@Kitenite has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between dffde86 and 4d49af5.

📒 Files selected for processing (14)
  • apps/desktop/src/lib/trpc/routers/config/config.ts (2 hunks)
  • apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/AppearanceSettings.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/ProjectSettings/ProjectSettings.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/ProjectSettings/index.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx (2 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx (0 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar/GeneralSettings.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar/ProjectsSettings.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar/SettingsSidebar.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar/index.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/components/ThemeCard/index.ts (0 hunks)
  • apps/desktop/src/renderer/stores/app-state.ts (2 hunks)

Walkthrough

The PR introduces a workspace settings section with inline renaming capability and config file preview. Backend TRPC endpoints now embed associated project and worktree data in workspace responses. The settings navigation is refactored to use TRPC-driven workspace grouping, and the SettingsSection type is expanded to include the new workspace section.

Changes

Cohort / File(s) Summary
TRPC Backend Workspace Updates
apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts
Augments workspace projection and getActive responses to resolve and embed project (id, name, mainRepoPath) and worktree (branch, gitStatus) entities from the database; retains computed worktreePath.
Config File Preview Component
apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx
New React TSX component that renders a styled preview card displaying project path, config file link, template block, and a Learn how to use scripts button.
Config File Preview Exports
apps/desktop/src/renderer/components/ConfigFilePreview/index.ts
Barrel export consolidating ConfigFilePreview component and ConfigFilePreviewProps type.
Workspace Settings Component
apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx
New component managing workspace settings UI with inline rename, worktree branch display, path section, and integrated config file preview; queries active workspace and config path via TRPC.
Workspace Settings Exports
apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/index.ts
Barrel export for WorkspaceSettings component.
Settings Navigation Refactor
apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx
Replaces static sections with TRPC-driven workspace navigation; adds project grouping, expand/collapse state, and workspace selection; preserves General settings section with keyboard and appearance options.
Settings Content Integration
apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx
Adds conditional rendering of WorkspaceSettings when active section is "workspace".
Settings State Model
apps/desktop/src/renderer/stores/app-state.ts
Expands SettingsSection type to include "workspace" option; updates initial app state to start with workspace section.
Configuration Constants
apps/desktop/src/shared/constants.ts
Adds three new constants: PROJECT_SUPERSET_DIR_NAME (".superset"), CONFIG_FILE_NAME ("config.json"), and CONFIG_TEMPLATE (JSON structure with setup/teardown arrays).

Sequence Diagram

sequenceDiagram
    participant User
    participant SettingsSidebar
    participant TRPC
    participant SettingsContent
    participant WorkspaceSettings
    participant ConfigFilePreview

    User->>SettingsSidebar: Click workspace item
    SettingsSidebar->>TRPC: Fetch grouped workspaces & activeWorkspace
    TRPC-->>SettingsSidebar: Return workspaces with project & worktree data
    SettingsSidebar->>SettingsSidebar: setActiveWorkspace, switch to workspace section
    SettingsSidebar->>SettingsContent: Render (activeSection = "workspace")
    SettingsContent->>WorkspaceSettings: Render component
    WorkspaceSettings->>TRPC: Query active workspace + config file path
    TRPC-->>WorkspaceSettings: Return workspace (with project/worktree) + configFilePath
    WorkspaceSettings->>ConfigFilePreview: Render config preview (if project exists)
    ConfigFilePreview-->>WorkspaceSettings: Display template & config path
    WorkspaceSettings-->>User: Show settings UI with rename, branch, scripts
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • SettingsSidebar: Significant refactoring with TRPC integration, state management for expand/collapse, and workspace selection logic
  • WorkspaceSettings: New component with rename state/hooks, TRPC queries, and conditional rendering based on loading state
  • TRPC workspace router: Data embedding logic to resolve and include project and worktree entities
  • ConfigFilePreview: New component with styling and button integration

Possibly related PRs

  • #127: Workspace rename UX and logic; directly addresses inline workspace renaming capability
  • #211: Modifies worktree path construction in workspace responses; potential interaction with worktreePath computation
  • #198: Worktree data fetching patterns in TRPC workspace queries; shares same data-resolution approach

Poem

🐰 Spaces for work, now nestled deep,
With rename whispers, config to keep,
Projects grouped by color's cheer,
Settings bloom—workspace premiere!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 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 ❓ Inconclusive The PR description includes a clear summary of changes and a comprehensive test plan, but does not follow the provided template structure with Description, Related Issues, Type of Change, Testing, and Additional Notes sections. Restructure the description to follow the template format: add a formal Description section, specify Related Issues, mark the Type of Change (appears to be 'New feature'), expand Testing details, and add Additional Notes if applicable.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: adding a workspace settings section and enhancing navigation with project/workspace listings.

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.

Show the actual config.json content if it exists, otherwise display the template.

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

Co-Authored-By: Claude <noreply@anthropic.com>
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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx (1)

20-40: Issue: Duplicate "Workspace" entry in GENERAL_SECTIONS.

The GENERAL_SECTIONS array includes a "workspace" entry (lines 25-29), but workspaces are already handled separately in the dynamic "Projects & Workspaces" section (lines 87-140). This creates duplication and potential confusion in the UI, as clicking on the General > Workspace item would navigate to the workspace section but wouldn't match any specific workspace.

Consider removing the "workspace" entry from GENERAL_SECTIONS:

 const GENERAL_SECTIONS: {
 	id: SettingsSection;
 	label: string;
 	icon: React.ReactNode;
 }[] = [
-	{
-		id: "workspace",
-		label: "Workspace",
-		icon: <HiOutlineFolder className="h-4 w-4" />,
-	},
 	{
 		id: "appearance",
 		label: "Appearance",
 		icon: <HiOutlinePaintBrush className="h-4 w-4" />,
 	},
 	{
 		id: "keyboard",
 		label: "Keyboard Shortcuts",
 		icon: <HiOutlineCommandLine className="h-4 w-4" />,
 	},
 ];
🧹 Nitpick comments (1)
apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx (1)

81-121: Branch, path, and scripts/config preview sections are straightforward and robust

  • Branch and “Needs Rebase” badge are correctly guarded by activeWorkspace.worktree and gitStatus?.needsRebase, so they won’t render when metadata is absent.
  • The path section always shows activeWorkspace.worktreePath in a monospace, breakable line, which is appropriate for filesystem paths.
  • The Scripts section is correctly conditional on activeWorkspace.project, and ConfigFilePreview receives both the project name and the (possibly undefined) configFilePath, matching the provided component contract.

If you later see very long branch names or paths in practice, consider truncation with a tooltip, but what you have here is fine for this PR.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13e926e and dffde86.

📒 Files selected for processing (9)
  • apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts (1 hunks)
  • apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx (1 hunks)
  • apps/desktop/src/renderer/components/ConfigFilePreview/index.ts (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx (2 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx (3 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx (1 hunks)
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/index.ts (1 hunks)
  • apps/desktop/src/renderer/stores/app-state.ts (2 hunks)
  • apps/desktop/src/shared/constants.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
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/components/ConfigFilePreview/index.ts
  • apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx
  • apps/desktop/src/shared/constants.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/index.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx
  • apps/desktop/src/renderer/stores/app-state.ts
  • apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.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/components/ConfigFilePreview/index.ts
  • apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx
  • apps/desktop/src/shared/constants.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/index.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx
  • apps/desktop/src/renderer/stores/app-state.ts
  • apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Avoid using any type - use explicit types instead for type safety
Use camelCase for variable and function names following existing codebase patterns
Keep diffs minimal with targeted edits only - avoid unnecessary changes when making modifications
Follow existing patterns and match the codebase style when writing new code

Files:

  • apps/desktop/src/renderer/components/ConfigFilePreview/index.ts
  • apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx
  • apps/desktop/src/shared/constants.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/index.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx
  • apps/desktop/src/renderer/stores/app-state.ts
  • apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never import Node.js modules (fs, path, os, net, etc.) in renderer process code - browser environment only

Files:

  • apps/desktop/src/renderer/components/ConfigFilePreview/index.ts
  • apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/index.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx
  • apps/desktop/src/renderer/stores/app-state.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx
**/components/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

**/components/**/*.tsx: Create one folder per component with structure: ComponentName/ComponentName.tsx + index.ts for barrel export
Co-locate tests next to the component file they test (e.g., ComponentName.test.tsx)
Co-locate dependencies (utils, hooks, constants, config, stories) next to the file using them
Use nested components/ subdirectory within a parent component only if a sub-component is used 2+ times within that parent; otherwise keep it in the parent's components/ folder
One component per file - avoid multi-component files

Files:

  • apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx
apps/desktop/src/renderer/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Call IPC methods using window.ipcRenderer.invoke() with object parameters - TypeScript will infer the exact response type automatically

Files:

  • apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx
apps/desktop/src/lib/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Never import Node.js modules in shared code like src/lib/electron-router-dom.ts - this code runs in both main and renderer processes

Files:

  • apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts
🧠 Learnings (7)
📚 Learning: 2025-11-28T01:03:47.963Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.963Z
Learning: Applies to **/components/**/*.tsx : Co-locate dependencies (utils, hooks, constants, config, stories) next to the file using them

Applied to files:

  • apps/desktop/src/renderer/components/ConfigFilePreview/index.ts
📚 Learning: 2025-11-24T21:33:13.267Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-11-24T21:33:13.267Z
Learning: Applies to apps/desktop/**/*.{ts,tsx} : Please use alias as defined in `tsconfig.json` when possible

Applied to files:

  • apps/desktop/src/renderer/components/ConfigFilePreview/index.ts
  • apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx
  • apps/desktop/src/shared/constants.ts
  • apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/index.ts
📚 Learning: 2025-11-28T01:03:47.963Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.963Z
Learning: Applies to apps/desktop/src/renderer/**/*.{ts,tsx} : Never import Node.js modules (fs, path, os, net, etc.) in renderer process code - browser environment only

Applied to files:

  • apps/desktop/src/renderer/components/ConfigFilePreview/index.ts
📚 Learning: 2025-11-28T01:03:47.963Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.963Z
Learning: Applies to **/components/**/*.tsx : One component per file - avoid multi-component files

Applied to files:

  • apps/desktop/src/renderer/components/ConfigFilePreview/index.ts
📚 Learning: 2025-11-28T01:03:47.963Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.963Z
Learning: Applies to **/components/**/*.tsx : Co-locate tests next to the component file they test (e.g., `ComponentName.test.tsx`)

Applied to files:

  • apps/desktop/src/renderer/components/ConfigFilePreview/index.ts
📚 Learning: 2025-11-28T01:03:47.963Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-28T01:03:47.963Z
Learning: Applies to **/*.{ts,tsx} : Keep diffs minimal with targeted edits only - avoid unnecessary changes when making modifications

Applied to files:

  • apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx
  • apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx
📚 Learning: 2025-11-24T21:33:13.267Z
Learnt from: CR
Repo: superset-sh/superset PR: 0
File: apps/desktop/AGENTS.md:0-0
Timestamp: 2025-11-24T21:33:13.267Z
Learning: Applies to apps/desktop/**/*.{ts,tsx} : Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary

Applied to files:

  • apps/desktop/src/renderer/stores/app-state.ts
🧬 Code graph analysis (4)
apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx (3)
apps/desktop/src/renderer/screens/main/components/TopBar/WorkspaceTabs/useWorkspaceRename.ts (1)
  • useWorkspaceRename (4-64)
packages/ui/src/components/input.tsx (1)
  • Input (29-29)
apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx (1)
  • ConfigFilePreview (18-62)
apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx (2)
apps/desktop/src/renderer/stores/app-state.ts (1)
  • SettingsSection (5-5)
packages/ui/src/lib/utils.ts (1)
  • cn (4-6)
apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts (2)
apps/desktop/src/main/lib/db/index.ts (1)
  • db (18-25)
apps/desktop/src/lib/trpc/routers/workspaces/utils/worktree.ts (1)
  • getWorktreePath (6-9)
apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx (2)
apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx (1)
  • WorkspaceSettings (12-125)
apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/index.ts (1)
  • WorkspaceSettings (1-1)
⏰ 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 (15)
apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsContent.tsx (1)

4-4: LGTM: Clean integration of WorkspaceSettings.

The import and conditional rendering follow the established pattern for other settings sections.

Also applies to: 13-13

apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/index.ts (1)

1-1: LGTM: Standard barrel export.

Follows the established component structure pattern.

apps/desktop/src/renderer/components/ConfigFilePreview/index.ts (1)

1-4: LGTM: Proper barrel export pattern.

Correctly exports both the component and its props type.

apps/desktop/src/shared/constants.ts (2)

24-27: LGTM: Project-level constants added.

The new constants PROJECT_SUPERSET_DIR_NAME and CONFIG_FILE_NAME are well-defined. Note that PROJECT_SUPERSET_DIR_NAME is intentionally not environment-dependent, unlike SUPERSET_DIR_NAME.


32-36: CONFIG_TEMPLATE structure correctly matches the SetupConfig schema.

The template structure is accurate. The SetupConfig interface (apps/desktop/src/shared/types.ts:130-133) defines both setup and teardown as optional string arrays. The template provides empty arrays for both, which aligns perfectly with the expected schema. The parsing logic in setup.ts and teardown.ts validates that these fields are arrays when present, and the template satisfies these requirements.

apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx (2)

23-25: LGTM: External link handling is appropriate.

The use of window.open with "_blank" is appropriate for opening documentation in a new tab. The URL is constructed from a trusted constant.


39-39: OpenInButton correctly handles undefined paths — no action required.

The component properly handles the optional path prop through multiple defensive checks: the prop type explicitly allows string | undefined, buttons are disabled when path is falsy (disabled={!path}), and all handler functions early return if path is undefined. This approach prevents mutations from being triggered with invalid paths.

apps/desktop/src/renderer/screens/main/components/SettingsView/SettingsSidebar.tsx (3)

73-73: Consider: Panel width increased from default.

The sidebar width changed from the default to w-56 (14rem/224px). Verify this accommodates longer project/workspace names without excessive truncation.


94-139: LGTM: Well-structured workspace navigation.

The dynamic project/workspace navigation with expand/collapse functionality is well-implemented:

  • Proper use of state for expanded projects
  • Color badges for visual project identification
  • Nested structure with appropriate indentation
  • Active state highlighting

50-53: No action needed - the code is correct as written.

The activeWorkspace?.projectId expression correctly handles the case where activeWorkspace is null or projectId is undefined. When projectId is falsy, the ternary returns an empty array [] (not [undefined]) which is passed to the Set constructor. The useState initializer is properly structured as a function, so it runs only once on mount and won't re-execute on every render.

apps/desktop/src/renderer/stores/app-state.ts (1)

5-5: LGTM: Workspace-first settings approach.

The addition of "workspace" to SettingsSection type and changing the default from "appearance" to "workspace" at line 23 aligns well with the PR objective to prioritize workspace settings. Verification confirms that "appearance" is only referenced in UI components (SettingsContent.tsx, SettingsSidebar.tsx) as a selectable option, not assumed as a default elsewhere. Code follows zustand patterns correctly with proper state management.

apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts (1)

226-246: No breaking changes; new fields actively used by consumers.

The enriched getActive response is backward compatible and already being utilized. Consumers like WorkspaceSettings access the new project (id, name) and worktree (branch, gitStatus) fields, as well as worktreePath. Note that getAllGrouped returns a different shape with only worktreePath enrichment, not the full project/worktree objects—verify this intentional divergence aligns with client needs.

apps/desktop/src/renderer/screens/main/components/SettingsView/WorkspaceSettings/WorkspaceSettings.tsx (3)

1-11: Imports and aliases align with desktop renderer guidelines

Imports use the configured aliases (renderer/..., @superset/ui/input) and avoid Node.js modules in renderer code, matching the documented patterns. No changes needed.

As per coding guidelines, this follows the expected alias and renderer-module rules.


13-24: TRPC data fetching and dependent query wiring look correct

Using trpc.workspaces.getActive.useQuery() as the source of truth and gating trpc.config.getConfigFilePath.useQuery() with enabled: !!activeWorkspace?.projectId is a good pattern for dependent data; passing activeWorkspace?.projectId ?? "" avoids undefined while still preventing calls when there is no project. Initializing useWorkspaceRename from activeWorkspace?.id/name ?? "" is safe given the early returns for loading/empty states.

Please just confirm that the config.getConfigFilePath input schema is happy with an empty string when the query is disabled (React Query should never invoke the procedure in that case, but it’s worth aligning expectations with the router definition).


26-48: Loading and empty workspace states are handled cleanly

Skeleton content while isLoading is true and a clear “No active workspace selected” message when activeWorkspace is missing give good feedback without leaking implementation details. Copyable text (select-text) is a nice touch for consistency with the main view.

- Add ProjectSettings component showing project name, repo path, and scripts config
- Move scripts/config section from WorkspaceSettings to ProjectSettings
- Update SettingsSidebar to show project hierarchy with Project Settings and Workspaces
- Workspaces are now shown as children of projects in the settings sidebar

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

Co-Authored-By: Claude <noreply@anthropic.com>
…debar

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

Co-Authored-By: Claude <noreply@anthropic.com>
…lapse

- Clicking project name now opens project settings directly
- Separate chevron button handles expand/collapse of workspaces
- Removed "Project Settings" child item

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

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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