@lukstei/dsh-client-split-view 0.0.0-stage → 0.2.2-rc.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +137 -2
- package/cordis.patch.yml +3 -0
- package/dist/client.js +2418 -0
- package/dist/index.js +4 -0
- package/package.json +114 -3
- package/src/client/SplitLayout.tsx +48 -0
- package/src/client/SplitPane.tsx +1076 -0
- package/src/client/SplitPaneHeader.tsx +79 -0
- package/src/client/contract.ts +112 -0
- package/src/client/css.d.ts +5 -0
- package/src/client/dsh.d.ts +18 -0
- package/src/client/file-preview.ts +67 -0
- package/src/client/index.tsx +267 -0
- package/src/client/split-store.ts +698 -0
- package/src/client/styles.ts +780 -0
- package/src/index.ts +8 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lukas Steinbrecher
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,138 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @lukstei/dsh-client-split-view
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Replaces the single-session chat view with side-by-side session panes. Each pane can show a file, a plugin view, or a related session in an overlay. Open panes persist across reloads. Used directly by people running several sessions at once, and by the Kanban and Git review plugins through the `splitView` service.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Use this package](#use-this-package)
|
|
10
|
+
- [Understand the implementation](#understand-the-implementation)
|
|
11
|
+
- [Further Exploration](#further-exploration)
|
|
12
|
+
- [Model Experience](#model-experience)
|
|
13
|
+
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
|
|
14
|
+
- [Dev Note](#dev-note)
|
|
15
|
+
|
|
16
|
+
-----
|
|
17
|
+
|
|
18
|
+
<a id="use-this-package"></a>
|
|
19
|
+
## Use this package
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
- insert:
|
|
23
|
+
- id: split-view
|
|
24
|
+
name: '@lukstei/dsh-client-split-view'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
No config. Client plugin (`platform: web`, `immediately: true`). Required services: `slots`, `sessions`, `uiWorkspace`, `uiSession`, `layout`, `remote`, `sidebarRight`, `remote.workspaceFiles`. The host entry is a no-op.
|
|
28
|
+
|
|
29
|
+
### Plugin dependencies
|
|
30
|
+
|
|
31
|
+
Client-side only. Client `inject`: `slots`, `sessions`, `uiWorkspace`, `uiSession`, `layout`, `remote`, `sidebarRight`, `remote.workspaceFiles`.
|
|
32
|
+
|
|
33
|
+
| Plugin / service | Required? | Provided by | Effect without it |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| `slots` | Required | @deepseek-ai/dsh-client-ui-slots | Plugin stays pending; never applies. |
|
|
36
|
+
| `sessions` | Required | @deepseek-ai/dsh-api-session-controller | Plugin stays pending; never applies. |
|
|
37
|
+
| `uiWorkspace`, `uiSession`, `layout` | Required | @deepseek-ai/dsh-client-ui-workspace, @deepseek-ai/dsh-client-ui-session, @deepseek-ai/dsh-client-ui-layout | Plugin stays pending; never applies. |
|
|
38
|
+
| `remote`, `remote.workspaceFiles` | Required | @deepseek-ai/dsh-api-gateway, @deepseek-ai/dsh-api-workspace-files | Plugin stays pending; never applies. |
|
|
39
|
+
| `sidebarRight` | Required | @deepseek-ai/dsh-client-ui-sidebar-right | Plugin stays pending; never applies. |
|
|
40
|
+
|
|
41
|
+
Code import (no mount): [`@lukstei/util-review-ui`](../util-review-ui/README.md) (`quote`, `useSelectionQuote`).
|
|
42
|
+
|
|
43
|
+
Provides the client service `splitView`.
|
|
44
|
+
|
|
45
|
+
Used by: [`dsh-client-kanban`](../dsh-client-kanban/README.md) (optional), [`dsh-client-review-git`](../dsh-client-review-git/README.md) (optional), [`dsh-session-handoff`](../dsh-session-handoff/README.md) (required, client side).
|
|
46
|
+
|
|
47
|
+
### Behavior
|
|
48
|
+
|
|
49
|
+
- Open sessions are equal-width columns. Focus, maximize or close each one; double-clicking a pane header (outside buttons) toggles maximize. Headers are draggable to reorder panes.
|
|
50
|
+
- Viewports under 768 px show one pane. Selecting a session replaces the current one, and maximize is disabled.
|
|
51
|
+
- State (open sessions, focus, overlays) is stored in `localStorage` under `dsh-client-split-view:state:v1` and restored once the session list is `ready`.
|
|
52
|
+
- A header control in `conversation.session.header.utilities` (`split-view-restore`) restores the split from the native view.
|
|
53
|
+
- While a pane is the pointer origin, `uiWorkspace.openSession` opens the target in that pane as a `session` overlay. `sidebarRight.openResource` opens a `file` overlay for file addresses; `uiWorkspace.startSession` creates a session and adds it as a pane. Other cases fall through to the originals. The overrides are restored on dispose.
|
|
54
|
+
- File overlays preview Markdown (rendered), images (png, jpg, gif, webp, avif, bmp, svg) or plain text.
|
|
55
|
+
|
|
56
|
+
### Service: `splitView`
|
|
57
|
+
|
|
58
|
+
`ISplitView` (from `@lukstei/dsh-client-split-view/client-contract`), provided on the Cordis client context:
|
|
59
|
+
|
|
60
|
+
| Member | Purpose |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `getSnapshot`, `subscribe` | Observe `SplitState` (`sessionIds`, `focusedSessionId`, `maximizedSessionId`, `hoveredSessionId`, `suspended`, `overlays`) |
|
|
63
|
+
| `openSession`, `toggleSession`, `removeSession`, `resetToSingle` | Pane membership |
|
|
64
|
+
| `setFocus`, `toggleMaximize`, `setHoveredSession`, `reorderSession` | Pane state |
|
|
65
|
+
| `suspend`, `resume`, `isSuspended`, `isSplitActive` | Switch between split and native view |
|
|
66
|
+
| `openSlotOverlay(hostId, slotName, title, props)`, `closeOverlay(hostId)` | Factory overlays |
|
|
67
|
+
| `setFallbackPanelId(id)` | Panel selected when the last pane closes; default `null` (native conversation). Integrations must restore `null` on disposal |
|
|
68
|
+
|
|
69
|
+
`openSlotOverlay` props must be JSON objects (pass `{}` for factories without input). Functions, cycles, class instances and non-finite numbers are rejected before the current overlay is replaced. Props persist and are restored on reload. The overlay tab stays closable if its factory provider unloads.
|
|
70
|
+
|
|
71
|
+
### Slots
|
|
72
|
+
|
|
73
|
+
| Slot | Kind | Purpose |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| `split.pane` | single, session | Conversation viewport per column |
|
|
76
|
+
| `split.overlay` | single, session | File, factory and child-session overlays |
|
|
77
|
+
| `split.pane.status` | single, session | Pane indicator |
|
|
78
|
+
| `split.subagent.status` | single, session | Subagent indicator (owner state `active` or `review`) |
|
|
79
|
+
| `split.pane.header.actions` | list, session | Plugin header actions; register through `ctx.slots.inject` |
|
|
80
|
+
|
|
81
|
+
CSS classes use `dsh-split-*`; pane roots carry `data-split-pane`.
|
|
82
|
+
|
|
83
|
+
-----
|
|
84
|
+
|
|
85
|
+
<a id="understand-the-implementation"></a>
|
|
86
|
+
## Understand the implementation
|
|
87
|
+
|
|
88
|
+
<details>
|
|
89
|
+
<summary>Implementation internals — click to expand</summary>
|
|
90
|
+
|
|
91
|
+
| File | Role |
|
|
92
|
+
|---|---|
|
|
93
|
+
| [src/index.ts](src/index.ts) | Host no-op |
|
|
94
|
+
| [src/client/index.tsx](src/client/index.tsx) | Client entry: provides `splitView`, registers `main` / slots, hydration, navigation overrides, restore control. Re-exports `SplitStore`, `splitStore`, `ISplitView`, `SplitOverlay`, `SplitState` |
|
|
95
|
+
| [src/client/contract.ts](src/client/contract.ts) | Public types and Cordis/slot augmentations |
|
|
96
|
+
| [src/client/split-store.ts](src/client/split-store.ts) | `SplitStore`: membership, overlays, persistence, mobile rules |
|
|
97
|
+
| [src/client/SplitLayout.tsx](src/client/SplitLayout.tsx), [SplitPane.tsx](src/client/SplitPane.tsx), [SplitPaneHeader.tsx](src/client/SplitPaneHeader.tsx) | UI |
|
|
98
|
+
| [src/client/file-preview.ts](src/client/file-preview.ts) | Path to preview kind (`markdown`, `image`, `text`) |
|
|
99
|
+
| [src/client/styles.ts](src/client/styles.ts) | Stylesheet registration |
|
|
100
|
+
|
|
101
|
+
Each pane holds a `SessionReference` (source `splitView`) released on removal. The main view registers with key `split-view`; the registration precedes hydration because a re-applied fiber can restore a ready list synchronously. A pointer or focus interaction outside every pane (menus and dialogs excepted) clears the pointer origin.
|
|
102
|
+
|
|
103
|
+
Persisted: `localStorage` only. File overlays store address, owner session, path and title; loaded `contents` are not stored. Session overlays store target and title.
|
|
104
|
+
|
|
105
|
+
Tests: [tests/](tests/) (store, layout, overlays, header, hydration, styles).
|
|
106
|
+
|
|
107
|
+
</details>
|
|
108
|
+
|
|
109
|
+
-----
|
|
110
|
+
|
|
111
|
+
<a id="further-exploration"></a>
|
|
112
|
+
## Further Exploration
|
|
113
|
+
|
|
114
|
+
- Upstream: [DSH module graph](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/module-graph.md).
|
|
115
|
+
- [`@lukstei/dsh-client-kanban`](../dsh-client-kanban/README.md): uses `splitView` for navigation and status.
|
|
116
|
+
- [`@lukstei/dsh-client-review-git`](../dsh-client-review-git/README.md): adds a header action and overlay.
|
|
117
|
+
|
|
118
|
+
<a id="model-experience"></a>
|
|
119
|
+
## Model Experience
|
|
120
|
+
|
|
121
|
+
No model-visible surface. This package adds no tools, prompt text, or context to the model.
|
|
122
|
+
|
|
123
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
124
|
+
## Known Limitations and Deferred Work
|
|
125
|
+
|
|
126
|
+
- The mobile threshold (768 px) is fixed.
|
|
127
|
+
- Split state is per browser (`localStorage`), not per user or host.
|
|
128
|
+
- No Review or Kanban dependency exists in this package; those plugins plug in through the service and slots.
|
|
129
|
+
|
|
130
|
+
<a id="dev-note"></a>
|
|
131
|
+
### Dev Note
|
|
132
|
+
|
|
133
|
+
<details>
|
|
134
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
135
|
+
|
|
136
|
+
`pnpm run verify` runs Biome, build, typecheck and tests.
|
|
137
|
+
|
|
138
|
+
</details>
|
package/cordis.patch.yml
ADDED