Skip to content

Give the empty projects state a create-project action - #6231

Open
T0nyzz wants to merge 1 commit into
block:mainfrom
T0nyzz:fix/projects-empty-state-create-action
Open

Give the empty projects state a create-project action#6231
T0nyzz wants to merge 1 commit into
block:mainfrom
T0nyzz:fix/projects-empty-state-create-action

Conversation

@T0nyzz

@T0nyzz T0nyzz commented Aug 18, 2026

Copy link
Copy Markdown

Problem

On a relay with no projects yet, there is no way to create your first project.

ProjectsView returns EmptyState from an early return at ProjectsView.tsx:594:

if (projects.length === 0) {
  return <EmptyState />;
}

That happens before the create menu and CreateProjectDialog are mounted (further down, around line 790), and EmptyState itself renders only an icon and the text "No projects yet · Projects published to this relay will appear here." — no action.

So the create control only appears once you already have a project.

There is no other entry point: CreateProjectDialog is mounted solely in ProjectsView, and AddProjectRepositoryDialog / AttachProjectRepositoryDialog live in ProjectRepositoryManagement, which is inside a project detail screen you cannot reach without an existing project.

Reproduce: open Projects on a relay with zero projects. There is no create affordance anywhere.

Fix

EmptyState now takes a required onCreateProject callback and renders a Create project button. ProjectsView wires it to the same handler and dialog the pinned create menu uses, and mounts CreateProjectDialog in the empty-state branch so the button opens something.

The prop is required rather than optional deliberately. EmptyState has exactly one call site, so making it required turns dropped wiring at that call site into a compile error instead of a silent regression — which is precisely the failure this PR is fixing.

Testing

  • ProjectCards.test.mjs — new coverage asserting the empty state renders a create action and invokes the callback
  • tsc --noEmit clean
  • biome check clean on all three changed files
  • Full suite: 4792 passing, 0 failing

With zero projects, ProjectsView returned EmptyState directly, before
the create menu and CreateProjectDialog ever mounted. There was no
other entry point to project creation (the other create dialogs live
behind a project detail screen you can't reach without one), so a
fresh relay had no way to create its first project.

EmptyState now takes a required onCreateProject callback and renders
a "Create project" button. ProjectsView wires it to the same handler
and dialog the pinned create menu uses, mounting CreateProjectDialog
in the empty-state branch too so the button actually opens something.
The prop is required, not optional — EmptyState has exactly one call
site, so making it required turns a dropped wiring at that call site
into a compile error instead of a silent regression.

Co-authored-by: Tony Do <tony.do@ib.team>
Signed-off-by: Tony Do <tony.do@ib.team>
@T0nyzz
T0nyzz requested a review from a team as a code owner August 18, 2026 15:37
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