One-click collapse for the DSH Web GUI chat component
Click once to hide it; a floating restore ball appears in the corner. Click the ball to bring it back — the ball disappears.
English | 中文
> A browser-side plugin with **zero changes to the DSH codebase**. No patching the host, > no bundle injection, no host-side service. ## The problem it solves On a small screen the composer and its toolbar are always there, and that eats a slice of the conversation you can actually read. This plugin puts a **⌄** button at the right end of the composer tool row: one click collapses the whole component and hands the vertical space back to the transcript. A restore ball stays in the corner, ready to bring it back. Hiding is **CSS-only — the DOM stays mounted** — so your draft, pasted images and caret position all survive. Reopen it and keep typing. ## Interactions | Action | Result | | --- | --- | | Click the **⌄** button at the right end of the composer tool row | The target component collapses (draft / images / caret preserved) | | After collapsing | A **restore ball** (chat-bubble icon) floats in the viewport corner | | Click the restore ball | The component returns and the ball hides itself | | Right-click the restore ball | Cycles the collapse target between “composer only” and “whole conversation area”, with a brief toast | | `Alt+H` | Keyboard toggle for collapse / expand | State (collapsed or not, collapse target, ball position) lives in `localStorage['dsh.chatCollapse.v1']` and survives a reload. ## Collapse targets | target | What gets hidden | Anchored by | | --- | --- | --- | | `composer` (default) | Only the composer seat | `[data-composer-seat]` | | `chat` | The whole conversation area (transcript + composer + session header) | the parent of `[data-conversation-scroll]` | Visibility is driven by two attributes on `` (`data-dsh-cc` / `data-dsh-cc-target`) plus CSS selectors — **no class names are added to official nodes**, so a React re-render cannot wipe them. ## Install ```bash dsh plugin --profile web add github:cx2002302-lang/dsh-chat-collapse ``` Then **restart `dsh web` once** (a new client bundle has to enter the boot graph) and refresh the page: ```bash # Adjust the unit name to your deployment; this is the systemd user-service form systemctl --user restart dsh-web.service ``` After the refresh the ⌄ button appears at the right end of the composer tool row. For local development you can also point straight at a directory: ```bash dsh plugin --profile web add /path/to/dsh-chat-collapse ``` ## Uninstall ```bash dsh plugin --profile web remove dsh-chat-collapse ``` On unload the `ctx.effect` disposer removes the injected `