Skip to content

v0.2.0 — 侧边栏层级:最近任务成为独立折叠区块 / Recent tasks as a section-level block

Choose a tag to compare

@winditer winditer released this 20 Oct 08:46
· 10 commits to main since this release

中文

侧边栏层级调整:「最近任务」现在是与「工作区」同层的独立折叠区块。

  • 两块各自折叠:官方行自带的箭头收起它自己那一组;标题行前新增的箭头收起其它工作区分组(「最近任务」不受影响)。
  • 「最近任务」下的对话行相对它的标题缩进一级;它仍然是真工作区记录、仍钉在末位,官方行为(改名、搜索、拖拽排序、折叠)一个没丢。
  • 折叠状态只存在你自己的浏览器里(dsh.recent-tasks.workspaces-collapsed.v1),不上报、不同步。
  • 前提不成立时自动停用且不留残留:单列表、搜索中、56px 细栏、树模式下被嵌套、官方结构变化;切回来立刻恢复。:has() 不可用时只丢开关、保留换装。
  • 纯表现层:不写工作区数据、不调 host、全文只用一个选择器,且只认官方稳定属性(data-row-key / role / 内联 --dsh-workspace-indent)——从不依赖随版本变化的官方 class 哈希。

发布前抓掉的一个真故障:这一版的第一稿在真机上根本不会生效——官方把每一行都包在 HoverCard 的 <span> 里(ui-workspace:2043 / :2272,包裹体是 jsxs("span", {className: cn(Gn.root, …)})),因此"行的父节点就是分组容器""会话行在容器直下"两个前提都不成立,定位链直接判停用、缩进规则永不匹配。现已沿父链上溯到列表的直接子元素、并递归打标签;独立复核在真实浏览器引擎里用 0.2.1-rc.2 的官方 CSS 复跑验证通过,回归测试的假 DOM 也改成按真实结构包裹。

测试 75/75(npm run verify,含制品契约守卫;6 条关键守卫另做变异测试证明会挂)。

安装:dsh plugin --profile desktop add <附带的 tarball>,或 npm i dsh-recent-tasks。

English

The sidebar hierarchy change: Recent tasks is now its own collapsible block beside the workspaces section.

  • The two blocks collapse independently: the official arrow collapses its own group, while the new arrow in front of the section title collapses the other workspace groups (Recent tasks stays put).
  • Chat rows under Recent tasks sit one indent step in from its title. It is still a real workspace record pinned last, and nothing official is lost (rename, search, drag-reorder, collapse).
  • The collapse flag lives only in your browser (dsh.recent-tasks.workspaces-collapsed.v1); it is never reported or synced.
  • It disables itself and leaves nothing behind when the anchors are not right: flat list, search, the 56px rail, tree-mode nesting, or an official structure change — and it re-applies the moment they come back. Where :has() is unsupported it drops only the toggle and keeps the restyle.
  • Presentation only: no workspace data written, no host call, one document-wide selector, and it keys on official stable attributes only (data-row-key, role, the inline --dsh-workspace-indent) — never on the build-hash class names.

A real defect caught before release: the first cut would never have activated on a real machine — every official row is wrapped in a HoverCard <span> (ui-workspace:2043 / :2272, jsxs("span", {className: cn(Gn.root, …)})), so "the row's parent is the group container" and "sessions are its direct children" were both false: the adapter disabled itself and the indent rule matched nothing. It now climbs to the list's direct child and tags recursively; an independent review replayed it in a real browser engine against the extracted 0.2.1-rc.2 CSS, and the regression tests' fake DOM models the wrapper.

75/75 tests pass (npm run verify, including the artifact contract guards; six key guards were mutation-tested).

Install: dsh plugin --profile desktop add <attached tarball>, or npm i dsh-recent-tasks.