dsh-ui-controller 0.1.1 → 0.2.2

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.
Files changed (4) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +43 -34
  3. package/client.js +697 -234
  4. package/package.json +46 -46
package/CHANGELOG.md CHANGED
@@ -2,6 +2,70 @@
2
2
 
3
3
  Notable changes to `dsh-ui-controller`.
4
4
 
5
+ ## 0.2.2 — 2026-11-15
6
+
7
+ ### Fixed
8
+
9
+ - **The More menu rows carry the panel's own icon.** The icon is cloned at
10
+ runtime from the live sidebar row — the first child of
11
+ `span[class*="panelGlyph"]` — into a reserved slot left of the name, so no
12
+ SVG is shipped here and no host class name is hardcoded. The slot is emptied
13
+ before each fill (a host remount cannot stack copies), ids are stripped from
14
+ the clone, and a panel without a readable glyph keeps an empty slot silently.
15
+ - **Folding takes the icon with the text.** `applyFoldState` now hides the
16
+ element that actually wraps both: the row button normally, or the wrapper when
17
+ the host draws the glyph beside the button. `nav` is never hidden, and
18
+ unfolding restores every element it touched.
19
+
20
+ ## 0.2.1 — 2026-11-15
21
+
22
+ ### Fixed
23
+
24
+ - **The More button now carries its count, and folding survives a reload.**
25
+ The launcher is found by its own `aria-label` under
26
+ `nav[class*="panelList"]` — the wide rail has no
27
+ `[data-shortcut-modal="sidebar"]` wrapper, so the previous lookup never
28
+ matched and the count was never painted (and the aria-label is left untouched).
29
+ - **Folded panels are actually hidden now.** Writing the host's pin only happens
30
+ while the menu is mounted, so a reload lost it; folding is now a
31
+ `display:none` pass over the live panel rows, matched by `aria-label` /
32
+ title, re-applied by a MutationObserver, and undone on teardown. A row we
33
+ cannot identify is left alone.
34
+ - **The More menu rows look host-drawn.** The row class list and fixed sizes are
35
+ sampled from a real host menu item at runtime (never a hardcoded hashed class);
36
+ our own class is used until one is on screen.
37
+
38
+ ### Removed
39
+
40
+ - **The two bulk buttons in the More menu.** Fold-all / unfold-all move to the
41
+ settings page only (`sidebarMore.foldAll`); the menu keeps one per-row toggle,
42
+ so the three conflicting controls the user saw cannot appear together.
43
+
44
+ ## 0.2.0 — 2026-11-15
45
+
46
+ ### Added
47
+
48
+ - **Left column folded behind the More button.** A new entry in
49
+ `sidebar.panellist.actions` renders rows for every panel: click jumps and
50
+ dismisses, a pin button per row folds/restores through the host's
51
+ `onPinnedChange`, and fold-all / unfold-all actions cover the whole list. The
52
+ folded ids are persisted (`dsh.uic.sidebarMore.v1`, `{ folded: string[] }`)
53
+ because the host's own pin state is in-memory only, cleaned against the live
54
+ panel set on every read, and replayed on every menu open / panel-list change.
55
+ `sidebarMore.foldAll` (default on) decides the shape for fresh installs. The
56
+ host's "More" launcher label gains a painted count (`更多 (3)`), only when the
57
+ number changes.
58
+ - `window.__UI_CONTROLLER__` additions: none — the menu is a slot entry, not an
59
+ API; the record lives under the normal settings storage.
60
+
61
+ ### Removed
62
+
63
+ - **Three-state settings rail** (0.1.1's `nav` field, its CSS, its settings-page
64
+ block and its i18n keys). The user chose the left column of the chat page over
65
+ the settings dialog, so the whole width block is gone; `SETTINGS_VERSION`
66
+ stays at 1 and the unknown-key preservation rules keep an old `nav` record
67
+ harmless if it was ever written.
68
+
5
69
  ## 0.1.1 — 2026-11-14
6
70
 
7
71
  ### Added
package/README.md CHANGED
@@ -65,19 +65,28 @@ is missing, this is the plugin that answers that.
65
65
  5. **Presets.** Hide-marks and visual order can be captured as named presets, applied,
66
66
  and deleted; storage follows the same rules as `better-notice` (unknown keys are
67
67
  preserved, user changes are marked, upgrades do not overwrite).
68
- 6. **Settings rail width.** The left column of the settings dialog has three states:
69
- **full** (188px, the default), an **icon rail** (56px — labels hidden, each button
70
- keeps its name as a `title` tooltip) and **collapsed** (0px). By default it
71
- **follows the host sidebar**: when the host's own session list is a rail, this one
72
- is too, and the stored three-way choice is not read at all. Turn *Follow the host
73
- sidebar* off to pick one of the three yourself. Only the first grid track and a
74
- few `title` attributes are touched — no slot is registered, and `settings.header`
75
- is never involved, so the shipped title is never shadowed.
76
-
77
- The follow switch reads the same two signals the shipped behaviour does: an
78
- explicit `data-sidebar-collapsed` marker in the document, or a sidebar element
79
- measured between 1px and 64px wide. A different threshold would make the two
80
- disagree the moment the host changes its width.
68
+ 6. **Left column: folded panels behind the More button.** The session list on the
69
+ home page keeps only `plugins` and the "More" launcher in the left column; every
70
+ other panel is folded behind it. The host's own pin state is in-memory only, so
71
+ this plugin persists the folded ids itself (`dsh.uic.sidebarMore.v1` →
72
+ `{ folded: string[] }`) and replays them every time the menu opens or the panel
73
+ list changes. Folded ids are cleaned against the live panel set on every read,
74
+ and `sidebarMore.foldAll` (default **on**) decides the shape for fresh installs;
75
+ with it off, only the ids already in the record are folded. The "More" button
76
+ label gains a count (`更多 (3)`) painted in place, only when the number changes.
77
+ The menu itself is one entry in `sidebar.panellist.actions`: it renders one
78
+ row per panel with a single per-row toggle (folds / restores through the
79
+ host's `onPinnedChange` and mirrors the record). There are no bulk buttons in
80
+ the menu — `sidebarMore.foldAll` on the settings page is the only bulk switch.
81
+ Rows copy the look of a real host menu item at runtime (class list plus
82
+ `getComputedStyle` height / padding / font / radius / colour); nothing is
83
+ hardcoded, and if no host item is on screen our own class is used until one
84
+ appears. Folding itself is a `display:none` pass over
85
+ `nav[class*="panelList"] button[class*="panelRow"]`, matched by
86
+ `aria-label` / title, re-applied by a MutationObserver, and undone on
87
+ teardown; a row we cannot identify is left alone. Nothing else is touched: no
88
+ custom panel rows, no icon replacement, and the settings dialog's own nav
89
+ width is left alone.
81
90
 
82
91
  ## What it deliberately does **not** do
83
92
 
@@ -136,7 +145,7 @@ on it.
136
145
  ```js
137
146
  const api = window.__UI_CONTROLLER__;
138
147
 
139
- api.version // '0.1.1'
148
+ api.version // '0.2.1'
140
149
  api.catalog() // → [{ key, kind, scope, risk, purpose, registrantStatic, injectStatic }]
141
150
  api.catalogSummary() // → { total: 109, kinds: {...} }
142
151
  api.inventory() // → { rows, empty, totalSlots, occupiedSlots, hiddenCount,
@@ -177,7 +186,7 @@ Two sentences that belong in any answer about ordering:
177
186
  node --check client.js
178
187
  node --check index.js
179
188
  node --check test/classify.test.mjs
180
- node test/classify.test.mjs # expect: PASS — 35 groups
189
+ node test/classify.test.mjs # expect: PASS — 40 groups
181
190
  node ..\..\cangku\tmp\261114_gate_ui_controller.mjs # static gate, separate script
182
191
  ```
183
192
 
@@ -191,12 +200,16 @@ with the old `order` alias, and the zh/en dictionary parity. The grouped page ha
191
200
  its own groups: entries group under their slot with empty seats in their own zone,
192
201
  the three filters count what they keep, folding starts closed and survives a
193
202
  re-render, and the static fallback still draws slot heads when no live snapshot is
194
- available. The settings rail has four groups of its own: each state owns its grid
195
- track (56px / 0px, and `full` claims none so a wider host rail is inherited
196
- instead of pinned), following the host sidebar ignores the stored three-way
197
- choice (and reads the same 64px threshold the host does), the attribute plus
198
- tooltips are painted on the panel and taken back off, and picking a state stops
199
- following while the follow switch writes it straight back.
203
+ available. The sidebar-more behaviour has groups of its own: replay folds only
204
+ what the record and `foldAll` ask for; the count label repaints through the
205
+ `nav.panelList` ancestor and only when its text changes; folding hides the live
206
+ rows and restores them on the way out, leaving rows it cannot identify alone; and
207
+ the menu borrows a live host item's class list and computed size instead of any
208
+ hardcoded name; each menu row copies the panel glyph from the live sidebar row
209
+ (runtime clone taken from the drawing inside the host's slot anchor, ids and
210
+ `data-slot` stripped, refilled on every mount, remembered per panel so a folded
211
+ panel keeps its icon after the host stops rendering its row) and folding hides
212
+ the wrapper that owns both the icon and the text, never `nav`.
200
213
 
201
214
  ## Known limits
202
215
 
@@ -219,19 +232,15 @@ following while the follow switch writes it straight back.
219
232
  readable at runtime for entries present in the registry; the column shows the
220
233
  static proxy scanned out of the shipped bundles, so an entry registered by code
221
234
  that ships no literal key can read as "—".
222
- 8. **The rail only collapses above 768px.** Below that breakpoint the host turns the
223
- settings nav into a horizontal tab strip, where hiding the labels would leave an
224
- unlabelled bar; the three states are inert there. Collapsing changes width and
225
- paint order only — the keyboard order and the DOM order stay exactly as shipped.
226
- 9. **Following is read at paint time, not subscribed to.** The rail re-reads the host
227
- sidebar on the same two-second pass that applies visibility and order, so a manual
228
- host collapse is reflected within that window rather than instantly.
229
- 10. **Collapsed hides the section list.** With `Collapsed` the settings nav is 0px
230
- wide, so while it is collapsed you cannot switch to another settings section.
231
- Turn it back on from this page, or run
232
- `__UI_CONTROLLER__.settings.set({ nav: { follow: false, state: 'rail' } })` in
233
- the console. `Follow the host sidebar` (the default) never lands you there on
234
- its own — only an explicit choice does.
235
+ 8. **The More menu coexists with other action entries.** The host renders every
236
+ registration of `sidebar.panellist.actions` into the same menu; when another
237
+ plugin (for example the codex-ui skin on the desktop profile) also contributes
238
+ there, the two menus share the popup. This plugin does not remove or reorder
239
+ other entries.
240
+ 9. **Replay is best-effort against the host's in-memory pins.** The host keeps its
241
+ own `unpinned` list only for the session; a folded id is re-hidden when the host
242
+ honours the pin callback, and a host restart resets the host list while this
243
+ plugin's record is replayed on the next menu open or panel-list change.
235
244
 
236
245
  ## License
237
246