dsh-mobile-fixes: A CSS Patch Layer for Narrow Screens

Introduction

Plugins in the DeepSeek Harness (DSH) ecosystem often define layouts that are too wide, causing overflow, text truncation, and obscured controls on mobile devices. The conventional approach is to add narrow-screen adaptations directly within the plugin, but that modifies upstream code and increases maintenance costs. dsh-mobile-fixes is a patch-layer plugin that only injects a single <style> element into document.head — it takes over no DOM, listens to nothing, observes nothing, and alters not a single byte of upstream plugin code.

Plugin Overview

  • Name: dsh-mobile-fixes
  • Maintainer: ymf2317-tech
  • Purpose: Narrow-screen (mobile) CSS override layer, applying fixes to exactly two DSH plugins that have been verified in testing
  • Core capability: Injects a single stylesheet that fixes layout issues in dsh-expert’s T Expert modal and dsh-purge’s floating Purge panel on narrow screens

Coverage

This plugin contains exactly two patches and has only been tested on the following specific versions of those plugins:

Target Plugin Issue Fixed Tested Version
dsh-expert · T Expert modal (.t-team-pop) 4-column cards squeezed to ~79 px on narrow screens; names and tag rows clipped Version in use as of 2026-11
dsh-purge · Floating Purge panel (.dshp-dock / .dshp-launch) Panel overflows on the right; buttons clipped; floating launcher overlaps the input field’s send button 1.1.73+dsh0.2.1

No other plugins have been verified. This is not a general-purpose “mobile adaptation framework.”

All rules are scoped inside @media (max-width: 640px), so desktop-width rendering is unaffected.

Patch 1: dsh-expert · T Expert Modal

On a 390 px phone, the four-column card grid compresses each column to roughly 79 px, truncating names to “Edge Rikk…” and clipping the category tag rows. The root cause is that upstream hard-codes the grid to repeat(4, minmax(0,1fr)) with no width-based fallback. The overrides:

  1. experts / skills tab lists → repeat(2, minmax(0,1fr)), gap 8px 10px
  2. Name and subtitle: changed from nowrap + ellipsis to allow wrapping, showing 2 lines
  3. Avatar reduced from 44 px to 36 px; .t-team-pop-head height set to auto
  4. Search box font-size: 16px, height 36 px — prevents iOS Safari from auto-zooming the entire page on focus
  5. Category tag strip: hide the scrollbar (upstream already has overflow-x: auto and side arrows)
  6. max-height changed to calc(100dvh - 16px) to account for the mobile address bar

Patch 2: dsh-purge · Floating Purge Panel

On a 424 px-class phone, the panel’s right edge goes off-screen, with the “Collapse,” “Check for Updates,” and “View Release Notes” buttons half-clipped. The bottom-right dsh-purge capsule also overlaps the input field’s send button. Two root causes: (1) PurgeDock sets its position via an inline style — Math.max(380, vw - 16) raises the lower bound to 380 on narrow screens, which combined with page zoom causes overflow; (2) .dshp-launch is pinned at right: 16px; bottom: 16px, directly intersecting the send button.

Overrides:

  1. html body .dshp-dock: left/right/top: 8px + width/height: auto + min-width: 0 + max-width: none + max-height: calc(100dvh - 96px). This uses !important (the only !important in the entire file) because the target properties are set as inline styles, which can only be overridden at this specificity level. The trade-off: the panel can no longer be resized by dragging on narrow screens — a touchscreen can’t reliably grab that 10 px drag handle anyway.
  2. Internals: root padding 16→12, gap 18→14; panel padding 18→14/12; edition-name allowed to wrap
  3. .dshp-dock-resize{,-l,-r,-b} → display: none (unusable on touch; only wastes clicks at the edges)
  4. .dshp-launch → right: 8px; bottom: calc(140px + env(safe-area-inset-bottom)), height 32, opacity 0.72

Verified (Playwright + local Chrome, panel replicated at real-device widths):
- 360 px · no zoom: before fix right edge at 388 (28 px overflow), after fix at 352 (8 px inset)
- 390 px · zoom 1.08: before fix 419 (29 px overflow), after fix 381 (9 px inset)
- 424 px · zoom 1.08: before fix 449 (25 px overflow), after fix 415 (9 px inset)

Panel height changed from a hard-coded 640 px to content-adaptive (~433 px), with internal scrollWidth == clientWidth.

Design Discipline

  1. One stylesheet, zero logic. No node creation, no event listeners, no observers.
  2. All rules wrapped in @media (max-width: 640px); desktop rendering must remain identical.
  3. Selectors always prefixed with html body to prevent being overridden by later-injected upstream rules.
  4. Avoid !important wherever possible; only use it when the target property is set as an inline style, and only at that one location, locking only the box model.

Installation & Activation

DSH supports installing plugins directly from GitHub:

# In the profile directory (e.g., ~/.dsh/profiles/web)
dsh plugin add github:ymf2317-tech/dsh-mobile-fixes

Or wire it up manually (consistent with local vendor usage): place the repo under the profile’s vendor/ directory, add the dependency and whitelist entry to package.json, then re-run pnpm install:

{
  "dependencies": { "dsh-mobile-fixes": "file:vendor/dsh-mobile-fixes" },
  "dsh": { "profile": { "bundles": [ /* … */ "dsh-mobile-fixes" ] } }
}

Note: this goes under dsh.profile.bundles, not dsh.bundle.plugins.

Activation: simply refresh the page. The client module manifest will pick up client.js — no host restart required.

Rollback

Removing the <style> element is equivalent to never having installed it:
- Deactivate the plugin (remove it from dsh.profile.bundles) → refresh the page;
- Or temporarily run document.getElementById('dsh-mobile-fixes')?.remove() in the console.

How to Add a Patch

Measure first, then write:

  1. In the @media block in client.js, add a comment clearly stating which plugin, which class name, what symptom, and what the root cause is — an override without a stated cause will be incomprehensible to anyone reading it three months later.
  2. Reproduce at real-device widths (360 / 390 / 424 px) and measure with getBoundingClientRect() and scrollWidth — don’t rely on eyeballing.
  3. Regression-check at desktop width to confirm nothing changed.
  4. Add the target plugin’s class name to the coverage table in the README, noting the tested version.

Use Cases & Notes

This plugin is intended for users who already use dsh-expert or dsh-purge and encounter layout issues on mobile. Before use, ensure the host dsh process has permission to read the plugin’s source code and license. It only applies fixes to the two verified plugins above; no other plugins have been tested, and blind reliance on it for unverified plugins is not recommended.

Conclusion

dsh-mobile-fixes achieves narrow-screen overrides through a single stylesheet without modifying any upstream code, reducing maintenance costs. It demonstrates the ceiling of the patch approach at the CSS level: a stylesheet cannot remove any nodes, and layout fixes can only be applied through overriding rules. If you encounter similar issues with other DSH plugins, refer to the “How to Add a Patch” section in the README to add your own fix.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye