feat(sidebar): 后台激活的页面不再顶掉读者,改为标记未读红点

维护者在 #817 上批准了「后台自动激活不接管右侧栏」的行为,并要求同批补上
「后台新开了页面」的提示:事件不能丢,但也不能把读者正在看的页面顶走。

行为:
- 被门控跳过的那次激活仍然创建任务管理页,只是不再抢焦点
  (`OpenTabSeed.reveal: false` → 宿主 `revealIfOpened: false`,即
  「放置但不聚焦」;页面类型本来就没有自己的聚焦路径,已经存在的页面
  再开一次也只是一次聚焦,正是门控要拒绝的那件事)。
- 该页在原生右栏芯片与插件底部工作台对应页签上显示一个静态小红点
  (`aria-label` = 新词条 `tabUnread`,颜色取既有 `--dsw-alias-danger`)。
- 读者切到该页即清除标记:底部工作台走 service.activateTab;原生栏的
  点击插件看不见(`ISidebarRight` 只有 `active()` 读取器,没有选中事件流),
  所以由宿主自己的芯片按 `tab.visible` 清除——非可见芯片不清除,
  否则宿主为每个展开页签都画标题,红点刚亮就会被抹掉。
- 标记存进会话状态的 `unread: TabType[]`(随布局持久化,跨挂载/跨会话/
  刷新都在),两个承载面读同一份,不会各自为政。

文案:20 份词典同批更新两条设置项描述(门控行为变了)+ 新增 `tabUnread`
词条(ja 真日文)。

测试:`tests/sidebar-auto-activation.spec.tsx` 的门控两条改为断言
「页面仍创建 + revealIfOpened:false + 标记出现」,并加红点生命周期与
「已在任务页/正常激活不标红」三条;新增 `tests/native-tab-unread.spec.tsx`
钉住原生芯片这一承载面(画点、按 visible 清除、非可见不清除、别的类型
不串味、不破坏可访问名)。判别性用 6 处镜像还原逐条证伪(见报告)。
This commit is contained in:
Menghuan1918 committed 2026-10-05 23:03:40 +08:00
1 parent 9c18f05441
commit de1e76e2f5
33 files changed
+654 -57

No files matched your search

+24
View File
@@ -487,6 +487,30 @@ body[data-dsh-sidebar-dragging] .bottomPanel {
flex: none;
}
/* "This page has something you have not looked at": a small solid dot on the
tab, drawn on the native chip and on the bottom workbench strip alike. Static
by design — a pulsing marker on every new subagent is noise, and the two
carriers must read as the same thing. The chip is inline text (its content
IS the host's tab label), so the mark is an inline-block sitting on the text
baseline; the strip's own mark centres in its flex row instead. */
.chipUnread {
display: inline-block;
width: 6px;
height: 6px;
margin-left: 6px;
border-radius: 50%;
background: var(--dsw-alias-danger);
vertical-align: middle;
}
.tabUnreadDot {
flex: none;
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--dsw-alias-danger);
}
/* One tab's mounted content; inactive tabs stay mounted but hidden so
switching never tears down terminals/editors (state survives). */
.paneTab {