Skip to content

feat(desktop): create blank projects from Superset - #5906

Merged
saddlepaddle merged 2 commits into
ParadevAI:mainfrom
Roshvan:roshvan/create-blank-project
Jul 24, 2026
Merged

saddlepaddle merged 2 commits into
ParadevAI:mainfrom
Roshvan:roshvan/create-blank-project

Conversation

@Roshvan

@Roshvan Roshvan commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Superset can clone a repository, open an existing folder, or start from a template, but it cannot create a blank project for someone starting an app from scratch.

This adds a first-class Create new project action to the new-workspace picker, project menus, command palette, legacy workspace flow, and onboarding. The new modal creates a named folder, initializes a Git repository on main with an initial commit, registers the project, and makes it available for workspace creation without leaving Superset. It uses the existing host-service empty-project mode and adds the equivalent v1 desktop path.

How I tested it

  • bun run lint — passed with no warnings
  • bun run typecheck — 35/35 tasks passed
  • cd apps/desktop && bun test src/renderer/stores/add-repository-modal.test.ts — 2/2 passed
  • cd packages/host-service && bun test test/integration/project-setup.integration.test.ts — 8/8 passed
  • End-to-end in the signed-in desktop app from this managed worktree at renderer http://localhost:3085: New Workspace → project picker → Create new project → enter name/location → Create project → select No agent → create workspace. Verified the resulting folder is a Git repository on main with an initial commit and no remote, and that Superset created and opened the workspace.

Screenshots

Create new project entry point

New Workspace project picker showing Create new project

Blank project form

Create a new project form with project name and location

Created project and workspace

Superset workspace created from the new blank project

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs

Summary by cubic

Adds a “Create new project” flow to the desktop app so users can start from a blank folder without leaving Superset. Creates a named directory, initializes a Git repo on main with an initial commit, registers the project, and returns users to workspace creation with the project selected.

  • New Features

    • New EmptyProjectModal to name a project and pick a location, with browse, progress, and error toasts.
    • Entry points in command palette, dashboard sidebar menus, workspace sidebar footer, new workspace picker, and an onboarding card.
    • v1 and v2 support: uses electronTrpc.projects.createEmptyRepo and host-service project.create (empty mode); invalidates projects.getRecents and finalizes setup.
    • Store and flow updates: adds empty-project via useOpenEmptyProjectModal, ensures only one add-project modal at a time, and workspace/onboarding flows preselect the newly created project.
  • Refactors

    • Centralized v1 creation error handling with runCreate and onError passthrough in useCreateV1Project; unified pending state with createEmptyRepo.

Written for commit c5a6b5a. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added “Create new project” (empty project) actions across the dashboard, workspace sidebar, command palette, and onboarding.
    • Introduced an Empty Project dialog to enter a name, pick/browse a directory, and create the project with progress feedback.
    • Enabled end-to-end empty project creation in both supported setup environments.
  • Bug Fixes
    • Improved completion, error, and cancellation handling in the empty project flow (including clearer failure toasts and safer close behavior).
  • Tests
    • Added coverage for opening, resolving success, and canceling the empty-project modal/store flow.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an empty-project creation modal with V1/V2 creation paths, directory selection, promise-based modal state, and new entry points across the command palette, dashboards, sidebars, project picker, and onboarding flow.

Changes

Empty project creation

Layer / File(s) Summary
Modal state contract and resolution
apps/desktop/src/renderer/stores/add-repository-modal.ts, apps/desktop/src/renderer/stores/add-repository-modal.test.ts
Adds the "empty-project" modal state, promise-based opener, resolution behavior, and tests for success and cancellation.
Empty project creation modal
apps/desktop/src/renderer/routes/_authenticated/components/EmptyProjectModal/*, apps/desktop/src/renderer/react-query/projects/useCreateV1Project.ts
Adds project name/location inputs, directory browsing, validation, V1/V2 creation flows, error handling, loading state, and recents invalidation.
Dashboard modal wiring and entry points
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/AddRepositoryModals/*, apps/desktop/src/renderer/commandPalette/..., apps/desktop/src/renderer/components/NewWorkspaceModal/*, apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/...
Renders the modal from shared state and adds “Create new project” actions to dashboard, command palette, workspace, and project-picker interfaces.
Onboarding and workspace navigation
apps/desktop/src/renderer/routes/_authenticated/onboarding/*, apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/*, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/*
Adds empty-project creation to onboarding and sidebar menus, routing successful creation to onboarding completion or the selected workspace.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant EntryPoint
  participant EmptyProjectModal
  participant ProjectCreation
  participant Workspace
  User->>EntryPoint: Select Create new project
  EntryPoint->>EmptyProjectModal: Open modal
  User->>EmptyProjectModal: Submit name and location
  EmptyProjectModal->>ProjectCreation: Create and initialize project
  ProjectCreation-->>EmptyProjectModal: Return projectId
  EmptyProjectModal->>Workspace: Resolve project and navigate
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise, conventional, and accurately summarizes the main change: creating blank projects from Superset.
Description check ✅ Passed The description includes the required What & why, How I tested it, screenshots, and checklist sections, with sufficient detail.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@Roshvan
Roshvan marked this pull request as ready for review July 24, 2026 00:48

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/desktop/src/renderer/react-query/projects/useCreateV1Project.ts (1)

10-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate try/catch/toast pattern between cloneFromUrl and createEmpty.

Both callbacks repeat the same "call mutation → check result.success → toast/return null → invalidate recents → catch/toast" shape. Consider extracting a shared helper to reduce duplication and keep error-toast wording in one place.

♻️ Example helper extraction
+	const runCreate = useCallback(
+		async <T extends { success: boolean; error?: string; project: { id: string } }>(
+			mutateAsync: () => Promise<T>,
+		): Promise<string | null> => {
+			try {
+				const result = await mutateAsync();
+				if (!result.success) {
+					toast.error("Could not create project", { description: result.error });
+					return null;
+				}
+				await utils.projects.getRecents.invalidate();
+				return result.project.id;
+			} catch (err) {
+				toast.error("Could not create project", {
+					description: err instanceof Error ? err.message : String(err),
+				});
+				return null;
+			}
+		},
+		[utils],
+	);

Also applies to: 51-78

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/desktop/src/renderer/react-query/projects/useCreateV1Project.ts` around
lines 10 - 17, Extract the shared mutation error-handling, success validation,
toast, and recents-invalidation flow from cloneFromUrl and createEmpty into a
reusable helper within useCreateV1Project. Update both callbacks to use the
helper while preserving their mutation-specific inputs and existing error-toast
wording.
apps/desktop/src/renderer/routes/_authenticated/components/EmptyProjectModal/EmptyProjectModal.tsx (1)

93-103: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

V1 failure path bypasses the onError contract.

When createV1Project.createEmpty fails, this branch just returns — the caller-supplied onError (which formats "Create failed: …" per AddRepositoryModals.tsx) is never invoked, only the internal toast from useCreateV1Project. The V2 branch below does honor onError. Result: users see differently-worded error toasts depending on isV2CloudEnabled, and any consumer relying on onError for custom handling silently loses v1 failures.

Consider having createEmpty return the error message (or surface it) so this component can route it through onError/fallback toast consistently with the v2 branch.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/desktop/src/renderer/routes/_authenticated/components/EmptyProjectModal/EmptyProjectModal.tsx`
around lines 93 - 103, Update the V1 failure handling in the createEmpty flow to
surface the failure message from createV1Project.createEmpty, then pass it
through the component’s onError contract (with the existing fallback toast
behavior) before returning. Preserve the current success flow and align the
resulting error handling with the V2 branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/desktop/src/renderer/components/NewWorkspaceModal/NewWorkspaceModal.tsx`:
- Around line 67-70: Update handleNewProject to await the promise returned by
openEmptyProject, then pass the resulting projectId into the existing
workspace-selection/creation flow after closing NewWorkspaceModal. Preserve the
current modal-closing behavior and reuse the established selection/creation
handler rather than discarding the project result.

---

Nitpick comments:
In `@apps/desktop/src/renderer/react-query/projects/useCreateV1Project.ts`:
- Around line 10-17: Extract the shared mutation error-handling, success
validation, toast, and recents-invalidation flow from cloneFromUrl and
createEmpty into a reusable helper within useCreateV1Project. Update both
callbacks to use the helper while preserving their mutation-specific inputs and
existing error-toast wording.

In
`@apps/desktop/src/renderer/routes/_authenticated/components/EmptyProjectModal/EmptyProjectModal.tsx`:
- Around line 93-103: Update the V1 failure handling in the createEmpty flow to
surface the failure message from createV1Project.createEmpty, then pass it
through the component’s onError contract (with the existing fallback toast
behavior) before returning. Preserve the current success flow and align the
resulting error handling with the V2 branch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d06e3685-8b1a-492d-bf6b-ecf455ff7384

📥 Commits

Reviewing files that changed from the base of the PR and between f313df2 and 8244443.

📒 Files selected for processing (14)
  • apps/desktop/src/renderer/commandPalette/modules/addProject/commands.tsx
  • apps/desktop/src/renderer/components/NewWorkspaceModal/NewWorkspaceModal.tsx
  • apps/desktop/src/renderer/react-query/projects/useCreateV1Project.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/AddRepositoryModals/AddRepositoryModals.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspacesHeader/DashboardSidebarWorkspacesHeader.tsx
  • apps/desktop/src/renderer/routes/_authenticated/components/DashboardNewWorkspaceModal/components/DashboardNewWorkspaceForm/PromptGroup/components/ProjectPickerPill/ProjectPickerPill.tsx
  • apps/desktop/src/renderer/routes/_authenticated/components/EmptyProjectModal/EmptyProjectModal.tsx
  • apps/desktop/src/renderer/routes/_authenticated/components/EmptyProjectModal/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/onboarding/layout.tsx
  • apps/desktop/src/renderer/routes/_authenticated/onboarding/project/page.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/WorkspaceSidebarFooter.tsx
  • apps/desktop/src/renderer/stores/add-repository-modal.test.ts
  • apps/desktop/src/renderer/stores/add-repository-modal.ts

@Roshvan
Roshvan force-pushed the roshvan/create-blank-project branch from 8244443 to 50224eb Compare July 24, 2026 01:08
Roshvan and others added 2 commits July 23, 2026 19:11
@saddlepaddle
saddlepaddle force-pushed the roshvan/create-blank-project branch from 50224eb to c5a6b5a Compare July 24, 2026 02:19
@saddlepaddle
saddlepaddle merged commit f72e08d into ParadevAI:main Jul 24, 2026
11 checks passed
@Roshvan
Roshvan deleted the roshvan/create-blank-project branch October 11, 2026 14:50
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.

2 participants