Skip to content

fix(desktop): adjust new workspace modal styling#2205

Merged
saddlepaddle merged 1 commit into
mainfrom
saddlepaddle/fluffy-hamster
Mar 7, 2026
Merged

fix(desktop): adjust new workspace modal styling#2205
saddlepaddle merged 1 commit into
mainfrom
saddlepaddle/fluffy-hamster

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Mar 7, 2026

Summary

  • Reverts Kiet's 3 fix commits (639c133bf, adc7a16d7, 6228e8ccf) that broke the New Workspace modal styling, restoring all modal files to Satya's revamp state (2210a060a)
  • Re-adds PromptGroupAdvancedOptions component (branch name, base branch, setup script) with correct styling
  • Repositions advanced options between prompt input and create button, removes duplicate branch preview

Test plan

  • Open the New Workspace modal and verify styling matches the original revamp design
  • Verify advanced options (branch name, base branch, setup script) work correctly
  • Test creating workspaces from all tabs (Prompt, Issues, PRs, Branches)

Summary by cubic

Restores the New Workspace modal to the revamp design and brings back advanced options (branch name, base branch, setup script) with correct styling and placement. Also simplifies modal state and creation flows for stability across all tabs.

  • Bug Fixes

    • Use CommandDialog from @superset/ui/command and fix header/tabs, search input, and scrolling.
    • Re-add PromptGroupAdvancedOptions, place it between the prompt input and Create button, and remove the duplicate branch preview.
  • Refactors

    • Drop modal-wide Zustand fields (queries, prompt/branch/base, “draftVersion”) and manage them locally; store now keeps only isOpen and preSelectedProjectId.
    • Standardize create toasts/navigation and simplify tab search handling and project pre-selection.

Written for commit 68132ec. Summary will update on new commits.

Summary by CodeRabbit

Release Notes

  • New Features

    • Redesigned New Workspace Modal with improved user interface structure.
    • Advanced workspace options now collapsible for a cleaner, more focused experience.
  • Bug Fixes

    • Streamlined workspace creation flow for improved reliability.

Reverts Kiet's 3 fix commits (639c133, adc7a16, 6228e8c) that
broke the New Workspace modal styling, restoring all files to Satya's
revamp state (2210a06). Re-adds PromptGroupAdvancedOptions component
with correct styling, repositioned between prompt input and create button.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 7, 2026

📝 Walkthrough

Walkthrough

This PR refactors the NewWorkspaceModal from a Dialog-based UI with centralized Zustand store state management to a CommandDialog-based UI with local component state. The store is simplified to only manage modal open/close state and pre-selection, while individual components (PromptGroup, BranchesGroup, IssuesGroup, PullRequestsGroup) now maintain their own state and handle mutations locally.

Changes

Cohort / File(s) Summary
Modal Store Simplification
apps/desktop/src/renderer/stores/new-workspace-modal.ts
Drastically reduced public state surface: removed draftVersion, activeTab, selectedProjectId, input fields; retained only isOpen and preSelectedProjectId. Removed numerous setter actions and hooks (setActiveTab, setSelectedProjectId, setPrompt, setBranchName, etc.). Added usePreSelectedProjectId accessor.
Main Modal Component
apps/desktop/src/renderer/components/NewWorkspaceModal/NewWorkspaceModal.tsx
Migrated from Dialog-based to CommandDialog-based UI. Introduced local state for activeTab (prompt | issues | pull-requests | branches) and selectedProjectId. Consolidated content rendering into a single CommandList with conditional subcomponent rendering. Updated modal initialization to sync selectedProjectId with preSelectedProjectId.
Workspace Creation Groups
apps/desktop/src/renderer/components/NewWorkspaceModal/components/BranchesGroup/BranchesGroup.tsx, IssuesGroup/IssuesGroup.tsx, PullRequestsGroup/PullRequestsGroup.tsx
Removed store hook dependencies (useClearNewWorkspaceModalInputs, useClearNewWorkspaceModalInputsIfDraftVersion, useNewWorkspaceModalDraftVersion). Simplified creation flows: eliminated draft-submission logic and intermediate promise construction; now directly use toast.promise around mutateAsync calls.
Prompt-based Creation
apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/PromptGroup.tsx
Migrated from store-backed state to local React state (prompt, branchName, branchNameEdited, baseBranch, branchSearch, showAdvanced, runSetupScript). Removed draft/version handling. Integrated PromptGroupAdvancedOptions component. Replaced ButtonGroup with single Create Workspace Button.
Advanced Prompt Options
apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PromptGroupAdvancedOptions/PromptGroupAdvancedOptions.tsx
Added collapsible UI wrapper (Collapsible, CollapsibleTrigger, CollapsibleContent) for advanced options. Introduced new public props: showAdvanced (boolean) and onShowAdvancedChange callback. Reorganized branch selection and setup script toggle under collapsible sections with updated chevron icons.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A modal once bound by the store's gilded cage,
Now dances with local state upon React's stage!
CommandDialog whispers where Dialog once stood,
Simpler, lighter, understood—
The workspace awaits, fresh and good!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description provides a clear summary and test plan but lacks required template sections like Type of Change, Testing details, and Related Issues. Complete the description by adding the missing template sections: specify the Type of Change (Bug fix/Refactor), provide detailed testing steps, and include related issue links if applicable.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: reverting modal styling changes and re-adding advanced options to the New Workspace modal.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch saddlepaddle/fluffy-hamster

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.

@saddlepaddle saddlepaddle changed the title fix(desktop): revert modal styling and re-add advanced options fix(desktop): adjust new workspace modal styling Mar 7, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 7 files

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/PromptGroup.tsx`:
- Around line 143-148: The existing useEffect that resets picker state on
projectId change (calls setBaseBranch, setBaseBranchOpen, setBranchSearch) must
also clear the manual branch override state so the new project's default/prefix
behavior is applied: add calls to reset branchName (e.g., setBranchName("")),
set branchNameEdited to false (setBranchNameEdited(false)), and restore
applyPrefix to its default (setApplyPrefix(true) or the appropriate default
setter) inside the same effect so all branch-related state is cleared when
projectId changes.

In
`@apps/desktop/src/renderer/components/NewWorkspaceModal/NewWorkspaceModal.tsx`:
- Around line 35-44: The effect that initializes the default project when the
modal opens only depends on isOpen so if recentProjects arrives asynchronously
after getRecents resolves the effect never reruns; update the effect used in
NewWorkspaceModal (the useEffect that calls setSelectedProjectId) to also depend
on recentProjects (and optionally preSelectedProjectId/selectedProjectId) and
ensure it only runs when isOpen is true, so when recentProjects changes while
the modal is open it will set selectedProjectId to preSelectedProjectId or to
recentProjects[0].id as before.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6edbbcb7-17f5-4fda-9ee2-b4a096b845db

📥 Commits

Reviewing files that changed from the base of the PR and between 2fe2c4c and 68132ec.

📒 Files selected for processing (7)
  • apps/desktop/src/renderer/components/NewWorkspaceModal/NewWorkspaceModal.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/components/BranchesGroup/BranchesGroup.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/components/IssuesGroup/IssuesGroup.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/PromptGroup.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/components/PromptGroupAdvancedOptions/PromptGroupAdvancedOptions.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/components/PullRequestsGroup/PullRequestsGroup.tsx
  • apps/desktop/src/renderer/stores/new-workspace-modal.ts

Comment on lines +143 to +148
// biome-ignore lint/correctness/useExhaustiveDependencies: intentionally reset advanced branch state when project changes
useEffect(() => {
if (previousProjectIdRef.current === projectId) {
return;
}
previousProjectIdRef.current = projectId;
setBaseBranch(null);
setBaseBranchOpen(false);
setBranchSearch("");
}, [projectId, setBaseBranch, setBranchSearch]);
}, [projectId]);
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 | 🟠 Major

Reset the manual branch override when the project changes.

This effect clears the base-branch picker state, but it leaves branchName and branchNameEdited intact. If a user customizes the branch for project A and then switches to project B, the old branch name carries over and applyPrefix stays false, so the new project's prefix/default-branch behavior is skipped accidentally.

Suggested fix
 // biome-ignore lint/correctness/useExhaustiveDependencies: intentionally reset advanced branch state when project changes
 useEffect(() => {
+	setBranchName("");
+	setBranchNameEdited(false);
 	setBaseBranch(null);
 	setBaseBranchOpen(false);
 	setBranchSearch("");
 }, [projectId]);
📝 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
// biome-ignore lint/correctness/useExhaustiveDependencies: intentionally reset advanced branch state when project changes
useEffect(() => {
if (previousProjectIdRef.current === projectId) {
return;
}
previousProjectIdRef.current = projectId;
setBaseBranch(null);
setBaseBranchOpen(false);
setBranchSearch("");
}, [projectId, setBaseBranch, setBranchSearch]);
}, [projectId]);
// biome-ignore lint/correctness/useExhaustiveDependencies: intentionally reset advanced branch state when project changes
useEffect(() => {
setBranchName("");
setBranchNameEdited(false);
setBaseBranch(null);
setBaseBranchOpen(false);
setBranchSearch("");
}, [projectId]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/components/NewWorkspaceModal/components/PromptGroup/PromptGroup.tsx`
around lines 143 - 148, The existing useEffect that resets picker state on
projectId change (calls setBaseBranch, setBaseBranchOpen, setBranchSearch) must
also clear the manual branch override state so the new project's default/prefix
behavior is applied: add calls to reset branchName (e.g., setBranchName("")),
set branchNameEdited to false (setBranchNameEdited(false)), and restore
applyPrefix to its default (setApplyPrefix(true) or the appropriate default
setter) inside the same effect so all branch-related state is cleared when
projectId changes.

Comment on lines +35 to +44
// Sync pre-selected project when modal opens
// biome-ignore lint/correctness/useExhaustiveDependencies: reset on modal open
useEffect(() => {
if (!isOpen) return;
const hasSelectedProject = recentProjects.some(
(project) => project.id === selectedProjectId,
);
if (!hasSelectedProject) {
setSelectedProjectId(recentProjects[0]?.id ?? null);
if (preSelectedProjectId) {
setSelectedProjectId(preSelectedProjectId);
} else if (recentProjects.length > 0 && !selectedProjectId) {
setSelectedProjectId(recentProjects[0].id);
}
}, [isOpen, recentProjects, selectedProjectId, setSelectedProjectId]);
}, [isOpen]);
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 | 🟠 Major

Let the default-project initialization react to async recents.

If the modal opens before getRecents resolves, recentProjects is still empty here, so selectedProjectId stays null. Because the effect only depends on isOpen, it never reruns when the recents query finishes, and the modal opens without a default project until the user picks one manually.

Suggested fix
-	// Sync pre-selected project when modal opens
-	// biome-ignore lint/correctness/useExhaustiveDependencies: reset on modal open
 	useEffect(() => {
 		if (!isOpen) return;
 		if (preSelectedProjectId) {
 			setSelectedProjectId(preSelectedProjectId);
-		} else if (recentProjects.length > 0 && !selectedProjectId) {
-			setSelectedProjectId(recentProjects[0].id);
+			return;
 		}
-	}, [isOpen]);
+		if (recentProjects.length > 0) {
+			setSelectedProjectId((current) => current ?? recentProjects[0].id);
+		}
+	}, [isOpen, preSelectedProjectId, recentProjects]);
📝 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
// Sync pre-selected project when modal opens
// biome-ignore lint/correctness/useExhaustiveDependencies: reset on modal open
useEffect(() => {
if (!isOpen) return;
const hasSelectedProject = recentProjects.some(
(project) => project.id === selectedProjectId,
);
if (!hasSelectedProject) {
setSelectedProjectId(recentProjects[0]?.id ?? null);
if (preSelectedProjectId) {
setSelectedProjectId(preSelectedProjectId);
} else if (recentProjects.length > 0 && !selectedProjectId) {
setSelectedProjectId(recentProjects[0].id);
}
}, [isOpen, recentProjects, selectedProjectId, setSelectedProjectId]);
}, [isOpen]);
useEffect(() => {
if (!isOpen) return;
if (preSelectedProjectId) {
setSelectedProjectId(preSelectedProjectId);
return;
}
if (recentProjects.length > 0) {
setSelectedProjectId((current) => current ?? recentProjects[0].id);
}
}, [isOpen, preSelectedProjectId, recentProjects]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/desktop/src/renderer/components/NewWorkspaceModal/NewWorkspaceModal.tsx`
around lines 35 - 44, The effect that initializes the default project when the
modal opens only depends on isOpen so if recentProjects arrives asynchronously
after getRecents resolves the effect never reruns; update the effect used in
NewWorkspaceModal (the useEffect that calls setSelectedProjectId) to also depend
on recentProjects (and optionally preSelectedProjectId/selectedProjectId) and
ensure it only runs when isOpen is true, so when recentProjects changes while
the modal is open it will set selectedProjectId to preSelectedProjectId or to
recentProjects[0].id as before.

@saddlepaddle saddlepaddle merged commit 46bae7c into main Mar 7, 2026
7 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 7, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

@Kitenite Kitenite deleted the saddlepaddle/fluffy-hamster branch March 8, 2026 06:36
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