Skip to content

A worktree group's header shows only the last path segment #188

Description

@omartelo

What

SessionGroup titles a group with baseName(path || projectPath) (frontend/src/components/sidebar/SessionGroup.tsx:64).

A worktree's directory is <worktrees-root>/<projectID>/<name> (internal/project/worktree.go:187), and name is anything git check-ref-format --branch accepts — slashes included. So a worktree created as feat/x lives at .../<projectID>/feat/x and its header reads x.

Two worktrees named feat/x and fix/x therefore draw two identical headers, and the divider stops identifying which checkout it labels.

Expected

The header names the worktree the way it was created: the path relative to the project's worktree root (feat/x), not its last segment.

Notes

The frontend never learns the worktree root — SessionGroup is handed only the checkout path — so the label needs a real source rather than more string slicing. ListCheckouts already returns the worktree with its name; the fix is deciding what reaches the group, not inventing a new field.

The root group (empty path, titled from the project directory) is correct as it stands.

Surfaced while adding group reordering (#187), which does not touch the label.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions