deepseek-harness-background 0.4.2 → 0.5.1

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/README.md CHANGED
@@ -1,3 +1,10 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="docs/banner-dark.svg">
4
+ <img src="docs/banner.svg" alt="DeepSeek Harness Background" width="720">
5
+ </picture>
6
+ </p>
7
+
1
8
  # DeepSeek Harness Background
2
9
 
3
10
  [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
@@ -8,6 +15,7 @@
8
15
  [![CI](https://img.shields.io/github/actions/workflow/status/HaoyueQin/deepseek-harness-background/ci.yml?style=flat-square&logo=githubactions&logoColor=white)](https://github.com/HaoyueQin/deepseek-harness-background/actions)
9
16
  [![GitHub issues](https://img.shields.io/github/issues/HaoyueQin/deepseek-harness-background?style=flat-square&logo=github)](https://github.com/HaoyueQin/deepseek-harness-background/issues)
10
17
  [![GitHub last commit](https://img.shields.io/github/last-commit/HaoyueQin/deepseek-harness-background?style=flat-square&logo=github)](https://github.com/HaoyueQin/deepseek-harness-background/commits)
18
+ [![Commit activity](https://img.shields.io/github/commit-activity/t/HaoyueQin/deepseek-harness-background?style=flat-square&logo=github)](https://github.com/HaoyueQin/deepseek-harness-background/graphs/commit-activity)
11
19
  [![Top language](https://img.shields.io/github/languages/top/HaoyueQin/deepseek-harness-background?style=flat-square&logo=typescript)](https://github.com/HaoyueQin/deepseek-harness-background)
12
20
  [![Repo size](https://img.shields.io/github/repo-size/HaoyueQin/deepseek-harness-background?style=flat-square&logo=github)](https://github.com/HaoyueQin/deepseek-harness-background)
13
21
  [![License](https://img.shields.io/github/license/HaoyueQin/deepseek-harness-background?style=flat-square)](LICENSE)
@@ -18,6 +26,10 @@ A custom **background image plugin** for the DeepSeek Harness Web GUI (`dsh web`
18
26
 
19
27
  The look (fixed wallpaper layer + theme-aware scrim + translucent glass panels driven by `--dsw-*` design tokens) is modeled on the community `dsh-wallpaper-engine` implementation.
20
28
 
29
+ <p align="center">
30
+ <img src="docs/demo.svg" alt="demo: upload a wallpaper, the whole app turns to frosted glass, then jump between turns on the timeline">
31
+ </p>
32
+
21
33
  ## Screenshots
22
34
 
23
35
  | | |
@@ -35,9 +47,12 @@ The look (fixed wallpaper layer + theme-aware scrim + translucent glass panels d
35
47
  - **Five controls** — wallpaper opacity, readability scrim, panel opacity, frosted-glass blur, and wallpaper blur.
36
48
  - **Fit modes** — `cover` (fill, crop) or `contain` (whole image).
37
49
  - **Theme-aware scrim** — the light theme uses a white veil (lifts the art so dark text keeps contrast); the dark theme automatically switches to a black veil (dims the art so light text keeps contrast).
38
- - **Frosted glass (whitelisted)** — while a background is active, only the surfaces that float as small cards over the wallpaper turn into translucent glass (specular sheen + `backdrop-filter`): the composer card and message bubbles, code blocks / terminal / diff / tool-IO cards / skill & MCP call cards and inline code, the agent task strips and their takeover panels (approval / question / plan review), the chrome buttons (new session, composer plus, scroll-to-bottom), the load-earlier history button, the subagent lineage popover, the sidebar build badge, and the home hero "preview" badge — every glassed surface carries the full recipe (fill + sheen + blur), never translucency without frost. Reading surfaces — dialogs, the settings UI, menus, tooltips, toasts, hover fills and every accent (the send button stays blue) — keep their **official opaque paints** so nothing legible turns washy. The blur radius is driven by the glass-blur slider; `panelOpacity` at 100% restores the official paints on the whitelisted list too.
50
+ - **Frosted glass (whitelisted)** — while a background is active, only the surfaces that float as small cards over the wallpaper turn into translucent glass (specular sheen + `backdrop-filter`): the composer card and message bubbles, code blocks / terminal / diff / tool-IO cards / skill & MCP call cards and inline code, the agent task strips and their takeover panels (approval / question / plan review), the chrome buttons (new session, composer plus, scroll-to-bottom), the load-earlier history button, the subagent lineage popover, the sidebar build badge, and the home hero "preview" badge — every glassed surface carries the full recipe (fill + sheen + blur), never translucency without frost. Reading surfaces — dialogs, the settings UI, menus, tooltips, toasts, hover fills and every accent (the send button stays blue) — keep their **official opaque paints** so nothing legible turns washy (the one documented exception: the turn rail's hover preview, which is rail chrome over the art and joins the glass sheet). The blur radius is driven by the glass-blur slider; `panelOpacity` at 100% restores the official paints on the whitelisted list too.
39
51
  - **Third-party glass registry** — any plugin can register its own panels into the same frosted-glass system through the published bridge (`window.__DSH_BACKGROUND_GLASS__` global + the `dsh-background-glass:ready` event): *token* mode adds the missing sheen + blur chain when the panel already fills with an overridden `--dsw-*` token, *fill* mode takes the fill over as well; every rule sits under the `data-dsh-bg-glass` gate so it toggles with the glass automatically. Consumers take zero dependencies and degrade gracefully when this plugin is absent; the whole bridge tears down with it. See [docs/GLASS_API.md](docs/GLASS_API.md).
40
- - **Conversation timeline** — a DeepSeek-web-style scroll-navigation rail at the right edge of long conversations: one tick per user message on a frosted capsule; hovering expands it into a frosted panel listing every question (active one highlighted in brand blue); clicking jumps the chat to that message with a **smooth glide** (ease-in-out, distance-paced; the bottom-follow state is detached from the official 25px follow zone one frame before the slide, so streaming growth / turn-end re-renders cannot yank it back to the floor; wheel, touch or keyboard scrolling takes over instantly mid-glide, and `prefers-reduced-motion` places directly). **Key-point bookmarks** — star a question in the expanded panel (persisted per session): marked questions show a golden tick in the collapsed capsule and a "★ marked only" filter narrows the list. Jumps freeze the reading-position tracker until scrolling settles (no mid-jump jitter), and messages withdrawn by a rewind are dropped from the rail automatically (the target parser accepts `seq 42` / `#42` / english-chinese verb forms plus structured fields, and recognizes third-party `data-dsh-rewind-hidden` node markers). Collapsed and expanded share **one identical height** (no jump); idle ticks are **bottom-pinned** — the newest question's tick hugs the capsule's bottom edge like the official nav, fed by the full-session history regardless of how much of the conversation the chat view has paged in — and the expanded panel's clipped edges get the official **32px fade veils**. While the background glass is on, the rail joins the **same unified glass recipe** as the composer card and bubbles (fill follows panel opacity, blur follows the glass-blur slider); without glass it keeps the official DeepSeek frosted paints. Toggle it off with the timeline switch in the row. If the third-party dsh-chat-timeline plugin is also installed, this rail steps aside instead of doubling it.
52
+ - **Conversation timeline** — the DeepSeek-web turn-navigation rail at the right edge of long conversations, one tick per question, with a hover/focus preview of that turn's prompt. Two frontends, one backend, chosen by what the running kernel supports:
53
+ - **dsh ≥ 0.1.2 (enhancement)** — the kernel ships this rail already, so the plugin renders nothing of its own and only fixes its behaviour: clicks become a **smooth glide** instead of the stock instant jump (ease-in-out, distance-paced, cancelled the moment the reader scrolls, `prefers-reduced-motion` places directly), and reaching for the rail pages older history in so turns behind "load earlier" get a tick and become reachable — stopping at the rail's own uncompressed capacity, past which the official stylesheet would squeeze the marks into an unaimable bar. Because the official hover preview card paints an opaque fill, it joins the glass sheet under the wallpaper gate instead (same explicit-fill recipe as the composer card, driven by the glass-blur slider). The rail's active-mark state stays the kernel's own — the glide scrolls the real scrollport, so the stock scroll handler keeps updating it and the persisted scroll position.
54
+ - **dsh ≤ 0.1.1 (ported rail)** — no official rail exists, so the plugin renders its own port of it (identical metrics, plus the same glass treatment), fed by the same backend.
55
+ In both cases the bottom-follow state is detached one frame before the glide (streaming growth / turn-end re-renders cannot yank it back to the floor), messages withdrawn by a rewind are dropped automatically (the target parser accepts `seq 42` / `#42` / english-chinese verb forms plus structured fields, and recognizes third-party `data-dsh-rewind-hidden` node markers), and history paging compensates the prepended height so the reader's view never moves. Toggle it off with the timeline switch in the row.
41
56
  - **Persisted in the official settings document** (`$DSH_HOME/settings.yaml`), waits out restarts.
42
57
  - **Clean teardown** — disabling, clearing or uninstalling restores the original background exactly; the plugin only ever removes what it wrote.
43
58
 
@@ -88,7 +103,7 @@ dsh --profile web
88
103
  | 毛玻璃模糊 / Glass blur | `0..40px` `backdrop-filter` blur on the translucent surfaces (1px steps). |
89
104
  | 壁纸模糊 / Wallpaper blur | `0..60px` blur of the wallpaper image itself (2px steps). |
90
105
  | 填充方式 / Fit | `cover` or `contain`. |
91
- | 会话时间线 / Timeline | on/off switch for the conversation timeline rail (default on). |
106
+ | 会话时间线 / Timeline | on/off switch for the conversation timeline (default on). On dsh ≥ 0.1.2 the row is labelled 会话时间线增强 / *enhancement*: the official rail stays and this only improves its behaviour; turning it off restores stock behaviour. On older kernels the row is 会话时间线 / *timeline* and the switch controls the plugin's own ported rail. |
92
107
 
93
108
  5. **清除背景** removes the background and restores the stock look.
94
109
 
@@ -97,7 +112,7 @@ dsh --profile web
97
112
  - The **settings row** lives in the official General settings section (`settings.general.item` slot), next to the Appearance row. Its chrome uses only `--dsw-alias-*` design tokens (buttons / pills / segmented control / slider track match the official shell); sliders are native `input[type=range]` with 5% / 1–2px steps and release-commit.
98
113
  - The plugin's own host routes (`/api/bg-wallpaper/*`: `settings`, `upload`, `image/<id>`) read/write the section and serve uploads with same-origin + size caps + MIME/signature checks + a path-escape fence. A custom route family is used because the api-proxy settings allowlist does not expose third-party namespaces over the settings RPC.
99
114
  - The background is drawn as a fixed `z-index:-2` wallpaper layer plus a `z-index:-1` scrim on `body`, toggled by the `data-dsh-bg` attribute; the scrim switches white/black by `data-ds-dark-theme` in the injected stylesheet. Frosted glass is whitelist-scoped: only the whitelisted surfaces get `--dsw-*` surface-token overrides, while everything else is painted by explicit `data-dsh-bg-glass`-gated rules carrying the FULL recipe (fill + sheen + blur chain): the three chrome buttons, the load-earlier history button, the composer dock family (agent task strips TodoPanel / GoalBar / QueueDock and their takeover panels — approval, question, plan review — whose tokens turn translucent and need the blur added), the subagent lineage popover, the home hero preview badge and the sidebar build badge — every other official token and reading surface (menus, dialogs, tooltips, toasts) stays untouched.
100
- - The **timeline rail** is registered into the `conversation.input.dock` slot (per-session lifecycle) and portals to `body`. Its data comes, fastest first, from a host-side session projection (`bgTimeline`, registered in `src/projection.ts`) that enumerates every user message of the whole session — including turns the conversation has not paged in yet — with the loaded chat-node window as fallback. The conversation's own lazy loading is never driven by the rail (jumping to an old message pages history on demand, exactly like clicking "load earlier"); bookmarks persist in localStorage per session. Idle (collapsed), the tick stack is pinned to the capsule's bottom edge — the newest question's tick always hugs the bottom, older ones clip at the top — matching the official ScrollNav; hovering expands and follows the reading position instead. The official DeepSeek frosted paints are the no-glass fallback — under `data-dsh-bg-glass` the rail joins the plugin's unified recipe (composer fill token + the glass-blur slider chain), exactly like the chrome buttons, code cards and the composer itself.
115
+ - The **timeline** is registered into the `conversation.input.dock` slot (per-session lifecycle). Mode detection is a capability check on the slot props rather than a version compare: the official rail is rendered from the very index `ui-chat` publishes as a session hook (`useChat(s => s.navigation.items())`, dsh >= 0.1.2), so the presence of that hook *is* the presence of the official rail — and it survives pre-releases, forks and deployments that mount a different conversation target. With the hook the plugin renders nothing and intercepts the official rail clicks in the **capture** phase (React 18 dispatches `onClick` from the root container during the bubble phase, so a capture listener on the rail runs first and `stopImmediatePropagation()` keeps the stock handler from ever firing); without it the plugin renders its own port of the rail, portaled to `body`. Both run the same jump engine. Data comes, fastest first, from a host-side session projection (`bgTimeline`, registered in `src/projection.ts`) that enumerates every user message of the whole session — including turns the conversation has not paged in yet — with the loaded chat-node window as fallback; that window is read duck-typed across both kernel generations, because 0.1.2 moved the Chat snapshot from `session.getSnapshot().chat` to `useChat()`, the one breaking change for this plugin. History warm-up runs only when the reader reaches for the rail and stops at the rail uncompressed tick capacity (`floor((height - 12) / 10) + 1`); every page compensates the prepended height, because the host own prepend anchor is unreachable from outside. The ported rail carries the same **glass treatment as the enhanced official one** — the hover preview joins the frosted-glass sheet under the wallpaper gate (same explicit-fill recipe as the composer card) — so both frontends look identical to the reader.
101
116
  - The **third-party glass registry** (`src/client/glass-registry.ts`) publishes its bridge on client apply — before any repaint can race it: `register({ plugin, selectors, mode })` is idempotent per (plugin, mode, selector) triple and synthesizes explicit `body[data-dsh-bg-glass]`-gated recipe rules into a dedicated `<style data-plugin-css>` tag; selectors are structurally validated first (no `{ } ; @ < > ,`, no backslashes, 500-char cap) with per-selector warn-and-drop that never blocks valid siblings; disposing the client fiber retracts the whole bridge (stylesheet, entries, window key). Contract docs in `docs/GLASS_API.md` / `GLASS_API.zh.md`; behavior locked by `tests/glass-registry.spec.ts`.
102
117
  - Uploads live under `$DSH_HOME/deepseek-harness-background/` (content-addressed ids). Switching to a new image or clearing the background deletes the superseded upload file, so the directory does not accumulate dead images in normal use. (An upload that is never saved into the section — e.g. the tab closes right after an upload — can leave one orphaned file behind.) Disable / uninstall leaves nothing behind.
103
118
 
@@ -127,8 +142,16 @@ deepseek-harness-background/ # the plugin repo (package name stays the
127
142
  │ ├── backdrop.ts # fixed wallpaper layer + scrim + glass surface + preview vars
128
143
  │ ├── background-css.ts # injected stylesheet (layers, glass, light/dark scrim, variables)
129
144
  │ ├── glass-registry.ts # third-party glass registry (window bridge + gated rule synthesis)
130
- │ ├── timeline.tsx # conversation timeline rail (ScrollNav port on the glass system)
131
- │ ├── timeline-css.ts # timeline stylesheet (dsbt- prefixed, official metrics)
145
+ │ ├── timeline/
146
+ │ │ ├── index.tsx # dock entry: mode dispatch + re-exports
147
+ │ │ ├── official-enhance.tsx # dsh>=0.1.2: click interception + history warm-up
148
+ │ │ ├── legacy-rail.tsx # dsh<=0.1.1: ported official turn rail
149
+ │ │ ├── legacy-rail-css.ts # rail stylesheet (dsbt- prefixed, official metrics)
150
+ │ │ ├── jump.ts # shared jump engine (paging + glide + compensation)
151
+ │ │ ├── source.ts # shared data source (projection + node window)
152
+ │ │ ├── rail-pointer.ts # tick geometry & capacity (official metrics)
153
+ │ │ ├── mode-store.ts # detected mode, for the settings row
154
+ │ │ └── types.ts # shared shapes
132
155
  │ ├── SettingsRow.tsx # the General-settings row (preview surface + stepped sliders)
133
156
  │ ├── SettingsRow.module.css # row styles (official tokens)
134
157
  │ ├── settings-client.ts# fetch transport (read/write/upload)
@@ -136,6 +159,10 @@ deepseek-harness-background/ # the plugin repo (package name stays the
136
159
  └── tests/ # schema, routes, apply (painter), settings-row contracts
137
160
  ```
138
161
 
162
+ ## Activity
163
+
164
+ [![HaoyueQin/deepseek-harness-background GitStock K-Line Chart](https://gitstock.org/HaoyueQin/deepseek-harness-background/stock.svg)](https://gitstock.org/HaoyueQin/deepseek-harness-background)
165
+
139
166
  ## License
140
167
 
141
168
  MIT
package/README.zh.md CHANGED
@@ -1,3 +1,10 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="docs/banner-zh-dark.svg">
4
+ <img src="docs/banner-zh.svg" alt="DeepSeek Harness Background" width="720">
5
+ </picture>
6
+ </p>
7
+
1
8
  # DeepSeek Harness Background
2
9
 
3
10
  [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
@@ -8,6 +15,7 @@
8
15
  [![CI](https://img.shields.io/github/actions/workflow/status/HaoyueQin/deepseek-harness-background/ci.yml?style=flat-square&logo=githubactions&logoColor=white)](https://github.com/HaoyueQin/deepseek-harness-background/actions)
9
16
  [![GitHub issues](https://img.shields.io/github/issues/HaoyueQin/deepseek-harness-background?style=flat-square&logo=github)](https://github.com/HaoyueQin/deepseek-harness-background/issues)
10
17
  [![GitHub last commit](https://img.shields.io/github/last-commit/HaoyueQin/deepseek-harness-background?style=flat-square&logo=github)](https://github.com/HaoyueQin/deepseek-harness-background/commits)
18
+ [![Commit activity](https://img.shields.io/github/commit-activity/t/HaoyueQin/deepseek-harness-background?style=flat-square&logo=github)](https://github.com/HaoyueQin/deepseek-harness-background/graphs/commit-activity)
11
19
  [![Top language](https://img.shields.io/github/languages/top/HaoyueQin/deepseek-harness-background?style=flat-square&logo=typescript)](https://github.com/HaoyueQin/deepseek-harness-background)
12
20
  [![Repo size](https://img.shields.io/github/repo-size/HaoyueQin/deepseek-harness-background?style=flat-square&logo=github)](https://github.com/HaoyueQin/deepseek-harness-background)
13
21
  [![License](https://img.shields.io/github/license/HaoyueQin/deepseek-harness-background?style=flat-square)](LICENSE)
@@ -18,6 +26,10 @@
18
26
 
19
27
  外观(固定壁纸层 + 主题自适应遮罩 + 由 `--dsw-*` 设计 token 驱动的半透明玻璃面板)借鉴了社区 `dsh-wallpaper-engine` 的实现。
20
28
 
29
+ <p align="center">
30
+ <img src="docs/demo-zh.svg" alt="演示:上传壁纸后全站变毛玻璃,并在会话时间线的轮次之间平滑跳转">
31
+ </p>
32
+
21
33
  ## 截图
22
34
 
23
35
  | | |
@@ -35,9 +47,9 @@
35
47
  - **五个调节项** —— 壁纸不透明度、可读性遮罩、面板不透明度、毛玻璃模糊、壁纸模糊。
36
48
  - **填充方式** —— `cover`(铺满、裁剪)或 `contain`(完整、留白)。
37
49
  - **主题自适应遮罩** —— 浅色主题用白色纱帘(把图片提亮保持深色文字对比度),深色主题自动换成黑色纱帘(压暗图片保持浅色文字对比度)。
38
- - **毛玻璃(白名单制)** —— 启用背景后,只有以小卡片/小按钮形态悬浮在壁纸上的表面才会变成半透明玻璃(顶部白色高光渐变 + `backdrop-filter`):输入框卡片与消息气泡、代码块 / 终端 / diff / 工具 IO 卡 / 技能与 MCP 调用卡与行内代码、agent 任务条及其接管面板(审批 / 提问 / 计划评审)、三个铬件按钮(新会话、输入框加号、回到底部)、「加载更早」历史按钮、标题栏展开的子代理列表面板、侧栏构建徽标,以及首页右上角的「预览版」徽标——每块玻璃面都带完整配方(填充 + 高光 + 模糊),绝无"只透明不磨砂"的残缺面。阅读型表面——对话框、设置界面、菜单、Tooltip、Toast、悬停填充与所有强调色(发送键保持品牌蓝)——一律保留**官方不透明样式**,保证可读性。模糊半径由「毛玻璃模糊」滑块驱动;「面板不透明度」调至 100% 时白名单表面也恢复官方原样。
50
+ - **毛玻璃(白名单制)** —— 启用背景后,只有以小卡片/小按钮形态悬浮在壁纸上的表面才会变成半透明玻璃(顶部白色高光渐变 + `backdrop-filter`):输入框卡片与消息气泡、代码块 / 终端 / diff / 工具 IO 卡 / 技能与 MCP 调用卡与行内代码、agent 任务条及其接管面板(审批 / 提问 / 计划评审)、三个铬件按钮(新会话、输入框加号、回到底部)、「加载更早」历史按钮、标题栏展开的子代理列表面板、侧栏构建徽标,以及首页右上角的「预览版」徽标——每块玻璃面都带完整配方(填充 + 高光 + 模糊),绝无"只透明不磨砂"的残缺面。阅读型表面——对话框、设置界面、菜单、Tooltip、Toast、悬停填充与所有强调色(发送键保持品牌蓝)——一律保留**官方不透明样式**,保证可读性(唯一例外:时间线导航轨的悬浮预览卡,它是画在壁纸上的导航铬件,加入玻璃配方)。模糊半径由「毛玻璃模糊」滑块驱动;「面板不透明度」调至 100% 时白名单表面也恢复官方原样。
39
51
  - **第三方毛玻璃接口** —— 内置毛玻璃注册表(`window.__DSH_BACKGROUND_GLASS__` 全局 + `dsh-background-glass:ready` 事件):任何插件都可把自家面板的选择器注册进来,套上与内置表面完全一致的配方——`token` 模式为已使用被覆盖 `--dsw-*` 填充的面板补齐高光+模糊链,`fill` 模式连填充一并接管;规则统一挂在 `data-dsh-bg-glass` 门控下随玻璃自动开关。消费方零依赖、未安装本插件时优雅降级,本插件卸载时整桥拆除。详见 [docs/GLASS_API.zh.md](docs/GLASS_API.zh.md)。
40
- - **会话时间线** —— 长会话右缘的 DeepSeek 官网风格滚动导航轨:毛玻璃胶囊上每条用户消息一枚指示刻度;悬停展开为列出全部提问的毛玻璃面板(当前阅读位置品牌蓝高亮);点击跳转到对应消息(**平滑滑动**:ease-in-out 按距离调速;跳转前先把底部跟随状态移出官方 25px 跟随区,流式增长 / 回合结束不会把动画拽回底部;动画期间滚轮、触控或键盘滚动即时接管,`prefers-reduced-motion` 下直接定位)。**重点书签**——展开面板内点击 ★ 标记重点提问(按会话持久化):已标记项在折叠胶囊上显示金色加宽刻度,「★ 只看标记」一键筛选;跳转期间冻结高亮跟踪(消除中途乱跳),被回退撤回的消息自动从轨道剔除(目标解析兼容 `seq 42` / `#42` / 中英文动词文案与结构化字段,并识别他人的 `data-dsh-rewind-hidden` 节点标记)。折叠态与展开态**共用同一高度**(零跳变);折叠刻度**贴底锚定**——最新提问的横杠始终贴住胶囊底缘(与官网一致),且由全量会话历史驱动、不受对话区分页加载进度影响;展开面板的裁切边缘带官方同款 **32px 淡化渐变**。开启背景毛玻璃后,导航轨与输入框、消息气泡共用**同一套玻璃配方**(透明度随「面板不透明度」、模糊随「毛玻璃模糊」滑块调节,不比其他表面更重);未开启背景时保持 DeepSeek 官网同款毛玻璃配色。可在设置行内用「会话时间线」开关关闭;若同时安装了第三方 dsh-chat-timeline 插件,本轨道会自动让位避免重叠。
52
+ - **会话时间线** —— 长会话右缘的 DeepSeek 官网风格轮次导航轨:每一轮一个刻度,悬停或聚焦时预览该轮的问题。 两套前端、同一套后端,按当前内核支持的能力自动选择: - **dsh ≥ 0.1.2(增强)** —— 内核已经自带这条导航轨,因此插件不渲染任何自己的界面,只修正它的行为: 点击由官方的瞬时跳转改为**平滑滑动**(缓入缓出、按距离定时长、读者一滚动立刻接管、`prefers-reduced-motion` 下直接定位); 并且当读者把手伸向导航轨时自动往回翻页加载历史,让“需要点加载更多才出现”的轮次也长出刻度、可以直接跳转 —— 补到导航轨自身不压缩的刻度上限为止(再往后官方样式表会把刻度挤成无法瞄准的实心条)。官方悬浮预览卡是实心底,在壁纸门控下改为与输入卡同配方的毛玻璃(受「毛玻璃模糊」滑块驱动);刻度列加上 DeepSeek 网页版式的上下渐隐(仅绘制层,不影响命中测试)。导航轨的高亮状态仍归内核自己维护——滑动走的是真实滚动容器,官方滚动处理会持续更新活动轮次与持久化滚动位置。 - **dsh ≤ 0.1.1(移植版)** —— 没有官方导航轨,插件渲染自己移植的同一套界面(完全相同的尺寸,同样带上玻璃 + 上下渐隐), 数据来自同一套后端。 两种情况下,滑动前都会先解除宿主的底部跟随状态(流式增长、轮次结束重渲染都不会把视图拽回底部);被 rewind 撤回的消息自动从轨道剔除; 历史翻页会补偿前置内容的高度,读者视野纹丝不动。用设置行里的时间线开关可关闭。
41
53
  - **持久化到官方设置文档** —— 存于 `$DSH_HOME/settings.yaml`,跨重启保留。
42
54
  - **干净卸载** —— 关闭、清除或卸载后完整恢复原背景;插件只移除自己写过的内容。
43
55
 
@@ -88,14 +100,14 @@ dsh --profile web
88
100
  | 毛玻璃模糊 | `0..40px` 半透明表面上的 `backdrop-filter` 模糊(1px 步进)。 |
89
101
  | 壁纸模糊 | `0..60px` 壁纸图片本身的模糊(2px 步进)。 |
90
102
  | 填充方式 | `cover`(铺满)或 `contain`(完整)。 |
91
- | 会话时间线 | 会话右侧时间线导航轨的开关(默认开启)。 |
103
+ | 会话时间线 | 会话时间线的开关(默认开启)。dsh ≥ 0.1.2 上该项显示为**会话时间线增强**:官方导航轨保留,插件只优化其行为,关掉即恢复官方原样;旧内核上该项为**会话时间线**,开关控制插件自己移植的导航轨。 |
92
104
 
93
105
  5. 点 **清除背景** 移除背景,恢复默认外观。
94
106
 
95
107
  ## 原理
96
108
 
97
109
  - **设置行**位于官方「通用」设置分区的 `settings.general.item` 槽中,紧挨「外观」行。控件样式全部使用 `--dsw-alias-*` 设计 token(按钮 / 胶囊 / 分段控件 / 滑块轨道与官方 chrome 一致),滑块为原生 `input[type=range]` 的 5% / 1–2px 步进 + 松手提交。
98
- - **会话时间线**注册进 `conversation.input.dock` 槽位(绑定每会话生命周期),portal 渲染到 `body`。数据按速度优先:host 侧会话投影 `bgTimeline`(见 `src/projection.ts`,完整枚举整个会话的全部用户消息——包括对话区尚未分页加载的早期内容),已加载聊天节点窗口作为兜底;轨道从不驱动对话区的懒加载策略(点击旧消息跳转时才按需补页,与点「加载更早」一致)。折叠态刻度列贴底锚定——最新一条提问的横杠始终贴住胶囊底缘、更早的向顶部裁掉,与官网 ScrollNav 一致;悬停展开则改为跟随阅读位置。书签存于 localStorage(按会话隔离)。官网同款毛玻璃配色仅作为未开背景时的兜底:开启玻璃后(`data-dsh-bg-glass`)轨道并入插件统一配方——与输入框一致的 token 填充 + 由「毛玻璃模糊」滑块驱动的同一滤镜链。
110
+ - **会话时间线**注册进 `conversation.input.dock` 槽位(绑定每会话生命周期)。模式判定是对槽位 props 的能力探测,而不是比较版本号: 官方导航轨正是由 `ui-chat` 以会话 hook 形式发布的同一份索引渲染的(`useChat(s => s.navigation.items())`,dsh ≥ 0.1.2), 所以这个 hook 存在**就是**官方导航轨存在 —— 而且它能扛住预发布版、fork 以及挂载了其它会话目标的部署。 hook 存在时插件什么都不渲染,只在**捕获阶段**拦截官方导航轨的点击(React 18 在冒泡阶段由根容器派发 `onClick`, 所以导航轨上的捕获监听先执行,`stopImmediatePropagation()` 让官方处理器根本收不到事件);hook 不存在时插件渲染自己移植的导航轨,portal 到 `body`。 两者跑同一个跳转引擎。数据最快的来源是宿主侧会话投影(`bgTimeline`,注册于 `src/projection.ts`), 它枚举整个会话的每一条用户消息(含会话视图尚未分页载人的轮次),已加载的 chat 节点窗口作为兜底; 该窗口以鸭子类型同时兼容两代内核,因为 0.1.2 把 Chat 快照从 `session.getSnapshot().chat` 迁到了 `useChat()` —— 这是本插件唯一一处破坏性变更。 历史预热只在读者把手伸向导航轨时运行,并停在导航轨不压缩的刻度上限(`floor((高度 - 12) / 10) + 1`); 每一页都补偿前置内容的高度,因为宿主的 prepend 锚点在插件侧无法触及。移植版导航轨与增强后的官方轨采用完全一致的**玻璃 + 上下渐隐处理** —— 悬浮预览在壁纸门控下加入毛玻璃配方(与输入卡片同一显式填充配方),刻度列带 DeepSeek 网页版式上下渐隐,两个前端对读者的视觉完全一致。
99
111
  - 插件自有的 host 路由(`/api/bg-wallpaper/*`:`settings`、`upload`、`image/<id>`)负责读写设置与提供上传图片,带同源校验、大小上限、MIME/签名校验与路径穿越防护。使用自定义路由族,是因为 api-proxy 的 settings 白名单不向第三方命名空间开放 settings RPC。
100
112
  - 背景以 `body` 上一张固定的 `z-index:-2` 壁纸层 + `z-index:-1` 遮罩绘制,由 `data-dsh-bg` 属性开关;遮罩在注入样式表里按 `data-ds-dark-theme` 切换白/黑纱帘。毛玻璃为白名单制:仅对输入/气泡/代码/任务条等白名单表面覆盖 `--dsw-*` surface token,其余表面通过 `data-dsh-bg-glass` 门控的显式规则补齐整套配方(填充 + 高光 + 模糊滤镜链):三个 chrome 按钮、「加载更早」历史按钮、composer 坞列家族——agent 任务条(TodoPanel / GoalBar / QueueDock)与接管面板(审批 / 提问 / 计划评审,token 变半透明后由这里补上模糊)、子代理列表弹出层、首页「预览版」徽标、侧栏构建徽章——全部官方 token 与阅读型界面(菜单/对话框/tooltip/toast)保持原样。
101
113
  - **第三方玻璃注册表**(`src/client/glass-registry.ts`):客户端 apply 时即在 `window.__DSH_BACKGROUND_GLASS__` 发布注册 api 并派发 `dsh-background-glass:ready`;`register({ plugin, selectors, mode })` 按 `(plugin, mode, selector)` 三元组幂等登记,把 `body[data-dsh-bg-glass]` 门控的显式配方规则合成进独立的 `<style data-plugin-css>` 标签;选择器先做结构性校验(禁 `{} ; @ < > ,` 与反斜杠、500 字符上限),违规条目逐条警告并丢弃、不影响兄弟条目;fiber dispose 时整桥拆除(样式表、条目、window 键全清)。契约文档见 `docs/GLASS_API.md` / `GLASS_API.zh.md`,行为由 `tests/glass-registry.spec.ts` 锁定。
@@ -127,8 +139,16 @@ deepseek-harness-background/ # 插件仓库(包名保留 npm 风格 i
127
139
  │ ├── backdrop.ts # 固定壁纸层 + 遮罩 + 玻璃表面 + 预览变量
128
140
  │ ├── background-css.ts # 注入的样式表(层、玻璃、明暗遮罩、变量)
129
141
  │ ├── glass-registry.ts # 第三方毛玻璃注册表(window 桥 + 门控规则合成)
130
- │ ├── timeline.tsx # 会话时间线导航轨(官方 ScrollNav 结构 × 本插件玻璃体系)
131
- │ ├── timeline-css.ts # 时间线样式(dsbt- 前缀,官方度量)
142
+ │ ├── timeline/
143
+ │ │ ├── index.tsx # 停靠入口:模式分发与再导出
144
+ │ │ ├── official-enhance.tsx # dsh>=0.1.2:点击拦截 + 历史预热
145
+ │ │ ├── legacy-rail.tsx # dsh<=0.1.1:移植的官方轮次导航轨
146
+ │ │ ├── legacy-rail-css.ts # 导航轨样式(dsbt- 前缀,官方尺寸)
147
+ │ │ ├── jump.ts # 共享跳转引擎(翻页 + 滑动 + 补偿)
148
+ │ │ ├── source.ts # 共享数据源(投影 + 节点窗口)
149
+ │ │ ├── rail-pointer.ts # 刻度几何与容量(官方尺寸)
150
+ │ │ ├── mode-store.ts # 探测到的模式,供设置行读取
151
+ │ │ └── types.ts # 共享类型
132
152
  │ ├── SettingsRow.tsx # 通用设置中的设置行(预览卡 + 阻尼滑块)
133
153
  │ ├── SettingsRow.module.css # 设置行样式(官方 token)
134
154
  │ ├── settings-client.ts# fetch 传输层(读/写/上传)
@@ -136,6 +156,10 @@ deepseek-harness-background/ # 插件仓库(包名保留 npm 风格 i
136
156
  └── tests/ # 契约测试(schema、routes、apply/painter、设置行)
137
157
  ```
138
158
 
159
+ ## Activity
160
+
161
+ [![HaoyueQin/deepseek-harness-background GitStock K-Line Chart](https://gitstock.org/HaoyueQin/deepseek-harness-background/stock.svg)](https://gitstock.org/HaoyueQin/deepseek-harness-background)
162
+
139
163
  ## License
140
164
 
141
165
  MIT