feat(desktop): create blank projects from Superset

Merged
RO
4mo ago
+444-26

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.

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.