feat(daemon): collapse workspace noise into a "show hidden" section

Discovery returns every pi session directory ever seen, so the console opened on
47 rows on this machine: 20 ghosts (cwd deleted) and 21 scratch dirs under /tmp
next to the real projects. Every row now carries a derived, non-persisted
`visibility`/`visibilityReason`; nothing is filtered server-side, so
`/workspace/<id>` deep links and the chat page's id lookup still resolve.

Precedence: explicit `hidden` wins; a live instance, `pinned` or `trusted`
rescues a row; then temp paths (`PI2_WORKSPACE_HIDE_TEMP`, on), ghosts
(`PI2_WORKSPACE_HIDE_GHOSTS`, on), outside roots (`PI2_WORKSPACE_HIDE_OUTSIDE_ROOTS`,
off) and staleness (`PI2_WORKSPACE_STALE_DAYS`, off). Measured on real data:
47 → 26 default rows, 0 openable rows lost.

The browser collapses the secondary rows behind a persisted toggle and dims them
with a reason badge; `workspace.add` now clears `hidden`.
This commit is contained in:
yuez committed 2026-10-23 10:08:15 +08:00
1 parent 58e247644d
commit 64a1a98c1f
12 files changed
+888 -38

No files matched your search

+11 -1
View File
@@ -385,6 +385,11 @@
"time.minutesAgo": "{n}m ago",
"workspaces.activeRecently": "Active in the last hour",
"workspaces.addFailed": "Could not open the workspace. Check that the path is accessible.",
"workspaces.allHidden": "All workspaces are hidden",
"workspaces.allHiddenText": "Turn on “Show {n} hidden” to list them.",
"workspaces.hideHidden": "Hide {n} hidden",
"workspaces.showHidden": "Show {n} hidden",
"workspaces.showHiddenAria": "Show hidden workspaces",
"workspaces.contextAria": "Current server",
"workspaces.count": "{n} workspaces",
"workspaces.count.one": "{n} workspace",
@@ -420,5 +425,10 @@
"workspaces.sessionCount.other": "{n} sessions",
"workspaces.subtitle": "A workspace is a Neovim working directory (cwd); sessions are isolated per cwd.",
"workspaces.title": "Workspaces",
"workspaces.unnamed": "Untitled"
"workspaces.unnamed": "Untitled",
"workspaces.reason.ghost": "missing",
"workspaces.reason.hidden": "hidden",
"workspaces.reason.outside-roots": "outside roots",
"workspaces.reason.stale": "stale",
"workspaces.reason.temp": "temp"
}
+11 -1
View File
@@ -385,6 +385,11 @@
"time.minutesAgo": "{n} 分钟前",
"workspaces.activeRecently": "最近 1 小时有活动",
"workspaces.addFailed": "打开工作空间失败,请检查路径是否可访问",
"workspaces.allHidden": "所有工作空间都被隐藏了",
"workspaces.allHiddenText": "打开“显示 {n} 个隐藏项”以查看。",
"workspaces.hideHidden": "隐藏 {n} 个隐藏项",
"workspaces.showHidden": "显示 {n} 个隐藏项",
"workspaces.showHiddenAria": "显示隐藏的工作空间",
"workspaces.contextAria": "当前服务器",
"workspaces.count": "{n} 个工作空间",
"workspaces.count.one": "{n} 个工作空间",
@@ -420,5 +425,10 @@
"workspaces.sessionCount.other": "{n} 个会话",
"workspaces.subtitle": "工作空间 = Neovim 工作目录(cwd),会话严格按 cwd 隔离。",
"workspaces.title": "工作空间",
"workspaces.unnamed": "未命名"
"workspaces.unnamed": "未命名",
"workspaces.reason.ghost": "目录不存在",
"workspaces.reason.hidden": "已隐藏",
"workspaces.reason.outside-roots": "根目录外",
"workspaces.reason.stale": "长期未动",
"workspaces.reason.temp": "临时目录"
}