Introduction¶
DeepSeek Harness’s (DSH) AppFrame is a three-track grid: [DSH Left Rail | Agent Conversation Panel (1fr) | Native Right Column (R px)]. The right column is DSH’s native right sidebar (@deepseek-ai/dsh-client-ui-sidebar-right), containing panels, tabs, Guide, and dock/navigation services. DSH does not provide a toggle to “move the right column to the left.” The public surface of ctx.layout only exposes openRightbar(track, fullscreen) / closeRightbar, with no setter for the right column width. This is where a pure client-side layout patch comes in: semantic anchor positioning + rewriting the frame’s inline track sizes + a few CSS variables — without modifying any upstream files.
Plugin Scope¶
dsh-column-swap is a DSH web client plugin developed by maintainer lakersoul. It addresses the issue of DSH’s fixed layout being non-adjustable, allowing users to swap the positions of the native right sidebar and the agent conversation panel while preserving both sides’ widths.
Core Features¶
- Column order swap: Changes
[Left Rail | Conversation | Right Column]to[Left Rail | Right Column | Conversation], preserving each side’s width. - Toggle button: A “two-columns + ⇄” button in the top-right corner of the window. Click to swap column order; click again to revert. State is not persisted — every launch starts from the native layout.
- Drag compatibility: After the swap, dragging the divider maintains natural semantics (drag right to widen the right column, drag left to narrow it).
- Divider handling: In the swapped state, a divider is inserted between “Right Column | Conversation” to avoid overlapping with the left rail boundary.
- Zero dependencies: Does not
require, invoke, or check any third-party plugin (including dsh-better-sidebar).
Installation & Enablement¶
Option 1: Plugin Marketplace / dsh plugin add (Recommended)¶
Paste the repository URL in the marketplace, or run:
dsh plugin --profile web add github:lakersoul/dsh-column-swap
The package declares dsh.bundle.patch, so dsh plugin add appends it to dsh.profile.bundles, and the profile assembles it at startup.
Option 2: Local Checkout (Development / Code Changes)¶
git clone https://github.com/lakersoul/dsh-column-swap
cd dsh-column-swap
node install.mjs --dry-run # Only prints the changes it would make; no writes
node install.mjs # Creates link: dependency + writes bundles + node_modules symlink
install.mjs supports two mounting channels and always cleans up the other one — if the same package appears from two Loader sources, dsh-client-modules will throw an error outright.
Uninstall:
node install.mjs --remove # Cleans both channels (deps, bundles, symlinks, manual sections), then restart DSH
How It Works¶
Anchor Positioning¶
The right column anchor is [data-rightbar-col]; the frame is the nearest display:grid ancestor above it. Each of the three columns traces upward from its own anchor to a direct child of the frame (crossing any number of slot wrapper layers). The conversation column has four levels of fallback (main → main.conversation → the slot host of conversation → “the only in-flow child of the frame excluding the left and right columns”). If the left rail anchor is not found, it does not block (in that case, only the right column and conversation panel are explicitly placed; the left rail auto-fills track 1).
Track Rewriting¶
Reads the frame’s inline grid-template-columns (the React source of truth; reading the computed value would read back your own writes and cause feedback), splits the three track expressions by top-level whitespace (spaces inside minmax(400px, 1fr) are not delimiters), then swaps the last two segments to yield left-rail-track right-col-track conversation-track — each expression is preserved as-is, and handle boundaries are measured only when the template changes.
Supports two host notations:
- 0.1.5: Spx minmax(0,1fr) Rpx
- 0.1.7 onwards: Spx minmax(400px,1fr) minmax(0px,Rmax)
Only recognizes three tracks; if the shape is unrecognized, no action is taken.
grid-row: 1 (Required)¶
When only “fixed column, auto row” is specified for grid items, the sparse auto-placement cursor increments the row by +1 on column number regression — in the layout, document order is Left Rail (col1) → Conversation (col3) → Right Column (col2), so the right column gets assigned to the implicit row 2; but grid-template-rows: 100% only defines row 1, and the implicit row height is auto ⇒ height 0, pushing the entire column below the viewport. Writing grid-row: 1 explicitly for all three columns resolves this.
Dividers¶
After the swap, there must be a line between “Right Column | Conversation” — they are different panels. The native line moves with the right column: in 0.1.5–0.1.7 it is the panel’s own border-left; from 0.2.2 onwards it is the left border of the Web shell dockkit tab host ([data-dockkit-host="dock"][data-dockkit-column="0"] > section, also --dsw-alias-border-l4). After the swap, it lands on the left rail boundary, stacking with the left rail’s own border-right (-l3) to form a thick line. The fix is two steps:
1. In the swapped state, make this “mobile native line” transparent (border-left-color:transparent, preserving the placeholder and geometry).
2. This plugin adds a -l4 line at the right edge of the right column as the new separator; the left rail’s -l3 line stays put ⇒ each boundary has exactly one line, with strength matching the native. If the column width is 0 (collapsed / hover), no line is added.
Drag Direction¶
The native handle’s onDrag is setRightbar(base - dx) — this is right-docked semantics (handle is on the panel’s left edge; drag left = panel widens). After the swap, the right column becomes “left-edge pinned to the left rail” (left-docked), and the same formula inverts. Since there is no width API, correction must happen at the event layer: on the frame, intercept the right handle’s pointer events in the capture phase and re-dispatch with clientX mirrored about 0 — DragHandle only uses the delta of clientX (origin / latest); the absolute value never participates, so mirroring is equivalent to dx → -dx. When the toggle is off, events pass through untouched, preserving the native layout’s originally correct direction.
Master Toggle¶
All layout rules are gated behind [data-dsh-swap-on]; the toggle only adds/removes this single attribute, and CSS variables and column markers remain in place, so switching takes effect immediately without recalculation. The button is registered in conversation.session.header.utilities (the list slot, pure append, right-aligned) — the single conversation.session.header.corner belongs to DSH’s native right sidebar package and cannot be claimed; in the swapped state, the conversation panel is the rightmost column, and this row happens to be the window’s top-right corner, adjacent to the native right sidebar expand button. Button styling uses only existing product tokens, and the label follows navigator.language. No swap by default: the plugin maintains DSH’s native column order at startup; the button is the sole toggle entry point, and this choice is intentionally not persisted — every launch starts from the native state.
Verification¶
- The browser console prints a line:
[dsh-column-swap] ready — tracks = <left-rail-track> / <right-col-track> (native order — click the header button to swap); each button click prints a geometry self-check:[dsh-column-swap] swapped | rail <l>..<r> | sidebar <l>..<r> | conversation <l>..<r> | gap 0px | template <computed-value>—gap 0pxmeans the right column is flush with the left rail;templateshould not benone(ifnone, the track declaration has failed). The health check is silent by default: each boundary should have exactly 1 visible border; when the count mismatches (or they’re not flush), it automatically expands the element stack and border details (includinglines L=… R=… (expect 1 / 1)) — paste that output to diagnose. - The three column rects should be
Left Rail [0..S], Right Column[S..S+R], Conversation[S+R..], and all three should havegrid-rowof1 / auto. - Drag the divider between “Right Column ↔ Conversation”: drag right to widen the right column, drag left to narrow it, follows the pointer, and in-column width tracks frame-by-frame.
- Click the top-right button: column order becomes the swapped state (
[Left Rail | Right Column | Conversation]), and divider drag direction becomes natural; click again to revert to native order (drag direction returns to native semantics).
Applicable Scenarios & Notes¶
Suitable for developers or advanced users who need to adjust DSH’s layout order. The plugin runs with the current dsh process permissions; review the source code and license before installing.
Known trade-offs:
- The bottom workbench follows the conversation panel to the right side (only visible when better-sidebar is installed): its bottom bar is bound to the conversation column (positioned by that column’s rect), so when the column swaps, it naturally follows; width matches the conversation panel.
- Right column overflow:hidden: when opening/closing the right sidebar, the track width animates, while the panel is fixed to track width and anchored at right:0 — without clipping, the panel would first cover the entire left rail then slide back. Clipping results in a clean erase. Trade-off: drag-out tab overlays extending beyond the column get clipped (native menus and hover overlays are portaled to document.body and are unaffected).
- Narrow window / hover mode (right column track is 0): the panel is pinned to the viewport’s right edge, preserving the native “floating above the conversation area” behavior.
- Mirroring only activates in the swapped state: when the toggle is off, events pass through unchanged.
- The panel has border-left removed in the swapped state, and its width is derived from the track, always equal to the rail width.
- Not tested on macOS ([data-platform=darwin]): that generation of styles adds border-left to the conversation column and removes border-right from the left rail; in the swapped state, this may overlap with the plugin’s added divider at the boundary, forming two 0.5px lines — purely a visual difference, no functional impact.
Relationship with dsh-better-sidebar¶
Zero code-level coupling (grep -n "betterSidebar\|better-sidebar" lib/*.js self-proves: it only appears in comments and descriptive text). Does not require it, does not call ctx.betterSidebar, does not reference any of its DOM markers (its data-dsh-center-col on the conversation column is deliberately unused), and does not check whether it is installed.
- Swapping still works if the placeholder is replaced: after uninstalling better-sidebar, the same column becomes DSH’s built-in content (built-in Guide page,
dsh-client-ui-sidebar-documentpreviewdocument preview); the swap works as usual, just with different content in the column. - When the right column has no track (not opened / narrow window hover mode), the plugin visually does nothing (the top-right button remains available for toggling at any time).
- One real interaction (not a dependency): better-sidebar’s bottom workbench positions itself relative to the “conversation panel” column’s rectangle, so when the column swaps, it follows the conversation panel to the right side; if it’s not installed, this side effect simply doesn’t exist.
Summary¶
dsh-column-swap provides a clean client-side patch that allows DSH users to freely swap the positions of the native right sidebar and the agent conversation panel while preserving both sides’ widths. It depends on no third-party plugins and achieves column order swapping and drag compatibility through semantic anchor positioning, track rewriting, and event-level mirroring — without modifying any upstream files.
- Plugin directory page: https://www.skillhub.cn/plugins/lakersoul/dsh-column-swap
- GitHub: https://github.com/lakersoul/dsh-column-swap