Type Markdown, see it rendered live — Open-WebUI-style composer for the DeepSeek Harness (DSH) web, with syntax-highlighted code blocks, task lists, format toolbars and smart paste.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-composer-live
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:zeusxx/dsh-composer-live
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README

dsh-composer-live turns the DSH Web input box into an Open-WebUI-style live editor: you type Markdown, it renders as you type — bold, italic, code blocks with syntax highlighting, lists, quotes, tables — while the draft itself stays plain Markdown source, so what you send is exactly what you typed.
Since v0.3.0 it also does what Obsidian's live preview does: the line your caret is on shows the raw Markdown (editable, markers visible), every other line renders in clean reading form — markers hidden, - list items become bullet dots, - [ ] / - [x] tasks become real checkboxes. And all colors now follow your theme/skin via official DSH variables — inline code looks the same while typing as it does after sending.
It is a pure browser-side plugin: zero runtime dependencies, no service injection, no patches to official code. It layers on top of the official 0.1.5+ Lexical composer without touching what DSH already does natively.
Looking for the DSH 0.1.x (textarea composer) version? That's
dsh-composer-md, the predecessor of this plugin — discontinued.
Screenshots
Focus-line source/reading split (v0.3.0)
Caret line shows raw markers (with the blinking caret); every other line is reading form — hidden ##/>/**, bullet dots, checkbox tasks, ordered numbers kept.

Live markdown rendering

Code blocks

Selection toolbar

Features
Focus-line source/reading split (v0.3.0)
Obsidian-style live preview: the line your caret/selection is on shows raw Markdown markers (editable), every other line renders in reading form — inline markers (**, `, ~~, []()) and ## / > prefixes are hidden, unordered - becomes a bullet dot, task [ ] / [x] become real checkboxes (checked = green with a tick), ordered lists keep their numbers. Table rows and code fences always stay in source form (they are editing structure). When the composer is not focused, all lines are in reading form — a clean preview.
Hiding is paint-only (color:transparent on the absolutely-positioned render segments; symbols drawn as pseudo-elements on those segments) — character slots are preserved, so caret alignment is unaffected.
Theme-following colors (v0.3.0)
No hardcoded palette any more: accents follow --dsw-alias-link, inline-code background follows --dsw-alias-markdown-inline-code (typing and sent-message colors finally match), code-block background follows --dsw-alias-markdown-code-block, syntax tokens follow the official --shiki-token-* theme, markers follow --dsw-alias-label-dimmed, task-done follows the success token, toolbar/toast follow surface tokens. Change skin or theme and the composer follows automatically; on hosts without these variables (DSH 0.1.x) it falls back to the built-in light/dark palette.
Live Markdown rendering
- Inline styles render as you type:
**bold**,*italic*,`code`(theme accent capsule),~~strikethrough~~,[links](url)(whitelisted protocols),capsules. - Character-perfect caret alignment. Marker characters (
**,`,~~,[]()) are dimmed but keep their exact width, and bold/headings use paint-only faux-bold — so the rendered line stays character-for-character aligned with the invisible editor text. The caret lands precisely everywhere, including inside formatted spans, with zero drift while typing. - Task list items:
- [ ]/- [x]render as checkbox capsules; completed items get struck through. - The draft always remains plain Markdown source. Rendering is purely visual — the message you send is the source text you typed.
Code blocks
- Typing ``` shows plain text until the fence closes — no half-rendered blocks while you are still typing.
- Shift+Enter on an open fence auto-completes a closed block (blank line + closing fence + trailing line) and puts the caret inside, ready to code.
- ↓ on the last content line of a closed block jumps below the block.
- Zero-dependency regex syntax highlighting: js/ts/py/sh/json/yml/css/html, auto-detected from content when unlabeled — Chinese prose is never misdetected as code.
- Language label on the fence line; token colors follow the official shiki theme (GitHub palette as fallback); fence characters dimmed.
- Monospace: while a closed code block is present, the whole composer (editor + overlay) switches to a monospace stack synced with the official code font. CJK characters deliberately stay on the UI font so line wrapping never diverges between the two layers.
Lists, quotes, tables
- Enter at the end of a list line continues it:
-/*/+markers kept, ordered markers increment (1.→2.,3)→4)), indentation kept. Enter on an empty item exits the list — two Shift+Enter presses end a list. >quote lines continue the same way (>textwithout a space counts too); Enter on an empty quote item exits.- Tab / Shift+Tab indent / outdent by 2 spaces — single line or whole selection block. Tab with the caret in a list marker or leading whitespace nests the item. Tab is fully intercepted: it never moves focus out of the composer.
- A table header row (
|a|b|, ≥ 2 columns) followed by Enter completes the|---|---|separator row plus a blank line, caret on the blank line.
Toolbars and shortcuts
- Format toolbar (outside the composer card since v0.2.14): B / italic / code / link / list / code block / expand. Wraps the selection, or inserts empty markers at the caret; B lights up when the caret sits inside
**…**. The bar is a standalone strip directly above the composer card, card-aligned width, taking no space inside the input area — it never overlaps content or image attachments. - Selection floating format bar (Open WebUI style): select text and B/italic/code/link appear above the selection.
- Ctrl+B / Ctrl+I / Ctrl+E for bold / italic / inline code — which also blocks the browser's native contenteditable bold that would silently insert real
<b>tags into the draft.
Paste handling
- Large pastes (> 8 lines or > 4 KB) that look like code or logs are automatically wrapped in a code fence — one undo step, with a toast hint. Chinese prose is not misdetected; no wrapping when the caret is already inside a code block or the paste itself contains fences.
Esc dispatch, themes, compatibility
- Esc does the right thing in context: open candidate menus → official handler; expanded composer → collapse; generation in progress → stop generating.
- One-key 70vh expand for long-form writing.
- Light/dark theme aware; IME-safe (composition input never flashes); rendering is rAF-batched and incremental.
- @ mention chips stay official and editable. Paragraphs containing chips gracefully degrade to official rendering (chip widths cannot be replicated; zero misalignment wins). Text decorations are unaffected —
/commands and skill-name references are painted in the official reference colour, and the official hover background is disabled (it paints above the render layer and would cover the text). - Also fixes two official positioning glitches when image attachments are present: the trigger menu floating far above the composer, and toolbars overlapping thumbnails.
Not duplicated from DSH 0.1.5
The official composer already provides — and this plugin deliberately does not reimplement: / command menu, @ file mentions, paste-image/file to attachments, Enter-to-send / Shift+Enter newline, IME protection, draft persistence.
Quick reference
| Input | Context | Action |
|---|---|---|
| Enter | plain line | send (official) |
| Shift+Enter | plain line | line break (official) |
| Enter / Shift+Enter | end of list / quote line | continue the marker (ordered increments) |
| Enter / Shift+Enter | empty list / quote item | remove marker, exit the list / quote |
| Enter / Shift+Enter | unclosed fence line | close the block; caret lands inside |
| Enter / Shift+Enter | table header row (≥ 2 cols) | complete separator row + blank line |
| Tab | inside a code block | insert 2 spaces at caret |
| Tab | list/quote marker or leading whitespace | indent line (nested list) |
| Tab | anywhere else | insert 2 spaces at caret |
| Tab / Shift+Tab | multi-line selection | indent / outdent the whole block |
| Shift+Tab | any line | outdent up to 2 spaces (absorbs the key when none) |
| Ctrl+B / Ctrl+I / Ctrl+E | anywhere | wrap selection bold / italic / code, or insert empty markers |
| ↓ | last content line of a closed block | jump below the block |
| Esc | menus open → official · expanded → collapse · generating → stop | context dispatch |
Requirements
- DSH ≥ 0.1.5-rc.2,
webprofile — the plugin targets the 0.1.5 Lexical contenteditable composer. - A Chromium-based browser (Chrome, Edge, …): the transparency technique relies on
-webkit-text-fill-color. - OS-independent — it is pure DOM/CSS with no native dependencies.
Verified DSH versions — every release runs the full 141-scenario E2E suite on two live instances covering both supported generations:
| DSH version | Status |
|---|---|
| 0.1.5-rc.2 | ✅ E2E tested |
| 0.2.0-rc.2 | ✅ E2E tested |
| 0.2.1-rc.5 | ✅ E2E tested (primary) |
Installation
# from npm (recommended)
dsh plugin --profile web add dsh-composer-live
# or from a local checkout (file: installs are physically copied)
dsh plugin --profile web add "file:/path/to/dsh-composer-live"
Restart the web instance after installing. Plugins load from a startup snapshot; refreshing the page alone can leave old and new bundles coexisting.
Running an isolated DSH instance? Point DSH_HOME at it so the plugin installs there instead of the default ~/.dsh:
DSH_HOME=/path/to/your/.dsh dsh plugin --profile web add dsh-composer-live
Usage
Everything is on by default — install, restart, and type Markdown in the composer.
Typical flows:
- Code block: type
```js, press Shift+Enter — a closed block appears with the caret inside. Code with live highlighting; Tab indents two spaces; press ↓ on the last content line to exit below the block. - List: type
- item, press Shift+Enter to continue items; press Shift+Enter on an empty item to end the list. Tab nests, Shift+Tab un-nests. - Long text: hit the expand button (or work as usual) — the composer grows to 70vh for long-form writing; Esc collapses it.
- Paste a log: a big chunk of code or log text becomes a fenced code block automatically; Ctrl+Z if you don't want that.
How it works
The official composer is a Lexical contenteditable editor. This plugin makes its text invisible with -webkit-text-fill-color: transparent (the color property is kept, so the caret and official decorations keep working) and paints its own rendering layer — with every rendered character positioned at the editor's real text coordinates, measured per-character from Range rects.
Because the overlay never does its own layout, alignment bugs (drift, jitter, misplacement) cannot exist by construction: measured deviation is ≤ 0.02px across scenarios, 0.00 per keystroke frame.
Row-level differential rendering (v0.4.0) — the overlay is split into a background layer plus one positioned container per line, with segment coordinates relative to the line head. Typing re-renders only the 1–2 changed lines (a 60-keystroke burst on a 200-line document rewrites exactly one line container — 0 long tasks, versus 33 tasks peaking at 170 ms before), and cursor moves across lines rewrite only the old and new line. Re-flowing an upstream line shifts downstream lines with a single style.top write each — no re-measuring, no re-parsing. Steady-state typing cost is decoupled from document length.
The plugin injects no official services. It reads the editor DOM directly and derives a "projection text" (chips → U+FFFC, <br>/paragraph boundaries → newlines), which keeps it immune to client API churn; DOM anchoring uses stable data- attributes instead of hashed CSS-module class names. Draft edits (list continuation, fence completion, indenting…) go through Lexical-native channels — synthetic beforeinput events that preserve the undo stack — never direct DOM mutation.
See docs/architecture.md for the full deep dive.
Known limitations
- Paragraphs containing @ chips render as plain official text (chip widths cannot be replicated; zero misalignment wins). Text-ref decorations are unaffected.
- Block visuals (headings, quotes, lists, table markers) are paint-only — color, weight, background. Never font size, line height, or indentation; the source layout is preserved so line metrics never change.
- Whole-composer monospace applies whenever a closed code block is present (not per-line — a literal-
\nsingle-text-node draft makes per-line font switching physically impossible). - Fence-completion caret placement waits 80 ms for Lexical's async commit; on very slow machines the caret may occasionally land slightly late.
- ↓ jump-out only triggers on the last content line of a closed block; an unclosed fence falls through to the official handler.
- "Stop generating" is matched by aria-label (English and Chinese enumerated); if upstream renames the label, use the button directly.
webprofile only; Chromium-family browsers only.
Complementary plugins
This plugin focuses purely on the editing experience. Other composer plugins focus on different things — they do not overlap, and can be installed together:
| Plugin | What it does | Overlap with dsh-composer-live |
|---|---|---|
| dsh-composer-live (this one) | Live Markdown rendering, code blocks, lists/quotes/tables, format toolbars, paste handling | — |
| dsh-composer-plus | Model picker, reasoning-effort rail, account display in the composer | none — different layer |
| dsh-client-composer-enter | Swaps Enter/Shift+Enter send behaviour | none — keymap only |
| dsh-prompt-history | ↑ history recall with prefix search | none — recall, not rendering |
Development
node test-live.cjs # 246 unit tests (pure functions, no browser needed)
node e2e/run-e2e.mjs # 141-scenario × 10-invariant E2E suite against a live instance
node e2e/run-perf.mjs # performance gate: idle 0 renders, typing frame median <20ms, long tasks ≤8 (loose anti-regression thresholds)
The E2E runner expects a DSH web instance with this source deployed and derives everything from environment variables: DSH_CL_PORT (default 8124) and DSH_CL_DSH_HOME (defaults to DSH_HOME, then ~/.dsh) locate the deployed copy for a version check; the auth cookie is fetched automatically. See e2e/README.md for the full variable list.
The suite replays six real input channels (literal \n / literal \r\n / line-by-line br / insertParagraph / synthetic paste / refresh-restore multi-paragraph) and cross-checks an independent projection against the plugin's own, character by character.
Version discipline: every change bumps package.json and gets a CHANGELOG.md entry.
FAQ
Why Chromium-only?
The transparency trick (-webkit-text-fill-color) and several caret behaviors are Chromium-specific. Firefox/Safari would need a different approach.
Does it change what I send? No. The draft is always plain Markdown source; rendering is purely visual.
Is per-character measurement slow?
It is batched per render frame and merged into a few absolutely-positioned spans. The overlay is pointer-events: none and out of flow, so it causes no reflow of the editor. Measured per-keystroke delta is 0; no perceptible input latency.
Will a DSH update break it?
Zero service injection plus data--attribute anchoring make it resilient to routine updates (class-name hash churn, client API refactors). When the official composer architecture itself changes — as 0.1.1 → 0.1.5 did, textarea → Lexical — the plugin needs a port. This plugin is that port: dsh-composer-md was its 0.1.x predecessor and is now discontinued.
Feedback
Found a bug, a misaligned character, or a DSH version that misbehaves? Please open an issue — screenshots plus your DSH version help a lot. Feature ideas (new shortcuts, highlighting languages, block styles) are equally welcome.
License
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10562
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10562
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8043
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7387
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5269
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1040
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.