dsh-ide-window 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +14 -1
- package/CHANGELOG.md +11 -0
- package/README.md +7 -1
- package/client.js +44 -3
- package/package.json +1 -1
- package/themes/atom-one-light.css +2 -2
- package/themes/dracula.css +2 -2
- package/themes/github-light.css +2 -2
- package/themes/intellij-light.css +2 -2
- package/themes/material-light.css +2 -2
- package/themes/material-oceanic.css +2 -2
- package/themes/material-palenight.css +2 -2
- package/themes/monokai-pro.css +2 -2
- package/themes/night-owl.css +2 -2
- package/themes/solarized-light.css +2 -2
package/AGENTS.md
CHANGED
|
@@ -56,7 +56,7 @@ locale/{zh,en}.json UI 文案(165 个键);插件管理器也从这里
|
|
|
56
56
|
| `06-platform.js` | **客户端平台层**:`toPosix/toNative`、`isAbsolutePath`、手势选项与按键文案(`apply()` 里按 `ctx.shortcuts.platform` 换实例) |
|
|
57
57
|
| `07-log.js` | **客户端日志**:100 条环形缓冲 `ideLogRecord/ideLogSnapshot`,供「复制诊断信息」上报 |
|
|
58
58
|
| `10-core.js` | store(`useSyncExternalStore` 订阅)、偏好持久化、标签页/历史/视图状态 |
|
|
59
|
-
| `12-theme.js` | **配色主题**:注册表(10 套)、`<link id="iw-theme-link">` 切换、状态栏切换器;主题同时提供 8
|
|
59
|
+
| `12-theme.js` | **配色主题**:注册表(10 套)、`<link id="iw-theme-link">` 切换、状态栏切换器;主题同时提供 8 个语法色变量;对外发布主题(见 3.6) |
|
|
60
60
|
| `20-tree.js` | 文件树(展开、筛选、拖宽、`⌘P` 定位) |
|
|
61
61
|
| `30-code.js` | 代码视图(行渲染、符号点击、跳转、右键菜单挂载) |
|
|
62
62
|
| `40-panel.js` | 面板骨架(工具栏、横幅、布局、字号 CSS 变量) |
|
|
@@ -119,6 +119,18 @@ locale/{zh,en}.json UI 文案(165 个键);插件管理器也从这里
|
|
|
119
119
|
| `/dsh-ide/theme` | 主题样式表 | `GET ?id=<主题>` 返回 `themes/<id>.css`(唯一非 JSON 路由,浏览器用 `<link>` 取);id 只允许 `[a-z0-9-]`,未知 404、非法 400 |
|
|
120
120
|
| `/dsh-ide/license` | JetBrains 授权 | `{action:'status'}` 跑 `intellij-server license status`;`{action:'open'}` 后台跑 `license login --browser` 并回传授权 URL(6 秒内没出现 URL 就回传工具输出)。给这两个 JVM 动词加 `-Didea.log.path=<tmp>`,避免受限环境下写 `~/Library/Logs` 失败 |
|
|
121
121
|
|
|
122
|
+
### 3.3.1 跨插件主题约定(和 dsh-git-window)
|
|
123
|
+
|
|
124
|
+
代码工作区选的配色要能带着同页的 `dsh-git-window` 一起变,靠三条约定,**只有本插件写、对方只读**:
|
|
125
|
+
|
|
126
|
+
| 通道 | 形状 | 用途 |
|
|
127
|
+
|---|---|---|
|
|
128
|
+
| `localStorage['dsh-theme']` | 主题 id 字符串,空/缺失 = 跟随 DSH | 后加载的插件启动时能立刻读到 |
|
|
129
|
+
| `window` 事件 `dsh-theme` | `{ detail: { id } }` | 同页立即生效,不用刷新 |
|
|
130
|
+
| `data-dsh-theme` 属性 + `/dsh-ide/theme?id=<id>` | 主题文件选择器就是 `[data-dsh-theme="<id>"]` | 对方给自己的根节点加属性、`link` 同一份样式表即可套用 |
|
|
131
|
+
|
|
132
|
+
改主题文件的选择器或键名 = 改接口,必须同步改 `dsh-git-window`(它的 `src/client/05-theme.js` 只读这三样)。对方没装本插件时样式请求 404,它保持自己的 token 外观,不会报错。
|
|
133
|
+
|
|
122
134
|
### 3.4 用到的 DSH 槽位
|
|
123
135
|
|
|
124
136
|
| 槽 | 用途 |
|
|
@@ -308,6 +320,7 @@ dsh plugin --profile desktop add link:~/dev/dsh-ide-window
|
|
|
308
320
|
| 「复制诊断信息」点了没反应、页面像卡住 | `await navigator.clipboard.writeText()` 在无权限/嵌入式环境下可能永不 resolve | 剪贴板用 `Promise.race` 加 1.5 秒超时,上报日志优先,超时退化为「已写入宿主日志」提示 |
|
|
309
321
|
| 主题弹层里点某一项没反应(真鼠标点不动,代码里 `.click()` 却正常) | 关闭弹层用的是 `document` 上的 **capture** `pointerdown`:真实鼠标先派发 pointerdown,监听器先把弹层卸载,行的 click 永远到不了 | 关闭监听要放过落在弹层/触发按钮内部的按压(`target.closest('.iw-theme-pop, .iw-theme-button')`);**交互必须用真实指针事件验证**,程序化 `.click()` 会绕过 pointerdown |
|
|
310
322
|
| 切到浅色主题后代码看不清(深色语法色仍在用) | 语法高亮是写死的深色配色,没有跟着主题走 | 语法色走 `--iw-syn-*` 变量,每套主题各给一组并按对比度校验(正文类 ≥4.5:1,注释 ≥3.5:1);`test/theme.mjs` 断言每套主题都有这 8 个变量 |
|
|
323
|
+
| 两个插件(代码工作区 + git 窗口)配色不一致 | 各自注入 CSS、各自用 DSH token,主题是本插件私有的 | 把主题做成跨插件约定:`localStorage['dsh-theme']` + `dsh-theme` 事件 + `[data-dsh-theme]` 选择器;对方只读这三样。只在 `.iw-root` 上作用域的选择器无法共享,必须用通用属性 |
|
|
311
324
|
|
|
312
325
|
---
|
|
313
326
|
|
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
升级方式:DSH →「插件」→ 打开插件的「版本」区 →「检查更新」,或直接卸载后重新安装。
|
|
7
7
|
(`link:` 本地安装不参与版本检查,拉取仓库即可。)
|
|
8
8
|
|
|
9
|
+
## [0.3.0] — 2026-11-19
|
|
10
|
+
|
|
11
|
+
### 新增
|
|
12
|
+
|
|
13
|
+
- **主题跨插件共享**:同一页面里的 `dsh-git-window` 会跟随代码工作区的配色,切「德古拉」或「IntelliJ 浅色」时它的工具窗口同步换色,无需单独设置。
|
|
14
|
+
- 共享方式是三条约定,本插件只写不读:`localStorage['dsh-theme']`(当前主题 id)、`window` 事件 `dsh-theme`(同页立即生效)、`[data-dsh-theme]` 属性(配合 `/dsh-ide/theme?id=<id>` 样式表)。其他插件给自己的根节点加这个属性即可套用同一套配色。
|
|
15
|
+
|
|
16
|
+
### 变更
|
|
17
|
+
|
|
18
|
+
- 主题样式表的选择器从 `.iw-root[data-iw-theme="<id>"]` 改为通用的 `[data-dsh-theme="<id>"]`。**自己改过主题文件选择器的用户**需要同步这一行;正常使用不受影响。
|
|
19
|
+
|
|
9
20
|
## [0.2.1] — 2026-11-19
|
|
10
21
|
|
|
11
22
|
### 文档
|
package/README.md
CHANGED
|
@@ -223,9 +223,15 @@ dsh plugin --profile desktop add "git+https://github.com/simons-jiang/dsh-ide-wi
|
|
|
223
223
|
|
|
224
224
|
语法高亮有单独一层变量(`--iw-syn-keyword` / `string` / `number` / `comment` / `annotation` / `type` / `function` / `punct`),同样由主题文件提供——深色主题的关键字色放到白底上根本看不清,所以每套主题都自带一组经过对比度检查的语法色(浅色主题的关键字/字符串/类型都 ≥4.5:1)。
|
|
225
225
|
|
|
226
|
+
主题还是一个**跨插件约定**:同一页面里 `dsh-git-window` 的工具窗口会跟着变色(它只读这里的主题,不写):
|
|
227
|
+
|
|
228
|
+
- `localStorage['dsh-theme']` 存当前主题 id(空 = 跟随 DSH)
|
|
229
|
+
- `window` 上派发 `dsh-theme` 事件(`detail.id`)——同页立即生效
|
|
230
|
+
- 样式表匹配 `[data-dsh-theme="<id>"]`,任何插件给自己的根节点加上这个属性就套用同一套配色,并自行 `link` 到 `/dsh-ide/theme?id=<id>`
|
|
231
|
+
|
|
226
232
|
因此:
|
|
227
233
|
|
|
228
|
-
- 组件样式**一行都不用改**,切换主题只是把 `<link id="iw-theme-link">` 指到另一个文件(外加一个 `data-
|
|
234
|
+
- 组件样式**一行都不用改**,切换主题只是把 `<link id="iw-theme-link">` 指到另一个文件(外加一个 `data-dsh-theme` 属性)
|
|
229
235
|
- 改调色板**不需要重新构建** `client.js`,刷新页面即可看到
|
|
230
236
|
- 新增一套主题 = 放一个 `themes/<id>.css` + 在 `src/client/12-theme.js` 的注册表加一行(`themes/index.json`、`test/theme.mjs` 会校验三处一致:10 套、5 深 5 浅、变量集合完全相同)
|
|
231
237
|
|
package/client.js
CHANGED
|
@@ -4296,11 +4296,15 @@ function ideCreateStore(refs) {
|
|
|
4296
4296
|
* Colour themes for the code workspace.
|
|
4297
4297
|
*
|
|
4298
4298
|
* A palette is a file: `themes/<id>.css` overrides the DSH alias tokens, scoped
|
|
4299
|
-
* to
|
|
4300
|
-
*
|
|
4299
|
+
* to `[data-dsh-theme="<id>"]`. Every `.iw-*` rule already reads those tokens, so
|
|
4300
|
+
* a theme never touches a component style — switching a theme points
|
|
4301
4301
|
* `<link id="iw-theme-link">` at another file and sets one attribute. A palette
|
|
4302
4302
|
* can be edited without rebuilding the bundle.
|
|
4303
4303
|
*
|
|
4304
|
+
* The attribute and the storage key are a **shared contract**: a sibling plugin
|
|
4305
|
+
* (`dsh-git-window`) sets the same attribute on its own tool window and loads
|
|
4306
|
+
* the same stylesheet, so both follow one palette. See `idePublishTheme`.
|
|
4307
|
+
*
|
|
4304
4308
|
* `themes/index.json` lists the same ids; `test/theme.mjs` holds the two in sync
|
|
4305
4309
|
* and checks that every file defines the same token set.
|
|
4306
4310
|
*/
|
|
@@ -4362,10 +4366,45 @@ function ideApplyTheme(id) {
|
|
|
4362
4366
|
if (existing.getAttribute('href') !== href) existing.setAttribute('href', href)
|
|
4363
4367
|
}
|
|
4364
4368
|
|
|
4369
|
+
/**
|
|
4370
|
+
* The shared palette contract.
|
|
4371
|
+
*
|
|
4372
|
+
* `dsh-git-window` draws its own tool window; when both plugins are open they
|
|
4373
|
+
* should look like one workspace, so a palette is published, not just applied:
|
|
4374
|
+
*
|
|
4375
|
+
* - `localStorage['dsh-theme']` — the current id (empty means "follow DSH"),
|
|
4376
|
+
* readable by any plugin at start-up;
|
|
4377
|
+
* - `window` event `dsh-theme` with `{ id }` — same document, so a listener
|
|
4378
|
+
* reacts immediately;
|
|
4379
|
+
* - the stylesheet attribute `data-dsh-theme` — whatever element carries it
|
|
4380
|
+
* gets the palette, whichever plugin owns that element.
|
|
4381
|
+
*
|
|
4382
|
+
* Only this plugin writes the key; followers read it.
|
|
4383
|
+
*/
|
|
4384
|
+
const IDE_THEME_SHARED_KEY = 'dsh-theme'
|
|
4385
|
+
const IDE_THEME_SHARED_EVENT = 'dsh-theme'
|
|
4386
|
+
|
|
4387
|
+
/** Publish the palette: storage for late loaders, an event for live listeners. */
|
|
4388
|
+
function idePublishTheme(id) {
|
|
4389
|
+
const value = typeof id === 'string' ? id : ''
|
|
4390
|
+
try {
|
|
4391
|
+
if (value === '') globalThis.localStorage?.removeItem(IDE_THEME_SHARED_KEY)
|
|
4392
|
+
else globalThis.localStorage?.setItem(IDE_THEME_SHARED_KEY, value)
|
|
4393
|
+
} catch {
|
|
4394
|
+
/* a browser with storage disabled simply cannot share the palette */
|
|
4395
|
+
}
|
|
4396
|
+
try {
|
|
4397
|
+
globalThis.dispatchEvent?.(new CustomEvent(IDE_THEME_SHARED_EVENT, { detail: { id: value } }))
|
|
4398
|
+
} catch {
|
|
4399
|
+
/* CustomEvent is always available in the panel's browser; ignore if not */
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4402
|
+
|
|
4365
4403
|
/** Apply the saved theme once, and after every change; the panel owns the DOM. */
|
|
4366
4404
|
function ideUseTheme(themeId) {
|
|
4367
4405
|
useEffect(() => {
|
|
4368
4406
|
ideApplyTheme(themeId)
|
|
4407
|
+
idePublishTheme(themeId)
|
|
4369
4408
|
}, [themeId])
|
|
4370
4409
|
}
|
|
4371
4410
|
|
|
@@ -7066,7 +7105,9 @@ function IdePanel({ store, translate, onBackToChat, onToggleSidebar, onEnter, us
|
|
|
7066
7105
|
const treeSize = Number.isFinite(state.treeFontSize) ? state.treeFontSize : 14.5
|
|
7067
7106
|
return h('div', {
|
|
7068
7107
|
className: 'iw-root',
|
|
7069
|
-
|
|
7108
|
+
// The shared palette attribute: the theme stylesheet targets this, so any
|
|
7109
|
+
// plugin that sets it on its own root gets the same colours.
|
|
7110
|
+
'data-dsh-theme': ideIsThemeId(state.theme) ? state.theme : undefined,
|
|
7070
7111
|
// The editor and the tree share one typographic scale, set in Settings.
|
|
7071
7112
|
style: {
|
|
7072
7113
|
'--iw-code-font-size': `${codeSize}px`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ide-window",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "IDEA-style code workspace for DeepSeek Harness: a centre panel with a workspace file tree, editor tabs and live-updating source, while the left navigation column hides.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"icon": "icon.svg",
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
|
|
5
5
|
* rule picks the palette up without knowing this file exists. Nothing outside
|
|
6
|
-
*
|
|
6
|
+
* `[data-dsh-theme="atom-one-light"]` is touched.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
[data-dsh-theme="atom-one-light"] {
|
|
9
9
|
--dsw-alias-bg-base: #fafafa;
|
|
10
10
|
--dsw-alias-bg-layer-1: #ffffff;
|
|
11
11
|
--dsw-alias-bg-layer-2: #f0f0f1;
|
package/themes/dracula.css
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
|
|
5
5
|
* rule picks the palette up without knowing this file exists. Nothing outside
|
|
6
|
-
*
|
|
6
|
+
* `[data-dsh-theme="dracula"]` is touched.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
[data-dsh-theme="dracula"] {
|
|
9
9
|
--dsw-alias-bg-base: #282a36;
|
|
10
10
|
--dsw-alias-bg-layer-1: #21222c;
|
|
11
11
|
--dsw-alias-bg-layer-2: #343746;
|
package/themes/github-light.css
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
|
|
5
5
|
* rule picks the palette up without knowing this file exists. Nothing outside
|
|
6
|
-
*
|
|
6
|
+
* `[data-dsh-theme="github-light"]` is touched.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
[data-dsh-theme="github-light"] {
|
|
9
9
|
--dsw-alias-bg-base: #ffffff;
|
|
10
10
|
--dsw-alias-bg-layer-1: #f6f8fa;
|
|
11
11
|
--dsw-alias-bg-layer-2: #f6f8fa;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
|
|
5
5
|
* rule picks the palette up without knowing this file exists. Nothing outside
|
|
6
|
-
*
|
|
6
|
+
* `[data-dsh-theme="intellij-light"]` is touched.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
[data-dsh-theme="intellij-light"] {
|
|
9
9
|
--dsw-alias-bg-base: #f7f8fa;
|
|
10
10
|
--dsw-alias-bg-layer-1: #ffffff;
|
|
11
11
|
--dsw-alias-bg-layer-2: #ebecf0;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
|
|
5
5
|
* rule picks the palette up without knowing this file exists. Nothing outside
|
|
6
|
-
*
|
|
6
|
+
* `[data-dsh-theme="material-light"]` is touched.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
[data-dsh-theme="material-light"] {
|
|
9
9
|
--dsw-alias-bg-base: #fafafa;
|
|
10
10
|
--dsw-alias-bg-layer-1: #ffffff;
|
|
11
11
|
--dsw-alias-bg-layer-2: #f2f3f5;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
|
|
5
5
|
* rule picks the palette up without knowing this file exists. Nothing outside
|
|
6
|
-
*
|
|
6
|
+
* `[data-dsh-theme="material-oceanic"]` is touched.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
[data-dsh-theme="material-oceanic"] {
|
|
9
9
|
--dsw-alias-bg-base: #0f111a;
|
|
10
10
|
--dsw-alias-bg-layer-1: #131521;
|
|
11
11
|
--dsw-alias-bg-layer-2: #1b1e2b;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
|
|
5
5
|
* rule picks the palette up without knowing this file exists. Nothing outside
|
|
6
|
-
*
|
|
6
|
+
* `[data-dsh-theme="material-palenight"]` is touched.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
[data-dsh-theme="material-palenight"] {
|
|
9
9
|
--dsw-alias-bg-base: #292d3e;
|
|
10
10
|
--dsw-alias-bg-layer-1: #2f3445;
|
|
11
11
|
--dsw-alias-bg-layer-2: #333747;
|
package/themes/monokai-pro.css
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
|
|
5
5
|
* rule picks the palette up without knowing this file exists. Nothing outside
|
|
6
|
-
*
|
|
6
|
+
* `[data-dsh-theme="monokai-pro"]` is touched.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
[data-dsh-theme="monokai-pro"] {
|
|
9
9
|
--dsw-alias-bg-base: #2d2a2e;
|
|
10
10
|
--dsw-alias-bg-layer-1: #221f22;
|
|
11
11
|
--dsw-alias-bg-layer-2: #363337;
|
package/themes/night-owl.css
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
|
|
5
5
|
* rule picks the palette up without knowing this file exists. Nothing outside
|
|
6
|
-
*
|
|
6
|
+
* `[data-dsh-theme="night-owl"]` is touched.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
[data-dsh-theme="night-owl"] {
|
|
9
9
|
--dsw-alias-bg-base: #011627;
|
|
10
10
|
--dsw-alias-bg-layer-1: #0b2942;
|
|
11
11
|
--dsw-alias-bg-layer-2: #0e2b43;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
|
|
5
5
|
* rule picks the palette up without knowing this file exists. Nothing outside
|
|
6
|
-
*
|
|
6
|
+
* `[data-dsh-theme="solarized-light"]` is touched.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
[data-dsh-theme="solarized-light"] {
|
|
9
9
|
--dsw-alias-bg-base: #fdf6e3;
|
|
10
10
|
--dsw-alias-bg-layer-1: #eee8d5;
|
|
11
11
|
--dsw-alias-bg-layer-2: #f5eedc;
|