@laoyuehanni/dsh-git-worktree 0.4.1-dsh-0.1.2-alpha.3 → 0.4.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.
- package/README.md +2 -0
- package/README.zh.md +2 -0
- package/lib/client.js +839 -281
- package/lib/client.js.map +1 -1
- package/lib/git.d.ts +34 -0
- package/lib/git.js +50 -0
- package/lib/index.d.ts +2 -3
- package/lib/index.js +49 -24
- package/lib/routes.d.ts +55 -2
- package/lib/routes.js +173 -4
- package/lib/wire.d.ts +68 -0
- package/lib/wire.js +8 -0
- package/package.json +17 -29
package/lib/client.js
CHANGED
|
@@ -8,6 +8,7 @@ window.__ModuleLoader__.load({
|
|
|
8
8
|
let react_dom = require("react-dom");
|
|
9
9
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
10
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
|
11
12
|
//#region src/normalize.ts
|
|
12
13
|
/**
|
|
13
14
|
* Local branch name for a display name: strip the leading `<remote>/` segment
|
|
@@ -68,6 +69,14 @@ window.__ModuleLoader__.load({
|
|
|
68
69
|
const ROUTE_UPDATE = `${ROUTE_PREFIX}/update`;
|
|
69
70
|
/** POST ROUTE_PREFIX/group — git belonging facts for a batch of workspace paths. */
|
|
70
71
|
const ROUTE_GROUP = `${ROUTE_PREFIX}/group`;
|
|
72
|
+
/** POST ROUTE_PREFIX/inspect — pre-delete facts for one worktree directory. */
|
|
73
|
+
const ROUTE_INSPECT = `${ROUTE_PREFIX}/inspect`;
|
|
74
|
+
/** POST ROUTE_PREFIX/remove — delete one linked worktree (git registration + folder). */
|
|
75
|
+
const ROUTE_REMOVE = `${ROUTE_PREFIX}/remove`;
|
|
76
|
+
/** POST ROUTE_PREFIX/exists — batch directory-existence probe (fs, no git). */
|
|
77
|
+
const ROUTE_EXISTS = `${ROUTE_PREFIX}/exists`;
|
|
78
|
+
/** POST ROUTE_PREFIX/ensure-directory — mkdir -p a missing worktree storage slot. */
|
|
79
|
+
const ROUTE_ENSURE_DIRECTORY = `${ROUTE_PREFIX}/ensure-directory`;
|
|
71
80
|
//#endregion
|
|
72
81
|
//#region src/client/api.ts
|
|
73
82
|
/** POST one JSON body and parse the uniform envelope. */
|
|
@@ -194,9 +203,47 @@ window.__ModuleLoader__.load({
|
|
|
194
203
|
async function requestGroupWorktrees(paths) {
|
|
195
204
|
return post(ROUTE_GROUP, { paths });
|
|
196
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Pre-delete facts for one worktree directory: the uncommitted-file count
|
|
208
|
+
* (lost with the folder) and the branch's ahead count (kept).
|
|
209
|
+
* @param path - absolute worktree directory.
|
|
210
|
+
*/
|
|
211
|
+
function requestInspectWorktree(path) {
|
|
212
|
+
return post(ROUTE_INSPECT, { path });
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Remove one linked worktree (git registration + folder). `force` rides
|
|
216
|
+
* `--force` past uncommitted changes the confirm dialog already showed.
|
|
217
|
+
* @param path - absolute worktree directory to delete.
|
|
218
|
+
* @param force - delete past uncommitted changes.
|
|
219
|
+
*/
|
|
220
|
+
function requestRemoveWorktree(path, force) {
|
|
221
|
+
return post(ROUTE_REMOVE, {
|
|
222
|
+
path,
|
|
223
|
+
force
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Batch directory-existence probe (true = exists AND is a directory). The
|
|
228
|
+
* sidebar gates register-as-workspace on this so a missing folder never
|
|
229
|
+
* reaches the DSH workspace API.
|
|
230
|
+
* @param paths - absolute directories to probe.
|
|
231
|
+
*/
|
|
232
|
+
function requestPathExists(paths) {
|
|
233
|
+
return post(ROUTE_EXISTS, { paths });
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Recreate a missing worktree storage slot (`mkdir -p`). The host gates this
|
|
237
|
+
* to paths directly inside the storage root; historical sessions reattach
|
|
238
|
+
* automatically once the directory is back.
|
|
239
|
+
* @param path - the missing slot directory (absolute).
|
|
240
|
+
*/
|
|
241
|
+
function requestEnsureDirectory(path) {
|
|
242
|
+
return post(ROUTE_ENSURE_DIRECTORY, { path });
|
|
243
|
+
}
|
|
197
244
|
//#endregion
|
|
198
|
-
//#region \0git-worktree-css:
|
|
199
|
-
const css$3 = "/* Branch chip row inside the composer tool row (conversation.input_1419641174.left_1419641174,\n * right of the mode chips). Modeled as a single rounded-rectangle\n * segmented control: the branch picker and the worktree toggle share one\n * container with a thin divider between them, so they read as one\n * affordance instead of two loose buttons.\n *\n * Geometry mirrors the composer trigger chips in the DSH base (see\n * PermissionSelect / ModelSelect): 28px height, 13/20 medium-secondary\n * label, transparent fill, no outline 鈥?the dock stays at the same\n * visual weight as the surrounding chips (dsh-worktree select, standard\n * mode select, Workspace Write, MiniMax-M3 High). The corners stop short\n * of the base's full pill (24px) so the silhouette stays a chip rather\n * than a capsule, per the design brief. */\n\n/* Shared trigger geometry 鈥?copied 1:1 from the base composer triggers\n * (PermissionSelect .trigger_1419641174 / ModelSelect .trigger_1419641174). Centralizing here\n * keeps the two segments visually fused so the divider reads as part of\n * one component, not two loose buttons. */\n.dock_1419641174 {\n display: inline-flex;\n align-items: stretch;\n height: 28px;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #81858c);\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n min-height: 28px;\n overflow: hidden;\n}\n\n/* Vertical separator between the two segments. Uses the secondary label\n * color so it stays in the same tonal family as the surrounding trigger\n * outlines and chevrons. */\n.divider_1419641174 {\n width: 1px;\n margin: 6px 0;\n background: color-mix(in srgb, currentColor 22%, transparent);\n flex-shrink: 0;\n}\n\n.chip_1419641174 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n padding: 0 8px 0 8px;\n border: none;\n border-radius: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.chip_1419641174:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The leftmost segment rounds only its left corners so it tucks into the dock. */\n.chip_1419641174:first-child {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n}\n\n/* Started sessions drop the worktree segment: the lone chip rounds all\n * corners and reads as a plain button, not a broken-off half control. */\n.chip_1419641174:only-child {\n border-radius: 6px;\n}\n\n.branch_1419641174 {\n max-width: 16em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.check_1419641174,\n.checkOn_1419641174 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n padding: 0 4px 0 8px;\n border: none;\n border-radius: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.check_1419641174:hover,\n.checkOn_1419641174:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The rightmost segment rounds only its right corners. */\n.check_1419641174:last-child,\n.checkOn_1419641174:last-child {\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.box_1419641174 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n border: 1px solid color-mix(in srgb, currentColor 45%, transparent);\n border-radius: 4px;\n}\n\n/* Selected worktree: only the checkbox itself turns bluish and fills 鈥?the\n * surrounding button stays transparent so the label keeps the same\n * secondary tone. Mirrors the Claude Code toggle treatment. The inner\n * check rides the bluish fill with an inverted foreground token so the\n * glyph stays legible. */\n.checkOn_1419641174 .box_1419641174 {\n border-color: var(--dsw-alias-label-primary-bluish, #4186f0);\n background: var(--dsw-alias-label-primary-bluish, #4186f0);\n color: var(--dsw-alias-label-primary-foreground, #ffffff);\n}\n\n.checkLabel_1419641174 {\n white-space: nowrap;\n}\n\n/* Confirm flyout: the second-level panel opening right of the branch\n * card (the base Menu's submenu posture: r12, inverted hairline,\n * shadow-lv3, --dsw-specific-menu). Width is content-driven — it follows\n * the longest line (for remote picks that is the subject line's branch\n * name) — floored at 168px (the Cancel/Confirm pair plus padding: short\n * branch names must not squeeze the buttons into wrapping \"切换中…\"\n * mid-word) and capped at 400px; BranchMenu also clamps it inline to the\n * room right of the card. Beyond the cap the lines wrap. border-box so\n * every width arm includes the card chrome. */\n.popCard_1419641174 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1000;\n width: max-content;\n min-width: 168px;\n max-width: min(400px, 80vw);\n padding: 4px;\n border: 1px solid var(--dsw-alias-border-inverted);\n border-radius: 12px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\n box-shadow: var(--dsw-shadow-lv3);\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.popAsk_1419641174 {\n margin: 0;\n padding: 6px 8px;\n font-size: 13px;\n line-height: 20px;\n color: inherit;\n /* Branch names are long unbroken tokens — plain wrapping would let them\n * overflow the capped card instead of breaking. */\n overflow-wrap: anywhere;\n}\n\n/* Remote confirm's name line: the branch itself, weight 500 like the leaf\n * rows — the subject the ask line refers to (\"该远程分支\"). A dedicated\n * line keeps the long unbroken token away from the sentence, so wraps\n * happen inside the name instead of shredding the Chinese around it. */\n.popSubject_1419641174 {\n margin: 0;\n padding: 0 8px 2px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n color: inherit;\n overflow-wrap: anywhere;\n}\n\n.popActions_1419641174 {\n display: flex;\n gap: 2px;\n padding: 2px;\n}\n\n/* Menu-row-like buttons: transparent fill, hover tint, same 13px type.\n * nowrap keeps labels like 切换中… from splitting mid-word when the flyout\n * is pinned to its minimum width by a short branch name. */\n.popActions_1419641174 button {\n flex: 1 1 0;\n height: 28px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.popActions_1419641174 button:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.popActions_1419641174 button:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n.popActions_1419641174 button:last-child {\n color: var(--dsw-alias-label-primary-bluish, #4186f0);\n font-weight: 500;\n}\n\n/* ── Branch picker popup (BranchMenu) ──────────────────────────────\n * Upward-opening card pinned above the chip, in the Menu's card chrome\n * (r12, inverted hairline, shadow-lv3, --dsw-specific-menu — same family\n * as .popCard_1419641174). Three owner requirements shape the geometry:\n *\n * 1. height cap: min(420px, 60vh) on the card, only the rows area\n * scrolls (.menuRows_1419641174) — heading and search stay pinned;\n * 2. the search field sits pinned at the card's bottom edge, directly\n * above the chip, with the scrolling rows above it;\n * 3. the card is CSS-`bottom`-pinned ~6px above the chip's top and so\n * grows entirely upward — it can never cover the composer or fill\n * the viewport, whatever the branch count.\n *\n * The inline `left`/`bottom` come from BranchMenu's placement pass; the\n * width is fixed here (design 360px — 320 tree + 40 tool strip — and\n * viewport-capped) so horizontal clamping stays deterministic without\n * measuring the card. */\n\n/* The portal lands directly under document.body_1419641174, outside the shell's\n * box-sizing reset — content-box default would add padding/border on top\n * of the declared width (360 became 370, and the width:100% children\n * padded 16px past the card's right clip, shearing off their rounded\n * corners). Every width-declared box in this popup opts back into\n * border-box: the card, the toolbar, the rows, and the search input. */\n.menuCard_1419641174 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1000;\n display: flex;\n flex-direction: row;\n width: min(360px, calc(100vw - 24px));\n max-height: min(420px, 60vh);\n overflow: hidden;\n padding: 4px;\n border: 1px solid var(--dsw-alias-border-inverted);\n border-radius: 12px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\n box-shadow: var(--dsw-shadow-lv3);\n}\n\n/* Left tool strip (IDEA branch-panel posture at popup scale): a narrow\n * column of icon-only buttons for actions that do not belong in the tree\n * — locate the checked-out branch, expand/collapse the whole tree.\n * Buttons stack from the BOTTOM up: the card's height shrinks when the\n * repo has few branches, so a top-anchored strip would drift around and\n * the buttons would sit far from the search bar; anchoring to the bottom\n * pins them at a stable spot (beside the search row) whatever the height. */\n.menuToolbar_1419641174 {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n gap: 2px;\n flex-shrink: 0;\n width: 32px;\n padding: 0 2px;\n margin-right: 4px;\n border-right: 1px solid color-mix(in srgb, currentColor 12%, transparent);\n}\n\n.menuToolButton_1419641174 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n margin: 0 auto;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n}\n\n.menuToolButton_1419641174:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.menuToolButton_1419641174:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n/* The sync tools while their action runs: a soft opacity pulse. The glyph\n * is a directional arrow, so the circular-refresh spin read as garbled\n * rotation — pulsing keeps the arrow legible while clearly \"live\", and the\n * button keeps full opacity (the usual disabled dim would read as broken\n * for an in-flight network operation). */\n.menuToolButtonRunning_1419641174 svg {\n animation: menuToolPulse 700ms ease-in-out infinite alternate;\n}\n\n.menuToolButtonRunning_1419641174:disabled {\n opacity: 1;\n cursor: progress;\n}\n\n@keyframes menuToolPulse {\n from { opacity: 1; }\n to { opacity: 0.25; }\n}\n\n/* The main column: heading + scrollable rows + pinned search. */\n.menuMain_1419641174 {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n}\n\n/* Non-interactive group heading — the Menu label row's posture. */\n.menuHeading_1419641174 {\n padding: 6px 8px 4px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary, #81858c);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 0;\n}\n\n/* The only scrollable region: shrinks within the capped card so the\n * heading above and the search below stay visible while rows scroll. */\n.menuRows_1419641174 {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n}\n\n/* Menu-row-like buttons: transparent fill, hover tint, same 13px type.\n * Weight 500 mirrors the chip's branch label (the portal escapes the\n * composer's font context, so the match must be explicit — the inherited\n * body weight is 400 and reads visibly lighter than the chip beside it). */\n.menuRow_1419641174 {\n box-sizing: border-box; /* width:100% + padding must stay inside .menuRows_1419641174 */\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n min-height: 28px;\n padding: 4px 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n}\n\n.menuRow_1419641174:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* Locked rows (a linked-worktree session answers every non-current pick\n * with the main-checkout toast): dimmed with a default cursor, but KEEP\n * the click path alive — no disabled attribute, the double-click is the\n * toast's stage. Hover stays quiet: nothing is on offer here. */\n.menuRowLocked_1419641174 {\n opacity: 0.45;\n cursor: default;\n}\n\n.menuRowLocked_1419641174:hover {\n background: transparent;\n}\n\n/* The checked-out branch: a persistent tint a step above the resting rows\n * so it reads as \"you are here\" the moment the list scrolls it into view\n * (BranchMenu centers it on open) — the trailing check alone is easy to\n * miss from a distance. */\n.menuRowSelected_1419641174,\n.menuRowSelected_1419641174:hover:not(:disabled) {\n background: color-mix(in srgb, currentColor 10%, transparent);\n}\n\n/* IDEA-style selection: the clicked row gets a bluish fill, layering over\n * the HEAD tint when the same row is both — selection communicates intent,\n * the HEAD tint communicates position, and they coexist (IDEA 4.4). */\n.menuRowPicked_1419641174,\n.menuRowPicked_1419641174:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-label-primary-bluish, #4186f0) 18%, transparent);\n}\n\n.menuRowLabel_1419641174 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* Upstream divergence arrows (↑N/↓N) trailing a local branch row, before\n * the HEAD check: the count badge tone at a smaller size so a busy list\n * still reads the name first. Plain text arrows — no base-set icon pairs\n * a direction with a count. tabular-nums keeps ↑10 from nudging neighbors\n * as the digits tick. */\n.menuRowArrow_1419641174 {\n flex-shrink: 0;\n font-size: 11px;\n line-height: 20px;\n font-weight: 400;\n font-variant-numeric: tabular-nums;\n color: color-mix(in srgb, currentColor 55%, transparent);\n}\n\n/* Search hit highlight (IDEA): the matched substring gets a warm tint\n * behind it — theme-agnostic, legible in both light and dark cards. */\n.menuSearchMark_1419641174 {\n background: color-mix(in srgb, #b58900 38%, transparent);\n border-radius: 2px;\n}\n\n/* Tree group rows (folder headers) — BranchMenu's '/' prefix tree: the\n * same row geometry as .menuRow_1419641174, but labeled in the secondary tone so the\n * leaf rows pop, with a count badge and a chevron that turns on expand. */\n.menuGroup_1419641174 {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n min-height: 28px;\n padding: 4px 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #81858c);\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n}\n\n.menuGroup_1419641174:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The two top-level section headers (local/remote branches) step ABOVE the\n * folder headers they contain: primary label tone like the leaf rows plus\n * a heavier weight, so the nav hierarchy reads group > row > folder — the\n * folder headers keep the secondary tone that alone would leave the\n * sections as the faintest (and most important) rows on the list. */\n.menuGroupTop_1419641174 {\n color: inherit;\n font-weight: 600;\n}\n\n.menuGroupLabel_1419641174 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.menuGroupChevron_1419641174 {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 12px;\n transition: transform 120ms ease;\n}\n\n.menuGroupChevronOpen_1419641174 {\n transform: rotate(90deg);\n}\n\n.menuGroupCount_1419641174 {\n flex-shrink: 0;\n font-size: 12px;\n line-height: 20px;\n font-weight: 400;\n color: color-mix(in srgb, currentColor 55%, transparent);\n}\n\n/* Zero-search-hit state: centered secondary line inside the rows area. */\n.menuEmpty_1419641174 {\n padding: 10px 8px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary, #81858c);\n text-align: center;\n}\n\n/* Bottom-pinned search field, separated from the rows by a hairline.\n * Borderless so it reads as part of the card, focus shown as the\n * standard hover tint rather than an outline. */\n.menuSearchWrap_1419641174 {\n flex-shrink: 0;\n margin-top: 2px;\n padding-top: 4px;\n border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);\n}\n\n.menuSearch_1419641174 {\n box-sizing: border-box; /* width:100% + padding must stay inside the wrap */\n width: 100%;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n /* Weight 500 mirrors the chip's branch label (see .menuRow_1419641174) — the portal\n * escapes the composer's font context and would inherit body's 400. */\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuSearch_1419641174::placeholder {\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n.menuSearch_1419641174:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* ── New-branch create flyout (BranchMenu toolbar plus) ─────────────\n * Opens to the RIGHT of the card (the confirm flyout's posture) and holds\n * the whole flow in one panel: ask line, naming input, live hint, and the\n * Cancel/Create pair — typing the name and pressing Create fires the\n * create in one stroke, no second confirm step. */\n\n/* The toolbar plus in its active (flyout open) state: a bluish tint\n * layering the same way the picked row does, so the toggled state reads at\n * a glance. */\n.menuToolButtonOn_1419641174,\n.menuToolButtonOn_1419641174:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-label-primary-bluish, #4186f0) 18%, transparent);\n color: var(--dsw-alias-label-primary-bluish, #4186f0);\n}\n\n/* The naming input inside the flyout: borderless, part of the card, focus\n * shown as the standard hover tint. Fixed width — the popCard is\n * max-content, so a percentage width would chase the input's own default\n * size instead of the design width. */\n.menuCreate_1419641174 {\n box-sizing: border-box;\n width: 248px;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n /* Weight 500 mirrors the chip's branch label (see .menuSearch_1419641174). */\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuCreate_1419641174::placeholder {\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n.menuCreate_1419641174:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.menuCreate_1419641174:disabled {\n opacity: 0.5;\n}\n\n/* The error line under the input — only rendered while the draft is\n * unacceptable with a non-empty reason; the input itself stays neutral,\n * the line carries the state. */\n.menuCreateHintBad_1419641174 {\n margin: 0;\n padding: 0 8px;\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-label-error);\n}\n";
|
|
245
|
+
//#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\BranchChip.module.css?inline
|
|
246
|
+
const css$3 = "/* Branch chip row inside the composer tool row (conversation.input_2006230319.left_2006230319,\n * right of the mode chips). Modeled as a single rounded-rectangle\n * segmented control: the branch picker and the worktree toggle share one\n * container with a thin divider between them, so they read as one\n * affordance instead of two loose buttons.\n *\n * Geometry mirrors the composer trigger chips in the DSH base (see\n * PermissionSelect / ModelSelect): 28px height, 13/20 medium-secondary\n * label, transparent fill, no outline 鈥?the dock stays at the same\n * visual weight as the surrounding chips (dsh-worktree select, standard\n * mode select, Workspace Write, MiniMax-M3 High). The corners stop short\n * of the base's full pill (24px) so the silhouette stays a chip rather\n * than a capsule, per the design brief. */\n\n/* Shared trigger geometry 鈥?copied 1:1 from the base composer triggers\n * (PermissionSelect .trigger_2006230319 / ModelSelect .trigger_2006230319). Centralizing here\n * keeps the two segments visually fused so the divider reads as part of\n * one component, not two loose buttons. */\n.dock_2006230319 {\n display: inline-flex;\n align-items: stretch;\n height: 28px;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #81858c);\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n min-height: 28px;\n overflow: hidden;\n}\n\n/* Vertical separator between the two segments. Uses the secondary label\n * color so it stays in the same tonal family as the surrounding trigger\n * outlines and chevrons. */\n.divider_2006230319 {\n width: 1px;\n margin: 6px 0;\n background: color-mix(in srgb, currentColor 22%, transparent);\n flex-shrink: 0;\n}\n\n.chip_2006230319 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n padding: 0 8px 0 8px;\n border: none;\n border-radius: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.chip_2006230319:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The leftmost segment rounds only its left corners so it tucks into the dock. */\n.chip_2006230319:first-child {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n}\n\n/* Started sessions drop the worktree segment: the lone chip rounds all\n * corners and reads as a plain button, not a broken-off half control. */\n.chip_2006230319:only-child {\n border-radius: 6px;\n}\n\n.branch_2006230319 {\n max-width: 16em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.check_2006230319,\n.checkOn_2006230319 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n padding: 0 4px 0 8px;\n border: none;\n border-radius: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.check_2006230319:hover,\n.checkOn_2006230319:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The rightmost segment rounds only its right corners. */\n.check_2006230319:last-child,\n.checkOn_2006230319:last-child {\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.box_2006230319 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n border: 1px solid color-mix(in srgb, currentColor 45%, transparent);\n border-radius: 4px;\n}\n\n/* Selected worktree: only the checkbox itself turns bluish and fills 鈥?the\n * surrounding button stays transparent so the label keeps the same\n * secondary tone. Mirrors the Claude Code toggle treatment. The inner\n * check rides the bluish fill with an inverted foreground token so the\n * glyph stays legible. */\n.checkOn_2006230319 .box_2006230319 {\n border-color: var(--dsw-alias-label-primary-bluish, #4186f0);\n background: var(--dsw-alias-label-primary-bluish, #4186f0);\n color: var(--dsw-alias-label-primary-foreground, #ffffff);\n}\n\n.checkLabel_2006230319 {\n white-space: nowrap;\n}\n\n/* Confirm flyout: the second-level panel opening right of the branch\n * card (the base Menu's submenu posture: r12, inverted hairline,\n * shadow-lv3, --dsw-specific-menu). Width is content-driven — it follows\n * the longest line (for remote picks that is the subject line's branch\n * name) — floored at 168px (the Cancel/Confirm pair plus padding: short\n * branch names must not squeeze the buttons into wrapping \"切换中…\"\n * mid-word) and capped at 400px; BranchMenu also clamps it inline to the\n * room right of the card. Beyond the cap the lines wrap. border-box so\n * every width arm includes the card chrome. */\n.popCard_2006230319 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1000;\n width: max-content;\n min-width: 168px;\n max-width: min(400px, 80vw);\n padding: 4px;\n border: 1px solid var(--dsw-alias-border-inverted);\n border-radius: 12px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\n box-shadow: var(--dsw-shadow-lv3);\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.popAsk_2006230319 {\n margin: 0;\n padding: 6px 8px;\n font-size: 13px;\n line-height: 20px;\n color: inherit;\n /* Branch names are long unbroken tokens — plain wrapping would let them\n * overflow the capped card instead of breaking. */\n overflow-wrap: anywhere;\n}\n\n/* Remote confirm's name line: the branch itself, weight 500 like the leaf\n * rows — the subject the ask line refers to (\"该远程分支\"). A dedicated\n * line keeps the long unbroken token away from the sentence, so wraps\n * happen inside the name instead of shredding the Chinese around it. */\n.popSubject_2006230319 {\n margin: 0;\n padding: 0 8px 2px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n color: inherit;\n overflow-wrap: anywhere;\n}\n\n.popActions_2006230319 {\n display: flex;\n gap: 2px;\n padding: 2px;\n}\n\n/* Menu-row-like buttons: transparent fill, hover tint, same 13px type.\n * nowrap keeps labels like 切换中… from splitting mid-word when the flyout\n * is pinned to its minimum width by a short branch name. */\n.popActions_2006230319 button {\n flex: 1 1 0;\n height: 28px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.popActions_2006230319 button:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.popActions_2006230319 button:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n.popActions_2006230319 button:last-child {\n color: var(--dsw-alias-label-primary-bluish, #4186f0);\n font-weight: 500;\n}\n\n/* ── Branch picker popup (BranchMenu) ──────────────────────────────\n * Upward-opening card pinned above the chip, in the Menu's card chrome\n * (r12, inverted hairline, shadow-lv3, --dsw-specific-menu — same family\n * as .popCard_2006230319). Three owner requirements shape the geometry:\n *\n * 1. height cap: min(420px, 60vh) on the card, only the rows area\n * scrolls (.menuRows_2006230319) — heading and search stay pinned;\n * 2. the search field sits pinned at the card's bottom edge, directly\n * above the chip, with the scrolling rows above it;\n * 3. the card is CSS-`bottom`-pinned ~6px above the chip's top and so\n * grows entirely upward — it can never cover the composer or fill\n * the viewport, whatever the branch count.\n *\n * The inline `left`/`bottom` come from BranchMenu's placement pass; the\n * width is fixed here (design 360px — 320 tree + 40 tool strip — and\n * viewport-capped) so horizontal clamping stays deterministic without\n * measuring the card. */\n\n/* The portal lands directly under document.body_2006230319, outside the shell's\n * box-sizing reset — content-box default would add padding/border on top\n * of the declared width (360 became 370, and the width:100% children\n * padded 16px past the card's right clip, shearing off their rounded\n * corners). Every width-declared box in this popup opts back into\n * border-box: the card, the toolbar, the rows, and the search input. */\n.menuCard_2006230319 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1000;\n display: flex;\n flex-direction: row;\n width: min(360px, calc(100vw - 24px));\n max-height: min(420px, 60vh);\n overflow: hidden;\n padding: 4px;\n border: 1px solid var(--dsw-alias-border-inverted);\n border-radius: 12px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\n box-shadow: var(--dsw-shadow-lv3);\n}\n\n/* Left tool strip (IDEA branch-panel posture at popup scale): a narrow\n * column of icon-only buttons for actions that do not belong in the tree\n * — locate the checked-out branch, expand/collapse the whole tree.\n * Buttons stack from the BOTTOM up: the card's height shrinks when the\n * repo has few branches, so a top-anchored strip would drift around and\n * the buttons would sit far from the search bar; anchoring to the bottom\n * pins them at a stable spot (beside the search row) whatever the height. */\n.menuToolbar_2006230319 {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n gap: 2px;\n flex-shrink: 0;\n width: 32px;\n padding: 0 2px;\n margin-right: 4px;\n border-right: 1px solid color-mix(in srgb, currentColor 12%, transparent);\n}\n\n.menuToolButton_2006230319 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n margin: 0 auto;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n}\n\n.menuToolButton_2006230319:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.menuToolButton_2006230319:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n/* The sync tools while their action runs: a soft opacity pulse. The glyph\n * is a directional arrow, so the circular-refresh spin read as garbled\n * rotation — pulsing keeps the arrow legible while clearly \"live\", and the\n * button keeps full opacity (the usual disabled dim would read as broken\n * for an in-flight network operation). */\n.menuToolButtonRunning_2006230319 svg {\n animation: menuToolPulse 700ms ease-in-out infinite alternate;\n}\n\n.menuToolButtonRunning_2006230319:disabled {\n opacity: 1;\n cursor: progress;\n}\n\n@keyframes menuToolPulse {\n from { opacity: 1; }\n to { opacity: 0.25; }\n}\n\n/* The main column: heading + scrollable rows + pinned search. */\n.menuMain_2006230319 {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n}\n\n/* Non-interactive group heading — the Menu label row's posture. */\n.menuHeading_2006230319 {\n padding: 6px 8px 4px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary, #81858c);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 0;\n}\n\n/* The only scrollable region: shrinks within the capped card so the\n * heading above and the search below stay visible while rows scroll. */\n.menuRows_2006230319 {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n}\n\n/* Menu-row-like buttons: transparent fill, hover tint, same 13px type.\n * Weight 500 mirrors the chip's branch label (the portal escapes the\n * composer's font context, so the match must be explicit — the inherited\n * body weight is 400 and reads visibly lighter than the chip beside it). */\n.menuRow_2006230319 {\n box-sizing: border-box; /* width:100% + padding must stay inside .menuRows_2006230319 */\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n min-height: 28px;\n padding: 4px 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n}\n\n.menuRow_2006230319:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* Locked rows (a linked-worktree session answers every non-current pick\n * with the main-checkout toast): dimmed with a default cursor, but KEEP\n * the click path alive — no disabled attribute, the double-click is the\n * toast's stage. Hover stays quiet: nothing is on offer here. */\n.menuRowLocked_2006230319 {\n opacity: 0.45;\n cursor: default;\n}\n\n.menuRowLocked_2006230319:hover {\n background: transparent;\n}\n\n/* The checked-out branch: a persistent tint a step above the resting rows\n * so it reads as \"you are here\" the moment the list scrolls it into view\n * (BranchMenu centers it on open) — the trailing check alone is easy to\n * miss from a distance. */\n.menuRowSelected_2006230319,\n.menuRowSelected_2006230319:hover:not(:disabled) {\n background: color-mix(in srgb, currentColor 10%, transparent);\n}\n\n/* IDEA-style selection: the clicked row gets a bluish fill, layering over\n * the HEAD tint when the same row is both — selection communicates intent,\n * the HEAD tint communicates position, and they coexist (IDEA 4.4). */\n.menuRowPicked_2006230319,\n.menuRowPicked_2006230319:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-label-primary-bluish, #4186f0) 18%, transparent);\n}\n\n.menuRowLabel_2006230319 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* Upstream divergence arrows (↑N/↓N) trailing a local branch row, before\n * the HEAD check: the count badge tone at a smaller size so a busy list\n * still reads the name first. Plain text arrows — no base-set icon pairs\n * a direction with a count. tabular-nums keeps ↑10 from nudging neighbors\n * as the digits tick. */\n.menuRowArrow_2006230319 {\n flex-shrink: 0;\n font-size: 11px;\n line-height: 20px;\n font-weight: 400;\n font-variant-numeric: tabular-nums;\n color: color-mix(in srgb, currentColor 55%, transparent);\n}\n\n/* Search hit highlight (IDEA): the matched substring gets a warm tint\n * behind it — theme-agnostic, legible in both light and dark cards. */\n.menuSearchMark_2006230319 {\n background: color-mix(in srgb, #b58900 38%, transparent);\n border-radius: 2px;\n}\n\n/* Tree group rows (folder headers) — BranchMenu's '/' prefix tree: the\n * same row geometry as .menuRow_2006230319, but labeled in the secondary tone so the\n * leaf rows pop, with a count badge and a chevron that turns on expand. */\n.menuGroup_2006230319 {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n min-height: 28px;\n padding: 4px 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #81858c);\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n}\n\n.menuGroup_2006230319:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The two top-level section headers (local/remote branches) step ABOVE the\n * folder headers they contain: primary label tone like the leaf rows plus\n * a heavier weight, so the nav hierarchy reads group > row > folder — the\n * folder headers keep the secondary tone that alone would leave the\n * sections as the faintest (and most important) rows on the list. */\n.menuGroupTop_2006230319 {\n color: inherit;\n font-weight: 600;\n}\n\n.menuGroupLabel_2006230319 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.menuGroupChevron_2006230319 {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 12px;\n transition: transform 120ms ease;\n}\n\n.menuGroupChevronOpen_2006230319 {\n transform: rotate(90deg);\n}\n\n.menuGroupCount_2006230319 {\n flex-shrink: 0;\n font-size: 12px;\n line-height: 20px;\n font-weight: 400;\n color: color-mix(in srgb, currentColor 55%, transparent);\n}\n\n/* Zero-search-hit state: centered secondary line inside the rows area. */\n.menuEmpty_2006230319 {\n padding: 10px 8px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary, #81858c);\n text-align: center;\n}\n\n/* Bottom-pinned search field, separated from the rows by a hairline.\n * Borderless so it reads as part of the card, focus shown as the\n * standard hover tint rather than an outline. */\n.menuSearchWrap_2006230319 {\n flex-shrink: 0;\n margin-top: 2px;\n padding-top: 4px;\n border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);\n}\n\n.menuSearch_2006230319 {\n box-sizing: border-box; /* width:100% + padding must stay inside the wrap */\n width: 100%;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n /* Weight 500 mirrors the chip's branch label (see .menuRow_2006230319) — the portal\n * escapes the composer's font context and would inherit body's 400. */\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuSearch_2006230319::placeholder {\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n.menuSearch_2006230319:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* ── New-branch create flyout (BranchMenu toolbar plus) ─────────────\n * Opens to the RIGHT of the card (the confirm flyout's posture) and holds\n * the whole flow in one panel: ask line, naming input, live hint, and the\n * Cancel/Create pair — typing the name and pressing Create fires the\n * create in one stroke, no second confirm step. */\n\n/* The toolbar plus in its active (flyout open) state: a bluish tint\n * layering the same way the picked row does, so the toggled state reads at\n * a glance. */\n.menuToolButtonOn_2006230319,\n.menuToolButtonOn_2006230319:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-label-primary-bluish, #4186f0) 18%, transparent);\n color: var(--dsw-alias-label-primary-bluish, #4186f0);\n}\n\n/* The naming input inside the flyout: borderless, part of the card, focus\n * shown as the standard hover tint. Fixed width — the popCard is\n * max-content, so a percentage width would chase the input's own default\n * size instead of the design width. */\n.menuCreate_2006230319 {\n box-sizing: border-box;\n width: 248px;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n /* Weight 500 mirrors the chip's branch label (see .menuSearch_2006230319). */\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuCreate_2006230319::placeholder {\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n.menuCreate_2006230319:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.menuCreate_2006230319:disabled {\n opacity: 0.5;\n}\n\n/* The error line under the input — only rendered while the draft is\n * unacceptable with a non-empty reason; the input itself stays neutral,\n * the line carries the state. */\n.menuCreateHintBad_2006230319 {\n margin: 0;\n padding: 0 8px;\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-label-error);\n}\n";
|
|
200
247
|
const tagId$3 = "@laoyuehanni/dsh-git-worktree/BranchChip.module.css";
|
|
201
248
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId$3 + "\"]") === null) {
|
|
202
249
|
const tag = document.createElement("style");
|
|
@@ -206,48 +253,48 @@ window.__ModuleLoader__.load({
|
|
|
206
253
|
document.head.appendChild(tag);
|
|
207
254
|
}
|
|
208
255
|
var BranchChip_module_default = {
|
|
209
|
-
"input": "
|
|
210
|
-
"left": "
|
|
211
|
-
"trigger": "
|
|
212
|
-
"dock": "
|
|
213
|
-
"divider": "
|
|
214
|
-
"chip": "
|
|
215
|
-
"branch": "
|
|
216
|
-
"check": "
|
|
217
|
-
"checkOn": "
|
|
218
|
-
"box": "
|
|
219
|
-
"checkLabel": "
|
|
220
|
-
"popCard": "
|
|
221
|
-
"popAsk": "
|
|
222
|
-
"popSubject": "
|
|
223
|
-
"popActions": "
|
|
224
|
-
"menuRows": "
|
|
225
|
-
"body": "
|
|
226
|
-
"menuCard": "
|
|
227
|
-
"menuToolbar": "
|
|
228
|
-
"menuToolButton": "
|
|
229
|
-
"menuToolButtonRunning": "
|
|
230
|
-
"menuMain": "
|
|
231
|
-
"menuHeading": "
|
|
232
|
-
"menuRow": "
|
|
233
|
-
"menuRowLocked": "
|
|
234
|
-
"menuRowSelected": "
|
|
235
|
-
"menuRowPicked": "
|
|
236
|
-
"menuRowLabel": "
|
|
237
|
-
"menuRowArrow": "
|
|
238
|
-
"menuSearchMark": "
|
|
239
|
-
"menuGroup": "
|
|
240
|
-
"menuGroupTop": "
|
|
241
|
-
"menuGroupLabel": "
|
|
242
|
-
"menuGroupChevron": "
|
|
243
|
-
"menuGroupChevronOpen": "
|
|
244
|
-
"menuGroupCount": "
|
|
245
|
-
"menuEmpty": "
|
|
246
|
-
"menuSearchWrap": "
|
|
247
|
-
"menuSearch": "
|
|
248
|
-
"menuToolButtonOn": "
|
|
249
|
-
"menuCreate": "
|
|
250
|
-
"menuCreateHintBad": "
|
|
256
|
+
"input": "input_2006230319",
|
|
257
|
+
"left": "left_2006230319",
|
|
258
|
+
"trigger": "trigger_2006230319",
|
|
259
|
+
"dock": "dock_2006230319",
|
|
260
|
+
"divider": "divider_2006230319",
|
|
261
|
+
"chip": "chip_2006230319",
|
|
262
|
+
"branch": "branch_2006230319",
|
|
263
|
+
"check": "check_2006230319",
|
|
264
|
+
"checkOn": "checkOn_2006230319",
|
|
265
|
+
"box": "box_2006230319",
|
|
266
|
+
"checkLabel": "checkLabel_2006230319",
|
|
267
|
+
"popCard": "popCard_2006230319",
|
|
268
|
+
"popAsk": "popAsk_2006230319",
|
|
269
|
+
"popSubject": "popSubject_2006230319",
|
|
270
|
+
"popActions": "popActions_2006230319",
|
|
271
|
+
"menuRows": "menuRows_2006230319",
|
|
272
|
+
"body": "body_2006230319",
|
|
273
|
+
"menuCard": "menuCard_2006230319",
|
|
274
|
+
"menuToolbar": "menuToolbar_2006230319",
|
|
275
|
+
"menuToolButton": "menuToolButton_2006230319",
|
|
276
|
+
"menuToolButtonRunning": "menuToolButtonRunning_2006230319",
|
|
277
|
+
"menuMain": "menuMain_2006230319",
|
|
278
|
+
"menuHeading": "menuHeading_2006230319",
|
|
279
|
+
"menuRow": "menuRow_2006230319",
|
|
280
|
+
"menuRowLocked": "menuRowLocked_2006230319",
|
|
281
|
+
"menuRowSelected": "menuRowSelected_2006230319",
|
|
282
|
+
"menuRowPicked": "menuRowPicked_2006230319",
|
|
283
|
+
"menuRowLabel": "menuRowLabel_2006230319",
|
|
284
|
+
"menuRowArrow": "menuRowArrow_2006230319",
|
|
285
|
+
"menuSearchMark": "menuSearchMark_2006230319",
|
|
286
|
+
"menuGroup": "menuGroup_2006230319",
|
|
287
|
+
"menuGroupTop": "menuGroupTop_2006230319",
|
|
288
|
+
"menuGroupLabel": "menuGroupLabel_2006230319",
|
|
289
|
+
"menuGroupChevron": "menuGroupChevron_2006230319",
|
|
290
|
+
"menuGroupChevronOpen": "menuGroupChevronOpen_2006230319",
|
|
291
|
+
"menuGroupCount": "menuGroupCount_2006230319",
|
|
292
|
+
"menuEmpty": "menuEmpty_2006230319",
|
|
293
|
+
"menuSearchWrap": "menuSearchWrap_2006230319",
|
|
294
|
+
"menuSearch": "menuSearch_2006230319",
|
|
295
|
+
"menuToolButtonOn": "menuToolButtonOn_2006230319",
|
|
296
|
+
"menuCreate": "menuCreate_2006230319",
|
|
297
|
+
"menuCreateHintBad": "menuCreateHintBad_2006230319"
|
|
251
298
|
};
|
|
252
299
|
//#endregion
|
|
253
300
|
//#region src/client/BranchMenu.tsx
|
|
@@ -1775,9 +1822,8 @@ window.__ModuleLoader__.load({
|
|
|
1775
1822
|
}), document.body);
|
|
1776
1823
|
}
|
|
1777
1824
|
/** The tool-row entry registered into conversation.input.left. */
|
|
1778
|
-
function BranchChipDock({ session,
|
|
1779
|
-
const
|
|
1780
|
-
const cwd = (0, react.useSyncExternalStore)(sessionsList.subscribe, () => sessionId === void 0 ? void 0 : sessionsList.getSnapshot().byId[sessionId])?.cwd;
|
|
1825
|
+
function BranchChipDock({ session, sessionId, useSessions, adoptWorktree, t }) {
|
|
1826
|
+
const cwd = useSessions((state) => state.byId[sessionId])?.cwd;
|
|
1781
1827
|
const [repo, refresh] = useRepoStatus(cwd);
|
|
1782
1828
|
const [menuOpen, setMenuOpen] = (0, react.useState)(false);
|
|
1783
1829
|
const [worktreeMode, setWorktreeMode] = (0, react.useState)(false);
|
|
@@ -2326,8 +2372,8 @@ window.__ModuleLoader__.load({
|
|
|
2326
2372
|
});
|
|
2327
2373
|
}
|
|
2328
2374
|
//#endregion
|
|
2329
|
-
//#region \0git-worktree-css:
|
|
2330
|
-
const css$2 = "/* git-worktree settings card on the Plugins configuration tab. Visual\n * language mirrors the settings section's own card chrome (border radius,\n * layer fills, pending badge, footer buttons) so cards from different\n * packages sit in one list without reading as two designs; tokens only, no\n * literal colors. */\n\n.
|
|
2375
|
+
//#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\GitWorktreeCard.module.css?inline
|
|
2376
|
+
const css$2 = "/* git-worktree settings card on the Plugins configuration tab. Visual\n * language mirrors the settings section's own card chrome (border radius,\n * layer fills, pending badge, footer buttons) so cards from different\n * packages sit in one list without reading as two designs; tokens only, no\n * literal colors. */\n\n.card_1712176718 {\n list-style: none;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 12px;\n background: var(--dsw-alias-bg-layer-3);\n transition: border-color .16s, background .16s;\n}\n\n.card_1712176718:hover {\n border-color: var(--dsw-alias-label-dimmed);\n}\n\n/* An open card reads as the one being worked on, not merely taller. */\n.cardOpen_1712176718 {\n background: var(--dsw-alias-bg-layer-2);\n border-color: var(--dsw-alias-label-dimmed);\n}\n\n.header_1712176718 {\n width: 100%;\n appearance: none;\n border: 0;\n background: none;\n font: inherit;\n color: inherit;\n text-align: left;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 14px 16px;\n border-radius: 12px;\n}\n\n.header_1712176718:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: -2px;\n}\n\n/* Name over description, mirroring the section's own plugin cards: the\n * description is what tells one plugin's settings from another's. */\n.headText_1712176718 {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.name_1712176718 {\n font-size: 15px;\n font-weight: 600;\n line-height: 1.4;\n color: var(--dsw-alias-label-primary);\n}\n\n.description_1712176718 {\n font-size: 13px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* Carried on the header so a collapsed card still says it holds edits. */\n.pending_1712176718 {\n flex: none;\n border-radius: 999px;\n padding: 1px 8px;\n font-size: 11px;\n line-height: 17px;\n font-weight: 500;\n white-space: nowrap;\n background: var(--dsw-alias-bg-module-platform);\n color: var(--dsw-alias-label-secondary);\n}\n\n.chevron_1712176718 {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n transition: transform .16s;\n}\n\n.chevronOpen_1712176718 {\n transform: rotate(180deg);\n}\n\n.body_1712176718 {\n border-top: 1px solid var(--dsw-alias-border-l2);\n margin: 0 16px;\n padding: 12px 0 8px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.note_1712176718 {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.field_1712176718 {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.fieldLabel_1712176718 {\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-secondary);\n}\n\n.input_1712176718 {\n box-sizing: border-box;\n width: 100%;\n padding: 4px 8px;\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-primary);\n background-color: var(--dsw-alias-bg-layer-2);\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n appearance: none;\n}\n\n.input_1712176718:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: -1px;\n}\n\n.input_1712176718:disabled {\n opacity: 0.6;\n}\n\n/* The directory control and its native-dialog launcher share one row. */\n.inputRow_1712176718 {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.inputRow_1712176718 .input_1712176718 {\n flex: 1;\n min-width: 0;\n}\n\n.browse_1712176718 {\n appearance: none;\n flex: none;\n border: 1px solid var(--dsw-alias-border-l2);\n border-radius: 6px;\n padding: 4px 10px;\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n background: none;\n cursor: pointer;\n white-space: nowrap;\n}\n\n.browse_1712176718:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n border-color: var(--dsw-alias-label-dimmed);\n}\n\n.browse_1712176718:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n.browse_1712176718:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\n.hint_1712176718 {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.footer_1712176718 {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n padding: 8px 0 4px;\n border-top: 1px solid var(--dsw-alias-border-l2);\n}\n\n.failed_1712176718 {\n flex: 1;\n min-width: 0;\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-error);\n}\n\n.discard_1712176718,\n.save_1712176718 {\n appearance: none;\n border: 1px solid transparent;\n border-radius: 8px;\n padding: 5px 14px;\n font: inherit;\n font-size: 13px;\n line-height: 1.5;\n cursor: pointer;\n}\n\n.discard_1712176718 {\n border-color: var(--dsw-alias-border-l2);\n background: none;\n color: var(--dsw-alias-label-secondary);\n}\n\n.discard_1712176718:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n border-color: var(--dsw-alias-label-dimmed);\n}\n\n.save_1712176718 {\n background: var(--dsw-alias-label-primary);\n color: var(--dsw-alias-bg-layer-3);\n}\n\n.discard_1712176718:disabled,\n.save_1712176718:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n.discard_1712176718:focus-visible,\n.save_1712176718:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\n/* Sidebar-grouping switch: title + hint + caution beside a checkbox. */\n.toggleRow_1712176718 {\n margin-top: 10px;\n flex-direction: row;\n align-items: flex-start;\n gap: 10px;\n}\n\n.toggleText_1712176718 {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.toggleLabel_1712176718 {\n color: var(--dsw-alias-label-primary);\n font-weight: 500;\n}\n\n.toggleMark_1712176718 {\n margin-left: 4px;\n font-weight: 400;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.toggleHint_1712176718 {\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.toggleNote_1712176718 {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.toggleControl_1712176718 {\n display: flex;\n align-items: center;\n gap: 6px;\n flex: none;\n margin-top: 2px;\n}\n\n.spinner_1712176718 {\n display: flex;\n color: var(--dsw-alias-label-tertiary);\n animation: spin 0.7s linear infinite;\n}\n\n@keyframes spin {\n to { transform: rotate(360deg); }\n}\n\n.toggle_1712176718 {\n width: 16px;\n height: 16px;\n accent-color: var(--dsw-alias-brand-primary);\n cursor: pointer;\n}\n\n.toggle_1712176718:disabled {\n cursor: progress;\n}\n";
|
|
2331
2377
|
const tagId$2 = "@laoyuehanni/dsh-git-worktree/GitWorktreeCard.module.css";
|
|
2332
2378
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId$2 + "\"]") === null) {
|
|
2333
2379
|
const tag = document.createElement("style");
|
|
@@ -2337,36 +2383,36 @@ window.__ModuleLoader__.load({
|
|
|
2337
2383
|
document.head.appendChild(tag);
|
|
2338
2384
|
}
|
|
2339
2385
|
var GitWorktreeCard_module_default = {
|
|
2340
|
-
"card": "
|
|
2341
|
-
"cardOpen": "
|
|
2342
|
-
"header": "
|
|
2343
|
-
"headText": "
|
|
2344
|
-
"name": "
|
|
2345
|
-
"description": "
|
|
2346
|
-
"pending": "
|
|
2347
|
-
"chevron": "
|
|
2348
|
-
"chevronOpen": "
|
|
2349
|
-
"body": "
|
|
2350
|
-
"note": "
|
|
2351
|
-
"field": "
|
|
2352
|
-
"fieldLabel": "
|
|
2353
|
-
"input": "
|
|
2354
|
-
"inputRow": "
|
|
2355
|
-
"browse": "
|
|
2356
|
-
"hint": "
|
|
2357
|
-
"footer": "
|
|
2358
|
-
"failed": "
|
|
2359
|
-
"discard": "
|
|
2360
|
-
"save": "
|
|
2361
|
-
"toggleRow": "
|
|
2362
|
-
"toggleText": "
|
|
2363
|
-
"toggleLabel": "
|
|
2364
|
-
"toggleMark": "
|
|
2365
|
-
"toggleHint": "
|
|
2366
|
-
"toggleNote": "
|
|
2367
|
-
"toggleControl": "
|
|
2368
|
-
"spinner": "
|
|
2369
|
-
"toggle": "
|
|
2386
|
+
"card": "card_1712176718",
|
|
2387
|
+
"cardOpen": "cardOpen_1712176718",
|
|
2388
|
+
"header": "header_1712176718",
|
|
2389
|
+
"headText": "headText_1712176718",
|
|
2390
|
+
"name": "name_1712176718",
|
|
2391
|
+
"description": "description_1712176718",
|
|
2392
|
+
"pending": "pending_1712176718",
|
|
2393
|
+
"chevron": "chevron_1712176718",
|
|
2394
|
+
"chevronOpen": "chevronOpen_1712176718",
|
|
2395
|
+
"body": "body_1712176718",
|
|
2396
|
+
"note": "note_1712176718",
|
|
2397
|
+
"field": "field_1712176718",
|
|
2398
|
+
"fieldLabel": "fieldLabel_1712176718",
|
|
2399
|
+
"input": "input_1712176718",
|
|
2400
|
+
"inputRow": "inputRow_1712176718",
|
|
2401
|
+
"browse": "browse_1712176718",
|
|
2402
|
+
"hint": "hint_1712176718",
|
|
2403
|
+
"footer": "footer_1712176718",
|
|
2404
|
+
"failed": "failed_1712176718",
|
|
2405
|
+
"discard": "discard_1712176718",
|
|
2406
|
+
"save": "save_1712176718",
|
|
2407
|
+
"toggleRow": "toggleRow_1712176718",
|
|
2408
|
+
"toggleText": "toggleText_1712176718",
|
|
2409
|
+
"toggleLabel": "toggleLabel_1712176718",
|
|
2410
|
+
"toggleMark": "toggleMark_1712176718",
|
|
2411
|
+
"toggleHint": "toggleHint_1712176718",
|
|
2412
|
+
"toggleNote": "toggleNote_1712176718",
|
|
2413
|
+
"toggleControl": "toggleControl_1712176718",
|
|
2414
|
+
"spinner": "spinner_1712176718",
|
|
2415
|
+
"toggle": "toggle_1712176718"
|
|
2370
2416
|
};
|
|
2371
2417
|
//#endregion
|
|
2372
2418
|
//#region src/client/GitWorktreeCard.tsx
|
|
@@ -2817,6 +2863,57 @@ window.__ModuleLoader__.load({
|
|
|
2817
2863
|
}));
|
|
2818
2864
|
return rows.map((session) => sessionNode(session, descendants));
|
|
2819
2865
|
}
|
|
2866
|
+
/**
|
|
2867
|
+
* Derive the stray-session clusters: sessions no workspace account holds
|
|
2868
|
+
* (a deleted-then-recreated registration's leftovers, or history that
|
|
2869
|
+
* appeared after first-boot grouping), clustered by their header cwd into
|
|
2870
|
+
* VIRTUAL directory groups. The same visibility rule as everywhere else
|
|
2871
|
+
* applies (archived hidden, subagent rows never listed, a blank visible
|
|
2872
|
+
* only while it IS the current selection — deleting the current session's
|
|
2873
|
+
* workspace registration must not make it vanish).
|
|
2874
|
+
*
|
|
2875
|
+
* Matching against registered workspace paths is case-insensitive
|
|
2876
|
+
* (NTFS): one directory must never split into two clusters because of
|
|
2877
|
+
* casing drift between a session header and the registry's realpath.
|
|
2878
|
+
* @param items - workspace list items (their `sessionIds` projection IS the
|
|
2879
|
+
* accounting; the registry guarantees one record per canonical path).
|
|
2880
|
+
* @param sessions - session list snapshot.
|
|
2881
|
+
* @param archivedSessionIds - registry-global archive set.
|
|
2882
|
+
* @returns stray groups in first-appearance order; empty when nothing is loose.
|
|
2883
|
+
*/
|
|
2884
|
+
function deriveStrayGroups(items, sessions, archivedSessionIds) {
|
|
2885
|
+
const accounted = new Set(items.flatMap((workspace) => workspace.sessionIds));
|
|
2886
|
+
const registered = /* @__PURE__ */ new Map();
|
|
2887
|
+
for (const workspace of items) {
|
|
2888
|
+
const key = workspace.path.toLowerCase();
|
|
2889
|
+
if (!registered.has(key)) registered.set(key, workspace.title);
|
|
2890
|
+
}
|
|
2891
|
+
const archived = new Set(archivedSessionIds);
|
|
2892
|
+
const clusters = /* @__PURE__ */ new Map();
|
|
2893
|
+
for (const id of sessions.ids) {
|
|
2894
|
+
if (accounted.has(id)) continue;
|
|
2895
|
+
const summary = sessions.byId[id];
|
|
2896
|
+
if (summary === void 0) continue;
|
|
2897
|
+
if (summary.origin === "subagent") continue;
|
|
2898
|
+
if (archived.has(id)) continue;
|
|
2899
|
+
if (summary.blank && id !== sessions.current) continue;
|
|
2900
|
+
const path = summary.cwd ?? "";
|
|
2901
|
+
const key = `stray:${path === "" ? "?" : path.toLowerCase()}`;
|
|
2902
|
+
const existing = clusters.get(key);
|
|
2903
|
+
if (existing === void 0) clusters.set(key, {
|
|
2904
|
+
kind: "stray",
|
|
2905
|
+
key,
|
|
2906
|
+
path,
|
|
2907
|
+
belongsTo: path === "" ? void 0 : registered.get(path.toLowerCase()),
|
|
2908
|
+
sessions: [summary]
|
|
2909
|
+
});
|
|
2910
|
+
else clusters.set(key, {
|
|
2911
|
+
...existing,
|
|
2912
|
+
sessions: [...existing.sessions, summary]
|
|
2913
|
+
});
|
|
2914
|
+
}
|
|
2915
|
+
return [...clusters.values()];
|
|
2916
|
+
}
|
|
2820
2917
|
/** Display label for the ungrouped bucket row. */
|
|
2821
2918
|
const UNGROUPED_LABEL = "Ungrouped";
|
|
2822
2919
|
/**
|
|
@@ -2972,33 +3069,8 @@ window.__ModuleLoader__.load({
|
|
|
2972
3069
|
};
|
|
2973
3070
|
}
|
|
2974
3071
|
//#endregion
|
|
2975
|
-
//#region
|
|
2976
|
-
|
|
2977
|
-
* Browser-safe Workspace path and display helpers.
|
|
2978
|
-
* @module @deepseek-ai/dsh-util-workspace-path
|
|
2979
|
-
*/
|
|
2980
|
-
/** Whether a path uses a Windows drive or UNC prefix. */
|
|
2981
|
-
function isWindowsStylePath(value) {
|
|
2982
|
-
return /^[A-Za-z]:[/\\]/.test(value) || value.startsWith("\\\\");
|
|
2983
|
-
}
|
|
2984
|
-
/**
|
|
2985
|
-
* Abbreviate a POSIX home directory for display.
|
|
2986
|
-
* @param path - Absolute or already-short display path.
|
|
2987
|
-
* @param home - Host account home; absent skips abbreviation.
|
|
2988
|
-
* @returns `~` or `~/…` for the POSIX home and its descendants, otherwise `path`.
|
|
2989
|
-
*/
|
|
2990
|
-
function abbreviateHomePath(path, home) {
|
|
2991
|
-
if (home === void 0 || home === "") return path;
|
|
2992
|
-
if (isWindowsStylePath(path) || isWindowsStylePath(home)) return path;
|
|
2993
|
-
const root = home.replace(/\/+$/, "");
|
|
2994
|
-
if (root === "" || root === "/") return path;
|
|
2995
|
-
if (path.replace(/\/+$/, "") === root) return "~";
|
|
2996
|
-
if (path.startsWith(`${root}/`)) return `~${path.slice(root.length)}`;
|
|
2997
|
-
return path;
|
|
2998
|
-
}
|
|
2999
|
-
//#endregion
|
|
3000
|
-
//#region \0git-worktree-css:C:\Users\OYW\.dsh\gitworktree\dsh-worktree-origin-feature-0.1.2-alpha.3\src\client\sidebar-rows.module.css?inline
|
|
3001
|
-
const css$1 = "/* Native Rows.module_73286170.css_73286170 transplanted 1:1 (DSW tokens, row-in, reduced-motion).\n * Drag marker classes (dropBefore/dropAfter) are kept for P3; unused in P2. */\n\n.projectRow_73286170,\n.sessionRow_73286170 {\n cursor: pointer;\n user-select: none;\n color: var(--dsw-alias-label-primary);\n border-radius: 8px;\n align-items: center;\n gap: 6px;\n padding: 0 8px;\n display: flex;\n}\n\n.projectRow_73286170:hover,\n.sessionRow_73286170:hover,\n.sessionRow_73286170.selected_73286170 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.searchResultRow_73286170 {\n box-sizing: border-box;\n cursor: pointer;\n text-align: left;\n width: 100%;\n min-height: 48px;\n color: var(--dsw-alias-label-primary);\n background: 0 0;\n border: none;\n border-radius: 8px;\n flex-direction: column;\n align-items: stretch;\n padding: 4px 8px;\n display: flex;\n}\n\n.searchResultRow_73286170:hover,\n.searchResultRow_73286170.selected_73286170 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.searchResultHeading_73286170 {\n align-items: center;\n min-width: 0;\n display: flex;\n}\n\n.searchResultTitle_73286170 {\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n margin-left: 4px;\n font-size: 14px;\n line-height: 20px;\n overflow: hidden;\n}\n\n.searchResultMeta_73286170 {\n align-items: center;\n gap: 6px;\n min-width: 0;\n margin-left: 20px;\n display: flex;\n}\n\n.searchResultWorkspace_73286170,\n.searchResultSnippet_73286170 {\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n line-height: 17px;\n overflow: hidden;\n}\n\n.searchResultWorkspace_73286170 {\n max-width: 40%;\n color: var(--dsw-alias-label-tertiary);\n flex: none;\n}\n\n.searchResultSnippet_73286170 {\n min-width: 0;\n color: var(--dsw-alias-label-secondary);\n flex: 1;\n}\n\n.projectRow_73286170 {\n box-sizing: border-box;\n align-items: center;\n height: 34px;\n}\n\n.projectRow_73286170 .rowActions_73286170 {\n height: 20px;\n}\n\n.sessionRow_73286170 {\n height: 32px;\n animation: row-in 0.15s var(--ds-ease-in-out);\n gap: 0;\n}\n\n.sessionRow_73286170 .title_73286170 {\n margin: 0 6px 0 4px;\n}\n\n.flatSessionRowWithoutStatus_73286170 .title_73286170 {\n margin-left: 0;\n}\n\n@keyframes row-in {\n 0% { opacity: 0; }\n}\n\n.slot_73286170 {\n width: 16px;\n height: 20px;\n color: var(--dsw-alias-label-tertiary);\n flex: none;\n justify-content: center;\n align-items: center;\n display: inline-flex;\n}\n\n.visuallyHidden_73286170 {\n clip: rect(0 0 0 0);\n white-space: nowrap;\n width: 1px;\n height: 1px;\n position: absolute;\n overflow: hidden;\n}\n\n.folderActive_73286170 {\n color: var(--dsw-alias-state-business-primary);\n}\n\n.projectRow_73286170 .chevron_73286170 {\n display: none;\n}\n\n.projectRow_73286170:hover .chevron_73286170 {\n display: inline-flex;\n}\n\n.projectRow_73286170:hover .folder_73286170 {\n display: none;\n}\n\n.arrow_73286170 {\n transition: transform 0.15s var(--ds-ease-in-out);\n}\n\n.arrowOpen_73286170 {\n transform: rotate(90deg);\n}\n\n.projectText_73286170 {\n flex-direction: column;\n flex: 1;\n gap: 2px;\n min-width: 0;\n display: flex;\n}\n\n.title_73286170 {\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n font-size: 14px;\n line-height: 20px;\n overflow: hidden;\n}\n\n.renameInput_73286170 {\n border: 1px solid var(--dsw-alias-border-l2);\n background: var(--dsw-alias-button-elevated-fill);\n min-width: 0;\n color: inherit;\n border-radius: 4px;\n outline: none;\n padding: 0 2px;\n font-size: 14px;\n line-height: 20px;\n}\n\n.sessionRow_73286170 .title_73286170 {\n flex: 1;\n}\n\n.meta_73286170 {\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 20px;\n overflow: hidden;\n}\n\n.time_73286170 {\n color: var(--dsw-alias-label-tertiary);\n flex: none;\n font-size: 12px;\n line-height: 20px;\n}\n\n.dot_73286170 {\n flex: none;\n}\n\n.rowActions_73286170 {\n flex: none;\n align-items: center;\n gap: 12px;\n display: none;\n}\n\n.projectRow_73286170:hover .rowActions_73286170,\n.sessionRow_73286170:hover .rowActions_73286170,\n.projectRow_73286170.menuOpen_73286170 .rowActions_73286170,\n.sessionRow_73286170.menuOpen_73286170 .rowActions_73286170 {\n display: inline-flex;\n}\n\n.sessionRow_73286170:hover .time_73286170,\n.sessionRow_73286170.menuOpen_73286170 .time_73286170 {\n display: none;\n}\n\n.projectRow_73286170.menuOpen_73286170,\n.sessionRow_73286170.menuOpen_73286170 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n/* P3: session drag insertion markers (unused in P2). */\n.sessionRow_73286170.dropBefore_73286170,\n.sessionRow_73286170.dropAfter_73286170 {\n position: relative;\n}\n\n.sessionRow_73286170.dropBefore_73286170:before,\n.sessionRow_73286170.dropAfter_73286170:after {\n content: \"\";\n z-index: 1;\n background:\n linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat,\n linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat,\n linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;\n pointer-events: none;\n height: 12px;\n position: absolute;\n left: 0;\n right: 4px;\n}\n\n.sessionRow_73286170.dropBefore_73286170:before {\n top: -7px;\n}\n\n.sessionRow_73286170.dropAfter_73286170:after {\n bottom: -7px;\n}\n\n.hoverContent_73286170 {\n flex-direction: column;\n gap: 8px;\n display: flex;\n}\n\n.hoverTitle_73286170 {\n color: #fff;\n overflow-wrap: break-word;\n font-size: 14px;\n line-height: 20px;\n}\n\n.hoverPath_73286170 {\n color: #cfd3d6;\n word-break: break-all;\n font-size: 12px;\n line-height: 16px;\n}\n\n.hoverTime_73286170 {\n color: #cfd3d6;\n font-size: 12px;\n line-height: 16px;\n}\n\n.hoverStatus_73286170 {\n color: #adb2b8;\n align-items: center;\n gap: 8px;\n font-size: 12px;\n line-height: 20px;\n display: flex;\n}\n\n.iconButton_73286170 {\n cursor: pointer;\n width: 16px;\n height: 16px;\n color: var(--dsw-alias-label-tertiary);\n background: 0 0;\n border: none;\n border-radius: 4px;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.iconButton_73286170:hover {\n color: var(--dsw-alias-label-primary);\n}\n\n.chevron_73286170 {\n color: var(--dsw-alias-label-caption);\n}\n\n.repoCount_73286170 {\n flex: none;\n margin-left: 8px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 20px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .sessionRow_73286170,\n .arrow_73286170 {\n transition: none;\n animation: none;\n }\n}\n";
|
|
3072
|
+
//#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\sidebar-rows.module.css?inline
|
|
3073
|
+
const css$1 = "/* Native Rows.module_2050697429.css_2050697429 transplanted 1:1 (DSW tokens, row-in, reduced-motion).\n * Drag marker classes (dropBefore/dropAfter) are kept for P3; unused in P2. */\n\n.projectRow_2050697429,\n.sessionRow_2050697429 {\n cursor: pointer;\n user-select: none;\n color: var(--dsw-alias-label-primary);\n border-radius: 8px;\n align-items: center;\n gap: 6px;\n padding: 0 8px;\n display: flex;\n}\n\n.projectRow_2050697429:hover,\n.sessionRow_2050697429:hover,\n.sessionRow_2050697429.selected_2050697429 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.searchResultRow_2050697429 {\n box-sizing: border-box;\n cursor: pointer;\n text-align: left;\n width: 100%;\n min-height: 48px;\n color: var(--dsw-alias-label-primary);\n background: 0 0;\n border: none;\n border-radius: 8px;\n flex-direction: column;\n align-items: stretch;\n padding: 4px 8px;\n display: flex;\n}\n\n.searchResultRow_2050697429:hover,\n.searchResultRow_2050697429.selected_2050697429 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.searchResultHeading_2050697429 {\n align-items: center;\n min-width: 0;\n display: flex;\n}\n\n.searchResultTitle_2050697429 {\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n margin-left: 4px;\n font-size: 14px;\n line-height: 20px;\n overflow: hidden;\n}\n\n.searchResultMeta_2050697429 {\n align-items: center;\n gap: 6px;\n min-width: 0;\n margin-left: 20px;\n display: flex;\n}\n\n.searchResultWorkspace_2050697429,\n.searchResultSnippet_2050697429 {\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n line-height: 17px;\n overflow: hidden;\n}\n\n.searchResultWorkspace_2050697429 {\n max-width: 40%;\n color: var(--dsw-alias-label-tertiary);\n flex: none;\n}\n\n.searchResultSnippet_2050697429 {\n min-width: 0;\n color: var(--dsw-alias-label-secondary);\n flex: 1;\n}\n\n.projectRow_2050697429 {\n box-sizing: border-box;\n align-items: center;\n height: 34px;\n}\n\n.projectRow_2050697429 .rowActions_2050697429 {\n height: 20px;\n}\n\n.sessionRow_2050697429 {\n height: 32px;\n animation: row-in 0.15s var(--ds-ease-in-out);\n gap: 0;\n}\n\n.sessionRow_2050697429 .title_2050697429 {\n margin: 0 6px 0 4px;\n}\n\n.flatSessionRowWithoutStatus_2050697429 .title_2050697429 {\n margin-left: 0;\n}\n\n@keyframes row-in {\n 0% { opacity: 0; }\n}\n\n.slot_2050697429 {\n width: 16px;\n height: 20px;\n color: var(--dsw-alias-label-tertiary);\n flex: none;\n justify-content: center;\n align-items: center;\n display: inline-flex;\n}\n\n.visuallyHidden_2050697429 {\n clip: rect(0 0 0 0);\n white-space: nowrap;\n width: 1px;\n height: 1px;\n position: absolute;\n overflow: hidden;\n}\n\n.folderActive_2050697429 {\n color: var(--dsw-alias-state-business-primary);\n}\n\n.projectRow_2050697429 .chevron_2050697429 {\n display: none;\n}\n\n.projectRow_2050697429:hover .chevron_2050697429 {\n display: inline-flex;\n}\n\n.projectRow_2050697429:hover .folder_2050697429 {\n display: none;\n}\n\n.arrow_2050697429 {\n transition: transform 0.15s var(--ds-ease-in-out);\n}\n\n.arrowOpen_2050697429 {\n transform: rotate(90deg);\n}\n\n.projectText_2050697429 {\n flex-direction: column;\n flex: 1;\n gap: 2px;\n min-width: 0;\n display: flex;\n}\n\n.title_2050697429 {\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n font-size: 14px;\n line-height: 20px;\n overflow: hidden;\n}\n\n/* Virtual (unregistered) directory rows read one weight lighter than real\n * workspace rows — together with the dashed folder glyph, the whole row is\n * distinguishable at a glance. */\n.strayRow_2050697429 .title_2050697429 {\n color: var(--dsw-alias-label-secondary);\n}\n\n.renameInput_2050697429 {\n border: 1px solid var(--dsw-alias-border-l2);\n background: var(--dsw-alias-button-elevated-fill);\n min-width: 0;\n color: inherit;\n border-radius: 4px;\n outline: none;\n padding: 0 2px;\n font-size: 14px;\n line-height: 20px;\n}\n\n.sessionRow_2050697429 .title_2050697429 {\n flex: 1;\n}\n\n.meta_2050697429 {\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 20px;\n overflow: hidden;\n}\n\n.time_2050697429 {\n color: var(--dsw-alias-label-tertiary);\n flex: none;\n font-size: 12px;\n line-height: 20px;\n}\n\n.dot_2050697429 {\n flex: none;\n}\n\n.rowActions_2050697429 {\n flex: none;\n align-items: center;\n gap: 12px;\n display: none;\n}\n\n.projectRow_2050697429:hover .rowActions_2050697429,\n.sessionRow_2050697429:hover .rowActions_2050697429,\n.projectRow_2050697429.menuOpen_2050697429 .rowActions_2050697429,\n.sessionRow_2050697429.menuOpen_2050697429 .rowActions_2050697429 {\n display: inline-flex;\n}\n\n.sessionRow_2050697429:hover .time_2050697429,\n.sessionRow_2050697429.menuOpen_2050697429 .time_2050697429 {\n display: none;\n}\n\n.projectRow_2050697429.menuOpen_2050697429,\n.sessionRow_2050697429.menuOpen_2050697429 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n/* P3: session drag insertion markers (unused in P2). */\n.sessionRow_2050697429.dropBefore_2050697429,\n.sessionRow_2050697429.dropAfter_2050697429 {\n position: relative;\n}\n\n.sessionRow_2050697429.dropBefore_2050697429:before,\n.sessionRow_2050697429.dropAfter_2050697429:after {\n content: \"\";\n z-index: 1;\n background:\n linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat,\n linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat,\n linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;\n pointer-events: none;\n height: 12px;\n position: absolute;\n left: 0;\n right: 4px;\n}\n\n.sessionRow_2050697429.dropBefore_2050697429:before {\n top: -7px;\n}\n\n.sessionRow_2050697429.dropAfter_2050697429:after {\n bottom: -7px;\n}\n\n.hoverContent_2050697429 {\n flex-direction: column;\n gap: 8px;\n display: flex;\n}\n\n.hoverTitle_2050697429 {\n color: #fff;\n overflow-wrap: break-word;\n font-size: 14px;\n line-height: 20px;\n}\n\n.hoverPath_2050697429 {\n color: #cfd3d6;\n word-break: break-all;\n font-size: 12px;\n line-height: 16px;\n}\n\n.hoverTime_2050697429 {\n color: #cfd3d6;\n font-size: 12px;\n line-height: 16px;\n}\n\n.hoverStatus_2050697429 {\n color: #adb2b8;\n align-items: center;\n gap: 8px;\n font-size: 12px;\n line-height: 20px;\n display: flex;\n}\n\n.iconButton_2050697429 {\n cursor: pointer;\n width: 16px;\n height: 16px;\n color: var(--dsw-alias-label-tertiary);\n background: 0 0;\n border: none;\n border-radius: 4px;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.iconButton_2050697429:hover {\n color: var(--dsw-alias-label-primary);\n}\n\n.chevron_2050697429 {\n color: var(--dsw-alias-label-caption);\n}\n\n.repoCount_2050697429 {\n flex: none;\n margin-left: 8px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 20px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .sessionRow_2050697429,\n .arrow_2050697429 {\n transition: none;\n animation: none;\n }\n}\n";
|
|
3002
3074
|
const tagId$1 = "@laoyuehanni/dsh-git-worktree/sidebar-rows.module.css";
|
|
3003
3075
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId$1 + "\"]") === null) {
|
|
3004
3076
|
const tag = document.createElement("style");
|
|
@@ -3008,42 +3080,43 @@ window.__ModuleLoader__.load({
|
|
|
3008
3080
|
document.head.appendChild(tag);
|
|
3009
3081
|
}
|
|
3010
3082
|
var sidebar_rows_module_default = {
|
|
3011
|
-
"module": "
|
|
3012
|
-
"css": "
|
|
3013
|
-
"projectRow": "
|
|
3014
|
-
"sessionRow": "
|
|
3015
|
-
"selected": "
|
|
3016
|
-
"searchResultRow": "
|
|
3017
|
-
"searchResultHeading": "
|
|
3018
|
-
"searchResultTitle": "
|
|
3019
|
-
"searchResultMeta": "
|
|
3020
|
-
"searchResultWorkspace": "
|
|
3021
|
-
"searchResultSnippet": "
|
|
3022
|
-
"rowActions": "
|
|
3023
|
-
"title": "
|
|
3024
|
-
"flatSessionRowWithoutStatus": "
|
|
3025
|
-
"slot": "
|
|
3026
|
-
"visuallyHidden": "
|
|
3027
|
-
"folderActive": "
|
|
3028
|
-
"chevron": "
|
|
3029
|
-
"folder": "
|
|
3030
|
-
"arrow": "
|
|
3031
|
-
"arrowOpen": "
|
|
3032
|
-
"projectText": "
|
|
3033
|
-
"
|
|
3034
|
-
"
|
|
3035
|
-
"
|
|
3036
|
-
"
|
|
3037
|
-
"
|
|
3038
|
-
"
|
|
3039
|
-
"
|
|
3040
|
-
"
|
|
3041
|
-
"
|
|
3042
|
-
"
|
|
3043
|
-
"
|
|
3044
|
-
"
|
|
3045
|
-
"
|
|
3046
|
-
"
|
|
3083
|
+
"module": "module_2050697429",
|
|
3084
|
+
"css": "css_2050697429",
|
|
3085
|
+
"projectRow": "projectRow_2050697429",
|
|
3086
|
+
"sessionRow": "sessionRow_2050697429",
|
|
3087
|
+
"selected": "selected_2050697429",
|
|
3088
|
+
"searchResultRow": "searchResultRow_2050697429",
|
|
3089
|
+
"searchResultHeading": "searchResultHeading_2050697429",
|
|
3090
|
+
"searchResultTitle": "searchResultTitle_2050697429",
|
|
3091
|
+
"searchResultMeta": "searchResultMeta_2050697429",
|
|
3092
|
+
"searchResultWorkspace": "searchResultWorkspace_2050697429",
|
|
3093
|
+
"searchResultSnippet": "searchResultSnippet_2050697429",
|
|
3094
|
+
"rowActions": "rowActions_2050697429",
|
|
3095
|
+
"title": "title_2050697429",
|
|
3096
|
+
"flatSessionRowWithoutStatus": "flatSessionRowWithoutStatus_2050697429",
|
|
3097
|
+
"slot": "slot_2050697429",
|
|
3098
|
+
"visuallyHidden": "visuallyHidden_2050697429",
|
|
3099
|
+
"folderActive": "folderActive_2050697429",
|
|
3100
|
+
"chevron": "chevron_2050697429",
|
|
3101
|
+
"folder": "folder_2050697429",
|
|
3102
|
+
"arrow": "arrow_2050697429",
|
|
3103
|
+
"arrowOpen": "arrowOpen_2050697429",
|
|
3104
|
+
"projectText": "projectText_2050697429",
|
|
3105
|
+
"strayRow": "strayRow_2050697429",
|
|
3106
|
+
"renameInput": "renameInput_2050697429",
|
|
3107
|
+
"meta": "meta_2050697429",
|
|
3108
|
+
"time": "time_2050697429",
|
|
3109
|
+
"dot": "dot_2050697429",
|
|
3110
|
+
"menuOpen": "menuOpen_2050697429",
|
|
3111
|
+
"dropBefore": "dropBefore_2050697429",
|
|
3112
|
+
"dropAfter": "dropAfter_2050697429",
|
|
3113
|
+
"hoverContent": "hoverContent_2050697429",
|
|
3114
|
+
"hoverTitle": "hoverTitle_2050697429",
|
|
3115
|
+
"hoverPath": "hoverPath_2050697429",
|
|
3116
|
+
"hoverTime": "hoverTime_2050697429",
|
|
3117
|
+
"hoverStatus": "hoverStatus_2050697429",
|
|
3118
|
+
"iconButton": "iconButton_2050697429",
|
|
3119
|
+
"repoCount": "repoCount_2050697429"
|
|
3047
3120
|
};
|
|
3048
3121
|
//#endregion
|
|
3049
3122
|
//#region src/client/sidebar-rows.tsx
|
|
@@ -3089,16 +3162,25 @@ window.__ModuleLoader__.load({
|
|
|
3089
3162
|
function ProjectRowItem({ row, onToggle, onCreate, actions, home, t, badge }) {
|
|
3090
3163
|
const active = row.expanded && row.containsCurrent;
|
|
3091
3164
|
const [menuOpen, setMenuOpen] = (0, react.useState)(false);
|
|
3092
|
-
const workspaceMenuItems = [
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3165
|
+
const workspaceMenuItems = [
|
|
3166
|
+
{
|
|
3167
|
+
id: "rename",
|
|
3168
|
+
label: t("rename"),
|
|
3169
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, {})
|
|
3170
|
+
},
|
|
3171
|
+
...actions?.removeWorktree !== void 0 ? [{
|
|
3172
|
+
id: "removeWorktree",
|
|
3173
|
+
label: t("worktreeRemove.menu"),
|
|
3174
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, {}),
|
|
3175
|
+
danger: true
|
|
3176
|
+
}] : [],
|
|
3177
|
+
{
|
|
3178
|
+
id: "delete",
|
|
3179
|
+
label: t("delete.workspace"),
|
|
3180
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, {}),
|
|
3181
|
+
danger: true
|
|
3182
|
+
}
|
|
3183
|
+
];
|
|
3102
3184
|
const ownRow = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3103
3185
|
className: cx$1(sidebar_rows_module_default.projectRow, menuOpen && sidebar_rows_module_default.menuOpen),
|
|
3104
3186
|
role: "treeitem",
|
|
@@ -3134,9 +3216,9 @@ window.__ModuleLoader__.load({
|
|
|
3134
3216
|
items: workspaceMenuItems,
|
|
3135
3217
|
onSelect: (id) => {
|
|
3136
3218
|
setMenuOpen(false);
|
|
3137
|
-
if (id !== "rename" && id !== "delete") return;
|
|
3138
3219
|
if (id === "rename") actions.rename();
|
|
3139
|
-
else actions.
|
|
3220
|
+
else if (id === "removeWorktree") actions.removeWorktree?.();
|
|
3221
|
+
else if (id === "delete") actions.delete();
|
|
3140
3222
|
},
|
|
3141
3223
|
portal: true,
|
|
3142
3224
|
closeOnPointerLeave: true,
|
|
@@ -3168,7 +3250,7 @@ window.__ModuleLoader__.load({
|
|
|
3168
3250
|
anchor: ownRow,
|
|
3169
3251
|
content: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorkspaceHoverContent, {
|
|
3170
3252
|
label: row.label,
|
|
3171
|
-
cwd: row.cwd === void 0 ? void 0 : abbreviateHomePath(row.cwd, home),
|
|
3253
|
+
cwd: row.cwd === void 0 ? void 0 : (0, _deepseek_ai_dsh_client_runtime_client.abbreviateHomePath)(row.cwd, home),
|
|
3172
3254
|
createdAt: row.createdAt,
|
|
3173
3255
|
t
|
|
3174
3256
|
}),
|
|
@@ -3181,6 +3263,146 @@ window.__ModuleLoader__.load({
|
|
|
3181
3263
|
function assertNever(value) {
|
|
3182
3264
|
throw new Error(`unknown pending interaction: ${String(value)}`);
|
|
3183
3265
|
}
|
|
3266
|
+
/** Final path segment of an absolute directory ('' for the unknown-cwd cluster). */
|
|
3267
|
+
function pathBasename(path) {
|
|
3268
|
+
if (path === "") return "";
|
|
3269
|
+
const parts = path.split(/[\\/]/);
|
|
3270
|
+
return parts[parts.length - 1] ?? "";
|
|
3271
|
+
}
|
|
3272
|
+
/**
|
|
3273
|
+
* Dashed folder glyph for virtual (unregistered) directory rows. The icon set
|
|
3274
|
+
* ships no dashed variant, so this follows the WorktreeCheck precedent of a
|
|
3275
|
+
* module-local SVG: at 16px a dash pattern is a far stronger "directory-shaped
|
|
3276
|
+
* but not a registered workspace" mark than the outline/solid stroke contrast
|
|
3277
|
+
* it replaces.
|
|
3278
|
+
*/
|
|
3279
|
+
function StrayFolderGlyph({ size = 16 }) {
|
|
3280
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
3281
|
+
width: size,
|
|
3282
|
+
height: size,
|
|
3283
|
+
viewBox: "0 0 16 16",
|
|
3284
|
+
fill: "none",
|
|
3285
|
+
"aria-hidden": "true",
|
|
3286
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
3287
|
+
d: "M1.75 4.4c0-.91.71-1.65 1.6-1.65h2.47c.45 0 .88.19 1.19.52l.79.86h4.85c.89 0 1.6.74 1.6 1.65v6.05c0 .91-.71 1.65-1.6 1.65H3.35c-.89 0-1.6-.74-1.6-1.65Z",
|
|
3288
|
+
stroke: "currentColor",
|
|
3289
|
+
strokeWidth: "1.15",
|
|
3290
|
+
strokeDasharray: "2 1.6",
|
|
3291
|
+
strokeLinejoin: "round",
|
|
3292
|
+
strokeLinecap: "round"
|
|
3293
|
+
})
|
|
3294
|
+
});
|
|
3295
|
+
}
|
|
3296
|
+
/**
|
|
3297
|
+
* One virtual directory row of the stray (Ungrouped) section: DASHED folder
|
|
3298
|
+
* (the real workspace rows' folder is solid — the dash pattern is the
|
|
3299
|
+
* at-a-glance "this directory is not a registered workspace" mark) +
|
|
3300
|
+
* directory basename + session-count badge; hover reveals the full path plus
|
|
3301
|
+
* one guidance line — ownership when a registered workspace holds the
|
|
3302
|
+
* directory, or the rebuild hint when it is a missing worktree storage slot.
|
|
3303
|
+
* The ⋯ menu carries exactly one action: register (directory probed real and
|
|
3304
|
+
* unregistered) or rebuild (missing but host-confirmed as a storage slot).
|
|
3305
|
+
*/
|
|
3306
|
+
function StrayGroupRow({ path, belongsTo, count, expanded, onToggle, onRegister, registering, onRebuild, rebuilding, missingDir, worktreeSlot, home, t }) {
|
|
3307
|
+
const [menuOpen, setMenuOpen] = (0, react.useState)(false);
|
|
3308
|
+
const label = path === "" ? t("stray.unknown") : pathBasename(path);
|
|
3309
|
+
const items = onRegister !== void 0 ? [{
|
|
3310
|
+
id: "register",
|
|
3311
|
+
label: t("stray.register"),
|
|
3312
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpen16, {})
|
|
3313
|
+
}] : onRebuild !== void 0 ? [{
|
|
3314
|
+
id: "rebuild",
|
|
3315
|
+
label: t("stray.rebuild"),
|
|
3316
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpen16, {})
|
|
3317
|
+
}] : [];
|
|
3318
|
+
const row = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3319
|
+
className: cx$1(sidebar_rows_module_default.projectRow, sidebar_rows_module_default.strayRow, menuOpen && sidebar_rows_module_default.menuOpen),
|
|
3320
|
+
role: "treeitem",
|
|
3321
|
+
"aria-expanded": expanded,
|
|
3322
|
+
onClick: onToggle,
|
|
3323
|
+
children: [
|
|
3324
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3325
|
+
className: cx$1(sidebar_rows_module_default.slot, sidebar_rows_module_default.folder),
|
|
3326
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StrayFolderGlyph, {})
|
|
3327
|
+
}),
|
|
3328
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3329
|
+
className: cx$1(sidebar_rows_module_default.slot, sidebar_rows_module_default.chevron),
|
|
3330
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTriangleRightFill14, { className: cx$1(sidebar_rows_module_default.arrow, expanded && sidebar_rows_module_default.arrowOpen) })
|
|
3331
|
+
}),
|
|
3332
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3333
|
+
className: sidebar_rows_module_default.projectText,
|
|
3334
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3335
|
+
className: sidebar_rows_module_default.title,
|
|
3336
|
+
children: label
|
|
3337
|
+
})
|
|
3338
|
+
}),
|
|
3339
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3340
|
+
className: sidebar_rows_module_default.repoCount,
|
|
3341
|
+
children: String(count)
|
|
3342
|
+
}),
|
|
3343
|
+
items.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3344
|
+
className: sidebar_rows_module_default.rowActions,
|
|
3345
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
|
|
3346
|
+
open: menuOpen,
|
|
3347
|
+
onClose: () => {
|
|
3348
|
+
setMenuOpen(false);
|
|
3349
|
+
},
|
|
3350
|
+
items,
|
|
3351
|
+
onSelect: (id) => {
|
|
3352
|
+
setMenuOpen(false);
|
|
3353
|
+
if (id === "register") onRegister?.();
|
|
3354
|
+
if (id === "rebuild") onRebuild?.();
|
|
3355
|
+
},
|
|
3356
|
+
portal: true,
|
|
3357
|
+
closeOnPointerLeave: true,
|
|
3358
|
+
anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3359
|
+
type: "button",
|
|
3360
|
+
className: sidebar_rows_module_default.iconButton,
|
|
3361
|
+
"aria-label": onRegister !== void 0 ? t("stray.register.aria", { name: label }) : t("stray.rebuild.aria", { name: label }),
|
|
3362
|
+
disabled: registering === true || rebuilding === true,
|
|
3363
|
+
onClick: (e) => {
|
|
3364
|
+
e.stopPropagation();
|
|
3365
|
+
setMenuOpen((v) => !v);
|
|
3366
|
+
},
|
|
3367
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEllipsisOutline16, {})
|
|
3368
|
+
})
|
|
3369
|
+
})
|
|
3370
|
+
})
|
|
3371
|
+
]
|
|
3372
|
+
});
|
|
3373
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.HoverCard, {
|
|
3374
|
+
anchor: row,
|
|
3375
|
+
content: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3376
|
+
className: sidebar_rows_module_default.hoverContent,
|
|
3377
|
+
children: [
|
|
3378
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3379
|
+
className: sidebar_rows_module_default.hoverTitle,
|
|
3380
|
+
children: label
|
|
3381
|
+
}),
|
|
3382
|
+
path !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3383
|
+
className: sidebar_rows_module_default.hoverPath,
|
|
3384
|
+
children: (0, _deepseek_ai_dsh_client_runtime_client.abbreviateHomePath)(path, home)
|
|
3385
|
+
}),
|
|
3386
|
+
belongsTo !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3387
|
+
className: sidebar_rows_module_default.hoverStatus,
|
|
3388
|
+
children: t("stray.belongsTo", { name: belongsTo })
|
|
3389
|
+
}),
|
|
3390
|
+
missingDir === true && worktreeSlot === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3391
|
+
className: sidebar_rows_module_default.hoverStatus,
|
|
3392
|
+
children: t("stray.worktreeSlot")
|
|
3393
|
+
}),
|
|
3394
|
+
missingDir === true && worktreeSlot !== true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3395
|
+
className: sidebar_rows_module_default.hoverStatus,
|
|
3396
|
+
children: t("stray.missingDir")
|
|
3397
|
+
})
|
|
3398
|
+
]
|
|
3399
|
+
}),
|
|
3400
|
+
disabled: menuOpen,
|
|
3401
|
+
copyText: path === "" ? void 0 : path,
|
|
3402
|
+
copyLabel: t("copy"),
|
|
3403
|
+
copiedLabel: t("hover.copied")
|
|
3404
|
+
});
|
|
3405
|
+
}
|
|
3184
3406
|
/** Session status presentation; pending interaction is primary and live activity outranks completion. */
|
|
3185
3407
|
function sessionStatuses(node, t) {
|
|
3186
3408
|
const subagents = node.runningSubagentCount === 0 ? void 0 : {
|
|
@@ -3450,8 +3672,8 @@ window.__ModuleLoader__.load({
|
|
|
3450
3672
|
return reason instanceof Error ? reason.message : String(reason);
|
|
3451
3673
|
}
|
|
3452
3674
|
//#endregion
|
|
3453
|
-
//#region \0git-worktree-css:
|
|
3454
|
-
const css = "/* Native WorkspaceBrowser.module_108469306.css_108469306 + WorkspacePicker.module_108469306.css_108469306 transplanted\n * 1:1 (DSW tokens, search expand, reduced-motion). Drag classes\n * (workspaceDrop*, listTopDrop*) are kept for P3; unused in P2.\n * Overlay: memberIndent / sessionsIndent for the repo-grouped tree. */\n\n.root_108469306 {\n --dsh-session-list-edge-inset: var(--dsh-sidebar-inline-padding);\n --dsh-session-list-scrollbar-width: 8px;\n --dsh-session-list-scrollbar-offset: 2px;\n box-sizing: border-box;\n min-height: 0;\n padding-right: var(--dsh-session-list-edge-inset);\n flex-direction: column;\n flex: 1;\n display: flex;\n}\n\n.root_108469306.rail_108469306 {\n padding-right: 0;\n}\n\n.iconButton_108469306 {\n cursor: pointer;\n width: 28px;\n height: 28px;\n color: var(--dsw-alias-label-secondary);\n background: 0 0;\n border: none;\n border-radius: 50%;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.iconButton_108469306:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.sectionHeader_108469306 {\n box-sizing: border-box;\n height: 36px;\n color: var(--dsw-alias-label-tertiary);\n border-radius: 12px;\n flex: none;\n justify-content: flex-end;\n align-items: center;\n gap: 4px;\n margin-bottom: 4px;\n padding-left: 4px;\n display: flex;\n overflow: hidden;\n}\n\n.root_108469306:not(.rail_108469306) .sectionHeader_108469306 {\n margin-top: 2px;\n margin-right: -4px;\n}\n\n.sectionLabel_108469306 {\n white-space: nowrap;\n opacity: 1;\n visibility: visible;\n min-width: 0;\n max-width: 45%;\n transition: max-width 0.18s var(--ds-ease-in-out), margin-right 0.18s var(--ds-ease-in-out), opacity 0.12s var(--ds-ease-in-out), transform 0.18s var(--ds-ease-in-out), visibility 0s linear;\n flex: none;\n line-height: 20px;\n overflow: hidden;\n}\n\n.sectionLabelHidden_108469306 {\n opacity: 0;\n visibility: hidden;\n max-width: 0;\n margin-right: -4px;\n transition-delay: 0s, 0s, 0s, 0s, 0.18s;\n transform: translate(-4px);\n}\n\n.searchSlot_108469306 {\n box-sizing: border-box;\n min-width: 0;\n max-width: 28px;\n transition: max-width 0.18s var(--ds-ease-in-out), padding-left 0.18s var(--ds-ease-in-out);\n flex: 1;\n align-items: center;\n margin-left: auto;\n padding-left: 0;\n display: flex;\n}\n\n.searchSlotExpanded_108469306 {\n max-width: 100%;\n padding-left: 0;\n}\n\n.headerActions_108469306 {\n opacity: 1;\n visibility: visible;\n max-width: 60px;\n transition: max-width 0.18s var(--ds-ease-in-out), opacity 0.12s var(--ds-ease-in-out), transform 0.18s var(--ds-ease-in-out), visibility 0s linear;\n flex: none;\n align-items: center;\n gap: 4px;\n display: flex;\n overflow: hidden;\n}\n\n.headerActionsHidden_108469306 {\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n max-width: 0;\n transition-delay: 0s, 0s, 0s, 0.18s;\n transform: translate(4px);\n}\n\n.search_108469306 {\n box-sizing: border-box;\n cursor: text;\n width: 100%;\n height: 28px;\n color: var(--dsw-alias-label-secondary);\n transition: width 0.18s var(--ds-ease-in-out), padding 0.18s var(--ds-ease-in-out), border-color 0.18s var(--ds-ease-in-out), background-color 0.18s var(--ds-ease-in-out);\n background: 0 0;\n border: none;\n border-radius: 50%;\n flex: none;\n align-items: center;\n gap: 0;\n margin: 0;\n padding: 0;\n display: flex;\n overflow: hidden;\n}\n\n.searchExpanded_108469306 {\n border: 1px solid var(--dsw-alias-border-l2);\n width: calc(100% + 4px);\n height: 30px;\n color: var(--dsw-alias-label-caption);\n background: 0 0;\n border-radius: 10px;\n margin-inline: -2px;\n padding: 0 4px 0 0;\n}\n\n.searchButton_108469306 {\n cursor: pointer;\n width: 28px;\n height: 28px;\n color: inherit;\n background: 0 0;\n border: none;\n border-radius: 50%;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.searchExpanded_108469306 .searchButton_108469306 {\n width: 28px;\n height: 30px;\n}\n\n.searchButton_108469306:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.searchExpanded_108469306 .searchButton_108469306:hover {\n background: 0 0;\n}\n\n.searchInput_108469306 {\n opacity: 0;\n pointer-events: none;\n width: 0;\n min-width: 0;\n color: var(--dsw-alias-label-primary);\n transition: opacity 0.12s var(--ds-ease-in-out);\n background: 0 0;\n border: none;\n outline: none;\n flex: 1;\n font-size: 13px;\n line-height: 18px;\n}\n\n.searchExpanded_108469306 .searchInput_108469306 {\n opacity: 1;\n pointer-events: auto;\n margin-left: -2px;\n}\n\n.searchInput_108469306::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.clearButton_108469306 {\n cursor: pointer;\n width: 24px;\n height: 24px;\n color: var(--dsw-alias-label-secondary);\n background: 0 0;\n border: none;\n border-radius: 50%;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.clearButton_108469306:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.rail_108469306 .sectionHeader_108469306 {\n justify-content: flex-start;\n gap: 0;\n margin-bottom: 12px;\n padding-left: 0;\n}\n\n.rail_108469306 .headerActions_108469306 {\n max-width: none;\n}\n\n.rail_108469306 .iconButton_108469306 {\n width: 36px;\n height: 36px;\n color: var(--dsw-alias-label-primary);\n}\n\n.rail_108469306 .search_108469306 {\n background: 0 0;\n border-color: #0000;\n gap: 0;\n width: 36px;\n height: 36px;\n margin: 0 0 12px;\n padding: 0;\n}\n\n.rail_108469306 .searchButton_108469306 {\n width: 36px;\n height: 36px;\n color: var(--dsw-alias-label-primary);\n}\n\n.rail_108469306 .searchButton_108469306:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.listArea_108469306 {\n min-height: 0;\n margin-left: -4px;\n margin-right: calc(-1 * var(--dsh-session-list-edge-inset));\n flex-direction: column;\n flex: 1;\n padding-left: 4px;\n display: flex;\n overflow: visible;\n}\n\n.rail_108469306 .listArea_108469306 {\n margin-left: 0;\n margin-right: 0;\n padding-left: 0;\n}\n\n.treeBody_108469306 {\n flex-direction: column;\n flex: 1;\n min-height: 0;\n display: flex;\n position: relative;\n}\n\n.fade_108469306 {\n left: 0;\n right: var(--dsh-session-list-edge-inset);\n background: linear-gradient(to bottom, transparent, var(--dsw-specific-sidebar-fill));\n pointer-events: none;\n height: 24px;\n position: absolute;\n bottom: 0;\n}\n\n.wide_108469306 {\n animation: wide-in 0.2s var(--ds-ease-in-out);\n}\n\n@keyframes wide-in {\n 0% { opacity: 0; }\n}\n\n.list_108469306 {\n min-height: 0;\n margin-left: -4px;\n margin-right: var(--dsh-session-list-scrollbar-offset);\n padding-left: 4px;\n padding-right: calc(var(--dsh-session-list-edge-inset) - var(--dsh-session-list-scrollbar-width) - var(--dsh-session-list-scrollbar-offset));\n scrollbar-gutter: stable;\n flex: 1;\n padding-bottom: 16px;\n overflow-y: auto;\n}\n\n.flatList_108469306 > * + *,\n.searchTree_108469306 > [role=treeitem] + [role=treeitem],\n.groupSection_108469306 > * + * {\n margin-top: 2px;\n}\n\n.searchStatus_108469306,\n.searchWarning_108469306 {\n color: var(--dsw-alias-label-tertiary);\n padding: 10px 12px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.searchWarning_108469306 {\n color: var(--dsw-alias-label-secondary);\n}\n\n.groupSection_108469306 {\n position: relative;\n}\n\n.groupSection_108469306 + .groupSection_108469306 {\n margin-top: 4px;\n}\n\n/* P3: workspace drag insertion markers (unused in P2). */\n.listTopDropIndicator_108469306,\n.workspaceDropBefore_108469306:before,\n.workspaceDropAfter_108469306:after {\n content: \"\";\n z-index: 1;\n background:\n linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat,\n linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat,\n linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;\n pointer-events: none;\n height: 12px;\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.listTopDropIndicator_108469306 {\n top: -8px;\n left: 0;\n right: var(--dsh-session-list-edge-inset);\n}\n\n.listTopDropActive_108469306 > .workspaceDropBefore_108469306:first-child:before {\n display: none;\n}\n\n.workspaceDropBefore_108469306:before {\n top: -8px;\n}\n\n.workspaceDropAfter_108469306:after {\n bottom: -8px;\n}\n\n.sessionOverflowButton_108469306 {\n cursor: pointer;\n text-align: left;\n width: 100%;\n height: 28px;\n color: var(--dsw-alias-label-tertiary);\n background: 0 0;\n border: none;\n border-radius: 8px;\n padding: 0 12px 0 28px;\n font-size: 12px;\n}\n\n.groupSection_108469306 > .sessionOverflowButton_108469306 {\n margin-top: 0;\n}\n\n.sessionOverflowButton_108469306:hover {\n color: var(--dsw-alias-label-secondary);\n background: 0 0;\n}\n\n.empty_108469306 {\n color: var(--dsw-alias-label-tertiary);\n padding: 16px 12px;\n font-size: 13px;\n}\n\n.renameInput_108469306 {\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n width: 100%;\n height: 44px;\n color: var(--dsw-alias-label-primary);\n background: 0 0;\n border-radius: 22px;\n outline: none;\n padding: 7px 14px;\n font-size: 14px;\n font-weight: 400;\n line-height: 22px;\n}\n\n.renameInput_108469306:disabled {\n color: var(--dsw-alias-label-dimmed);\n}\n\n.renameError_108469306 {\n color: var(--dsw-alias-state-error-primary);\n margin-top: 8px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.deleteAction_108469306:not(:disabled) {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.deleteStatus_108469306 {\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.modalAction_108469306 {\n min-width: 72px;\n}\n\n.modalError_108469306,\n.menuStatus_108469306 {\n margin-top: 8px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.modalError_108469306 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.menuStatus_108469306 {\n color: var(--dsw-alias-label-secondary);\n}\n\n/* Aggregation overlay: indent member workspaces and their sessions. */\n.memberIndent_108469306 {\n margin-left: 16px;\n}\n\n.sessionsIndent_108469306 {\n margin-left: 8px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wide_108469306 {\n animation: none;\n }\n\n .search_108469306,\n .sectionLabel_108469306,\n .searchSlot_108469306,\n .searchInput_108469306,\n .headerActions_108469306 {\n transition: none;\n }\n}\n";
|
|
3675
|
+
//#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\GroupedSidebar.module.css?inline
|
|
3676
|
+
const css = "/* Native WorkspaceBrowser.module_1808205761.css_1808205761 + WorkspacePicker.module_1808205761.css_1808205761 transplanted\n * 1:1 (DSW tokens, search expand, reduced-motion). Drag classes\n * (workspaceDrop*, listTopDrop*) are kept for P3; unused in P2.\n * Overlay: memberIndent / sessionsIndent for the repo-grouped tree. */\n\n.root_1808205761 {\n --dsh-session-list-edge-inset: var(--dsh-sidebar-inline-padding);\n --dsh-session-list-scrollbar-width: 8px;\n --dsh-session-list-scrollbar-offset: 2px;\n box-sizing: border-box;\n min-height: 0;\n padding-right: var(--dsh-session-list-edge-inset);\n flex-direction: column;\n flex: 1;\n display: flex;\n}\n\n.root_1808205761.rail_1808205761 {\n padding-right: 0;\n}\n\n.iconButton_1808205761 {\n cursor: pointer;\n width: 28px;\n height: 28px;\n color: var(--dsw-alias-label-secondary);\n background: 0 0;\n border: none;\n border-radius: 50%;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.iconButton_1808205761:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.sectionHeader_1808205761 {\n box-sizing: border-box;\n height: 36px;\n color: var(--dsw-alias-label-tertiary);\n border-radius: 12px;\n flex: none;\n justify-content: flex-end;\n align-items: center;\n gap: 4px;\n margin-bottom: 4px;\n padding-left: 4px;\n display: flex;\n overflow: hidden;\n}\n\n.root_1808205761:not(.rail_1808205761) .sectionHeader_1808205761 {\n margin-top: 2px;\n margin-right: -4px;\n}\n\n.sectionLabel_1808205761 {\n white-space: nowrap;\n opacity: 1;\n visibility: visible;\n min-width: 0;\n max-width: 45%;\n transition: max-width 0.18s var(--ds-ease-in-out), margin-right 0.18s var(--ds-ease-in-out), opacity 0.12s var(--ds-ease-in-out), transform 0.18s var(--ds-ease-in-out), visibility 0s linear;\n flex: none;\n line-height: 20px;\n overflow: hidden;\n}\n\n.sectionLabelHidden_1808205761 {\n opacity: 0;\n visibility: hidden;\n max-width: 0;\n margin-right: -4px;\n transition-delay: 0s, 0s, 0s, 0s, 0.18s;\n transform: translate(-4px);\n}\n\n.searchSlot_1808205761 {\n box-sizing: border-box;\n min-width: 0;\n max-width: 28px;\n transition: max-width 0.18s var(--ds-ease-in-out), padding-left 0.18s var(--ds-ease-in-out);\n flex: 1;\n align-items: center;\n margin-left: auto;\n padding-left: 0;\n display: flex;\n}\n\n.searchSlotExpanded_1808205761 {\n max-width: 100%;\n padding-left: 0;\n}\n\n.headerActions_1808205761 {\n opacity: 1;\n visibility: visible;\n max-width: 60px;\n transition: max-width 0.18s var(--ds-ease-in-out), opacity 0.12s var(--ds-ease-in-out), transform 0.18s var(--ds-ease-in-out), visibility 0s linear;\n flex: none;\n align-items: center;\n gap: 4px;\n display: flex;\n overflow: hidden;\n}\n\n.headerActionsHidden_1808205761 {\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n max-width: 0;\n transition-delay: 0s, 0s, 0s, 0.18s;\n transform: translate(4px);\n}\n\n.search_1808205761 {\n box-sizing: border-box;\n cursor: text;\n width: 100%;\n height: 28px;\n color: var(--dsw-alias-label-secondary);\n transition: width 0.18s var(--ds-ease-in-out), padding 0.18s var(--ds-ease-in-out), border-color 0.18s var(--ds-ease-in-out), background-color 0.18s var(--ds-ease-in-out);\n background: 0 0;\n border: none;\n border-radius: 50%;\n flex: none;\n align-items: center;\n gap: 0;\n margin: 0;\n padding: 0;\n display: flex;\n overflow: hidden;\n}\n\n.searchExpanded_1808205761 {\n border: 1px solid var(--dsw-alias-border-l2);\n width: calc(100% + 4px);\n height: 30px;\n color: var(--dsw-alias-label-caption);\n background: 0 0;\n border-radius: 10px;\n margin-inline: -2px;\n padding: 0 4px 0 0;\n}\n\n.searchButton_1808205761 {\n cursor: pointer;\n width: 28px;\n height: 28px;\n color: inherit;\n background: 0 0;\n border: none;\n border-radius: 50%;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.searchExpanded_1808205761 .searchButton_1808205761 {\n width: 28px;\n height: 30px;\n}\n\n.searchButton_1808205761:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.searchExpanded_1808205761 .searchButton_1808205761:hover {\n background: 0 0;\n}\n\n.searchInput_1808205761 {\n opacity: 0;\n pointer-events: none;\n width: 0;\n min-width: 0;\n color: var(--dsw-alias-label-primary);\n transition: opacity 0.12s var(--ds-ease-in-out);\n background: 0 0;\n border: none;\n outline: none;\n flex: 1;\n font-size: 13px;\n line-height: 18px;\n}\n\n.searchExpanded_1808205761 .searchInput_1808205761 {\n opacity: 1;\n pointer-events: auto;\n margin-left: -2px;\n}\n\n.searchInput_1808205761::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.clearButton_1808205761 {\n cursor: pointer;\n width: 24px;\n height: 24px;\n color: var(--dsw-alias-label-secondary);\n background: 0 0;\n border: none;\n border-radius: 50%;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.clearButton_1808205761:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.rail_1808205761 .sectionHeader_1808205761 {\n justify-content: flex-start;\n gap: 0;\n margin-bottom: 12px;\n padding-left: 0;\n}\n\n.rail_1808205761 .headerActions_1808205761 {\n max-width: none;\n}\n\n.rail_1808205761 .iconButton_1808205761 {\n width: 36px;\n height: 36px;\n color: var(--dsw-alias-label-primary);\n}\n\n.rail_1808205761 .search_1808205761 {\n background: 0 0;\n border-color: #0000;\n gap: 0;\n width: 36px;\n height: 36px;\n margin: 0 0 12px;\n padding: 0;\n}\n\n.rail_1808205761 .searchButton_1808205761 {\n width: 36px;\n height: 36px;\n color: var(--dsw-alias-label-primary);\n}\n\n.rail_1808205761 .searchButton_1808205761:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.listArea_1808205761 {\n min-height: 0;\n margin-left: -4px;\n margin-right: calc(-1 * var(--dsh-session-list-edge-inset));\n flex-direction: column;\n flex: 1;\n padding-left: 4px;\n display: flex;\n overflow: visible;\n}\n\n.rail_1808205761 .listArea_1808205761 {\n margin-left: 0;\n margin-right: 0;\n padding-left: 0;\n}\n\n.treeBody_1808205761 {\n flex-direction: column;\n flex: 1;\n min-height: 0;\n display: flex;\n position: relative;\n}\n\n.fade_1808205761 {\n left: 0;\n right: var(--dsh-session-list-edge-inset);\n background: linear-gradient(to bottom, transparent, var(--dsw-specific-sidebar-fill));\n pointer-events: none;\n height: 24px;\n position: absolute;\n bottom: 0;\n}\n\n.wide_1808205761 {\n animation: wide-in 0.2s var(--ds-ease-in-out);\n}\n\n@keyframes wide-in {\n 0% { opacity: 0; }\n}\n\n.list_1808205761 {\n min-height: 0;\n margin-left: -4px;\n margin-right: var(--dsh-session-list-scrollbar-offset);\n padding-left: 4px;\n padding-right: calc(var(--dsh-session-list-edge-inset) - var(--dsh-session-list-scrollbar-width) - var(--dsh-session-list-scrollbar-offset));\n scrollbar-gutter: stable;\n flex: 1;\n padding-bottom: 16px;\n overflow-y: auto;\n}\n\n.flatList_1808205761 > * + *,\n.searchTree_1808205761 > [role=treeitem] + [role=treeitem],\n.groupSection_1808205761 > * + * {\n margin-top: 2px;\n}\n\n.searchStatus_1808205761,\n.searchWarning_1808205761 {\n color: var(--dsw-alias-label-tertiary);\n padding: 10px 12px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.searchWarning_1808205761 {\n color: var(--dsw-alias-label-secondary);\n}\n\n.groupSection_1808205761 {\n position: relative;\n}\n\n.groupSection_1808205761 + .groupSection_1808205761 {\n margin-top: 4px;\n}\n\n/* P3: workspace drag insertion markers (unused in P2). */\n.listTopDropIndicator_1808205761,\n.workspaceDropBefore_1808205761:before,\n.workspaceDropAfter_1808205761:after {\n content: \"\";\n z-index: 1;\n background:\n linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat,\n linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat,\n linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;\n pointer-events: none;\n height: 12px;\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.listTopDropIndicator_1808205761 {\n top: -8px;\n left: 0;\n right: var(--dsh-session-list-edge-inset);\n}\n\n.listTopDropActive_1808205761 > .workspaceDropBefore_1808205761:first-child:before {\n display: none;\n}\n\n.workspaceDropBefore_1808205761:before {\n top: -8px;\n}\n\n.workspaceDropAfter_1808205761:after {\n bottom: -8px;\n}\n\n.sessionOverflowButton_1808205761 {\n cursor: pointer;\n text-align: left;\n width: 100%;\n height: 28px;\n color: var(--dsw-alias-label-tertiary);\n background: 0 0;\n border: none;\n border-radius: 8px;\n padding: 0 12px 0 28px;\n font-size: 12px;\n}\n\n.groupSection_1808205761 > .sessionOverflowButton_1808205761 {\n margin-top: 0;\n}\n\n.sessionOverflowButton_1808205761:hover {\n color: var(--dsw-alias-label-secondary);\n background: 0 0;\n}\n\n.empty_1808205761 {\n color: var(--dsw-alias-label-tertiary);\n padding: 16px 12px;\n font-size: 13px;\n}\n\n.renameInput_1808205761 {\n box-sizing: border-box;\n border: 1px solid var(--dsw-alias-border-l2);\n width: 100%;\n height: 44px;\n color: var(--dsw-alias-label-primary);\n background: 0 0;\n border-radius: 22px;\n outline: none;\n padding: 7px 14px;\n font-size: 14px;\n font-weight: 400;\n line-height: 22px;\n}\n\n.renameInput_1808205761:disabled {\n color: var(--dsw-alias-label-dimmed);\n}\n\n.renameError_1808205761 {\n color: var(--dsw-alias-state-error-primary);\n margin-top: 8px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.deleteAction_1808205761:not(:disabled) {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.deleteStatus_1808205761 {\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n/* Pre-delete facts of the worktree-removal dialog: one line per fact, the\n * destructive one (uncommitted files die with the folder) in error tone. */\n.removeFacts_1808205761 {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin-top: 8px;\n}\n\n.removeFact_1808205761 {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.removeFactWarn_1808205761 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.modalAction_1808205761 {\n min-width: 72px;\n}\n\n.modalError_1808205761,\n.menuStatus_1808205761 {\n margin-top: 8px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.modalError_1808205761 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.menuStatus_1808205761 {\n color: var(--dsw-alias-label-secondary);\n}\n\n/* Aggregation overlay: indent member workspaces and their sessions. */\n.memberIndent_1808205761 {\n margin-left: 16px;\n}\n\n.sessionsIndent_1808205761 {\n margin-left: 8px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wide_1808205761 {\n animation: none;\n }\n\n .search_1808205761,\n .sectionLabel_1808205761,\n .searchSlot_1808205761,\n .searchInput_1808205761,\n .headerActions_1808205761 {\n transition: none;\n }\n}\n";
|
|
3455
3677
|
const tagId = "@laoyuehanni/dsh-git-worktree/GroupedSidebar.module.css";
|
|
3456
3678
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId + "\"]") === null) {
|
|
3457
3679
|
const tag = document.createElement("style");
|
|
@@ -3461,48 +3683,51 @@ window.__ModuleLoader__.load({
|
|
|
3461
3683
|
document.head.appendChild(tag);
|
|
3462
3684
|
}
|
|
3463
3685
|
var GroupedSidebar_module_default = {
|
|
3464
|
-
"module": "
|
|
3465
|
-
"css": "
|
|
3466
|
-
"root": "
|
|
3467
|
-
"rail": "
|
|
3468
|
-
"iconButton": "
|
|
3469
|
-
"sectionHeader": "
|
|
3470
|
-
"sectionLabel": "
|
|
3471
|
-
"sectionLabelHidden": "
|
|
3472
|
-
"searchSlot": "
|
|
3473
|
-
"searchSlotExpanded": "
|
|
3474
|
-
"headerActions": "
|
|
3475
|
-
"headerActionsHidden": "
|
|
3476
|
-
"search": "
|
|
3477
|
-
"searchExpanded": "
|
|
3478
|
-
"searchButton": "
|
|
3479
|
-
"searchInput": "
|
|
3480
|
-
"clearButton": "
|
|
3481
|
-
"listArea": "
|
|
3482
|
-
"treeBody": "
|
|
3483
|
-
"fade": "
|
|
3484
|
-
"wide": "
|
|
3485
|
-
"list": "
|
|
3486
|
-
"flatList": "
|
|
3487
|
-
"searchTree": "
|
|
3488
|
-
"groupSection": "
|
|
3489
|
-
"searchStatus": "
|
|
3490
|
-
"searchWarning": "
|
|
3491
|
-
"listTopDropIndicator": "
|
|
3492
|
-
"workspaceDropBefore": "
|
|
3493
|
-
"workspaceDropAfter": "
|
|
3494
|
-
"listTopDropActive": "
|
|
3495
|
-
"sessionOverflowButton": "
|
|
3496
|
-
"empty": "
|
|
3497
|
-
"renameInput": "
|
|
3498
|
-
"renameError": "
|
|
3499
|
-
"deleteAction": "
|
|
3500
|
-
"deleteStatus": "
|
|
3501
|
-
"
|
|
3502
|
-
"
|
|
3503
|
-
"
|
|
3504
|
-
"
|
|
3505
|
-
"
|
|
3686
|
+
"module": "module_1808205761",
|
|
3687
|
+
"css": "css_1808205761",
|
|
3688
|
+
"root": "root_1808205761",
|
|
3689
|
+
"rail": "rail_1808205761",
|
|
3690
|
+
"iconButton": "iconButton_1808205761",
|
|
3691
|
+
"sectionHeader": "sectionHeader_1808205761",
|
|
3692
|
+
"sectionLabel": "sectionLabel_1808205761",
|
|
3693
|
+
"sectionLabelHidden": "sectionLabelHidden_1808205761",
|
|
3694
|
+
"searchSlot": "searchSlot_1808205761",
|
|
3695
|
+
"searchSlotExpanded": "searchSlotExpanded_1808205761",
|
|
3696
|
+
"headerActions": "headerActions_1808205761",
|
|
3697
|
+
"headerActionsHidden": "headerActionsHidden_1808205761",
|
|
3698
|
+
"search": "search_1808205761",
|
|
3699
|
+
"searchExpanded": "searchExpanded_1808205761",
|
|
3700
|
+
"searchButton": "searchButton_1808205761",
|
|
3701
|
+
"searchInput": "searchInput_1808205761",
|
|
3702
|
+
"clearButton": "clearButton_1808205761",
|
|
3703
|
+
"listArea": "listArea_1808205761",
|
|
3704
|
+
"treeBody": "treeBody_1808205761",
|
|
3705
|
+
"fade": "fade_1808205761",
|
|
3706
|
+
"wide": "wide_1808205761",
|
|
3707
|
+
"list": "list_1808205761",
|
|
3708
|
+
"flatList": "flatList_1808205761",
|
|
3709
|
+
"searchTree": "searchTree_1808205761",
|
|
3710
|
+
"groupSection": "groupSection_1808205761",
|
|
3711
|
+
"searchStatus": "searchStatus_1808205761",
|
|
3712
|
+
"searchWarning": "searchWarning_1808205761",
|
|
3713
|
+
"listTopDropIndicator": "listTopDropIndicator_1808205761",
|
|
3714
|
+
"workspaceDropBefore": "workspaceDropBefore_1808205761",
|
|
3715
|
+
"workspaceDropAfter": "workspaceDropAfter_1808205761",
|
|
3716
|
+
"listTopDropActive": "listTopDropActive_1808205761",
|
|
3717
|
+
"sessionOverflowButton": "sessionOverflowButton_1808205761",
|
|
3718
|
+
"empty": "empty_1808205761",
|
|
3719
|
+
"renameInput": "renameInput_1808205761",
|
|
3720
|
+
"renameError": "renameError_1808205761",
|
|
3721
|
+
"deleteAction": "deleteAction_1808205761",
|
|
3722
|
+
"deleteStatus": "deleteStatus_1808205761",
|
|
3723
|
+
"removeFacts": "removeFacts_1808205761",
|
|
3724
|
+
"removeFact": "removeFact_1808205761",
|
|
3725
|
+
"removeFactWarn": "removeFactWarn_1808205761",
|
|
3726
|
+
"modalAction": "modalAction_1808205761",
|
|
3727
|
+
"modalError": "modalError_1808205761",
|
|
3728
|
+
"menuStatus": "menuStatus_1808205761",
|
|
3729
|
+
"memberIndent": "memberIndent_1808205761",
|
|
3730
|
+
"sessionsIndent": "sessionsIndent_1808205761"
|
|
3506
3731
|
};
|
|
3507
3732
|
//#endregion
|
|
3508
3733
|
//#region src/client/GroupedSidebar.tsx
|
|
@@ -3733,7 +3958,7 @@ window.__ModuleLoader__.load({
|
|
|
3733
3958
|
const parsed = Date.parse(createdAt);
|
|
3734
3959
|
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
3735
3960
|
}
|
|
3736
|
-
function GroupedTree({ groups, sessions, archived, currentSessionId, expandMap, onToggle, expandTo, orderBy, now, home, onOpen, onRename, onFork, onArchive, onWorkspaceRename, onWorkspaceDelete, startSession, t }) {
|
|
3961
|
+
function GroupedTree({ groups, footer, sessions, archived, currentSessionId, expandMap, onToggle, expandTo, orderBy, now, home, onOpen, onRename, onFork, onArchive, onWorkspaceRename, onWorkspaceDelete, onWorktreeRemove, startSession, t }) {
|
|
3737
3962
|
const descendants = (0, react.useMemo)(() => indexSubagentRunning(sessions.byId), [sessions.byId]);
|
|
3738
3963
|
const [expandedSessionGroups, setExpandedSessionGroups] = (0, react.useState)([]);
|
|
3739
3964
|
const empty = groups.length === 0;
|
|
@@ -3743,34 +3968,66 @@ window.__ModuleLoader__.load({
|
|
|
3743
3968
|
className: GroupedSidebar_module_default.list,
|
|
3744
3969
|
role: "tree",
|
|
3745
3970
|
"aria-label": t("section.workspaces"),
|
|
3746
|
-
children: [
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3971
|
+
children: [
|
|
3972
|
+
empty && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3973
|
+
className: GroupedSidebar_module_default.empty,
|
|
3974
|
+
children: t("empty.none")
|
|
3975
|
+
}),
|
|
3976
|
+
groups.map((group) => {
|
|
3977
|
+
if (group.kind === "repo") {
|
|
3978
|
+
const memberIds = group.members.map((member) => orderedVisibleSessionIds(member.workspace, sessions, archived, orderBy));
|
|
3979
|
+
const visibleCount = memberIds.reduce((sum, ids) => sum + ids.length, 0);
|
|
3980
|
+
const containsCurrent = group.members.some((member) => member.workspace.sessionIds.includes(currentSessionId ?? "\0"));
|
|
3981
|
+
const open = expandMap[group.key] ?? containsCurrent;
|
|
3982
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3983
|
+
className: GroupedSidebar_module_default.groupSection,
|
|
3984
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProjectRowItem, {
|
|
3985
|
+
row: {
|
|
3986
|
+
key: group.key,
|
|
3987
|
+
label: group.repoName ?? group.key,
|
|
3988
|
+
expanded: open,
|
|
3989
|
+
containsCurrent
|
|
3990
|
+
},
|
|
3991
|
+
onToggle: () => {
|
|
3992
|
+
onToggle(group.key);
|
|
3993
|
+
},
|
|
3994
|
+
home,
|
|
3995
|
+
t,
|
|
3996
|
+
badge: String(visibleCount)
|
|
3997
|
+
}), open && group.members.map((member, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemberBlock, {
|
|
3998
|
+
member,
|
|
3999
|
+
indent: true,
|
|
4000
|
+
sessionIds: memberIds[index] ?? [],
|
|
4001
|
+
sessions,
|
|
4002
|
+
currentSessionId,
|
|
4003
|
+
expandMap,
|
|
4004
|
+
onToggle,
|
|
4005
|
+
expandTo,
|
|
4006
|
+
descendants,
|
|
4007
|
+
expandedSessionGroups,
|
|
4008
|
+
setExpandedSessionGroups,
|
|
4009
|
+
now,
|
|
4010
|
+
home,
|
|
4011
|
+
onOpen,
|
|
4012
|
+
onRename,
|
|
4013
|
+
onFork,
|
|
4014
|
+
onArchive,
|
|
4015
|
+
onWorkspaceRename,
|
|
4016
|
+
onWorkspaceDelete,
|
|
4017
|
+
onWorktreeRemove,
|
|
4018
|
+
startSession,
|
|
4019
|
+
t
|
|
4020
|
+
}, member.workspace.workspaceId))]
|
|
4021
|
+
}, group.key);
|
|
4022
|
+
}
|
|
4023
|
+
const member = group.members[0];
|
|
4024
|
+
if (member === void 0) return null;
|
|
4025
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3756
4026
|
className: GroupedSidebar_module_default.groupSection,
|
|
3757
|
-
children:
|
|
3758
|
-
row: {
|
|
3759
|
-
key: group.key,
|
|
3760
|
-
label: group.repoName ?? group.key,
|
|
3761
|
-
expanded: open,
|
|
3762
|
-
containsCurrent
|
|
3763
|
-
},
|
|
3764
|
-
onToggle: () => {
|
|
3765
|
-
onToggle(group.key);
|
|
3766
|
-
},
|
|
3767
|
-
home,
|
|
3768
|
-
t,
|
|
3769
|
-
badge: String(visibleCount)
|
|
3770
|
-
}), open && group.members.map((member, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemberBlock, {
|
|
4027
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemberBlock, {
|
|
3771
4028
|
member,
|
|
3772
|
-
indent:
|
|
3773
|
-
sessionIds:
|
|
4029
|
+
indent: false,
|
|
4030
|
+
sessionIds: orderedVisibleSessionIds(member.workspace, sessions, archived, orderBy),
|
|
3774
4031
|
sessions,
|
|
3775
4032
|
currentSessionId,
|
|
3776
4033
|
expandMap,
|
|
@@ -3787,44 +4044,18 @@ window.__ModuleLoader__.load({
|
|
|
3787
4044
|
onArchive,
|
|
3788
4045
|
onWorkspaceRename,
|
|
3789
4046
|
onWorkspaceDelete,
|
|
4047
|
+
onWorktreeRemove,
|
|
3790
4048
|
startSession,
|
|
3791
4049
|
t
|
|
3792
|
-
}
|
|
4050
|
+
})
|
|
3793
4051
|
}, group.key);
|
|
3794
|
-
}
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3798
|
-
className: GroupedSidebar_module_default.groupSection,
|
|
3799
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemberBlock, {
|
|
3800
|
-
member,
|
|
3801
|
-
indent: false,
|
|
3802
|
-
sessionIds: orderedVisibleSessionIds(member.workspace, sessions, archived, orderBy),
|
|
3803
|
-
sessions,
|
|
3804
|
-
currentSessionId,
|
|
3805
|
-
expandMap,
|
|
3806
|
-
onToggle,
|
|
3807
|
-
expandTo,
|
|
3808
|
-
descendants,
|
|
3809
|
-
expandedSessionGroups,
|
|
3810
|
-
setExpandedSessionGroups,
|
|
3811
|
-
now,
|
|
3812
|
-
home,
|
|
3813
|
-
onOpen,
|
|
3814
|
-
onRename,
|
|
3815
|
-
onFork,
|
|
3816
|
-
onArchive,
|
|
3817
|
-
onWorkspaceRename,
|
|
3818
|
-
onWorkspaceDelete,
|
|
3819
|
-
startSession,
|
|
3820
|
-
t
|
|
3821
|
-
})
|
|
3822
|
-
}, group.key);
|
|
3823
|
-
})]
|
|
4052
|
+
}),
|
|
4053
|
+
footer
|
|
4054
|
+
]
|
|
3824
4055
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: GroupedSidebar_module_default.fade })]
|
|
3825
4056
|
});
|
|
3826
4057
|
}
|
|
3827
|
-
function MemberBlock({ member, indent, sessionIds, sessions, currentSessionId, expandMap, onToggle, expandTo, descendants, expandedSessionGroups, setExpandedSessionGroups, now, home, onOpen, onRename, onFork, onArchive, onWorkspaceRename, onWorkspaceDelete, startSession, t }) {
|
|
4058
|
+
function MemberBlock({ member, indent, sessionIds, sessions, currentSessionId, expandMap, onToggle, expandTo, descendants, expandedSessionGroups, setExpandedSessionGroups, now, home, onOpen, onRename, onFork, onArchive, onWorkspaceRename, onWorkspaceDelete, onWorktreeRemove, startSession, t }) {
|
|
3828
4059
|
const key = `ws:${member.workspace.workspaceId}`;
|
|
3829
4060
|
const containsCurrent = member.workspace.sessionIds.includes(currentSessionId ?? "\0");
|
|
3830
4061
|
const open = expandMap[key] ?? containsCurrent;
|
|
@@ -3837,6 +4068,9 @@ window.__ModuleLoader__.load({
|
|
|
3837
4068
|
if (summary !== void 0) nodes.push(sessionNode(summary, descendants));
|
|
3838
4069
|
}
|
|
3839
4070
|
const created = createdAtMs(member.workspace.createdAt);
|
|
4071
|
+
const hasRunning = member.workspace.sessionIds.some((id) => sessions.byId[id]?.running === true);
|
|
4072
|
+
const occupied = containsCurrent || hasRunning;
|
|
4073
|
+
const canRemoveWorktree = member.label.type === "linked" && !occupied;
|
|
3840
4074
|
const body = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProjectRowItem, {
|
|
3841
4075
|
row: {
|
|
3842
4076
|
key,
|
|
@@ -3859,7 +4093,10 @@ window.__ModuleLoader__.load({
|
|
|
3859
4093
|
},
|
|
3860
4094
|
delete: () => {
|
|
3861
4095
|
onWorkspaceDelete(member.workspace.workspaceId, member.workspace.title);
|
|
3862
|
-
}
|
|
4096
|
+
},
|
|
4097
|
+
...canRemoveWorktree ? { removeWorktree: () => {
|
|
4098
|
+
onWorktreeRemove(member);
|
|
4099
|
+
} } : {}
|
|
3863
4100
|
},
|
|
3864
4101
|
home,
|
|
3865
4102
|
t
|
|
@@ -3893,7 +4130,7 @@ window.__ModuleLoader__.load({
|
|
|
3893
4130
|
const { t } = props;
|
|
3894
4131
|
const workspaces = (0, react.useSyncExternalStore)(props.workspacesList.subscribe, props.workspacesList.getSnapshot);
|
|
3895
4132
|
const sessions = (0, react.useSyncExternalStore)(props.sessionsList.subscribe, props.sessionsList.getSnapshot);
|
|
3896
|
-
const host = (0, react.useSyncExternalStore)(props.
|
|
4133
|
+
const host = (0, react.useSyncExternalStore)(props.hostDescription.subscribe, props.hostDescription.getSnapshot);
|
|
3897
4134
|
const directoryFlowAvailable = (0, react.useSyncExternalStore)(props.directoryFlow.subscribe, props.directoryFlow.getSnapshot);
|
|
3898
4135
|
const items = workspaces.items;
|
|
3899
4136
|
const home = host?.home;
|
|
@@ -4148,7 +4385,197 @@ window.__ModuleLoader__.load({
|
|
|
4148
4385
|
setDeleteError(reason instanceof Error ? reason.message : String(reason));
|
|
4149
4386
|
});
|
|
4150
4387
|
};
|
|
4388
|
+
const [wtRemoveTarget, setWtRemoveTarget] = (0, react.useState)(null);
|
|
4389
|
+
const [wtInspect, setWtInspect] = (0, react.useState)({ status: "loading" });
|
|
4390
|
+
const [wtRemoving, setWtRemoving] = (0, react.useState)(false);
|
|
4391
|
+
const [wtRemoveError, setWtRemoveError] = (0, react.useState)(null);
|
|
4392
|
+
(0, react.useEffect)(() => {
|
|
4393
|
+
if (wtRemoveTarget === null) return;
|
|
4394
|
+
setWtInspect({ status: "loading" });
|
|
4395
|
+
let live = true;
|
|
4396
|
+
props.inspectWorktree(wtRemoveTarget.workspace.path).then((facts) => {
|
|
4397
|
+
if (live) setWtInspect({
|
|
4398
|
+
status: "ready",
|
|
4399
|
+
dirty: facts.dirty,
|
|
4400
|
+
ahead: facts.ahead
|
|
4401
|
+
});
|
|
4402
|
+
}, (reason) => {
|
|
4403
|
+
if (live) setWtInspect({
|
|
4404
|
+
status: "error",
|
|
4405
|
+
error: reason instanceof Error ? reason.message : String(reason)
|
|
4406
|
+
});
|
|
4407
|
+
});
|
|
4408
|
+
return () => {
|
|
4409
|
+
live = false;
|
|
4410
|
+
};
|
|
4411
|
+
}, [wtRemoveTarget]);
|
|
4412
|
+
const archivedSet = (0, react.useMemo)(() => new Set(archived), [archived]);
|
|
4413
|
+
const wtArchiveIds = wtRemoveTarget === null ? [] : wtRemoveTarget.workspace.sessionIds.filter((id) => {
|
|
4414
|
+
const summary = sessionList.byId[id];
|
|
4415
|
+
return summary !== void 0 && !archivedSet.has(id) && !summary.blank && summary.origin !== "subagent";
|
|
4416
|
+
});
|
|
4417
|
+
const closeWtRemove = () => {
|
|
4418
|
+
if (wtRemoving) return;
|
|
4419
|
+
setWtRemoveTarget(null);
|
|
4420
|
+
setWtRemoveError(null);
|
|
4421
|
+
};
|
|
4422
|
+
const confirmWtRemove = () => {
|
|
4423
|
+
if (wtRemoving || wtRemoveTarget === null || wtInspect.status !== "ready") return;
|
|
4424
|
+
const target = wtRemoveTarget;
|
|
4425
|
+
setWtRemoving(true);
|
|
4426
|
+
setWtRemoveError(null);
|
|
4427
|
+
(async () => {
|
|
4428
|
+
try {
|
|
4429
|
+
await props.removeWorktree(target.workspace.path, wtInspect.dirty > 0);
|
|
4430
|
+
for (const sessionId of wtArchiveIds) await props.archiveSession(sessionId).catch((reason) => {
|
|
4431
|
+
console.warn("session archive rejected during worktree removal:", reason);
|
|
4432
|
+
});
|
|
4433
|
+
await props.deleteWorkspace(target.workspace.workspaceId);
|
|
4434
|
+
setWtRemoving(false);
|
|
4435
|
+
setWtRemoveTarget(null);
|
|
4436
|
+
} catch (reason) {
|
|
4437
|
+
setWtRemoving(false);
|
|
4438
|
+
setWtRemoveError(reason instanceof Error ? reason.message : String(reason));
|
|
4439
|
+
}
|
|
4440
|
+
})();
|
|
4441
|
+
};
|
|
4151
4442
|
const now = Date.now();
|
|
4443
|
+
const strayGroups = (0, react.useMemo)(() => deriveStrayGroups(items, sessionList, archived), [
|
|
4444
|
+
items,
|
|
4445
|
+
sessionList,
|
|
4446
|
+
archived
|
|
4447
|
+
]);
|
|
4448
|
+
const strayDescendants = (0, react.useMemo)(() => indexSubagentRunning(sessionList.byId), [sessionList.byId]);
|
|
4449
|
+
const strayProbePaths = (0, react.useMemo)(() => [...new Set(strayGroups.filter((group) => group.belongsTo === void 0 && group.path !== "").map((group) => group.path))], [strayGroups]);
|
|
4450
|
+
const strayProbeSignature = strayProbePaths.join("\n");
|
|
4451
|
+
const [strayDirExists, setStrayDirExists] = (0, react.useState)(void 0);
|
|
4452
|
+
const [straySlotRebuildable, setStraySlotRebuildable] = (0, react.useState)(void 0);
|
|
4453
|
+
(0, react.useEffect)(() => {
|
|
4454
|
+
if (strayProbePaths.length === 0) return;
|
|
4455
|
+
let live = true;
|
|
4456
|
+
props.probeDirectories(strayProbePaths).then((result) => {
|
|
4457
|
+
if (!live) return;
|
|
4458
|
+
setStrayDirExists(result?.exists);
|
|
4459
|
+
setStraySlotRebuildable(result?.rebuildable);
|
|
4460
|
+
}, () => {
|
|
4461
|
+
if (live) {
|
|
4462
|
+
setStrayDirExists(void 0);
|
|
4463
|
+
setStraySlotRebuildable(void 0);
|
|
4464
|
+
}
|
|
4465
|
+
});
|
|
4466
|
+
return () => {
|
|
4467
|
+
live = false;
|
|
4468
|
+
};
|
|
4469
|
+
}, [strayProbeSignature]);
|
|
4470
|
+
const straySectionKey = "stray:section";
|
|
4471
|
+
const strayContainsCurrent = strayGroups.some((group) => group.sessions.some((session) => session.id === sessions.current));
|
|
4472
|
+
const straySectionOpen = expandMap[straySectionKey] ?? strayContainsCurrent;
|
|
4473
|
+
const strayTotal = strayGroups.reduce((sum, group) => sum + group.sessions.length, 0);
|
|
4474
|
+
const [strayRegPath, setStrayRegPath] = (0, react.useState)(null);
|
|
4475
|
+
const [toast, setToast] = (0, react.useState)(null);
|
|
4476
|
+
const registerStrayWorkspace = (path) => {
|
|
4477
|
+
if (strayRegPath !== null) return;
|
|
4478
|
+
setStrayRegPath(path);
|
|
4479
|
+
props.createWorkspace({ path }).then(() => {
|
|
4480
|
+
setStrayRegPath(null);
|
|
4481
|
+
}, (reason) => {
|
|
4482
|
+
setStrayRegPath(null);
|
|
4483
|
+
setToast({
|
|
4484
|
+
seq: Date.now(),
|
|
4485
|
+
text: t("stray.registerFailed", { message: reason instanceof Error ? reason.message : String(reason) })
|
|
4486
|
+
});
|
|
4487
|
+
});
|
|
4488
|
+
};
|
|
4489
|
+
const [strayRebuildPath, setStrayRebuildPath] = (0, react.useState)(null);
|
|
4490
|
+
const rebuildStrayDirectory = (path) => {
|
|
4491
|
+
if (strayRebuildPath !== null) return;
|
|
4492
|
+
setStrayRebuildPath(path);
|
|
4493
|
+
props.ensureDirectory(path).then(() => {
|
|
4494
|
+
setStrayRebuildPath(null);
|
|
4495
|
+
setToast({
|
|
4496
|
+
seq: Date.now(),
|
|
4497
|
+
text: t("stray.rebuildDone")
|
|
4498
|
+
});
|
|
4499
|
+
props.probeDirectories([path]).then((result) => {
|
|
4500
|
+
if (result === void 0) return;
|
|
4501
|
+
setStrayDirExists((current) => ({
|
|
4502
|
+
...current,
|
|
4503
|
+
...result.exists
|
|
4504
|
+
}));
|
|
4505
|
+
setStraySlotRebuildable((current) => ({
|
|
4506
|
+
...current,
|
|
4507
|
+
...result.rebuildable
|
|
4508
|
+
}));
|
|
4509
|
+
});
|
|
4510
|
+
}, (reason) => {
|
|
4511
|
+
setStrayRebuildPath(null);
|
|
4512
|
+
setToast({
|
|
4513
|
+
seq: Date.now(),
|
|
4514
|
+
text: t("stray.rebuildFailed", { message: reason instanceof Error ? reason.message : String(reason) })
|
|
4515
|
+
});
|
|
4516
|
+
});
|
|
4517
|
+
};
|
|
4518
|
+
const straySection = strayGroups.length === 0 ? void 0 : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4519
|
+
className: GroupedSidebar_module_default.groupSection,
|
|
4520
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProjectRowItem, {
|
|
4521
|
+
row: {
|
|
4522
|
+
key: straySectionKey,
|
|
4523
|
+
label: t("group.ungrouped"),
|
|
4524
|
+
expanded: straySectionOpen,
|
|
4525
|
+
containsCurrent: strayContainsCurrent
|
|
4526
|
+
},
|
|
4527
|
+
onToggle: () => {
|
|
4528
|
+
toggle(straySectionKey);
|
|
4529
|
+
},
|
|
4530
|
+
home,
|
|
4531
|
+
t,
|
|
4532
|
+
badge: String(strayTotal)
|
|
4533
|
+
}), straySectionOpen && strayGroups.map((group) => {
|
|
4534
|
+
const groupOpen = expandMap[group.key] ?? group.sessions.some((session) => session.id === sessions.current);
|
|
4535
|
+
const registrable = group.belongsTo === void 0 && group.path !== "" && strayDirExists?.[group.path] === true;
|
|
4536
|
+
const missingDir = group.belongsTo === void 0 && group.path !== "" && strayDirExists?.[group.path] === false;
|
|
4537
|
+
const rebuildable = missingDir && straySlotRebuildable?.[group.path] === true;
|
|
4538
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4539
|
+
className: cx(GroupedSidebar_module_default.groupSection, GroupedSidebar_module_default.memberIndent),
|
|
4540
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StrayGroupRow, {
|
|
4541
|
+
path: group.path,
|
|
4542
|
+
belongsTo: group.belongsTo,
|
|
4543
|
+
count: group.sessions.length,
|
|
4544
|
+
expanded: groupOpen,
|
|
4545
|
+
onToggle: () => {
|
|
4546
|
+
toggle(group.key);
|
|
4547
|
+
},
|
|
4548
|
+
missingDir,
|
|
4549
|
+
worktreeSlot: rebuildable,
|
|
4550
|
+
...registrable ? {
|
|
4551
|
+
onRegister: () => {
|
|
4552
|
+
registerStrayWorkspace(group.path);
|
|
4553
|
+
},
|
|
4554
|
+
registering: strayRegPath === group.path
|
|
4555
|
+
} : rebuildable ? {
|
|
4556
|
+
onRebuild: () => {
|
|
4557
|
+
rebuildStrayDirectory(group.path);
|
|
4558
|
+
},
|
|
4559
|
+
rebuilding: strayRebuildPath === group.path
|
|
4560
|
+
} : {},
|
|
4561
|
+
home,
|
|
4562
|
+
t
|
|
4563
|
+
}), groupOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4564
|
+
className: GroupedSidebar_module_default.sessionsIndent,
|
|
4565
|
+
children: group.sessions.map((session) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionNodeItem, {
|
|
4566
|
+
node: sessionNode(session, strayDescendants),
|
|
4567
|
+
currentId: sessions.current,
|
|
4568
|
+
now,
|
|
4569
|
+
onOpen: props.openSession,
|
|
4570
|
+
onRename: onSessionRename,
|
|
4571
|
+
onFork: props.forkSession,
|
|
4572
|
+
onArchive: onSessionArchive,
|
|
4573
|
+
t
|
|
4574
|
+
}, session.id))
|
|
4575
|
+
})]
|
|
4576
|
+
}, group.key);
|
|
4577
|
+
})]
|
|
4578
|
+
});
|
|
4152
4579
|
const wide = props.wide;
|
|
4153
4580
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4154
4581
|
className: cx(GroupedSidebar_module_default.root, !wide && GroupedSidebar_module_default.rail),
|
|
@@ -4302,6 +4729,7 @@ window.__ModuleLoader__.load({
|
|
|
4302
4729
|
t
|
|
4303
4730
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupedTree, {
|
|
4304
4731
|
groups,
|
|
4732
|
+
footer: straySection,
|
|
4305
4733
|
sessions: sessionList,
|
|
4306
4734
|
archived,
|
|
4307
4735
|
currentSessionId: sessions.current,
|
|
@@ -4330,6 +4758,10 @@ window.__ModuleLoader__.load({
|
|
|
4330
4758
|
});
|
|
4331
4759
|
setDeleteError(null);
|
|
4332
4760
|
},
|
|
4761
|
+
onWorktreeRemove: (member) => {
|
|
4762
|
+
setWtRemoveTarget(member);
|
|
4763
|
+
setWtRemoveError(null);
|
|
4764
|
+
},
|
|
4333
4765
|
startSession: props.startSession,
|
|
4334
4766
|
t
|
|
4335
4767
|
}))
|
|
@@ -4463,7 +4895,75 @@ window.__ModuleLoader__.load({
|
|
|
4463
4895
|
role: "alert",
|
|
4464
4896
|
children: deleteError
|
|
4465
4897
|
})]
|
|
4466
|
-
})
|
|
4898
|
+
}),
|
|
4899
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
4900
|
+
open: wtRemoveTarget !== null,
|
|
4901
|
+
onClose: closeWtRemove,
|
|
4902
|
+
closeLabel: t("close"),
|
|
4903
|
+
title: t("worktreeRemove.title"),
|
|
4904
|
+
...wtRemoveTarget === null ? {} : { description: t("worktreeRemove.desc", { path: wtRemoveTarget.workspace.path }) },
|
|
4905
|
+
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
4906
|
+
variant: "outline",
|
|
4907
|
+
disabled: wtRemoving,
|
|
4908
|
+
onClick: closeWtRemove,
|
|
4909
|
+
children: t("cancel")
|
|
4910
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
4911
|
+
variant: "outline",
|
|
4912
|
+
className: GroupedSidebar_module_default.deleteAction,
|
|
4913
|
+
disabled: wtRemoving || wtInspect.status !== "ready",
|
|
4914
|
+
onClick: confirmWtRemove,
|
|
4915
|
+
children: t("worktreeRemove.menu")
|
|
4916
|
+
})] }),
|
|
4917
|
+
children: [
|
|
4918
|
+
wtRemoveTarget?.label.type === "linked" && wtRemoveTarget.label.branch !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4919
|
+
className: GroupedSidebar_module_default.removeFact,
|
|
4920
|
+
children: t("worktreeRemove.descBranch", { branch: wtRemoveTarget.label.branch })
|
|
4921
|
+
}),
|
|
4922
|
+
wtInspect.status === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4923
|
+
className: GroupedSidebar_module_default.deleteStatus,
|
|
4924
|
+
role: "status",
|
|
4925
|
+
children: t("worktreeRemove.inspecting")
|
|
4926
|
+
}),
|
|
4927
|
+
wtInspect.status === "error" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4928
|
+
className: GroupedSidebar_module_default.renameError,
|
|
4929
|
+
role: "alert",
|
|
4930
|
+
children: wtInspect.error
|
|
4931
|
+
}),
|
|
4932
|
+
wtInspect.status === "ready" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4933
|
+
className: GroupedSidebar_module_default.removeFacts,
|
|
4934
|
+
children: [
|
|
4935
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4936
|
+
className: cx(GroupedSidebar_module_default.removeFact, wtInspect.dirty > 0 && GroupedSidebar_module_default.removeFactWarn),
|
|
4937
|
+
children: wtInspect.dirty > 0 ? t(wtInspect.dirty === 1 ? "worktreeRemove.dirty.one" : "worktreeRemove.dirty.other", { n: wtInspect.dirty }) : t("worktreeRemove.clean")
|
|
4938
|
+
}),
|
|
4939
|
+
wtInspect.ahead !== void 0 && wtInspect.ahead > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4940
|
+
className: GroupedSidebar_module_default.removeFact,
|
|
4941
|
+
children: t("worktreeRemove.ahead", { n: wtInspect.ahead })
|
|
4942
|
+
}),
|
|
4943
|
+
wtArchiveIds.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4944
|
+
className: GroupedSidebar_module_default.removeFact,
|
|
4945
|
+
children: t(wtArchiveIds.length === 1 ? "worktreeRemove.sessions.one" : "worktreeRemove.sessions.other", { n: wtArchiveIds.length })
|
|
4946
|
+
})
|
|
4947
|
+
]
|
|
4948
|
+
}),
|
|
4949
|
+
wtRemoving && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4950
|
+
className: GroupedSidebar_module_default.deleteStatus,
|
|
4951
|
+
role: "status",
|
|
4952
|
+
children: t("worktreeRemove.busy")
|
|
4953
|
+
}),
|
|
4954
|
+
wtRemoveError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4955
|
+
className: GroupedSidebar_module_default.renameError,
|
|
4956
|
+
role: "alert",
|
|
4957
|
+
children: wtRemoveError
|
|
4958
|
+
})
|
|
4959
|
+
]
|
|
4960
|
+
}),
|
|
4961
|
+
toast !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Toast, {
|
|
4962
|
+
text: toast.text,
|
|
4963
|
+
onDone: () => {
|
|
4964
|
+
setToast(null);
|
|
4965
|
+
}
|
|
4966
|
+
}, toast.seq)
|
|
4467
4967
|
]
|
|
4468
4968
|
});
|
|
4469
4969
|
}
|
|
@@ -4572,6 +5072,29 @@ window.__ModuleLoader__.load({
|
|
|
4572
5072
|
"delete.workspace": "Delete workspace",
|
|
4573
5073
|
"delete.desc": "This removes “{name}” from the workspace list. The folder and session logs will be kept. Its sessions will appear under Ungrouped.",
|
|
4574
5074
|
"delete.pending": "Deleting workspace…",
|
|
5075
|
+
"worktreeRemove.menu": "Remove worktree",
|
|
5076
|
+
"worktreeRemove.title": "Remove worktree",
|
|
5077
|
+
"worktreeRemove.desc": "This removes the worktree from git and deletes the folder “{path}”.",
|
|
5078
|
+
"worktreeRemove.descBranch": "The branch {branch} is kept.",
|
|
5079
|
+
"worktreeRemove.inspecting": "Inspecting worktree…",
|
|
5080
|
+
"worktreeRemove.dirty.one": "{n} uncommitted file will be deleted with the folder.",
|
|
5081
|
+
"worktreeRemove.dirty.other": "{n} uncommitted files will be deleted with the folder.",
|
|
5082
|
+
"worktreeRemove.clean": "No uncommitted changes.",
|
|
5083
|
+
"worktreeRemove.ahead": "{n} commits ahead of upstream, kept on the branch.",
|
|
5084
|
+
"worktreeRemove.sessions.one": "{n} session in this workspace will be archived too.",
|
|
5085
|
+
"worktreeRemove.sessions.other": "{n} sessions in this workspace will be archived too.",
|
|
5086
|
+
"worktreeRemove.busy": "Removing…",
|
|
5087
|
+
"stray.unknown": "(unknown directory)",
|
|
5088
|
+
"stray.belongsTo": "Stray sessions of “{name}”",
|
|
5089
|
+
"stray.missingDir": "Directory no longer exists — registering is unavailable",
|
|
5090
|
+
"stray.worktreeSlot": "A worktree storage slot: rebuild this directory (e.g. git worktree add) and its historical sessions reattach automatically",
|
|
5091
|
+
"stray.rebuild": "Rebuild empty directory",
|
|
5092
|
+
"stray.rebuild.aria": "Rebuild the directory “{name}”",
|
|
5093
|
+
"stray.rebuildDone": "Directory rebuilt; its historical sessions will reattach automatically",
|
|
5094
|
+
"stray.rebuildFailed": "Rebuild failed: {message}",
|
|
5095
|
+
"stray.register": "Register as workspace",
|
|
5096
|
+
"stray.register.aria": "Register “{name}” as a workspace",
|
|
5097
|
+
"stray.registerFailed": "Registration failed: {message}",
|
|
4575
5098
|
"menu.fork": "Fork session",
|
|
4576
5099
|
"menu.archiveSession": "Archive session",
|
|
4577
5100
|
"sessions.count.one": "{n} session",
|
|
@@ -4704,6 +5227,29 @@ window.__ModuleLoader__.load({
|
|
|
4704
5227
|
"delete.workspace": "删除工作区",
|
|
4705
5228
|
"delete.desc": "将把“{name}”从工作区列表中移除。文件夹与会话记录会保留,其会话将显示在“未分组”下。",
|
|
4706
5229
|
"delete.pending": "正在删除工作区…",
|
|
5230
|
+
"worktreeRemove.menu": "删除工作树",
|
|
5231
|
+
"worktreeRemove.title": "删除工作树",
|
|
5232
|
+
"worktreeRemove.desc": "将从 git 移除该工作树并删除目录“{path}”。",
|
|
5233
|
+
"worktreeRemove.descBranch": "分支 {branch} 将保留。",
|
|
5234
|
+
"worktreeRemove.inspecting": "正在检查工作树…",
|
|
5235
|
+
"worktreeRemove.dirty.one": "{n} 个未提交文件将随目录一并删除。",
|
|
5236
|
+
"worktreeRemove.dirty.other": "{n} 个未提交文件将随目录一并删除。",
|
|
5237
|
+
"worktreeRemove.clean": "无未提交改动。",
|
|
5238
|
+
"worktreeRemove.ahead": "分支领先上游 {n} 个提交,提交将保留在分支上。",
|
|
5239
|
+
"worktreeRemove.sessions.one": "该工作区下的 {n} 个会话将一并归档。",
|
|
5240
|
+
"worktreeRemove.sessions.other": "该工作区下的 {n} 个会话将一并归档。",
|
|
5241
|
+
"worktreeRemove.busy": "删除中…",
|
|
5242
|
+
"stray.unknown": "(目录未知)",
|
|
5243
|
+
"stray.belongsTo": "属于“{name}”的失联会话",
|
|
5244
|
+
"stray.missingDir": "目录已不存在,无法注册",
|
|
5245
|
+
"stray.worktreeSlot": "工作树存放位:重建此目录(如 git worktree add)后,其历史会话将自动归位",
|
|
5246
|
+
"stray.rebuild": "重建空目录",
|
|
5247
|
+
"stray.rebuild.aria": "重建目录“{name}”",
|
|
5248
|
+
"stray.rebuildDone": "目录已重建,其历史会话将自动归位",
|
|
5249
|
+
"stray.rebuildFailed": "重建失败:{message}",
|
|
5250
|
+
"stray.register": "注册为工作区",
|
|
5251
|
+
"stray.register.aria": "将“{name}”注册为工作区",
|
|
5252
|
+
"stray.registerFailed": "注册失败:{message}",
|
|
4707
5253
|
"menu.fork": "分叉会话",
|
|
4708
5254
|
"menu.archiveSession": "归档会话",
|
|
4709
5255
|
"sessions.count.one": "{n} 个会话",
|
|
@@ -4742,14 +5288,12 @@ window.__ModuleLoader__.load({
|
|
|
4742
5288
|
* imported: a client package must not depend on a Host package.
|
|
4743
5289
|
*/
|
|
4744
5290
|
const GIT_WORKTREE_NS = "git-worktree";
|
|
4745
|
-
/** Required services: the slot ledger, session/workspace
|
|
4746
|
-
*
|
|
4747
|
-
* the plugin configuration card. */
|
|
5291
|
+
/** Required services: the slot ledger, session/workspace runtime, copy, and
|
|
5292
|
+
* the settings scope backing the plugin configuration card. */
|
|
4748
5293
|
const inject = [
|
|
4749
5294
|
"slots",
|
|
4750
5295
|
"sessions",
|
|
4751
5296
|
"workspaces",
|
|
4752
|
-
"uiWorkspace",
|
|
4753
5297
|
"locale",
|
|
4754
5298
|
"connection",
|
|
4755
5299
|
"remote",
|
|
@@ -4760,13 +5304,10 @@ window.__ModuleLoader__.load({
|
|
|
4760
5304
|
zh,
|
|
4761
5305
|
en
|
|
4762
5306
|
}), "git-worktree: dictionaries");
|
|
4763
|
-
const chipInjected = () => ({
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
},
|
|
4768
|
-
sessionsList: ctx.sessions.list
|
|
4769
|
-
});
|
|
5307
|
+
const chipInjected = () => ({ adoptWorktree: async (path) => {
|
|
5308
|
+
const workspace = await ctx.workspaces.create({ path });
|
|
5309
|
+
ctx.workspaces.startSession(workspace.workspaceId);
|
|
5310
|
+
} });
|
|
4770
5311
|
ctx.slots.inject("conversation.input.left", () => ctx.slots.register({
|
|
4771
5312
|
name: "conversation.input.left",
|
|
4772
5313
|
id: "git-worktree",
|
|
@@ -4854,7 +5395,7 @@ window.__ModuleLoader__.load({
|
|
|
4854
5395
|
ctx.sessions.open(sessionId);
|
|
4855
5396
|
},
|
|
4856
5397
|
startSession: (workspaceId) => {
|
|
4857
|
-
ctx.
|
|
5398
|
+
ctx.workspaces.startSession(workspaceId);
|
|
4858
5399
|
},
|
|
4859
5400
|
loadFacts: async (paths) => {
|
|
4860
5401
|
const result = await requestGroupWorktrees(paths);
|
|
@@ -4889,15 +5430,32 @@ window.__ModuleLoader__.load({
|
|
|
4889
5430
|
archiveSession: async (sessionId) => {
|
|
4890
5431
|
await ctx.workspaces.archiveSession(sessionId);
|
|
4891
5432
|
},
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
const generation = ctx.get("connection").generation;
|
|
5433
|
+
inspectWorktree: async (path) => {
|
|
5434
|
+
const result = await requestInspectWorktree(path);
|
|
5435
|
+
if (!result.ok) throw new Error(result.error);
|
|
4896
5436
|
return {
|
|
4897
|
-
|
|
4898
|
-
|
|
5437
|
+
dirty: result.dirty,
|
|
5438
|
+
ahead: result.ahead
|
|
4899
5439
|
};
|
|
4900
|
-
}
|
|
5440
|
+
},
|
|
5441
|
+
removeWorktree: async (path, force) => {
|
|
5442
|
+
const result = await requestRemoveWorktree(path, force);
|
|
5443
|
+
if (!result.ok) throw new Error(result.error);
|
|
5444
|
+
},
|
|
5445
|
+
probeDirectories: async (paths) => {
|
|
5446
|
+
const result = await requestPathExists(paths);
|
|
5447
|
+
return result.ok ? {
|
|
5448
|
+
exists: result.exists,
|
|
5449
|
+
...result.rebuildable === void 0 ? {} : { rebuildable: result.rebuildable }
|
|
5450
|
+
} : void 0;
|
|
5451
|
+
},
|
|
5452
|
+
ensureDirectory: async (path) => {
|
|
5453
|
+
const result = await requestEnsureDirectory(path);
|
|
5454
|
+
if (!result.ok) throw new Error(result.error);
|
|
5455
|
+
},
|
|
5456
|
+
createWorkspace: (input) => ctx.workspaces.create(input),
|
|
5457
|
+
pickDirectory: () => ctx.workspaces.pickDirectory(),
|
|
5458
|
+
hostDescription: ctx.get("connection").hostDescription,
|
|
4901
5459
|
directoryFlow: {
|
|
4902
5460
|
getSnapshot: () => ctx.slots.entries("sidebar.workspaces.directoryFlow").length > 0,
|
|
4903
5461
|
subscribe: (listener) => ctx.slots.subscribe("sidebar.workspaces.directoryFlow", listener)
|
|
@@ -4931,7 +5489,7 @@ window.__ModuleLoader__.load({
|
|
|
4931
5489
|
inject: () => ({
|
|
4932
5490
|
hooks: { gitWorktreeCard: store },
|
|
4933
5491
|
...form.actions(),
|
|
4934
|
-
pickDirectory: () => ctx.
|
|
5492
|
+
pickDirectory: () => ctx.workspaces.pickDirectory()
|
|
4935
5493
|
})
|
|
4936
5494
|
}, GitWorktreeCard));
|
|
4937
5495
|
syncGroupingSeat();
|