Repository navigation
fix(web): 在子会话所在的工作区显示委派树 / show a delegated Thread's tree in its own workspace - #1044
Conversation
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
感谢修复跨工作区委派树显示为空的问题!深审
|
A Web workspace looked empty when its only Threads were delegated from a Thread in another workspace: the sidebar builds one delegation tree across workspaces and listed each tree only under its root's workspace. Its "Show more" row kept fetching older pages, which could never add a row. A workspace now also lists such a child's tree, from its root, at the child's place, as the Desktop sidebar tree extension does. Each tree appears once per workspace. Rows of a tree shown through a descendant use group-scoped row keys, and locating the current or a searched Thread still uses its root's own workspace.
Pinning a Thread rewrites the saved order of every account from the pin-order source. That source still listed only a Workspace's own roots, so the root of a tree shown there through a delegated child dropped out of the saved order, and the next render put it back last: [P, X] became [X, P] after pinning an unrelated Thread elsewhere. The pin-order source now takes each Workspace's members from the same projection the browser lists, including such linked roots.
90618ac to
1d60145
Compare
|
感谢细致的审查,这个排序回归确实存在,已在 1d60145 修复。 另外,我把分支上两个提交的作者邮箱改成了 GitHub 的 noreply 地址,所以原来的 90618ac 现在是 07a77c1,代码没有变化。跨工作区显示整棵树的产品取舍等维护者确认。 Thanks for the careful review. The ordering regression is real and is fixed in 1d60145. I also changed the author email of both commits on the branch to the GitHub noreply address, so 90618ac is now 07a77c1 with no code changes. Showing the whole tree across workspaces is left to the maintainers to confirm. |
|
已复核 |
摘要
当一个 Web 工作区里只有从其他工作区的会话委派出来的子会话时,侧栏把这个工作区显示为空。侧栏把委派关系建成跨工作区的一棵树,但只在根会话所在的工作区列出这棵树,所以子会话自己的工作区一行都没有;它的「展开显示」会不停加载更早的历史页,也补不出这一行。
Desktop 会在那个项目里列出这个子会话:原生侧栏显示为普通行,装了 Sidebar Thread Tree 扩展时显示父会话的整棵树。现在 Web 也一样:工作区会在子会话的位置列出这棵树,从根会话开始。同一棵树在一个工作区里只出现一次,只在一个工作区内的树不变。
workspaceTreeMembers()取代浏览器工作区投影里只保留根的过滤:工作区成员不是根时,如果它的根不在这个工作区,就把根带进来。threadTreeOrderSource()同时返回每个后代的根。pinOrderSource()使用同一个投影,置顶无关会话时不会丢掉 linked 根的手动排序位置。linked:<workspace>:<id>行键,同一棵树出现在两个分组时行键仍然唯一;ArrowLeft 在同一前缀下查找父行。docs/architecture/web-thread-tree.md写明了新规则。关联 Issue
N/A
测试
基于
main(f2306fba),macOS 27.2.1(arm64):node --import tsx --test apps/web-ui/packages/client/ui-workspace/test/thread-tree.test.ts:15 个通过。[P, X](P 是 linked 根),置顶 A 中无关的会话后,B 的保存顺序仍为[P, X]。这条测试在第一个提交(07a77c17)上失败,保存顺序变成[X]。sidebar-window.test.ts:9 个通过。archived-query.test.ts(vitest)在本机加载失败,缺少浏览器全局对象;在修改前的 90618ac 上同样失败,所以没有运行。apps/web-ui/tsconfig.base.json对改动文件运行tsc:除了main上同样存在的错误(CSS module 声明、Node 类型)外没有新错误。改动文件的prettier --check通过。npm start web -- --port 4401 --host 127.0.0.1 --ch-data <临时目录>,CODEXHOST_EXTERNAL_CLIENT_PORT=off;Node 24.13.1,Rust 1.97.1),临时数据目录里放入所报告的父会话、子会话及其委派记录的副本。用无头 Chrome 157 在 1280×1000 下查看,本分支另在 390×844 下查看:main上,子会话所在的工作区展开后只有「展开显示」。Summary
A Web workspace looked empty when its only Threads were delegated from a Thread in another workspace. The sidebar builds one delegation tree across workspaces and listed each tree only under its root's workspace, so the child's own workspace had no rows. Its "Show more" row kept fetching older history pages, which could never add one.
Desktop lists the child in that project: as a plain row natively, and as its parent's tree with the Sidebar Thread Tree extension. Web now does the same: a workspace also lists such a child's tree, from its root, at the child's place. Each tree appears once per workspace, and a tree inside one workspace is unchanged.
workspaceTreeMembers()replaces the root-only filter in the browser's workspace projection: a member that is not a root brings in its root when that root is not in the workspace.threadTreeOrderSource()now also returns each descendant's root.pinOrderSource()uses the same projection, so pinning an unrelated Thread keeps a linked root's manual slot.linked:<workspace>:<id>row keys, so a tree rendered in two groups keeps unique keys. ArrowLeft finds the parent row under the same prefix.docs/architecture/web-thread-tree.mdstates the new rule.Related issues
N/A
Test plan
On
main(f2306fb), macOS 27.2.1 (arm64):node --import tsx --test apps/web-ui/packages/client/ui-workspace/test/thread-tree.test.ts: 15 passed.[P, X](P is a linked root); pinning an unrelated Thread in A keeps B's saved order at[P, X]. The case fails on the first commit (07a77c1), where the saved order becomes[X].sidebar-window.test.ts: 9 passed.archived-query.test.ts(vitest) does not load here: a browser global is missing. It fails the same way on 90618ac, before these changes, so it was not run.tscover the changed files withapps/web-ui/tsconfig.base.json: no errors beyond thosemainreports for the same files (CSS module declarations, Node types).prettier --checkon the changed files: passed.npm start web -- --port 4401 --host 127.0.0.1 --ch-data <temp dir>withCODEXHOST_EXTERNAL_CLIENT_PORT=off; Node 24.13.1, Rust 1.97.1). The temp data directory held copies of the reported parent Thread, child Thread and their Delegation record. Viewed in headless Chrome 157 at 1280×1000, and this branch also at 390×844:main, the child's workspace expanded to only "Show more".