Skip to content

Commit e7aaf6b

Browse files
committed
merge: 同步上游 main(sidechat/注入重构/桌面兼容/rc.8 基线),解决 Sidebar.tsx 冲突
2 parents e3fee83 + 6cea4bd commit e7aaf6b

88 files changed

Lines changed: 10827 additions & 1563 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: 📋 问题报告 / Issue Report
2+
description: 报告 Bug、功能请求或建议(中英双语)| Report a bug, feature request or suggestion (bilingual)
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
## 🙏 感谢反馈 / Thanks for reporting!
8+
请尽量完整填写以下信息,能显著加快定位与处理速度。
9+
Please fill out the following fields as completely as possible.
10+
11+
- type: checkboxes
12+
id: checklist
13+
attributes:
14+
label: 提交前确认 / Pre-submit checklist
15+
description: 请逐项确认 | Please confirm each item
16+
options:
17+
- label: 我已搜索现有 issue,确认没有**完全相同**的条目(只有完全一致才算重复)| I searched existing issues and confirmed there is no **exact duplicate** (only exactly identical issues count as duplicates)
18+
required: true
19+
- label: 我已确认使用最新版本 dsh-better-sidebar / I confirmed I am on the latest dsh-better-sidebar version
20+
required: false
21+
22+
- type: dropdown
23+
id: environment-type
24+
attributes:
25+
label: 运行环境 / Environment
26+
description: 你使用的是哪种运行方式?| Which runtime are you using?
27+
multiple: false
28+
options:
29+
- DSH Web(浏览器访问)/ DSH Web (browser access)
30+
- Desktop 实现(如 deepseek-harness-desktop)/ Desktop build (e.g. deepseek-harness-desktop)
31+
- 其他 / 不确定 (Other / Not sure)
32+
validations:
33+
required: true
34+
35+
- type: input
36+
id: dsh-web-version
37+
attributes:
38+
label: DSH Web 版本 + 浏览器 / DSH Web version + Browser
39+
description: |
40+
例:DSH 0.1.1-rc.1 + Chrome 151(macOS)。
41+
Example: DSH 0.1.1-rc.1 + Chrome 151 (macOS).
42+
placeholder: "DSH 版本 / version + 浏览器 / browser(如 0.1.1-rc.1 + Chrome 151)"
43+
validations:
44+
required: false
45+
46+
- type: input
47+
id: desktop-repo
48+
attributes:
49+
label: Desktop 实现仓库 / Desktop repo(源头 / upstream)
50+
description: |
51+
若使用 Desktop 实现,请附上源头仓库链接,方便对照宿主行为。
52+
If using a Desktop build, please link the upstream Desktop repo for host-behavior reference.
53+
placeholder: "https://github.com/anywhere-labs/deepseek-harness-desktop"
54+
validations:
55+
required: false
56+
57+
- type: input
58+
id: plugin-version
59+
attributes:
60+
label: 插件版本 / Plugin version
61+
description: dsh-better-sidebar 的版本号 | The dsh-better-sidebar version
62+
placeholder: "如 0.13.1(`dsh plugin --profile web add dsh-better-sidebar@latest` 安装的版本)"
63+
validations:
64+
required: false
65+
66+
- type: dropdown
67+
id: category
68+
attributes:
69+
label: 类别 / Category
70+
description: 请选择本 issue 的类型 | Please choose the type of this issue
71+
multiple: false
72+
options:
73+
- 🐛 Bug(功能异常 / Something is broken)
74+
- ✨ 功能请求(新功能 / Feature request)
75+
- 💡 建议(体验改进 / Suggestion & improvement)
76+
validations:
77+
required: true
78+
79+
- type: textarea
80+
id: description
81+
attributes:
82+
label: 描述 / Description
83+
description: |
84+
请详细描述:现象、期望行为、(Bug 必填)复现步骤、截图/日志等。
85+
Describe in detail: what happened, expected behavior, reproduction steps (required for bugs), screenshots/logs, etc.
86+
placeholder: |
87+
现象 / What happened:
88+
期望行为 / Expected behavior:
89+
复现步骤(Bug 必填)/ Steps to reproduce (required for bugs):
90+
截图或日志 / Screenshots or logs:
91+
validations:
92+
required: true
93+
94+
- type: textarea
95+
id: additional
96+
attributes:
97+
label: 补充信息 / Additional context
98+
description: 其他有助于定位的信息(可选)| Anything else that may help (optional)
99+
placeholder: "操作系统 / OS、配置文件、报错堆栈、临时 workaround 等 / OS, config files, error stack, temporary workarounds, etc."
100+
validations:
101+
required: false

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
# (dsh-base / dsh-web-app) resolves from this installation. Keep in
8383
# step with the plugin's @deepseek-ai/* peer range when bumping.
8484
- name: Install dsh CLI (pinned)
85-
run: npm install -g @deepseek-ai/dsh@0.1.0-rc.7
85+
run: npm install -g @deepseek-ai/dsh@0.1.1-rc.1
8686

8787
# lib/ is gitignored; the tarball is produced from this build.
8888
- name: Build and pack the npm tarball

AGENTS.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ better-sidebar 从 v0.4.0 起暴露 `ctx.betterSidebar` 服务(Cordis context
1919

2020
1. `pnpm build && pnpm pack` 产出 tarball(与发布产物一致)。
2121
2. `scripts/e2e-mount.sh` 用官方 CLI 把它装进一个**全新 scratch profile**`dsh plugin --profile web add file:<tarball>`,触发 `dsh.profile.bundles` 协调),然后启动真实 `dsh web`(keyless,`--port 0`)。
22-
3. `tests/e2e/mount.e2e.ts`(Playwright Chromium)加载页面,断言外壳与 `[data-dsh-better-sidebar]` 挂载、无 `dsh-better-sidebar:` 错误条、无 pageerror/插件 console 错误,显式展开面板(`openByDefault` 默认关)后通过「+ 菜单」逐个打开内置 tab(含终端懒加载 chunk)深扫,再经 Files 文件窗口的内嵌树打开 seed 文件强制加载 editor 懒加载 chunk(`client-editor.js`原地模式:seed 的 home tab 原地切换到文件)——缺失的内置 tab 或 chunk 都会使门禁变红。
22+
3. `tests/e2e/mount.e2e.ts`(Playwright Chromium)加载页面,断言外壳与 `[data-dsh-better-sidebar]` 挂载、无 `dsh-better-sidebar:` 错误条、无 pageerror/插件 console 错误,显式展开面板(`openByDefault` 默认关)后通过「+ 菜单」逐个打开内置 tab(含终端懒加载 chunk)深扫,再经 Files 文件窗口的树打开 seed 文件强制加载 editor 懒加载 chunk(`client-editor.js`独立模式:每个文件新开 tab,seed 的 home tab 保持资源管理器)——缺失的内置 tab 或 chunk 都会使门禁变红。
2323

24-
本地跑:`pnpm build && pnpm pack && pnpm exec playwright install chromium && pnpm test:mount`(需 PATH 上有 `dsh` 或可经 npx 拉取)。DSH CLI 版本在 CI 钉住 `@deepseek-ai/dsh@0.1.0-rc.7`(与插件 peer 范围同步)。`tests/e2e` 的 spec 命名 `*.e2e.ts` + vitest `exclude` 双保险与 vitest 隔离;**改动 vitest `exclude` 时必须保留默认排除项**`exclude` 会整体替换默认值)。
24+
本地跑:`pnpm build && pnpm pack && pnpm exec playwright install chromium && pnpm test:mount`(需 PATH 上有 `dsh` 或可经 npx 拉取)。DSH CLI 版本在 CI 钉住 `@deepseek-ai/dsh@0.1.1-rc.1`(插件 devDependencies 验证基线;peer 下限保持 `^0.1.0-rc.8`,rc.8 与 0.1.1-rc.1 双向兼容)。`tests/e2e` 的 spec 命名 `*.e2e.ts` + vitest `exclude` 双保险与 vitest 隔离;**改动 vitest `exclude` 时必须保留默认排除项**`exclude` 会整体替换默认值)。
2525

2626
### npm 发版(GitHub Release → npm publish)
2727

@@ -53,7 +53,7 @@ better-sidebar 从 v0.4.0 起暴露 `ctx.betterSidebar` 服务(Cordis context
5353
{
5454
"name": "my-plugin",
5555
"peerDependencies": {
56-
"cordis": "^4.0.0-rc.7",
56+
"cordis": "^4.0.0-rc.8",
5757
"dsh-better-sidebar": "workspace:*"
5858
},
5959
"peerDependenciesMeta": {
@@ -350,9 +350,10 @@ ctx.effect(() => {
350350

351351
| id | order | single | hidden | 用途 |
352352
|---|---|---|---|---|
353-
| `editor` | 10 | 否(按 path 去重) | 否 | 唯一的「文件窗口」(文件编辑/预览 + 文件资源管理):文件 tab(有 path)在两种 `editorExplorer` 模式下 chrome 恒为合并形态——头部路径输入框 + 文本编辑器预览/编辑/保存控件 + 可开关的内嵌文件树面板(含全局文件名搜索,走 host `fs.search` 路由;左缘拖拽调宽),状态存 `tab.meta.treeOpen` / `tab.meta.treeWidth`;pref 控制**打开行为与无路径窗口形态**:(默认,合并)= 树点击/输入框 Enter 原地切换当前 tab(`updateTab` 重写 path/title,id 与 meta 不变),无路径窗口 = 带 chrome 的空文件窗口(树默认展开);关(独立)= 走 `openSidebarFile` 按 path 新开,**无路径窗口即独立资源管理器——只渲染文件树面板**(搜索 + FileTree 撑满全窗,无编辑器 chrome)。树右键菜单提供「在新 Tab 中打开」「在侧边打开」(后者在当前 pane 右侧 split 出新 editor tab)。新会话在两种模式下都默认 seed 空文件窗口(`title: 'Files'`,无 path,树面板展开);持久化的旧 `explorer` tab 经 `sanitizeState` 迁移为该 home tab |
353+
| `editor` | 10 | 否(按 path 去重) | 否 | 唯一的「文件窗口」(文件编辑/预览 + 文件资源管理):文件 tab(有 path)在两种 `editorExplorer` 模式下 chrome 恒为合并形态——头部路径输入框 + 文本编辑器预览/编辑/保存控件 + 可开关的内嵌文件树面板(含全局文件名搜索,走 host `fs.search` 路由;左缘拖拽调宽),状态存 `tab.meta.treeOpen` / `tab.meta.treeWidth`;pref 控制**打开行为与无路径窗口形态**:(默认,独立)= 走 `openSidebarFile` 按 path 新开,**无路径窗口即独立资源管理器——只渲染文件树面板**(搜索 + FileTree 撑满全窗,无编辑器 chrome);开(合并)= 树点击/输入框 Enter 原地切换当前 tab(`updateTab` 重写 path/title,id 与 meta 不变),无路径窗口 = 带 chrome 的空文件窗口(树默认展开)。树右键菜单提供「在新 Tab 中打开」「在侧边打开」(后者在当前 pane 右侧 split 出新 editor tab)。新会话在两种模式下都默认 seed 空文件窗口(`title: 'Files'`,无 path,树面板展开);持久化的旧 `explorer` tab 经 `sanitizeState` 迁移为该 home tab |
354354
| `git` | 20 ||| Git 面板 |
355355
| `subagent` | 30 ||| 子代理拓扑 |
356+
| `sidechat` | 35 | 否(createTab 铸造 `sidechat:<uuid>`/按 `meta.threadId` 去重) | 否 | 侧边对话(Codex 风格,**每个对话一个独立 Tab**):打开 Tab 即自动创建空线程(composer 拥有首条消息,host 侧包裹边界提示 + 创建时停泊的进行中快照,首条消息赢得真实标签并同步 Tab 标题);线程 = 插件自建子会话(自定义种子继承父会话完整上下文,进行中回合以 `interrupted` 冻结诚实闭合;种子尾部带合法 `subagent/descriptor`——否则 cold 线程在宿主 subagents.list 里是 corrupt 诊断行——SubagentView/subagent-detect 按 `Side: ` 前缀过滤保持拓扑零噪音),`origin:'subagent'` 隐藏于主列表;生命周期走自有 `/sidebar/api/sidechat.*` 路由(`ctx.agents.create/resume` + `agent.followup/cancel` + `sidechat.info` 读 Agent 身份/状态);头部菜单可切换/重开既有线程(`parkSidechatReopen` + `sidechat:<threadId>` 确定性 id),关闭 Tab 释放 live agent(历史保留);重开 Tab 经 `collectOwnEvents` 大页回源到种子边界(cold 读会展开 chunk 压缩行,小窗口会丢早期 tool/call 行);「保存为新会话」= `session.fork` 提升顶层会话(必须方法调用形态,`this` 敏感)。UI 对齐主对话区(用户气泡 `--dsw-specific-bubble`、assistant 通栏 markdown、胶囊 composer + 圆形发送/停止钮、运行扫光状态行)。见 [设计文档](docs/plans/2026-08-20-sidechat-tab-design.md) |
356357
| `terminal` | 40 ||| 终端(nextTerminal 自增) |
357358
| `browser` | 50 | 否(createTab 铸造 browser:`<n>`,nextBrowser 自增) || 内嵌网页浏览器(沙箱 iframe;可设置关闭沙箱) |
358359
| `diff` | -1 | 否(按 id 去重) || 差异查看(由 GitView 触发) |
@@ -605,9 +606,17 @@ interface OpenTabSeed {
605606

606607
- **面板表面**:右/底面板背景 = `var(--dsw-alias-bg-layer-1)`(通用卡片表面)。**绝不消费 `--dsw-specific-sidebar-fill`**——那是宿主左侧导航列专属令牌,皮肤系统按左导航语义覆盖它(dsh-web-ui 皮肤把它做成半透明玻璃或主题色,Aqua 设成 `transparent`),面板消费它会失去填充或与标签令牌冲突。皮肤要整体换面板表面:覆写 `--dsw-alias-bg-layer-1` 即可(dsh-web-ui 10 款皮肤都已覆盖,无需任何额外工作)。
607608
- **终端/编辑器表面**:经 `effectiveTokenValue` 读取 `--dsw-alias-bg-base`——`transparent` 与 alpha < 0.9 的半透明玻璃值(dsh-web-ui 皮肤用 rgba 0.16–0.7)一律回退不透明底色,文字永不叠在皮肤背景画上滚动(issue #90);≥ 0.9 的近不透明值(如皮肤作用域内 0.96 的瓷器玻璃)放行,皮肤仍能控制终端表面。
608-
- **根锚点**:宿主 div 带 `data-dsh-better-sidebar` 属性(append 到 `document.body`),面板是其 fixed 直接子级。皮肤若要做作用域覆盖(deep-whale 的做法),限定在 `[data-dsh-better-sidebar]` 内即可,避免全局改写影响宿主。
609-
- **布局变量**(写在 `<html>` 上,面板打开时有效):`--dsh-sidebar-width` / `--dsh-sidebar-height`(面板几何;拖拽期间逐帧更新)。
610-
- **z-index**:面板 40、折叠按钮簇 45(角手柄在面板内层叠,z-index 2 仅面板内有效)——全部低于 DSH 浮层栈(100/1000+),任何浮层天然盖住侧边栏。
609+
- **根锚点**:宿主 div 带 `data-dsh-better-sidebar` 属性(append 到 `document.body`)。其内是**统一面板宿主层** `[data-dsh-panel-host]``position:fixed; inset:0; z-index:40; pointer-events:none`,v0.13.1+):面板/开关簇在其内 **absolute** 定位(层 inset:0 即视口坐标),免疫桌面套壳中间层 transform 对 fixed 含块的劫持;页面级 transform(罕见)触发 `data-dsh-panel-host-degraded` 降级同步。皮肤若要做作用域覆盖(deep-whale 的做法),限定在 `[data-dsh-better-sidebar]` 内即可,避免全局改写影响宿主。
610+
- **布局变量**(写在 `<html>` 上,面板打开时有效):`--dsh-sidebar-width` / `--dsh-sidebar-height`(面板几何;拖拽期间逐帧更新)。宿主推挤 = `#root``margin-right/width: calc(100% - var)`(v0.13.1+ 防桌面壳加性溢出)与 centerCol 的 `margin-bottom`;推挤锚点是**复合选择器**(同一元素双保险,禁止退回 `nth-child` 位置锚定):`#root [data-dsh-frame] > [data-pane="conversation"]` **** `#root :has(> [data-slot="conversation"])`(0.1.x 命名 / rc.8 时代命名,live 页面实测同元素;`drag-layout.e2e.ts` 断言两者同元素)。
611+
- **桌面信号与标题栏兼容**(v0.14.1+ 四选项模型,取代旧"win32 advanced 自动 32px"硬编码):
612+
- 壳信号(只读报告,不自动触发任何修改):URL `dsh-desktop-mode` / `dsh-desktop-platform`(DSH Desktop 壳注入;preload 另暴露 `__DSH_DESKTOP_FILE_PATH__`);可选契约参数 `dsh-desktop-titlebar-inset`(壳声明自己预留的顶栏像素,0–120,clamp;`parseDesktopEnv().titlebarInset`)。
613+
- **strip 取值链**`src/client/titlebar-strip.ts` 唯一决策点,纯函数):⓪ `web` 方案强制 0(显式 DSH官方Web,连 WCO 也不适用);① `navigator.windowControlsOverlay` 标准 API 真实几何(`src/client/wco.ts`,反应式订阅 `geometrychange`,最大化/还原实时更新——**即使为 0 也权威**`visible=false` 的幽灵 API 视为缺失,覆盖 #257 的 32/36px 差异);② URL `dsh-desktop-titlebar-inset`;③ 壳预设 `stripFor`(仅 `preset` 方案);④ 手动 `titleBarStripPx`(仅 `custom` 方案);⑤ 0(网页零修改)。结果驱动 `body[data-dsh-title-bar-compat]` + `--dsh-title-bar-strip`(语义与旧布尔一致)。
614+
- **四选项设置**`SidebarPrefs.titleBarScheme`,设置页主行**下拉**`auto` 默认 / `web` / `preset` / `custom`):`auto` = 只信标准信号(WCO),壳 stamp 不触发任何修改——**"为某壳做的兼容在另一个壳会再坏",核心不做壳专属分支**`web` = 显式「DSH官方Web」,任何情况强制 0;`preset` = 数据驱动的内置壳预设(`src/client/shell-presets.ts`,准入规则:issue/PR 中被提及且 GitHub ⭐>100;v1 仅 anywhere-labs DSH Desktop:darwin advanced 20px、win32 无 WCO 时 32px 兜底;下拉选项命中环境时带「已检测」后缀,仅提示、绝不自动启用);`custom` = 用户自定义 CSS + 手动 strip px(下拉选中后出现齿轮按钮,弹窗含下移距离与 CSS 输入)。
615+
- **旧文档迁移**:schema 中 `titleBarScheme` 无默认值(缺失才可迁移);旧文档**已有值**`titleBarCompat === true``titleBarStripPx` 非默认 40)→ 迁移到 `custom` 方案保留用户数值;干净文档 → `auto`
616+
- **用户空间 CSS**:预设 css(`<style data-dsh-preset-css>`)与自定义 css(`<style data-dsh-custom-css>`)经 `Sidebar.tsx` effect 注入到 `document.head` 末尾(后写胜出;覆盖 JS 内联变量需 `!important`),fiber 卸载/变更即移除。稳定寻址面(皮肤/预设/自定义 CSS 共用):`[data-dsh-toggle-cluster]``[data-dsh-panel]`(右面板)、`[data-dsh-bottom-panel]`(底面板)。
617+
- **拖拽区退出**:插件交互 chrome(`.toggleCluster` / `.toggleButton` / `.tabBar`)统一 `-webkit-app-region: no-drag`——无边框壳的顶部拖拽带会吞点击(#103/#111),该属性在普通浏览器与无拖拽区壳中惰性无害。
618+
- `compatibility` 模式与无信号环境不避让。
619+
- **z-index**:面板宿主层 40、折叠按钮簇 45(角手柄在面板内层叠,z-index 2 仅面板内有效)——全部低于 DSH 浮层栈(100/1000+),任何浮层天然盖住侧边栏。
611620

612621
### 8.2 注意事项
613622

@@ -631,7 +640,7 @@ interface OpenTabSeed {
631640
"./client": { "types": "./lib/types/client/index.d.ts", "default": "./lib/client.js" }
632641
},
633642
"peerDependencies": {
634-
"cordis": "^4.0.0-rc.7",
643+
"cordis": "^4.0.0-rc.8",
635644
"dsh-better-sidebar": "workspace:*",
636645
"@deepseek-ai/dsh-client-runtime": "^0.0.1",
637646
"react": "^18.2.0"

0 commit comments

Comments
 (0)