Show worktree names in workspace hover cards (#2711)

* fix(app): show worktree names in workspace hover cards

Managed worktree paths exposed Paseo's internal directory layout instead of the useful worktree name. Carry the owned worktree root through the sidebar model while preserving the full workspace path as the copy target.

* fix(workspaces): source owned worktree names from daemon

The daemon owns worktree path semantics, so expose the managed worktree slug and let the sidebar model produce a display-ready label. This keeps path parsing out of the hover-card component while preserving the full path for copying.

* fix(app): preserve worktree labels in replica cache
This commit is contained in:
Mohamed Boudra
2026-08-01 05:17:47 +08:00
committed by GitHub
parent d2de309fc3
commit 9d19e90323
15 changed files with 137 additions and 13 deletions
+3
View File
@@ -3155,6 +3155,9 @@ export const WorkspaceDescriptorPayloadSchema = z
projectCustomIconRevision: z.string().nullable().optional(),
projectRootPath: z.string(),
workspaceDirectory: z.string().optional(),
// COMPAT(worktreeSlug): added in v0.2.6, remove optional after 2027-01-31.
// Present only for Paseo-owned worktrees; this is the basename of their root directory.
worktreeSlug: z.string().optional(),
projectKind: z.enum(["git", "non_git", "directory"]),
// COMPAT(workspaces): keep legacy directory workspace kind parseable.
workspaceKind: z.enum(["directory", "local_checkout", "checkout", "worktree"]),
@@ -499,6 +499,26 @@ describe("workspace message schemas", () => {
throw new Error("Expected workspace_update upsert payload");
}
expect(parsed.payload.workspace.workspaceDirectory).toBe("/repo");
expect(parsed.payload.workspace.worktreeSlug).toBeUndefined();
});
test("preserves a Paseo-owned worktree slug", () => {
const parsed = WorkspaceDescriptorPayloadSchema.parse({
id: "owned-worktree",
projectId: "project",
projectDisplayName: "repo",
projectRootPath: "/repo",
workspaceDirectory: "/paseo/worktrees/project/feature/packages/app",
worktreeSlug: "feature",
projectKind: "git",
workspaceKind: "worktree",
name: "feature",
status: "done",
activityAt: null,
scripts: [],
});
expect(parsed.worktreeSlug).toBe("feature");
});
test("defaults omitted workspace archiving state and preserves present timestamps", () => {