Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

fix: Require explicit project creation and canonicalize repo paths#126

Merged
matt2e merged 3 commits intomainfrom
matt2e/ghost-branch
Feb 6, 2026
Merged

fix: Require explicit project creation and canonicalize repo paths#126
matt2e merged 3 commits intomainfrom
matt2e/ghost-branch

Conversation

@matt2e
Copy link
Collaborator

@matt2e matt2e commented Feb 6, 2026

Summary

Removes implicit project auto-creation behavior, requiring users to explicitly add projects via the "Add Project" flow. Also fixes duplicate project entries caused by path variations (symlinks, case differences) by canonicalizing repository paths.

Changes

  • Explicit project management: Removes getOrCreateGitProject API and associated implicit creation logic. Opening a repo now only creates a tab if a project already exists—users must use "Add Project" first. This makes project creation intentional rather than accidental.

  • Path canonicalization: Resolves symlinks and normalizes paths before storing or looking up projects, preventing the same repository from appearing as multiple projects when accessed via different path representations (e.g., /var vs /private/var on macOS).

  • Subpath normalization: Cleans subpath inputs by trimming whitespace and removing leading/trailing slashes, ensuring consistent storage and comparison.

  • Improved list ordering: Changes branches and projects to sort by most recently updated (DESC) instead of oldest first, surfacing active items at the top.

  • Empty state UX update: When no projects exist, the welcome screen now prompts "Add a project" with ⌘P shortcut instead of "New Branch" with ⌘N, guiding users through the correct onboarding flow.

matt2e and others added 2 commits February 6, 2026 14:57
Canonicalize repository paths before storing/querying to ensure case-insensitive
filesystem paths like /Users/foo/Code/repo and /Users/foo/code/repo are treated
as the same project. Also normalize subpaths by trimming whitespace and slashes.

This prevents duplicate project entries when the same repository is accessed
with different path capitalizations on macOS (which uses case-insensitive HFS+ by default).

Changes:
- Add canonicalize_repo_path() to resolve symlinks and normalize paths
- Add clean_subpath() to trim whitespace and normalize subpath formatting
- Update create_git_project, get_or_create_git_project, get_git_project_by_repo,
  and update_git_project to use these helpers

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ect flow

Projects are no longer created automatically when:
- Opening the app with a CLI path or current directory
- Creating a new tab via folder picker
- Creating branches without an existing project

The only way to create a project is now through the "Add Project" button.
This prevents ghost projects from appearing for dev directories, stale tab
paths, or unintended automatic project creation.

Changes:
- Remove getOrCreateGitProject() from frontend and backend
- Update App.svelte to check for existing projects instead of creating them
- Update NewBranchModal to require projectId (no longer optional)
- Update BranchHome empty state to show "Add Project" instead of "New Branch"
- Make Cmd+N shortcut only work when projects exist

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@matt2e matt2e marked this pull request as ready for review February 6, 2026 04:36
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@matt2e matt2e merged commit 709343d into main Feb 6, 2026
1 check passed
@matt2e matt2e deleted the matt2e/ghost-branch branch February 6, 2026 04:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant