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
+8 -1
View File
@@ -1,7 +1,7 @@
import equal from "fast-deep-equal";
import { v4 as uuidv4 } from "uuid";
import { lstat, mkdir, mkdtemp, rename, rm, stat } from "node:fs/promises";
import { resolve, sep } from "path";
import { basename, resolve, sep } from "path";
import { homedir } from "node:os";
import { CLIENT_CAPS, type ClientCapability } from "@getpaseo/protocol/client-capabilities";
import {
@@ -4276,6 +4276,11 @@ export class Session {
diffStat = snapshot.git.diffStat;
}
const worktreeSlug =
workspace.isPaseoOwnedWorktree && workspace.worktreeRoot
? basename(workspace.worktreeRoot)
: undefined;
return {
id: workspace.workspaceId,
projectId: workspace.projectId,
@@ -4286,6 +4291,7 @@ export class Session {
projectCustomIconRevision: resolvedProjectRecord?.customIconRevision ?? null,
projectRootPath: resolvedProjectRecord?.rootPath ?? workspace.cwd,
workspaceDirectory: workspace.cwd,
worktreeSlug,
projectKind: (resolvedProjectRecord?.kind ?? "directory") === "git" ? "git" : "non_git",
workspaceKind: workspace.kind,
name: resolveWorkspaceDisplayName(workspace),
@@ -4373,6 +4379,7 @@ export class Session {
projectCustomIconRevision: projectRecord?.customIconRevision ?? null,
projectRootPath: projectRecord?.rootPath ?? result.repoRoot,
workspaceDirectory: result.workspace.cwd,
worktreeSlug: basename(result.worktree.worktreePath),
projectKind: projectRecord?.kind ?? "git",
workspaceKind: result.workspace.kind,
name: resolveWorkspaceName({