feat(web): sort the workspace picker by recent use and make it searchable
The chat sidebar's workspace picker listed rows in daemon order, which says nothing about where the user was last. It now orders by recent use and filters as you type. - new `features/chat/workspace-order.ts`: recency = browser-local stamp (`pi2-workspace-recency`, written whenever a workspace becomes active) > daemon `lastActiveAt` > name/id, so the order is deterministic and stable; search matches name, alias, cwd, directory name and id, whitespace-split terms all required - `WorkspaceSwitch` becomes a filterable listbox: fixed search field on top (focused on open, cleared on close), scrolling row list, empty state, arrow/Home/End focus, Enter takes the first match, Esc returns focus to the trigger; rows are `role=option` + `aria-selected` - pages/chat.tsx stamps whichever workspace is active (deep link, picker, default), styles and en/zh strings for the search field - tests for ordering, matching, persistence and the keyboard/selection paths; the B5 UI e2e scenario follows the ARIA change and asserts the filter
This commit is contained in:
1 parent
00c81a56f4
commit
3a797ac3f7
10 files changed
+651
-54
No files matched your search
@@ -233,6 +233,11 @@ state (`/sessions`) and the WS snapshot — so no web code calls them.
|
||||
| 19 子代理状态线并入 telemetry | `telemetry.tsx`(`.telemetry--sub`,标题只留身份) |
|
||||
| 20 移动端顶栏胶囊 + 页面 sheet、删除底栏 | `components/shared/{page-pill,page-sheet}.tsx`、`app.css`;`.tabbar` 与 `--tabbar-h` 已删除 |
|
||||
|
||||
`WorkspaceSwitch`(CHG-02)的排序与搜索契约落在 `features/chat/workspace-order.ts`:行按
|
||||
**最近使用**排序(浏览器本地 `pi2-workspace-recency` 时间戳优先,其次 daemon 的 `lastActiveAt`,
|
||||
再按名称 / id);顶部搜索框按名称、别名、cwd、目录名、id 过滤(空格分词,全部命中);
|
||||
行是 `role=option` + `aria-selected`,Enter 取首个匹配,Esc 关闭并把焦点还给触发器。
|
||||
|
||||
### 9.1 与原型的有意偏差(数据模型所致)
|
||||
|
||||
| 原型 | pi2d 现实 | 我们的处理 |
|
||||
|
||||
Reference in new issue
Block a user