dsh-force-motion
界面增强 活跃维护

dsh-force-motion

maxesisnclaw/dsh-force-motion

提供轻量开关,直接覆盖浏览器 prefers-reduced-motion 媒体查询,让界面过渡、加载与交互动画持续播放;无需改动系统辅助设置,注入样式即恢复完整动效。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
6 KB
仓库大小
2 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:maxesisnclaw/dsh-force-motion
git clone https://github.com/maxesisnclaw/dsh-force-motion.git
git clone git@github.com:maxesisnclaw/dsh-force-motion.git
README.md main

dsh-force-motion

English | 中文

Keep DeepSeek Harness (dsh) UI animations
running even when the browser reports prefers-reduced-motion: reduce.

The problem

dsh honours the reduced-motion preference in two places, so on a machine whose OS/browser
reports it, every effect is frozen:

  1. CSS — each animated element carries a guard:

    @media (prefers-reduced-motion: reduce) {
     .turnStatus { background-position: 0 0; background-size: 100% 100%; animation: none }
    }

    Seven rules like this cover the "深度求索中…" status shimmer, command-row sweep, turn mark,
    reasoning-row sweep and retry shimmer. The status line ends up as a static gradient — it
    looks like a glow that never moves.

  2. JS — some renderers call matchMedia("(prefers-reduced-motion: reduce)").matches and take
    a static branch.

What this plugin does

Nothing under node_modules is touched. A small script injected into the served index page:

  • wraps matchMedia so the reduced-motion query never reports a match, and
  • deletes prefers-reduced-motion rules from every same-origin stylesheet (re-running when new
    <style>/<link> nodes appear), so the base animation declarations win again.

Result: all animations play, with no dependency on dsh's hashed class names or keyframe names, so
it keeps working across upgrades.

Install

dsh plugin --profile web add github:maxesisnclaw/dsh-force-motion

Manual install: copy this directory into <dsh-install>/plugins/ and add to
$DSH_HOME/cordis.patch.yml:

- insert:
    - id: force-motion
      name: /absolute/path/to/dsh-force-motion/index.js

Then restart dsh.

Opt out / trade-off

This deliberately overrides an accessibility preference. It is meant for a workstation whose
owner wants the animations (e.g. the OS reduced-motion flag is set for unrelated reasons).
Uninstall the plugin, or set window.__dshForceMotion = false before the app boots, to restore
the standard behaviour.

Verify

  • The status line while the model is thinking should shimmer instead of sitting still.
  • Console: matchMedia('(prefers-reduced-motion: reduce)').matches returns false, and the
    plugin logs dsh-force-motion: reduced-motion suppression neutralised.
  • Unit test: npm test.

License

MIT