Skip to content

fix(desktop): keep Create controls on empty Projects view - #5205

Open
vcolombo wants to merge 2 commits into
block:mainfrom
vcolombo:vcolombo/projects-empty-create
Open

fix(desktop): keep Create controls on empty Projects view#5205
vcolombo wants to merge 2 commits into
block:mainfrom
vcolombo:vcolombo/projects-empty-create

Conversation

@vcolombo

@vcolombo vcolombo commented Aug 7, 2026

Copy link
Copy Markdown

Summary

When a relay has zero projects, ProjectsView early-returned a bare <EmptyState /> before the header, toolbar, and ProjectsCreateMenu (+) mounted — so the first project could only be created from the CLI. Chicken-and-egg: the create button only appeared once a project already existed.

  • Remove the early return; render EmptyState inside the normal layout so the Projects chrome (header, filter toolbar, + create menu) always mounts.
  • Add a "Create your first project" CTA to the empty state (same pattern as the Workflows empty state), wired to the existing CreateProjectDialog.
  • Add a Playwright smoke spec covering both entry points against a true zero-project state (all mock seeds hidden).

Ported from closed PR #3620 (closed in favor of tracking as issue #4009) onto current main, adapted for the multi-repo changes from #4671 and the current create-menu item names.

Fixes #2585, fixes #2622, fixes #3470, fixes #3504, fixes #4009

Testing

  • pnpm exec tsc --noEmit, biome clean on touched files
  • pnpm exec playwright test --project=smoke tests/e2e/projects-empty-create.spec.ts — new spec green
  • All 36 existing project smoke specs (project-commit-detail, project-inbox, project-pr-review, project-issue-comments) pass
  • just ci

When a relay has zero projects, ProjectsView early-returned a bare
EmptyState before the header, toolbar, and ProjectsCreateMenu mounted,
so the first project could only be created from the CLI. Render the
empty state inside the normal layout instead, and give it a
'Create your first project' CTA wired to the existing
CreateProjectDialog.

Ported from closed PR block#3620 onto current main.

Fixes block#2585, fixes block#2622, fixes block#3470, fixes block#3504, fixes block#4009

Signed-off-by: Vincent Colombo <vcolombo@gmail.com>
@vcolombo
vcolombo requested a review from a team as a code owner August 7, 2026 17:12
Copilot AI lite review requested due to automatic review settings August 7, 2026 17:12
@vcolombo

vcolombo commented Aug 7, 2026

Copy link
Copy Markdown
Author

Empty state with full chrome

Zero projects on the relay: header, filter toolbar, and the + create menu all mount, and the empty state offers a "Create your first project" CTA.

01-empty-state-with-chrome

Create dialog from the empty-state CTA

Clicking the CTA opens the existing CreateProjectDialog.

02-create-dialog-from-empty-state

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a chicken-and-egg UX bug in the desktop Projects view: when a relay had zero projects, the view previously short-circuited to an empty state before mounting the Projects header/toolbar and ProjectsCreateMenu, preventing creation of the first project from the UI. The change keeps the full Projects “chrome” mounted even for an empty list, adds a first-project CTA in the empty state, and adds Playwright smoke coverage for both creation entry points in a true zero-project state.

Changes:

  • Remove the early-return empty state in ProjectsView and render the empty state within the standard layout so header/toolbar/create menu always mount.
  • Add an optional “Create your first project” CTA to the Projects empty state, wired to the existing create-project dialog open flow.
  • Add a Playwright smoke spec that hides all seeded mock projects and verifies project creation can be initiated via both the toolbar create menu and the empty-state CTA.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
desktop/tests/e2e/projects-empty-create.spec.ts New smoke spec ensuring Create controls work on a truly empty Projects view (both entry points).
desktop/src/features/projects/ui/ProjectsView.tsx Stops early-returning on empty lists; renders EmptyState inside the normal layout and wires CTA to open the create dialog.
desktop/src/features/projects/ui/ProjectCards.tsx Extends EmptyState to support an optional create-project CTA + adds testids for e2e targeting.
desktop/playwright.config.ts Registers the new smoke spec in the smoke project testMatch list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +61 to +62
await page.keyboard.press("Escape");
await expect(page.getByTestId("create-project-dialog")).not.toBeVisible();

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done in 9d326a8 — switched to toBeHidden() to match the suite.

Match the rest of the Projects e2e suite, which asserts dismissal of
create-project-dialog with toBeHidden() rather than not.toBeVisible().

Signed-off-by: Vincent Colombo <vcolombo@gmail.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

2 participants