dsh-conversation-float 0.1.4 → 0.3.0

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/README.md CHANGED
@@ -1,86 +1,119 @@
1
- # Conversation float
1
+ # Conversation Float
2
2
 
3
- **dsh-conversation-float** — lifts the **conversation view** out of its fixed seat in DSH and turns it into a floating panel.
4
-
5
- The float is **DSH's own** — the dock kit's floating panel, the same one the right sidebar uses — not a second browser window: the taskbar still shows a single DSH window. It holds **the real conversation view**, the same column rather than a redrawn copy, so typing, scrolling, switching between Conversation and Trajectory, the composer, attachments and the persona picker all stay native.
3
+ **dsh-conversation-float** turns the DSH conversation into a real floating window inside DSH — not a second OS window. The window can sit over the app, be minimised into the left sidebar as a taskbar row, or be docked into the right sidebar. It keeps the conversation usable while you open plugin pages, automation pages and other left-sidebar entries.
6
4
 
7
5
  [English](README.md) · [简体中文](docs/README.zh.md) · [日本語](docs/README.ja.md) · [Deutsch](docs/README.de.md) · [Español](docs/README.es.md) · [Français](docs/README.fr.md) · [Português](docs/README.pt.md) · [Русский](docs/README.ru.md)
8
6
 
9
- ## Use it
7
+ ## What you get
8
+
9
+ - **One click** from the small window icon at the right of the session title bar.
10
+ - **The real conversation**, not a redrawn copy: typing, scrolling, the Conversation/Trajectory tabs, the composer, attachments and the persona picker stay native.
11
+ - **Multiple floats**, one per Session, each with its own row in the left sidebar.
12
+ - **A taskbar that only raises windows**: clicking a session row brings that float forward and never changes the page behind it.
13
+ - **A full conversation on non-conversation pages**: opening Plugins, Automations, Settings or another left-sidebar entry leaves the live conversation's float on screen with its header, View tabs and composer. The page stays in the middle column behind the float.
14
+ - **A three-state entry button**: open the float, hide the rest of DSH, or bring the rest of DSH back.
15
+ - **Menu rows that know when to disappear**: “Stow the conversation here” hides once the window is minimised, and “Move the conversation here” hides once it is docked on the right.
16
+
17
+ ## Open, minimise, close
10
18
 
11
- **Entry**: the small window icon at the right of the session title bar (*Conversation float*).
19
+ Click the window icon in the session title bar. The float opens large (about 920×720, scaled to the window), with the rest of DSH still visible and both sidebars in the room it leaves.
12
20
 
13
- One click opens the float **with the rest of DSH still on screen**: both sidebars open, and the float sits centred in the room they leave. The *same* button then hides the DSH interface and leaves the float alone — its tooltip reads *Hide DSH* before that press and *Show DSH* while hidden — and the press after that brings the interface back. Closing the float, stowing it in the left sidebar or docking it into the right sidebar hands the sidebars back on its own.
21
+ The same button cycles through three states:
14
22
 
15
- The float **opens large** (about 920×711, scaled to the window) by calling the dock kit's own `resizeFloat` intent — `sidebarRight.require()` → `actions.resizeFloat(sessionId, paneId, rect)`, with `paneId` read from `data-dockkit-float` on the float. It only grows a float; one you already enlarged is never shrunk back.
23
+ 1. open the float;
24
+ 2. hide the DSH interface and leave only the float;
25
+ 3. show the DSH interface again.
16
26
 
17
- A collapsed right sidebar is **expanded before** the float opens, so "stow back into the sidebar" has somewhere to land, and a collapsed left sidebar is expanded too — collapse is detected by measuring width, so a narrow window never gets a collapse flag written.
27
+ Closing the float, minimising it into the left sidebar, or docking it into the right sidebar restores the sidebars to the arrangement captured when the float opened. The snapshot is taken once and is not overwritten while the window is up. Changes you make to the sidebars while the float is open are not tracked.
18
28
 
19
- **Closing the float — or leaving the hidden state — puts the sidebars back the way the window had them.** If you closed or opened a sidebar **yourself** while the float was open, that last arrangement is what comes back, and it is what comes back even when you close the float from the hidden state: a window you pared down to the right column stays that way. "Yourself" counts only your own press on a sidebar or a key, in both directions: DSH narrowing the left sidebar on a small window, a hidden sidebar being re-laid-out, or a press inside the float itself does not count. The snapshot of the earlier window is taken once, before any sidebar is touched, and is never overwritten while the float is up.
29
+ The window's **—** button minimises it: the window disappears, but its left-sidebar taskbar row stays. Click that row to bring it back. The **✕** button closes it for good: the window and its row go away, and the conversation returns to the middle column.
20
30
 
21
- ## Drag it left, centre or right
31
+ While DSH is hidden, **Escape** brings the interface back.
22
32
 
23
- Hold the float's title bar to drag. **Holding for 1.2 s** puts the drag into judging; from then on the outline follows the band under the pointer and the release drops into that band. Judging starts once per drag, so crossing bands never waits again. Releasing before 1.2 s does nothing — no accidental moves.
33
+ ## Move the conversation
24
34
 
25
- The three bands are the window's real columns: **left sidebar** (frame column 0, currently 0..280), **middle column** (280..680), **right sidebar** (the `data-rightbar-col` column, 680..1097). The outline covers exactly the block the float will land in, at the same size.
35
+ Hold the window's title bar and drag. Holding still for **1.2 seconds** arms the drop bands; the title bar tints, an outline follows the band under the pointer, and releasing drops the conversation there. Releasing before the hold does nothing. On touch, moving more than 10 px before the hold finishes keeps the gesture as a normal window move.
26
36
 
27
- | Drop | After release |
37
+ | Drop on | Result |
28
38
  | --- | --- |
29
- | **Left** | The float is **stowed in the left sidebar drawer**: it is not closed, only invisible, so the middle column stays empty; the left sidebar grows a row **named after that Conversation** that brings it back |
30
- | **Centre** | The float closes and the conversation returns to the middle column |
31
- | **Right** | The conversation docks as a **page in the right sidebar** — a native DSH tab with its own *Return to sidebar* and close |
39
+ | **Left sidebar** | The window is minimised into the left sidebar. It is not closed; its taskbar row is the way back. The middle column stays empty. |
40
+ | **Centre** | The window closes and the conversation returns to the middle column. |
41
+ | **Right sidebar** | The conversation docks as a native page in the right sidebar, with DSH's own return and close controls. |
32
42
 
33
- The left-sidebar row exists only after a float has actually been put there; before that the left sidebar stays empty and no permanent entry is added. The row carries the stowed Conversation's title — not the plugin's name — and switching Conversations leaves that title alone: pressing the row returns to *that* Conversation and puts its float back on screen.
43
+ The left-sidebar row carries the Conversation's title, not the plugin's name. It keeps that title while the window looks at other Conversations. Clicking the row only shows and raises that window; it never selects the plugin's main panel and never takes a plugin or automation page away.
34
44
 
35
- **Or skip the drag.** The left sidebar's *More* menu carries **Stow the conversation here**, and the guide's *More tools* card in the right sidebar carries **Move the conversation here**. Both are ordinary DSH menu rows below the shipped ones, and each hides itself once the conversation is already where it would send it.
45
+ **Or skip the drag.** The left sidebar's *More* menu carries **Stow the conversation here**. The right sidebar's guide carries **Move the conversation here**. Each row hides itself when the conversation is already in that place.
36
46
 
37
- ## How it works (and why the conversation is not redrawn)
47
+ ## Pages outside the conversation
38
48
 
39
- - The conversation exists as **one DOM**: the plugin moves the column that carries it into the panel body (same document, same React root) and moves it back on close or host change; if its original seat is gone, the fallback is the middle column.
40
- - **Stow left** = a marker on the float's root makes it hidden (`visibility`/`opacity`); the panel is **not closed**, which is why the middle column can stay empty.
41
- - **Dock right** = hands the tab to the right sidebar (`openResource(..., { destination: 'sidebar' })`) and lets DSH do the move and the docking.
42
- - **The docked tab keeps its body**: the tab type is registered with `keepMounted`, so switching to another tab of the right sidebar leaves the conversation in that tab's body instead of handing it back to the middle column. The column follows whichever retained body is on screen while its own Session is the current one; for any other Session the middle column is the seat again, exactly as before.
49
+ When you open Plugins, Automations, Settings or another left-sidebar entry, the conversation column goes back to the middle column so the page can use the normal three-column frame. The live Session's float stays on screen and switches to a **full local conversation**: session header, Conversation/Trajectory tabs and composer. It is not a read-only transcript.
43
50
 
44
- ## Performance
51
+ The page is **behind the float**. Drag the float aside to work on the page. Clicking the Session's taskbar row only raises the float; the page stays open and unchanged. Closing the page, or returning to the conversation normally, hands the real conversation column back to the float.
45
52
 
46
- Each animation frame does at most one measurement; the three bands are measured once, on press. The outline is repainted only when the band actually changes, and moves with `transform`. Earlier versions measured layout and wrote four styles on every mouse move — that, not the drop logic, was what made dragging feel slower than DSH's own.
53
+ A window for a Session that is **not** the live one still shows a read-only transcript. One conversation has one live composer; the composer and View tabs belong to the live Session.
47
54
 
48
- ## Known limits
55
+ ## Multiple windows and the taskbar
56
+
57
+ Each Session can have one float. Every float gets a row in the left sidebar, ordered as a taskbar. Rows are named after their Sessions.
58
+
59
+ - Clicking a row **raises that window**. It does not switch the current Session and does not change the main panel.
60
+ - A non-live window shows a **Switch to this conversation** chip when it is on top. Clicking it makes that Session live; the window then takes the real conversation column.
61
+ - Closing one window does not touch the others.
62
+ - A session taskbar row is an entry, never a second live copy of the conversation.
63
+
64
+ ## Dock into the right sidebar
65
+
66
+ Dragging right, or using **Move the conversation here**, hands the tab to DSH's right sidebar. The tab type is registered with `keepMounted`, so switching to another right-sidebar tab leaves the conversation in its own tab body. The column follows whichever retained body is on screen while its Session is live; for any other Session the middle column is the seat again.
67
+
68
+ ## Draft and composer
49
69
 
50
- - A conversation has exactly one host: the left-sidebar row is an **entry**, never a second live copy of the conversation.
51
- - The float belongs to the Session that opened it: switching to another Session hands the Conversation back to that Session's middle column (or to its own float, if that Session has one), and switching back brings this Session's float back.
52
- - The left-sidebar row is named after the Conversation that was stowed and keeps that name while the window looks at other Conversations. Pressing it switches to that Conversation and un-hides its float; it never floats whichever Conversation happens to be on screen.
53
- - The drawer holds **one** Conversation. Stowing another replaces the resident one: the replaced float is released back to being an ordinary float (losing only the drawer marker), so the left sidebar never grows a second row.
54
- - Taking the float back out of the drawer puts it back **where it was stowed** (possibly over the left sidebar); it does not recentre.
55
- - This is a float inside the DSH window, not a separate OS window.
56
- - Restart DSH and the drawer state is gone; the conversation returns to the middle column.
70
+ A Session has one input shell and one editor, and the editor can only ride one DOM root at a time. When the conversation moves between the middle column, a window and a right-sidebar page, the plugin re-attaches the editor to the composer on screen and restores the draft writer into an empty slot. The draft you see is the draft that gets sent.
57
71
 
58
- ## Moving the float
72
+ Closing the float no longer clicks another View tab to force a remount. The plugin heals the editor directly, so the window returns to the conversation without flashing Trajectory or any other View.
59
73
 
60
- The float is moved by DSH's own drag. While a hand is on the panel the plugin applies no seat of its own — re-applying the remembered rectangle mid-drag is what used to snap the float back on the first movement.
74
+ ## Performance
75
+
76
+ Each animation frame does at most one layout measurement. The three drop bands are measured once, on press. Waits that depend on DSH committing a change are frame-driven; the plugin keeps **no interval** and runs its repairs on layout passes DSH already causes. The outline is repainted only when the band changes and moves with `transform`.
77
+
78
+ ## Known limits
79
+
80
+ - The float is **inside the DSH window**, not a separate OS window.
81
+ - A conversation has exactly **one host**. A taskbar row is an entry, never a second live copy.
82
+ - A window whose Session is not live shows a **read-only transcript**: no View tabs, no composer. Switch it to the live Session to type.
83
+ - The live float keeps a full local conversation while a non-conversation page is open, but that page is **behind the window**. The float does not shrink to a sidebar or dock itself automatically.
84
+ - The float belongs to the Session that opened it. Switching Sessions hands the conversation to the new Session's middle column or its own float; switching back brings the old float back.
85
+ - Restarting DSH clears floats and taskbar rows. The conversation returns to the middle column.
86
+ - The composer repair uses a few DSH-internal shapes (the editor behind the composer box, the conversation input shell, and its draft slot). A future DSH release that renames them degrades to the old behaviour rather than crashing.
61
87
 
62
88
  ## Install
63
89
 
64
- Requires DSH **>= 0.2.2-rc.1** — the version this bundle is developed and tested against.
90
+ Requires DSH **>= 0.2.2-rc.1**.
65
91
 
66
92
  ### From npm
67
93
 
68
- ```bash
69
- npm i dsh-conversation-float
70
- ```
94
+ npm i dsh-conversation-float@0.3.0
71
95
 
72
96
  Then register it in the **profile's `package.json`** — both steps are required:
73
97
 
74
- 1. add `"dsh-conversation-float": "^0.1.4"` to `dependencies`
75
- 2. add `"dsh-conversation-float"` to `dsh.profile.bundles` — only a registered bundle shows up in the plugin list and can be toggled
98
+ 1. add `"dsh-conversation-float": "^0.3.0"` to `dependencies`;
99
+ 2. add `"dsh-conversation-float"` to the profile's `dsh.profile.bundles` list.
100
+
101
+ Only a registered bundle shows up in the plugin list and can be toggled.
102
+
103
+ ### From a tarball
104
+
105
+ dsh plugin add <path-to>/dsh-conversation-float-0.3.0.tgz
106
+
107
+ Or put the tarball in the profile and use a `file:` dependency, then add the name to the bundle list.
76
108
 
77
109
  ### From source
78
110
 
79
- 1. put the source anywhere
80
- 2. junction it into `<profile>/node_modules/dsh-conversation-float`
81
- 3. in the profile's `package.json`: `dependencies` gets `"dsh-conversation-float": "link:<path>"`, `dsh.profile.bundles` gets `"dsh-conversation-float"`
82
- 4. `client.js` reloads hot; the host half (`index.js`) is a no-op and needs a restart only if you change it
111
+ 1. put the source anywhere;
112
+ 2. link it into `<profile>/node_modules/dsh-conversation-float`;
113
+ 3. add a `link:` dependency and the bundle name to the profile.
114
+
115
+ The bundle is assembled at startup, so restart DSH after installing or upgrading.
83
116
 
84
117
  ## License
85
118
 
86
- MIT
119
+ MIT