Web 界面的对话字号控制:输入区步进器、键盘快捷键与 Ctrl+滚轮缩放,统一走主题服务的 setFontSize。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:AprilCrystal/dsh-client-ui-font-scale
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A DeepSeek Harness client (browser) plugin
that puts conversation font-size controls where you are already looking: a stepper in the composer
tool row, keyboard shortcuts, and Ctrl+wheel zoom.
No build step. The lib/*.js files are authored directly in the shipped bundle format, so cloning
the repository is enough.
Why this exists
DSH already ships a conversation font-size setting — Settings → General → 字号大小 / Font size,
contributed by @deepseek-ai/dsh-client-ui-theme. Its copy is explicit that it "only affects
conversation content", which is exactly the right scope.
This plugin does not replace or reimplement it. It adds the input surfaces that setting lacks:
- reaching it takes four clicks, so it is easy to forget it exists;
- there is no keyboard shortcut for it anywhere in the shipped shortcuts registry;
- there is no wheel gesture for it.
Every control here writes through the same theme.setFontSize('text', px) entry point the shipped
row uses, so the two can never disagree.
What it does
| Surface | Where | Behaviour |
|---|---|---|
| Stepper | composer tool row, before the submit action | A− / readout / A+, clamping at the ends |
| Reset | beside the stepper | ↺ restores the default; greys out when already there |
| Shortcuts | Ctrl+= / Ctrl+- / Ctrl+0 |
increase / decrease / restore default |
| Zoom | Ctrl+wheel over the page |
wheel up enlarges, wheel down shrinks |
Both the readout and the reset button render the live size from the theme snapshot, so a change made in the shipped settings row updates this control immediately, and vice versa.
Requirements
- DeepSeek Harness with the Web client (the
desktopprofile, or any profile mounting@deepseek-ai/dsh-web-app). - A theme service that exposes
setFontSize(role, px)— i.e.@deepseek-ai/dsh-client-ui-theme, which ships in the default composition. DSH 0.2.1 or newer: that release split the single font size into thetext/code/terminalroles, and this plugin drivestext. - No build step and no runtime dependencies beyond the browser module table.
Install
This package is a dsh bundle: package.json declares dsh.bundle.patch, so dsh treats
cordis.patch.yml as a composition layer and mounts it for you.
dsh plugin --profile <profile> add dsh-client-ui-font-scale
That installs the package into the profile and appends it to the profile's bundle list. The profile
is watched, so dsh recomposes without a restart. Remove it with
dsh plugin --profile <profile> remove dsh-client-ui-font-scale.
From a local checkout
dsh plugin --profile desktop add /absolute/path/to/dsh-client-ui-font-scale
Mounting by hand
Compose cordis.patch.yml into the profile's own patch file, and make the
package resolvable from the profile directory:
pnpm add link:/absolute/path/to/dsh-client-ui-font-scale --dir "$DSH_HOME/profiles/desktop"
# $DSH_HOME/profiles/<profile>/cordis.patch.yml
- insert:
- id: font-scale
name: dsh-client-ui-font-scale
A patch insert row may also name a path instead of a package — dsh rewrites ./-relative and
absolute names to file URLs anchored at the patch file — which needs no install at all.
After installing, reload the page: a client plugin's bundle is wired into the index at render time, so a page that was already open does not pick up a newly installed bundle.
Persistence
This plugin stores nothing, deliberately.
theme.setFontSize('text', px) writes through the ui-theme settings scope on the Host
(this.host.set('fontSize', px)), and @deepseek-ai/dsh-client-ui-theme's Host half re-embeds that
durable value into every index render as a boot script. The result:
- the size survives a page reload;
- the size survives an application restart;
- it is applied before the shell mounts, so there is no flash of the default size.
A second store here would be a second source of truth for one number. If you want to change how the
size persists, change it in dsh-client-ui-theme, not here.
Range
The accepted range is 10–22 px in whole steps, default 14. That range belongs to the theme
service: setFontSize throws for a fractional or out-of-range value. Every control here clamps
rather than bypassing it, so the shipped settings row and this plugin always agree.
If you need to go beyond 22 px, note that dsh-client-ui-layout writes the size as an
unimportant inline --dsh-content-font-size on <body>, so a stylesheet rule with !important
can override it. Doing that from a plugin means owning the resulting split-brain with the shipped
setting, which is why this plugin does not.
How it works
| Concern | Mechanism |
|---|---|
| Seat | ctx.slots.register into conversation.input.right (a list slot, replaceRisk: none, empty in the default composition) |
| Read | theme.getTheme().fontSizes.text, re-rendered on the theme/change event |
| Write | theme.setFontSize('text', px) — the only font-size write entry |
| Keys | ctx.shortcuts.register, so bindings appear on the Shortcuts settings page and stay user-rebindable |
| Locale | ctx.locale.register + ctx.locale.bind; the readout and labels follow the active locale |
| Styles | one <style> element inserted in ctx.effect, removed on dispose |
The font-size API changed in DSH 0.2.1
Before that release the theme service carried one fontSize and setFontSize(px) wrote it. Since
then the snapshot is fontSizes: Record<'text' | 'code' | 'terminal', number> and the write is
setFontSize(role, px).
This plugin had been written against the old shape, and the mismatch failed in a way worth recording because it produced no visible error surface:
- reading
.fontSizereturnedundefined, so the readout fell back to the default and showed14pxno matter what the real size was; setFontSize(15)passed15as the ROLE, so the service looked upFONT_SIZE_SPECS[15], gotundefined, and threw while formatting its own message —spec.minon an undefined spec. Every click, wheel step and shortcut died before writing anything.
The fix is the two lines in lib/client.js (fontSizes?.[ROLE] and setFontSize(ROLE, next));
ROLE is 'text', whose 10..22 range and 14 default are unchanged.
Two ordering details are load-bearing:
- Services are resolved per call (
ctx.get('theme')), not captured once inapply. A peer half may mount after this one, and a captured miss would silently disable a surface for the whole run. - Shortcuts and dictionaries register through
ctx.inject, which waits for the service instead of racing it. Registering against a not-yet-mounted service is a no-op, not an error, so the failure would be silent.
Shortcut bindings declare regions: ['page', 'editable'], so they keep working while the composer
has focus. On the desktop runtime no combination is reserved (bindingIssue returns early for
desktop on Windows and macOS), so Ctrl+= / - / 0 register cleanly.
Development
node scripts/validate-plugin.mjs .
# or
npm run validate
The validator is read-only and asserts the contract this bundle depends on: the dsh.client
manifest, the dsh.bundle.patch layer, apply() on the host half, the __ModuleLoader__.load
wrapper with a factory id equal to the package name, require('react') beside createElement,
CSS template-literal integrity, and locale-dictionary symmetry. It reads dictionary keys out of the
object literals themselves, so labels reached through a variable still count.
Also worth running before a commit:
node --check lib/client.js && node --check lib/index.js
Repository layout
lib/index.js host half (empty apply: the bundle owns no host capability)
lib/client.js browser half: slots, shortcuts, wheel, styles
cordis.patch.yml the bundle's composition layer
scripts/validate-plugin.mjs structural validation
Caveats
- The control is a decoration in the composer row, not a settings replacement. The shipped Settings → General → Font size row remains the canonical place to see and set the value.
Ctrl+wheel callspreventDefault, which suppresses the Electron shell's own page zoom. That is intentional — the gesture should mean one thing — but it does meanCtrl+wheel no longer zooms the whole page.- The wheel handler is attached to
window, so the gesture works anywhere over the page, not only over the conversation column.
License
MIT © 2026 AprilCrystal
链接
同类插件
zhu1090093659/dsh-web#packages/dsh-task-board★ 10172
侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。
zhu1090093659/dsh-web#packages/dsh-web-all★ 10172
DSH Web UI 插件与皮肤合集:任务看板、git 图、右侧面板、远程移动端 UI、桌宠、实时 token 统计与皮肤中心。
ccch1mneyyy/dsh-TUI★ 7101
Claude Code 风格全屏终端 UI:像素鲸鱼顶栏、实时工作状态行、思考流式展开。
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 6959
右下角常驻的小鲸鱼挂件:余额、今日已用与每轮对话消耗(含峰谷价),余额预警与今日预算的泡泡内容都可编辑;泡泡点击序列模块化自定义,支持并列加权 A/B、随机台词与随机图片;内置 30+ 厂商模板(OpenAI / OpenRouter / Kimi / 硅基流动 / 方舟 / 智谱 / MiniMax 等),按模型查余额与订阅额度;另有任务结束音效、导入音频、自定义角色与资源管理。数据全在本机,无遥测。
omdsh-dev/DSH-better-sidebar★ 4959
侧边栏完整工作台:内置文件渲染编辑、终端、Git 与子代理,支持三方插件注册新 Tab。
Devin-AXIS/deepseek-design#deepseek-idesign★ 1744
可视化设计工作室,支持网站、App 原型、海报、信息卡、报告和杂志的模板创建、元素编辑、选区级 AI 草稿衔接与导出。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。