Skip to content

Rename a project, the way sessions can already be renamed #84

Description

@Davidb-2107

Sessions can be renamed by double-clicking them, and the name is kept in session_meta. Projects can't — their sidebar label is the path, recomputed at each render site.

That matters once a few projects share a leaf directory name, or sit under a deep tree where the last two segments are not the part that distinguishes them. On my setup several projects read as Projects/<something> and I can't tell them apart at a glance in a narrow sidebar.

What I'd propose

The same interaction as sessions — double-click the project header, type, Enter — backed by a project_meta table keyed by projectPath rather than the ~/.claude/projects folder name, since several legacy folders can encode the same path and already render as one sidebar group. Clearing the field, or typing the path back, drops the override and falls back to the shortened path.

The display name gets attached once in buildProjectsFromCache, rather than at each of the three places that can create a project entry, so they can't drift apart.

Status

It's implemented and working on my fork, verified end to end (double-click, type, Enter, restart — the name persists). I'd rather ask before sending a feature PR you didn't request.

Two things worth flagging if you're interested:

  • It would sit on top of fix: shorten project paths correctly on Windows #83, since the sidebar label goes through the shortProjectPath() helper that PR introduces.
  • db.js can't be required outside Electron (better-sqlite3 is built against Electron's ABI), so the round trip is verified by driving the running app rather than by a unit test. If you'd want a test there, that's a separate conversation about how to run tests under Electron.

Happy to open the PR if this is something you'd take, or to close this if project labels are meant to stay path-derived.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions