aaronlei / dsh-width-tiers
DSH Web client plugin: chat content width tiers (standard / medium / wide / ultra / full / custom) with a floating picker button. Mounts into the app's shell.overlay slot on DSH 0.2.x and drives the native width axis, so the built-in drag handles keep working. UI copy follows the app language (zh / en / ja / es / fr / de / ru / pt).
About this plugin
Written by the registry from verified metadata, not from the README.
dsh-width-tiers is a DSH plugin published from the aaronlei/dsh-width-tiers repository.
Capabilities and topics
Tiers
| Tier | Content width | Sidebar |
|---|---|---|
| Standard 标准 | App default: max(680px, min(column × 0.64, 920px)) | unchanged |
| Medium 中等 | 1120px | unchanged |
| Wide 宽 | 1280px | unchanged |
| Ultra 超宽 | 1400px | unchanged |
| Full 全宽 | max(640px, column − 176px) | collapsed to icon rail |
| Custom 自定义 | width recorded from a native drag | unchanged |
Fixed and custom widths are clamped by the app to
max(640px, column − 176px); the standard tier follows the app default
(680–920px). The menu always lists each tier's nominal width (1120/1280/1400); only the
button shows the width actually applied after the clamp (on an 800px column,
Wide reads 1120px in the menu and 640px on the button once selected).
Full follows the live column maximum and is marked as hiding the left
sidebar, so selecting it can widen the column and change its own value.
Features
- Uses the app's native width axis (
--dsh-chat-user-widthanddsh.conversation.contentWidth), so the built-in drag handles keep working. - Persists the selected tier and restores it on the next visit; a width dragged
with the native handles before installation is adopted as
custom. - A native drag closes an open menu, and the settled width is announced through a polite live region for screen readers.
- Follows Settings → Language (中文 / English / 日本語 / Español / Français / Deutsch / Русский / Português), including the Settings plugin card's title and summary (
locale/<lang>.json). - Menu rows describe the tiers; the button shows the width actually applied.
- Menu supports ArrowUp/Down, Home/End, Escape and Tab, with focus restoration.
- Tier changes sync across tabs.
- Respects
prefers-reduced-motion. - Never touches the right panel. Only
fullcollapses the left sidebar, and you can expand it again at any time.
Install
dsh plugin --profile web add dsh-width-tiers
Restart dsh web, then hard-refresh the page. A six-bar picker appears at the
bottom-right.
For a local checkout:
dsh plugin --profile web add link:/path/to/dsh-width-tiers
Usage
- Click the picker and choose a tier.
- Picking
Custombefore the first drag opens a guide at the right edge; drag a native handle to record a width. - Dragging any native handle switches to
Custom; the plugin steps aside while you drag. Standardclears the width preference and returns to the app default.Fullcollapses the left sidebar; the icon rail stays available.
How it works
- Mounts the picker into the frame-wide
shell.overlayslot; the plugin fiber owns the controller lifetime, so no listeners or timers outlive it. - The controller publishes an immutable snapshot (tier, menu, guide); the React picker renders it and dispatches actions, so the view can remount without rebuilding observers.
- Locates the conversation body that declares
--dsh-chat-content-width(prefers[data-conversation-content], skips the right sidebar's embedded conversation), then writes--dsh-chat-user-widthon its parent. - Stores the configured target in the app preference; only the inline width is
clamped to
max(640px, column − 176px). - Watches the column with
ResizeObserversofullfollows sidebar, rightbar and window changes. - Drives panels through
ctx.layoutand registers copy throughctx.locale.
Compatibility
- DSH Web 0.2.x with a
webprofile (shell.overlayslot andslotsservice). - Width axis checked against DSH 0.2.2-rc.3 in the live Web UI: 640px floor,
176px handle budget,
--dsh-chat-*variables,data-width-handle, layout/locale services. - Narrow screens: the picker hides while the sidebar drawer
(
data-sidebar-drawer) is open and follows the on-screen keyboard.
Development
pnpm install
pnpm build # src/ -> lib/ (host entry + loader-wrapped client bundle)
pnpm typecheck
pnpm test # vitest: controller (jsdom) + picker component suites
pnpm verify:client
The sources live in src/ (src/index.ts is the no-op host entry, the
feature lives in src/client/); lib/ is the built, published payload. The
vitest suites import the sources directly: the controller runs under jsdom and
the picker is rendered with Testing Library, so no live DSH instance is
required. verify:client checks the built bundle contract. Development needs
Node 22+ and pnpm.
Notes
- Wider fixed tiers are clamped on narrow windows.
- A custom width dragged on a narrow window is clamped by the app before it is recorded.
License
MIT — see LICENSE. Copyright (c) 2026 aaronlei.
Badge
Listed here? Link back with this badge — paste the snippet into your repository README.
[](https://dsh-plugin.com/plugins/aaronlei/dsh-width-tiers)