Repository navigation
修复会话标题按钮回主列时页面丢失的问题,并修正 dsh-doca 插件文档 - #203
Merged
Merged
Conversation
The README and the smoke checklist were last changed on 2026-11-29; the plugin and the embedded web app moved on since. Every statement was checked against the code and each finding verified by a second reader. What was wrong or missing, now corrected in both editions: - Copying inside the embedded site was not mentioned. DSH denies embedded pages the Clipboard API; from Doca 0.3.6 copy and cut in a spreadsheet and the share dialog's copy-link work through the browser's older copy path, older sites show the sheet's warning, and image copy and the copy buttons of other pages fail on every version. - The reload button of both site views (added on 2026-11-30) was undocumented. - The page does not follow the conversation-title button back to the main column; only the tab header's "Open in the main view" carries it. The text said switching keeps the page in both directions, which spec 023 records as verified. The docs now describe the behaviour as it is and list it as a known limitation. - Which entries are remembered when the title button chooses where to open, and that a Start-pane tab is not. - From the main column, opening an attachment also brings the conversation back. - The confirmation mode `none`, and the three classes confirmed in every mode. - The 20 MiB transfer limit and the default download directory. - The MCP key pill is hidden in a narrow sidebar; the current row has no delete; the add form opens prefilled; the config row holds more than the address and a reference name; the first release with the narrow layout is 0.3.2. - The hand-written DSH types live in more than one file. The smoke checklist gains a reload step, names the Activity control by its English label, and states that item 7 returns through the tab header. Co-Authored-By: Claude Code <noreply@anthropic.com>
…le button The site view hands its page over when the site moves from the main column to the sidebar, and the sidebar tab header's own button brings the page back. The conversation-title button did not: returning the site from the sidebar to the main column only selected the panel, so the column reopened on the page it last showed itself and the document the sidebar had moved on to was left behind. Spec 023 records both directions as keeping the page. The button now copies the sidebar's page into the column's, with the narrow marker added again, exactly as the tab header's button does. The regression test fails on the previous code and passes with this one; it had no assertion on which page the column shows before. With the behaviour restored, the README and the smoke checklist describe the switch as keeping the page in both directions again, and item 7 of the checklist walks the title button as well as the tab header's button. Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SDD-Level: light
SDD-Spec: none
Problem
两件事,都在
@smartdoca/dsh-doca插件里。1. 一个代码缺陷。 站点视图在中间主列和右侧栏之间切换时应当保留当前打开的页面(spec 023 记录两个方向都已实测)。但用会话标题旁的 Doca 按钮把站点从右侧栏移回主列时页面不跟着走:主列重新打开的是它上次自己显示的页面(通常是文档列表),右侧栏当时正在看的那篇文档被留在右侧栏。用右侧栏标签页头部的“在中间打开”则正常。
原因是一行漏写。主列和右侧栏各自记着当前页面(
panelUrl、homeTabUrl)。主列→右侧栏(hostInSidebar)和标签页头部按钮(openInPanel)都有“把对方的状态赋过来”这一步;会话标题旁按钮的那个分支只切换了面板,没有赋值。这个缺陷此前没有测试能发现:现有测试走过这条路径,但只断言“主列被打开”,没有断言“主列显示哪一页”。
2. 文档过时。 README 和冒烟清单(SMOKE)最后一次修改是 2026-11-29,此后插件代码(11-30 加了刷新按钮)和被嵌入的 Doca 网页应用都变过,文档没有跟上。
Behavior
代码修复(
integrations/dsh-doca/client/index.ts,1 行): 会话标题旁按钮的“右侧栏→主列”分支补上if (homeTabUrl !== undefined) panelUrl = withNarrowMarker(panelSite, homeTabUrl),与标签页头部按钮的做法完全一致。只有站点自己的页面才会更新homeTabUrl(空白引导页和站外地址都被过滤),所以带过来的地址始终是站点内的页面。回归测试(
integrations/dsh-doca/test/client.test.ts): 右侧栏显示某篇文档时点会话标题旁的按钮,断言主列拿到的是这篇文档并带窄版式标记。去掉修复该断言失败(主列拿到的是#/documents),恢复修复后通过。文档(README + SMOKE,中英各一份,4 个文件)。 每条陈述对照代码核实,报告出的问题再由另一个读者复核(确认 18 条、否决 4 条)。最终内容:
新增(此前完全没写):
none:该模式下创建/移动/删除不再弹卡片,但申请文档阅读权限、通过 Doca 发出的 HTTP 请求、插件不认识的操作在任何模式下都会确认。doca-downloads。修正(原文与代码不符):
src/dsh-types.ts一处。冒烟清单: 第 7 项改成能照着执行的步骤,并且明确走会话标题旁的按钮这条路径(即本次修复的路径);新增 7a 检查刷新按钮;英文版“活动记录”控件补上英文名 Activity;“未覆盖”清单加上表格复制。
Impacts
docs/下的契约文档未改动,@smartdoca/dsh-doca的公开接口(注册的槽位、注入对象、IPC)没有变化。homeTabUrl和panelUrl都是插件运行时的内存变量。Verification
expected '#/documents…' to be '#/r/sidebar-doc…';加上修复后通过。随后临时去掉修复那一行重跑,再次失败于同一处;恢复后通过。pnpm check:dsh-doca退出码 0:类型检查(3 个程序)、312 个测试通过 / 5 个按环境跳过、构建成功。pnpm docs:check、pnpm sdd:check退出码 0(基线为 main0bfe5f6、Doca 0.3.9)。e68a994)里不存在,在 0.3.6(63cb599)、0.3.7(daf8878)及之后都有;紧凑版式路由在 0.3.2 的发布提交里首次出现。没有做的:
顺带发现、未在本次处理
interfaceEnabled和showGuideEntry在src/config.ts里声明并显示在 DSH 设置里,但没有任何代码读取它们。none的设置说明写的是“不确认”,但申请权限等三类操作在该模式下仍会确认(文档已按实际行为写明,设置里的说明文字未改)。🤖 Generated with Claude Code