@aryacode/dsh-aryacode-polish 0.8.2 → 0.10.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/CHANGELOG.md +79 -0
- package/README.md +2 -1
- package/client/face.js +3 -0
- package/client/switches.json +6 -0
- package/client/workspace.js +898 -0
- package/docs/better-workspace.md +72 -0
- package/entries/registry.js +6 -0
- package/lib/client.js +908 -1
- package/package.json +2 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Better workspace
|
|
2
|
+
|
|
3
|
+
Our own sidebar browser, mounted into `sidebar.workspaces` at `priority: -1` so it
|
|
4
|
+
shadows the shipped one while the switch is on, and steps aside the moment it is off.
|
|
5
|
+
|
|
6
|
+
## Why a takeover instead of a menu item
|
|
7
|
+
|
|
8
|
+
A plugin can add a menu to any surface it renders itself, and it can extend a
|
|
9
|
+
Shell-rendered surface only through a slot that surface declares. The workspace row
|
|
10
|
+
declares none: its "..." menu is a closed two-item array and the row has no
|
|
11
|
+
`onContextMenu`. So the only sanctioned route to "right-click a workspace" is to
|
|
12
|
+
replace the region that draws it - this feature - and own that region's upkeep.
|
|
13
|
+
|
|
14
|
+
## The two traps
|
|
15
|
+
|
|
16
|
+
**No `children` declaration.** A single-occupant seat renders its LOWEST priority
|
|
17
|
+
entry, which is why `priority: -1` shadows the shipped browser without touching it.
|
|
18
|
+
But declaring children is exclusive: the shipped registration already owns
|
|
19
|
+
`sidebar.workspaces.session.menu.item` and its siblings, so a second declaration
|
|
20
|
+
throws and the whole seat is dropped. This file reads the occupants off the slots
|
|
21
|
+
service (`slots.entries('sidebar.workspaces.session.menu.item')`) and renders them
|
|
22
|
+
by hand, reproducing exactly the two props the renderer would have synthesised:
|
|
23
|
+
|
|
24
|
+
- `t` - the occupant's own namespace bound through the locale face, so the shipped
|
|
25
|
+
labels stay translated;
|
|
26
|
+
- `useMenuOpenState` - the row's open-state pair, produced by the owner's declared
|
|
27
|
+
hook factory (`inject.hooks.menuOpenState(standard, hookContext)`).
|
|
28
|
+
|
|
29
|
+
Everything else on the occupant (Pin, Rename, Fork, Archive, Copy Session ID, and our
|
|
30
|
+
own "Open workspace folder") therefore keeps working untouched.
|
|
31
|
+
|
|
32
|
+
**Presence is the switch.** Because presence is what shadows the shipped browser, the
|
|
33
|
+
seat is registered and disposed with the `betterWorkspace` switch rather than
|
|
34
|
+
registered once and hidden. `installWorkspaceSeat` subscribes to the row's live
|
|
35
|
+
config form and adds/removes the registration each time the switch flips.
|
|
36
|
+
|
|
37
|
+
## What M1 ships
|
|
38
|
+
|
|
39
|
+
- Workspace rows: caret, folder, title, session count; click to fold.
|
|
40
|
+
- Session rows underneath, newest first, click to open.
|
|
41
|
+
- Session "..." menu: the shipped occupant list rendered as above.
|
|
42
|
+
- Workspace right-click menu: Open in File Explorer, Copy path, Remove workspace
|
|
43
|
+
(two-click confirm).
|
|
44
|
+
- `docs/panel-screenshot.md`-style honesty: a broken third-party menu row is caught
|
|
45
|
+
by a boundary so the tree still renders.
|
|
46
|
+
|
|
47
|
+
## What is not here yet
|
|
48
|
+
|
|
49
|
+
Drag and drop, reorder and pinned ordering, the "/" name grouping the reference
|
|
50
|
+
plugin offers, appearance options, and the same tree in the New Session picker. Those
|
|
51
|
+
are M2/M3; the seat is already the right place for them.
|
|
52
|
+
|
|
53
|
+
## What M2 added
|
|
54
|
+
|
|
55
|
+
- **Filter** — one box over workspaces and session titles. Every group it keeps is
|
|
56
|
+
opened, because a match you cannot see is not a match; the footer reports
|
|
57
|
+
"n of m sessions" whenever the filter hides any. `/` focuses it from anywhere,
|
|
58
|
+
Escape clears it.
|
|
59
|
+
- **Pinned first, running dot** — a pinned session is hoisted to the top of its
|
|
60
|
+
workspace with a star, and a running session shows a dot, so the row can be read
|
|
61
|
+
without clicking it.
|
|
62
|
+
- **Drag and drop** — a workspace dropped on another moves in front of it
|
|
63
|
+
(`workspaces.insertBefore`); a session dropped on a sibling reorders it
|
|
64
|
+
(`workspaces.insertSessionBefore`). A session refuses to leave its workspace: the
|
|
65
|
+
Host stores sessions inside workspaces, and moving one would look like a delete.
|
|
66
|
+
- **Keyboard walk** — arrows move a highlighted row, Enter opens a session or folds a
|
|
67
|
+
workspace, Escape closes the menu, then clears the filter, then drops the cursor.
|
|
68
|
+
- **Quiet rows** — the "..." action appears on hover or on the keyboard cursor instead
|
|
69
|
+
of on every row at once, and a header control folds or expands every workspace.
|
|
70
|
+
|
|
71
|
+
Still owed: "/"-in-title grouping, per-row appearance, workspace presets, and the same
|
|
72
|
+
tree in the Hero picker.
|
package/entries/registry.js
CHANGED
|
@@ -68,6 +68,12 @@ export const features = [
|
|
|
68
68
|
defaultOn: true,
|
|
69
69
|
mount: mountFolders,
|
|
70
70
|
},
|
|
71
|
+
{
|
|
72
|
+
id: 'betterWorkspace',
|
|
73
|
+
label: 'Better workspace',
|
|
74
|
+
description: 'Replace the sidebar workspace list with our own tree, with a right-click menu on every workspace.',
|
|
75
|
+
defaultOn: true,
|
|
76
|
+
},
|
|
71
77
|
{
|
|
72
78
|
id: 'panelScreenshot',
|
|
73
79
|
label: 'Right-panel screenshot',
|