Introduction¶
In the DSH Web environment, the official input field stops expanding after reaching 336px and starts internal scrolling, without providing collapse controls. When reading AI responses while editing a long draft, the expanded input field can obscure most of the chat content. This plugin changes this behavior while retaining the official content-adaptive mechanism, and only tightens the max-height ceiling.
Plugin Overview¶
dsh-composer-collapse is a pure client-side patch plugin for managing the height of the DSH Web composer input field. It does not modify host files and takes effect only through client-side scripts. The plugin owner is 483218131, and it is licensed under MIT.
Core Features¶
The plugin provides three height modes, switchable via the button in the upper-right corner or keyboard shortcuts, with state saved in local storage.
- Auto mode (default): Collapses to 72px (3 lines) when unfocused, expands to 192px (8 lines) when focused; collapses automatically while reading and expands automatically while editing.
- Persistent expanded mode: Fixed height of 336px (14 lines), matching the official default behavior, and does not collapse automatically.
- Persistent collapsed mode: Fixed height of 72px (3 lines), and does not expand even when focused.
Installation and Enablement¶
Use the following command to install the plugin:
dsh plugin --profile web add github:483218131/dsh-composer-collapse
After installation, refresh the Web page to apply the changes.
Usage¶
- Switch modes: Click the small arrow button in the upper-right corner of the input field card to cycle through modes (auto → persistent expanded → persistent collapsed → auto). Or use the shortcut
Alt+Shift+C. - Local tuning: For local
link:installations, edit the constants at the top ofclient/client.js(CAP_COLLAPSED,CAP_FOCUSED,CAP_OPEN,TEXT_INSET_RIGHT) to adjust height or layout parameters.
Notes¶
- Browser compatibility: Focus detection relies on the CSS
:has()pseudo-class and requires Chromium 105+ browsers (Edge/Chrome 2022 or later). - Side-effect registration: All side effects (style injection, DOM nodes, listeners) must be registered inside
ctx.effect(...); otherwise they will be reclaimed by the runtime engine. - Layout overlap: It is known that when the top notification bar or attachment thumbnails are visible, the toggle button may briefly cover their upper-right corners, but clicks on both remain unaffected.
- Hook mechanism: The plugin locates elements using official
data-*attributes (such asdata-composer-cardanddata-input-scroll) and does not use hashed class names.
Follow-up¶
By controlling the input field height, this plugin provides a more compact reading experience for long conversation scenarios. All features are implemented with local storage and have no cross-origin or server-side dependencies.
GitHub repository: https://github.com/483218131/dsh-composer-collapse