@laoyuehanni/dsh-git-worktree 0.4.1 → 0.4.3-dsh-0.1.2-alpha.5

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/lib/client.js CHANGED
@@ -8,7 +8,6 @@ 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");
12
11
  //#region src/normalize.ts
13
12
  /**
14
13
  * Local branch name for a display name: strip the leading `<remote>/` segment
@@ -69,6 +68,14 @@ window.__ModuleLoader__.load({
69
68
  const ROUTE_UPDATE = `${ROUTE_PREFIX}/update`;
70
69
  /** POST ROUTE_PREFIX/group — git belonging facts for a batch of workspace paths. */
71
70
  const ROUTE_GROUP = `${ROUTE_PREFIX}/group`;
71
+ /** POST ROUTE_PREFIX/inspect — pre-delete facts for one worktree directory. */
72
+ const ROUTE_INSPECT = `${ROUTE_PREFIX}/inspect`;
73
+ /** POST ROUTE_PREFIX/remove — delete one linked worktree (git registration + folder). */
74
+ const ROUTE_REMOVE = `${ROUTE_PREFIX}/remove`;
75
+ /** POST ROUTE_PREFIX/exists — batch directory-existence probe (fs, no git). */
76
+ const ROUTE_EXISTS = `${ROUTE_PREFIX}/exists`;
77
+ /** POST ROUTE_PREFIX/ensure-directory — mkdir -p a missing worktree storage slot. */
78
+ const ROUTE_ENSURE_DIRECTORY = `${ROUTE_PREFIX}/ensure-directory`;
72
79
  //#endregion
73
80
  //#region src/client/api.ts
74
81
  /** POST one JSON body and parse the uniform envelope. */
@@ -195,9 +202,47 @@ window.__ModuleLoader__.load({
195
202
  async function requestGroupWorktrees(paths) {
196
203
  return post(ROUTE_GROUP, { paths });
197
204
  }
205
+ /**
206
+ * Pre-delete facts for one worktree directory: the uncommitted-file count
207
+ * (lost with the folder) and the branch's ahead count (kept).
208
+ * @param path - absolute worktree directory.
209
+ */
210
+ function requestInspectWorktree(path) {
211
+ return post(ROUTE_INSPECT, { path });
212
+ }
213
+ /**
214
+ * Remove one linked worktree (git registration + folder). `force` rides
215
+ * `--force` past uncommitted changes the confirm dialog already showed.
216
+ * @param path - absolute worktree directory to delete.
217
+ * @param force - delete past uncommitted changes.
218
+ */
219
+ function requestRemoveWorktree(path, force) {
220
+ return post(ROUTE_REMOVE, {
221
+ path,
222
+ force
223
+ });
224
+ }
225
+ /**
226
+ * Batch directory-existence probe (true = exists AND is a directory). The
227
+ * sidebar gates register-as-workspace on this so a missing folder never
228
+ * reaches the DSH workspace API.
229
+ * @param paths - absolute directories to probe.
230
+ */
231
+ function requestPathExists(paths) {
232
+ return post(ROUTE_EXISTS, { paths });
233
+ }
234
+ /**
235
+ * Recreate a missing worktree storage slot (`mkdir -p`). The host gates this
236
+ * to paths directly inside the storage root; historical sessions reattach
237
+ * automatically once the directory is back.
238
+ * @param path - the missing slot directory (absolute).
239
+ */
240
+ function requestEnsureDirectory(path) {
241
+ return post(ROUTE_ENSURE_DIRECTORY, { path });
242
+ }
198
243
  //#endregion
199
- //#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\BranchChip.module.css?inline
200
- 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";
244
+ //#region \0git-worktree-css:C:\Users\OYW\.dsh\gitworktree\dsh-worktree-feature-0.1.2-alpha.5\src\client\BranchChip.module.css?inline
245
+ const css$3 = "/* Branch chip row inside the composer tool row (conversation.input_2098199083.left_2098199083,\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_2098199083 / ModelSelect .trigger_2098199083). 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_2098199083 {\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_2098199083 {\n width: 1px;\n margin: 6px 0;\n background: color-mix(in srgb, currentColor 22%, transparent);\n flex-shrink: 0;\n}\n\n.chip_2098199083 {\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_2098199083: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_2098199083: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_2098199083:only-child {\n border-radius: 6px;\n}\n\n.branch_2098199083 {\n max-width: 16em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.check_2098199083,\n.checkOn_2098199083 {\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_2098199083:hover,\n.checkOn_2098199083: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_2098199083:last-child,\n.checkOn_2098199083:last-child {\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n\n.box_2098199083 {\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_2098199083 .box_2098199083 {\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_2098199083 {\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: r20, elevation-prominent\n * hairline, --dsw-specific-menu — host alpha.4 Menu card; on alpha.3\n * hosts the missing token falls back to the old r12-era shadow-lv3).\n * 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_2098199083 {\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: 0;\n border-radius: 20px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\n /* Elevation-prominent carries the hairline stroke (host alpha.4); the\n * lv3 fallback keeps a shadow where the token does not exist. */\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.popAsk_2098199083 {\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_2098199083 {\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_2098199083 {\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_2098199083 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_2098199083 button:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.popActions_2098199083 button:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n.popActions_2098199083 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_2098199083). Three owner requirements shape the geometry:\n *\n * 1. height cap: min(420px, 60vh) on the card, only the rows area\n * scrolls (.menuRows_2098199083) — 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_2098199083, 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_2098199083 {\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: 0;\n border-radius: 20px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\n /* Same elevation card as .popCard_2098199083 (host alpha.4 Menu); lv3 fallback for\n * alpha.3 hosts. */\n box-shadow: var(--dsw-elevation-prominent, 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_2098199083 {\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: 0.5px solid color-mix(in srgb, currentColor 12%, transparent);\n}\n\n.menuToolButton_2098199083 {\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_2098199083:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.menuToolButton_2098199083: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_2098199083 svg {\n animation: menuToolPulse 700ms ease-in-out infinite alternate;\n}\n\n.menuToolButtonRunning_2098199083: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_2098199083 {\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_2098199083 {\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_2098199083 {\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_2098199083 {\n box-sizing: border-box; /* width:100% + padding must stay inside .menuRows_2098199083 */\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_2098199083: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_2098199083 {\n opacity: 0.45;\n cursor: default;\n}\n\n.menuRowLocked_2098199083: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_2098199083,\n.menuRowSelected_2098199083: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_2098199083,\n.menuRowPicked_2098199083:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-label-primary-bluish, #4186f0) 18%, transparent);\n}\n\n.menuRowLabel_2098199083 {\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_2098199083 {\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_2098199083 {\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_2098199083, 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_2098199083 {\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_2098199083: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_2098199083 {\n color: inherit;\n font-weight: 600;\n}\n\n.menuGroupLabel_2098199083 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.menuGroupChevron_2098199083 {\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_2098199083 {\n transform: rotate(90deg);\n}\n\n.menuGroupCount_2098199083 {\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_2098199083 {\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_2098199083 {\n flex-shrink: 0;\n margin-top: 2px;\n padding-top: 4px;\n border-top: 0.5px solid color-mix(in srgb, currentColor 12%, transparent);\n}\n\n.menuSearch_2098199083 {\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_2098199083) — 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_2098199083::placeholder {\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n.menuSearch_2098199083: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_2098199083,\n.menuToolButtonOn_2098199083: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_2098199083 {\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_2098199083). */\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuCreate_2098199083::placeholder {\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n.menuCreate_2098199083:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.menuCreate_2098199083: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_2098199083 {\n margin: 0;\n padding: 0 8px;\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-label-error);\n}\n";
201
246
  const tagId$3 = "@laoyuehanni/dsh-git-worktree/BranchChip.module.css";
202
247
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId$3 + "\"]") === null) {
203
248
  const tag = document.createElement("style");
@@ -207,48 +252,48 @@ window.__ModuleLoader__.load({
207
252
  document.head.appendChild(tag);
208
253
  }
209
254
  var BranchChip_module_default = {
210
- "input": "input_2006230319",
211
- "left": "left_2006230319",
212
- "trigger": "trigger_2006230319",
213
- "dock": "dock_2006230319",
214
- "divider": "divider_2006230319",
215
- "chip": "chip_2006230319",
216
- "branch": "branch_2006230319",
217
- "check": "check_2006230319",
218
- "checkOn": "checkOn_2006230319",
219
- "box": "box_2006230319",
220
- "checkLabel": "checkLabel_2006230319",
221
- "popCard": "popCard_2006230319",
222
- "popAsk": "popAsk_2006230319",
223
- "popSubject": "popSubject_2006230319",
224
- "popActions": "popActions_2006230319",
225
- "menuRows": "menuRows_2006230319",
226
- "body": "body_2006230319",
227
- "menuCard": "menuCard_2006230319",
228
- "menuToolbar": "menuToolbar_2006230319",
229
- "menuToolButton": "menuToolButton_2006230319",
230
- "menuToolButtonRunning": "menuToolButtonRunning_2006230319",
231
- "menuMain": "menuMain_2006230319",
232
- "menuHeading": "menuHeading_2006230319",
233
- "menuRow": "menuRow_2006230319",
234
- "menuRowLocked": "menuRowLocked_2006230319",
235
- "menuRowSelected": "menuRowSelected_2006230319",
236
- "menuRowPicked": "menuRowPicked_2006230319",
237
- "menuRowLabel": "menuRowLabel_2006230319",
238
- "menuRowArrow": "menuRowArrow_2006230319",
239
- "menuSearchMark": "menuSearchMark_2006230319",
240
- "menuGroup": "menuGroup_2006230319",
241
- "menuGroupTop": "menuGroupTop_2006230319",
242
- "menuGroupLabel": "menuGroupLabel_2006230319",
243
- "menuGroupChevron": "menuGroupChevron_2006230319",
244
- "menuGroupChevronOpen": "menuGroupChevronOpen_2006230319",
245
- "menuGroupCount": "menuGroupCount_2006230319",
246
- "menuEmpty": "menuEmpty_2006230319",
247
- "menuSearchWrap": "menuSearchWrap_2006230319",
248
- "menuSearch": "menuSearch_2006230319",
249
- "menuToolButtonOn": "menuToolButtonOn_2006230319",
250
- "menuCreate": "menuCreate_2006230319",
251
- "menuCreateHintBad": "menuCreateHintBad_2006230319"
255
+ "input": "input_2098199083",
256
+ "left": "left_2098199083",
257
+ "trigger": "trigger_2098199083",
258
+ "dock": "dock_2098199083",
259
+ "divider": "divider_2098199083",
260
+ "chip": "chip_2098199083",
261
+ "branch": "branch_2098199083",
262
+ "check": "check_2098199083",
263
+ "checkOn": "checkOn_2098199083",
264
+ "box": "box_2098199083",
265
+ "checkLabel": "checkLabel_2098199083",
266
+ "popCard": "popCard_2098199083",
267
+ "popAsk": "popAsk_2098199083",
268
+ "popSubject": "popSubject_2098199083",
269
+ "popActions": "popActions_2098199083",
270
+ "menuRows": "menuRows_2098199083",
271
+ "body": "body_2098199083",
272
+ "menuCard": "menuCard_2098199083",
273
+ "menuToolbar": "menuToolbar_2098199083",
274
+ "menuToolButton": "menuToolButton_2098199083",
275
+ "menuToolButtonRunning": "menuToolButtonRunning_2098199083",
276
+ "menuMain": "menuMain_2098199083",
277
+ "menuHeading": "menuHeading_2098199083",
278
+ "menuRow": "menuRow_2098199083",
279
+ "menuRowLocked": "menuRowLocked_2098199083",
280
+ "menuRowSelected": "menuRowSelected_2098199083",
281
+ "menuRowPicked": "menuRowPicked_2098199083",
282
+ "menuRowLabel": "menuRowLabel_2098199083",
283
+ "menuRowArrow": "menuRowArrow_2098199083",
284
+ "menuSearchMark": "menuSearchMark_2098199083",
285
+ "menuGroup": "menuGroup_2098199083",
286
+ "menuGroupTop": "menuGroupTop_2098199083",
287
+ "menuGroupLabel": "menuGroupLabel_2098199083",
288
+ "menuGroupChevron": "menuGroupChevron_2098199083",
289
+ "menuGroupChevronOpen": "menuGroupChevronOpen_2098199083",
290
+ "menuGroupCount": "menuGroupCount_2098199083",
291
+ "menuEmpty": "menuEmpty_2098199083",
292
+ "menuSearchWrap": "menuSearchWrap_2098199083",
293
+ "menuSearch": "menuSearch_2098199083",
294
+ "menuToolButtonOn": "menuToolButtonOn_2098199083",
295
+ "menuCreate": "menuCreate_2098199083",
296
+ "menuCreateHintBad": "menuCreateHintBad_2098199083"
252
297
  };
253
298
  //#endregion
254
299
  //#region src/client/BranchMenu.tsx
@@ -256,8 +301,9 @@ window.__ModuleLoader__.load({
256
301
  * BranchMenu: the branch picker popup anchored to the composer branch chip.
257
302
  * The base Menu primitive exposes neither a height cap nor a search field,
258
303
  * so with many branches its portal list fills the viewport — this popup
259
- * replaces it with an owner-styled card: Menu's card chrome (r12, inverted
260
- * hairline, shadow-lv3, --dsw-specific-menu, see .menuCard) on a
304
+ * replaces it with an owner-styled card: Menu's card chrome (r20,
305
+ * elevation-prominent hairline, --dsw-specific-menu, see .menuCard;
306
+ * alpha.3 hosts fall back to shadow-lv3) on a
261
307
  * portal-fixed posture, with owner requirements baked in:
262
308
  *
263
309
  * 1. the card is capped at min(420px, 60vh) and only the branch rows
@@ -1776,8 +1822,9 @@ window.__ModuleLoader__.load({
1776
1822
  }), document.body);
1777
1823
  }
1778
1824
  /** The tool-row entry registered into conversation.input.left. */
1779
- function BranchChipDock({ session, sessionId, useSessions, adoptWorktree, t }) {
1780
- const cwd = useSessions((state) => state.byId[sessionId])?.cwd;
1825
+ function BranchChipDock({ sessionId, useSession, adoptWorktree, sessionsList, t }) {
1826
+ const blank = useSession((snapshot) => snapshot.blank);
1827
+ const cwd = (0, react.useSyncExternalStore)(sessionsList.subscribe, () => sessionsList.getSnapshot().byId[sessionId])?.cwd;
1781
1828
  const [repo, refresh] = useRepoStatus(cwd);
1782
1829
  const [menuOpen, setMenuOpen] = (0, react.useState)(false);
1783
1830
  const [worktreeMode, setWorktreeMode] = (0, react.useState)(false);
@@ -1797,11 +1844,11 @@ window.__ModuleLoader__.load({
1797
1844
  setMenuOpen(false);
1798
1845
  }, [cwd]);
1799
1846
  (0, react.useEffect)(() => {
1800
- if (!session.blank) {
1847
+ if (!blank) {
1801
1848
  setWorktreeMode(false);
1802
1849
  setConfirm((current) => current !== null && current.kind !== "switch" ? null : current);
1803
1850
  }
1804
- }, [session.blank]);
1851
+ }, [blank]);
1805
1852
  (0, react.useEffect)(() => {
1806
1853
  const refreshIfIdle = () => {
1807
1854
  if (busyRef.current) return;
@@ -1968,7 +2015,7 @@ window.__ModuleLoader__.load({
1968
2015
  const inLinkedWorktree = facts !== null && facts.worktrees.find((w) => w.main)?.path !== facts.repoRoot;
1969
2016
  const rows = (0, react.useMemo)(() => {
1970
2017
  if (facts === null) return [];
1971
- if (inLinkedWorktree && !session.blank) {
2018
+ if (inLinkedWorktree && !blank) {
1972
2019
  const current = facts.branches.find((b) => b.kind === "local" && b.name === facts.currentBranch);
1973
2020
  return current === void 0 ? [] : [{
1974
2021
  name: current.name,
@@ -1981,7 +2028,7 @@ window.__ModuleLoader__.load({
1981
2028
  }, [
1982
2029
  facts,
1983
2030
  inLinkedWorktree,
1984
- session.blank
2031
+ blank
1985
2032
  ]);
1986
2033
  const localNames = (0, react.useMemo)(() => rows.filter((row) => row.kind !== "remote").map((row) => row.name), [rows]);
1987
2034
  if (facts === null) return null;
@@ -2032,7 +2079,7 @@ window.__ModuleLoader__.load({
2032
2079
  className: BranchChip_module_default.branch,
2033
2080
  children: displayBranch(facts.currentBranch)
2034
2081
  })]
2035
- }), session.blank && !inLinkedWorktree && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2082
+ }), blank && !inLinkedWorktree && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2036
2083
  className: BranchChip_module_default.divider,
2037
2084
  "aria-hidden": "true"
2038
2085
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
@@ -2068,7 +2115,7 @@ window.__ModuleLoader__.load({
2068
2115
  currentBranch: facts.currentBranch,
2069
2116
  confirm: confirmBundle,
2070
2117
  canCreate: !worktreeMode && !inLinkedWorktree,
2071
- canAdopt: session.blank,
2118
+ canAdopt: blank,
2072
2119
  busy,
2073
2120
  onCreate: (name) => {
2074
2121
  doCreateBranch(name);
@@ -2326,8 +2373,8 @@ window.__ModuleLoader__.load({
2326
2373
  });
2327
2374
  }
2328
2375
  //#endregion
2329
- //#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\GitWorktreeCard.module.css?inline
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.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";
2376
+ //#region \0git-worktree-css:C:\Users\OYW\.dsh\gitworktree\dsh-worktree-feature-0.1.2-alpha.5\src\client\GitWorktreeCard.module.css?inline
2377
+ 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_1542936780 {\n list-style: none;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: 16px;\n background: var(--dsw-alias-bg-layer-3);\n transition: border-color .16s, background .16s;\n}\n\n.card_1542936780: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_1542936780 {\n background: var(--dsw-alias-bg-layer-2);\n border-color: var(--dsw-alias-label-dimmed);\n}\n\n.header_1542936780 {\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_1542936780: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_1542936780 {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.name_1542936780 {\n font-size: 15px;\n font-weight: 600;\n line-height: 1.4;\n color: var(--dsw-alias-label-primary);\n}\n\n.description_1542936780 {\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_1542936780 {\n flex: none;\n border-radius: 999px;\n corner-shape: round;\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_1542936780 {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n transition: transform .16s;\n}\n\n.chevronOpen_1542936780 {\n transform: rotate(180deg);\n}\n\n.body_1542936780 {\n border-top: 0.5px 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_1542936780 {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.field_1542936780 {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.fieldLabel_1542936780 {\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-secondary);\n}\n\n.input_1542936780 {\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: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: 6px;\n appearance: none;\n}\n\n.input_1542936780:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: -1px;\n}\n\n.input_1542936780:disabled {\n opacity: 0.6;\n}\n\n/* The directory control and its native-dialog launcher share one row. */\n.inputRow_1542936780 {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.inputRow_1542936780 .input_1542936780 {\n flex: 1;\n min-width: 0;\n}\n\n.browse_1542936780 {\n appearance: none;\n flex: none;\n border: 0.5px solid var(--dsw-alias-border-l3);\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_1542936780:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n border-color: var(--dsw-alias-label-dimmed);\n}\n\n.browse_1542936780:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n.browse_1542936780:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\n.hint_1542936780 {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.footer_1542936780 {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n padding: 8px 0 4px;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n.failed_1542936780 {\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_1542936780,\n.save_1542936780 {\n appearance: none;\n border: 0.5px 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_1542936780 {\n border-color: var(--dsw-alias-border-l2);\n background: none;\n color: var(--dsw-alias-label-secondary);\n}\n\n.discard_1542936780:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n border-color: var(--dsw-alias-label-dimmed);\n}\n\n.save_1542936780 {\n background: var(--dsw-alias-label-primary);\n color: var(--dsw-alias-bg-layer-3);\n}\n\n.discard_1542936780:disabled,\n.save_1542936780:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n.discard_1542936780:focus-visible,\n.save_1542936780: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_1542936780 {\n margin-top: 10px;\n flex-direction: row;\n align-items: flex-start;\n gap: 10px;\n}\n\n.toggleText_1542936780 {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.toggleLabel_1542936780 {\n color: var(--dsw-alias-label-primary);\n font-weight: 500;\n}\n\n.toggleMark_1542936780 {\n margin-left: 4px;\n font-weight: 400;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.toggleHint_1542936780 {\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.toggleNote_1542936780 {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.toggleControl_1542936780 {\n display: flex;\n align-items: center;\n gap: 6px;\n flex: none;\n margin-top: 2px;\n}\n\n.spinner_1542936780 {\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_1542936780 {\n width: 16px;\n height: 16px;\n accent-color: var(--dsw-alias-brand-primary);\n cursor: pointer;\n}\n\n.toggle_1542936780:disabled {\n cursor: progress;\n}\n";
2331
2378
  const tagId$2 = "@laoyuehanni/dsh-git-worktree/GitWorktreeCard.module.css";
2332
2379
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId$2 + "\"]") === null) {
2333
2380
  const tag = document.createElement("style");
@@ -2337,36 +2384,36 @@ window.__ModuleLoader__.load({
2337
2384
  document.head.appendChild(tag);
2338
2385
  }
2339
2386
  var GitWorktreeCard_module_default = {
2340
- "card": "card_1712176718",
2341
- "cardOpen": "cardOpen_1712176718",
2342
- "header": "header_1712176718",
2343
- "headText": "headText_1712176718",
2344
- "name": "name_1712176718",
2345
- "description": "description_1712176718",
2346
- "pending": "pending_1712176718",
2347
- "chevron": "chevron_1712176718",
2348
- "chevronOpen": "chevronOpen_1712176718",
2349
- "body": "body_1712176718",
2350
- "note": "note_1712176718",
2351
- "field": "field_1712176718",
2352
- "fieldLabel": "fieldLabel_1712176718",
2353
- "input": "input_1712176718",
2354
- "inputRow": "inputRow_1712176718",
2355
- "browse": "browse_1712176718",
2356
- "hint": "hint_1712176718",
2357
- "footer": "footer_1712176718",
2358
- "failed": "failed_1712176718",
2359
- "discard": "discard_1712176718",
2360
- "save": "save_1712176718",
2361
- "toggleRow": "toggleRow_1712176718",
2362
- "toggleText": "toggleText_1712176718",
2363
- "toggleLabel": "toggleLabel_1712176718",
2364
- "toggleMark": "toggleMark_1712176718",
2365
- "toggleHint": "toggleHint_1712176718",
2366
- "toggleNote": "toggleNote_1712176718",
2367
- "toggleControl": "toggleControl_1712176718",
2368
- "spinner": "spinner_1712176718",
2369
- "toggle": "toggle_1712176718"
2387
+ "card": "card_1542936780",
2388
+ "cardOpen": "cardOpen_1542936780",
2389
+ "header": "header_1542936780",
2390
+ "headText": "headText_1542936780",
2391
+ "name": "name_1542936780",
2392
+ "description": "description_1542936780",
2393
+ "pending": "pending_1542936780",
2394
+ "chevron": "chevron_1542936780",
2395
+ "chevronOpen": "chevronOpen_1542936780",
2396
+ "body": "body_1542936780",
2397
+ "note": "note_1542936780",
2398
+ "field": "field_1542936780",
2399
+ "fieldLabel": "fieldLabel_1542936780",
2400
+ "input": "input_1542936780",
2401
+ "inputRow": "inputRow_1542936780",
2402
+ "browse": "browse_1542936780",
2403
+ "hint": "hint_1542936780",
2404
+ "footer": "footer_1542936780",
2405
+ "failed": "failed_1542936780",
2406
+ "discard": "discard_1542936780",
2407
+ "save": "save_1542936780",
2408
+ "toggleRow": "toggleRow_1542936780",
2409
+ "toggleText": "toggleText_1542936780",
2410
+ "toggleLabel": "toggleLabel_1542936780",
2411
+ "toggleMark": "toggleMark_1542936780",
2412
+ "toggleHint": "toggleHint_1542936780",
2413
+ "toggleNote": "toggleNote_1542936780",
2414
+ "toggleControl": "toggleControl_1542936780",
2415
+ "spinner": "spinner_1542936780",
2416
+ "toggle": "toggle_1542936780"
2370
2417
  };
2371
2418
  //#endregion
2372
2419
  //#region src/client/GitWorktreeCard.tsx
@@ -2722,6 +2769,110 @@ window.__ModuleLoader__.load({
2722
2769
  localStorage.setItem(VIEW_STORAGE_KEY, JSON.stringify(prefs));
2723
2770
  } catch {}
2724
2771
  }
2772
+ /** localStorage key of the grouping switch's last-known value (browser-local). */
2773
+ const GROUP_BOOT_STORAGE_KEY = "dsh-git-worktree.sidebar.groupSidebar";
2774
+ /**
2775
+ * Read the grouping switch's last-known value. The seat mounts from this on
2776
+ * startup so the sidebar renders grouped IMMEDIATELY, without waiting for the
2777
+ * settings document to cross from the Host — the settings scope is the
2778
+ * authority and corrects a stale value once it lands. undefined = no record
2779
+ * (first visit; the composition default "on" is used).
2780
+ */
2781
+ function loadGroupSidebarBoot() {
2782
+ if (typeof localStorage === "undefined") return void 0;
2783
+ try {
2784
+ const raw = localStorage.getItem(GROUP_BOOT_STORAGE_KEY);
2785
+ if (raw === "1") return true;
2786
+ if (raw === "0") return false;
2787
+ return;
2788
+ } catch {
2789
+ return;
2790
+ }
2791
+ }
2792
+ /** Persist the grouping switch's last-known value; write failures stay silent. */
2793
+ function saveGroupSidebarBoot(enabled) {
2794
+ if (typeof localStorage === "undefined") return;
2795
+ try {
2796
+ localStorage.setItem(GROUP_BOOT_STORAGE_KEY, enabled ? "1" : "0");
2797
+ } catch {}
2798
+ }
2799
+ /** localStorage key of the last successful /group facts batch (browser-local). */
2800
+ const FACTS_STORAGE_KEY = "dsh-git-worktree.sidebar.facts.v1";
2801
+ /** Parse one WorkspaceGitFacts value; undefined = malformed. */
2802
+ function parseWorkspaceGitFacts(value) {
2803
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
2804
+ const record = value;
2805
+ if (typeof record.repoRoot !== "string" || record.repoRoot === "") return void 0;
2806
+ if (typeof record.repoName !== "string") return void 0;
2807
+ if (record.branch !== null && typeof record.branch !== "string") return void 0;
2808
+ if (typeof record.main !== "boolean") return void 0;
2809
+ return {
2810
+ repoRoot: record.repoRoot,
2811
+ repoName: record.repoName,
2812
+ branch: record.branch,
2813
+ main: record.main
2814
+ };
2815
+ }
2816
+ /** Parse a facts map; any malformed entry discards the whole batch. */
2817
+ function parseFactsRecord(value) {
2818
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
2819
+ const out = {};
2820
+ for (const [key, entry] of Object.entries(value)) {
2821
+ if (entry === null) {
2822
+ out[key] = null;
2823
+ continue;
2824
+ }
2825
+ const parsed = parseWorkspaceGitFacts(entry);
2826
+ if (parsed === void 0) return null;
2827
+ out[key] = parsed;
2828
+ }
2829
+ return out;
2830
+ }
2831
+ /**
2832
+ * Read the last successful /group facts batch. The sidebar consults this
2833
+ * whenever the workspace path signature is known (including the frame the
2834
+ * pending-empty baseline becomes the real list), so a page refresh never
2835
+ * flashes the degraded flat list while git probes run; the fresh probe
2836
+ * overwrites both the view and this cache. A poisoned entry (wrong value
2837
+ * shape) discards the whole batch rather than grouping under `repo:undefined`.
2838
+ */
2839
+ function loadFactsCache() {
2840
+ if (typeof localStorage === "undefined") return null;
2841
+ try {
2842
+ const raw = localStorage.getItem(FACTS_STORAGE_KEY);
2843
+ if (raw === null) return null;
2844
+ const parsed = JSON.parse(raw);
2845
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return null;
2846
+ const record = parsed;
2847
+ if (typeof record.signature !== "string") return null;
2848
+ const facts = parseFactsRecord(record.facts);
2849
+ if (facts === null) return null;
2850
+ return {
2851
+ signature: record.signature,
2852
+ facts
2853
+ };
2854
+ } catch {
2855
+ return null;
2856
+ }
2857
+ }
2858
+ /**
2859
+ * Pick the facts batch that belongs to `signature`. Live (in-memory) hits
2860
+ * win; otherwise a matching cache batch. The grouped tree must paint the
2861
+ * moment the workspace path set is known — not only at `useState` init,
2862
+ * when the list is still the pending empty snapshot (signature `""`).
2863
+ */
2864
+ function factsForSignature(signature, live, cached) {
2865
+ if (live !== null && live.signature === signature) return live;
2866
+ if (cached !== null && cached.signature === signature) return cached;
2867
+ return null;
2868
+ }
2869
+ /** Persist one /group facts batch; write failures (quota, privacy mode) stay silent. */
2870
+ function saveFactsCache(entry) {
2871
+ if (typeof localStorage === "undefined") return;
2872
+ try {
2873
+ localStorage.setItem(FACTS_STORAGE_KEY, JSON.stringify(entry));
2874
+ } catch {}
2875
+ }
2725
2876
  /** Recency comparator: newest first, id as the deterministic tiebreak. */
2726
2877
  function byRecency(a, b) {
2727
2878
  if (b.updatedAt !== a.updatedAt) return b.updatedAt - a.updatedAt;
@@ -2817,6 +2968,57 @@ window.__ModuleLoader__.load({
2817
2968
  }));
2818
2969
  return rows.map((session) => sessionNode(session, descendants));
2819
2970
  }
2971
+ /**
2972
+ * Derive the stray-session clusters: sessions no workspace account holds
2973
+ * (a deleted-then-recreated registration's leftovers, or history that
2974
+ * appeared after first-boot grouping), clustered by their header cwd into
2975
+ * VIRTUAL directory groups. The same visibility rule as everywhere else
2976
+ * applies (archived hidden, subagent rows never listed, a blank visible
2977
+ * only while it IS the current selection — deleting the current session's
2978
+ * workspace registration must not make it vanish).
2979
+ *
2980
+ * Matching against registered workspace paths is case-insensitive
2981
+ * (NTFS): one directory must never split into two clusters because of
2982
+ * casing drift between a session header and the registry's realpath.
2983
+ * @param items - workspace list items (their `sessionIds` projection IS the
2984
+ * accounting; the registry guarantees one record per canonical path).
2985
+ * @param sessions - session list snapshot.
2986
+ * @param archivedSessionIds - registry-global archive set.
2987
+ * @returns stray groups in first-appearance order; empty when nothing is loose.
2988
+ */
2989
+ function deriveStrayGroups(items, sessions, archivedSessionIds) {
2990
+ const accounted = new Set(items.flatMap((workspace) => workspace.sessionIds));
2991
+ const registered = /* @__PURE__ */ new Map();
2992
+ for (const workspace of items) {
2993
+ const key = workspace.path.toLowerCase();
2994
+ if (!registered.has(key)) registered.set(key, workspace.title);
2995
+ }
2996
+ const archived = new Set(archivedSessionIds);
2997
+ const clusters = /* @__PURE__ */ new Map();
2998
+ for (const id of sessions.ids) {
2999
+ if (accounted.has(id)) continue;
3000
+ const summary = sessions.byId[id];
3001
+ if (summary === void 0) continue;
3002
+ if (summary.origin === "subagent") continue;
3003
+ if (archived.has(id)) continue;
3004
+ if (summary.blank && id !== sessions.current) continue;
3005
+ const path = summary.cwd ?? "";
3006
+ const key = `stray:${path === "" ? "?" : path.toLowerCase()}`;
3007
+ const existing = clusters.get(key);
3008
+ if (existing === void 0) clusters.set(key, {
3009
+ kind: "stray",
3010
+ key,
3011
+ path,
3012
+ belongsTo: path === "" ? void 0 : registered.get(path.toLowerCase()),
3013
+ sessions: [summary]
3014
+ });
3015
+ else clusters.set(key, {
3016
+ ...existing,
3017
+ sessions: [...existing.sessions, summary]
3018
+ });
3019
+ }
3020
+ return [...clusters.values()];
3021
+ }
2820
3022
  /** Display label for the ungrouped bucket row. */
2821
3023
  const UNGROUPED_LABEL = "Ungrouped";
2822
3024
  /**
@@ -2972,8 +3174,33 @@ window.__ModuleLoader__.load({
2972
3174
  };
2973
3175
  }
2974
3176
  //#endregion
2975
- //#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\sidebar-rows.module.css?inline
2976
- 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.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";
3177
+ //#region node_modules/.pnpm/@deepseek-ai+dsh-util-works_6e61a435a33302346cc90b5c6544222a/node_modules/@deepseek-ai/dsh-util-workspace-path/lib/index.js
3178
+ /**
3179
+ * Browser-safe Workspace path and display helpers.
3180
+ * @module @deepseek-ai/dsh-util-workspace-path
3181
+ */
3182
+ /** Whether a path uses a Windows drive or UNC prefix. */
3183
+ function isWindowsStylePath(value) {
3184
+ return /^[A-Za-z]:[/\\]/.test(value) || value.startsWith("\\\\");
3185
+ }
3186
+ /**
3187
+ * Abbreviate a POSIX home directory for display.
3188
+ * @param path - Absolute or already-short display path.
3189
+ * @param home - Host account home; absent skips abbreviation.
3190
+ * @returns `~` or `~/…` for the POSIX home and its descendants, otherwise `path`.
3191
+ */
3192
+ function abbreviateHomePath(path, home) {
3193
+ if (home === void 0 || home === "") return path;
3194
+ if (isWindowsStylePath(path) || isWindowsStylePath(home)) return path;
3195
+ const root = home.replace(/\/+$/, "");
3196
+ if (root === "" || root === "/") return path;
3197
+ if (path.replace(/\/+$/, "") === root) return "~";
3198
+ if (path.startsWith(`${root}/`)) return `~${path.slice(root.length)}`;
3199
+ return path;
3200
+ }
3201
+ //#endregion
3202
+ //#region \0git-worktree-css:C:\Users\OYW\.dsh\gitworktree\dsh-worktree-feature-0.1.2-alpha.5\src\client\sidebar-rows.module.css?inline
3203
+ const css$1 = "/* Native Rows.module_667592273.css_667592273 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_667592273,\n.sessionRow_667592273 {\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_667592273:hover,\n.sessionRow_667592273:hover,\n.sessionRow_667592273.selected_667592273 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.searchResultRow_667592273 {\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_667592273:hover,\n.searchResultRow_667592273.selected_667592273 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.searchResultHeading_667592273 {\n align-items: center;\n min-width: 0;\n display: flex;\n}\n\n.searchResultTitle_667592273 {\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_667592273 {\n align-items: center;\n gap: 6px;\n min-width: 0;\n margin-left: 20px;\n display: flex;\n}\n\n.searchResultWorkspace_667592273,\n.searchResultSnippet_667592273 {\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 12px;\n line-height: 17px;\n overflow: hidden;\n}\n\n.searchResultWorkspace_667592273 {\n max-width: 40%;\n color: var(--dsw-alias-label-tertiary);\n flex: none;\n}\n\n.searchResultSnippet_667592273 {\n min-width: 0;\n color: var(--dsw-alias-label-secondary);\n flex: 1;\n}\n\n.projectRow_667592273 {\n box-sizing: border-box;\n align-items: center;\n height: 34px;\n}\n\n.projectRow_667592273 .rowActions_667592273 {\n height: 20px;\n}\n\n.sessionRow_667592273 {\n height: 32px;\n animation: row-in 0.15s var(--ds-ease-in-out);\n gap: 0;\n}\n\n.sessionRow_667592273 .title_667592273 {\n margin: 0 6px 0 4px;\n}\n\n.flatSessionRowWithoutStatus_667592273 .title_667592273 {\n margin-left: 0;\n}\n\n@keyframes row-in {\n 0% { opacity: 0; }\n}\n\n.slot_667592273 {\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_667592273 {\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_667592273 {\n color: var(--dsw-alias-state-business-primary);\n}\n\n.projectRow_667592273 .chevron_667592273 {\n display: none;\n}\n\n.projectRow_667592273:hover .chevron_667592273 {\n display: inline-flex;\n}\n\n.projectRow_667592273:hover .folder_667592273 {\n display: none;\n}\n\n.arrow_667592273 {\n transition: transform 0.15s var(--ds-ease-in-out);\n}\n\n.arrowOpen_667592273 {\n transform: rotate(90deg);\n}\n\n.projectText_667592273 {\n flex-direction: column;\n flex: 1;\n gap: 2px;\n min-width: 0;\n display: flex;\n}\n\n.title_667592273 {\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_667592273 .title_667592273 {\n color: var(--dsw-alias-label-secondary);\n}\n\n.renameInput_667592273 {\n border: 0.5px solid var(--dsw-alias-border-l4);\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_667592273 .title_667592273 {\n flex: 1;\n}\n\n.meta_667592273 {\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_667592273 {\n color: var(--dsw-alias-label-tertiary);\n flex: none;\n font-size: 12px;\n line-height: 20px;\n}\n\n.dot_667592273 {\n flex: none;\n}\n\n.rowActions_667592273 {\n flex: none;\n align-items: center;\n gap: 12px;\n display: none;\n}\n\n.projectRow_667592273:hover .rowActions_667592273,\n.sessionRow_667592273:hover .rowActions_667592273,\n.projectRow_667592273.menuOpen_667592273 .rowActions_667592273,\n.sessionRow_667592273.menuOpen_667592273 .rowActions_667592273 {\n display: inline-flex;\n}\n\n.sessionRow_667592273:hover .time_667592273,\n.sessionRow_667592273.menuOpen_667592273 .time_667592273 {\n display: none;\n}\n\n.projectRow_667592273.menuOpen_667592273,\n.sessionRow_667592273.menuOpen_667592273 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n/* P3: session drag insertion markers (unused in P2). */\n.sessionRow_667592273.dropBefore_667592273,\n.sessionRow_667592273.dropAfter_667592273 {\n position: relative;\n}\n\n.sessionRow_667592273.dropBefore_667592273:before,\n.sessionRow_667592273.dropAfter_667592273: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_667592273.dropBefore_667592273:before {\n top: -7px;\n}\n\n.sessionRow_667592273.dropAfter_667592273:after {\n bottom: -7px;\n}\n\n.hoverContent_667592273 {\n flex-direction: column;\n gap: 8px;\n display: flex;\n}\n\n.hoverTitle_667592273 {\n color: #fff;\n overflow-wrap: break-word;\n font-size: 14px;\n line-height: 20px;\n}\n\n.hoverPath_667592273 {\n color: #cfd3d6;\n word-break: break-all;\n font-size: 12px;\n line-height: 16px;\n}\n\n.hoverTime_667592273 {\n color: #cfd3d6;\n font-size: 12px;\n line-height: 16px;\n}\n\n.hoverStatus_667592273 {\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_667592273 {\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_667592273:hover {\n color: var(--dsw-alias-label-primary);\n}\n\n.chevron_667592273 {\n color: var(--dsw-alias-label-caption);\n}\n\n.repoCount_667592273 {\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_667592273,\n .arrow_667592273 {\n transition: none;\n animation: none;\n }\n}\n";
2977
3204
  const tagId$1 = "@laoyuehanni/dsh-git-worktree/sidebar-rows.module.css";
2978
3205
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId$1 + "\"]") === null) {
2979
3206
  const tag = document.createElement("style");
@@ -2983,42 +3210,43 @@ window.__ModuleLoader__.load({
2983
3210
  document.head.appendChild(tag);
2984
3211
  }
2985
3212
  var sidebar_rows_module_default = {
2986
- "module": "module_2050697429",
2987
- "css": "css_2050697429",
2988
- "projectRow": "projectRow_2050697429",
2989
- "sessionRow": "sessionRow_2050697429",
2990
- "selected": "selected_2050697429",
2991
- "searchResultRow": "searchResultRow_2050697429",
2992
- "searchResultHeading": "searchResultHeading_2050697429",
2993
- "searchResultTitle": "searchResultTitle_2050697429",
2994
- "searchResultMeta": "searchResultMeta_2050697429",
2995
- "searchResultWorkspace": "searchResultWorkspace_2050697429",
2996
- "searchResultSnippet": "searchResultSnippet_2050697429",
2997
- "rowActions": "rowActions_2050697429",
2998
- "title": "title_2050697429",
2999
- "flatSessionRowWithoutStatus": "flatSessionRowWithoutStatus_2050697429",
3000
- "slot": "slot_2050697429",
3001
- "visuallyHidden": "visuallyHidden_2050697429",
3002
- "folderActive": "folderActive_2050697429",
3003
- "chevron": "chevron_2050697429",
3004
- "folder": "folder_2050697429",
3005
- "arrow": "arrow_2050697429",
3006
- "arrowOpen": "arrowOpen_2050697429",
3007
- "projectText": "projectText_2050697429",
3008
- "renameInput": "renameInput_2050697429",
3009
- "meta": "meta_2050697429",
3010
- "time": "time_2050697429",
3011
- "dot": "dot_2050697429",
3012
- "menuOpen": "menuOpen_2050697429",
3013
- "dropBefore": "dropBefore_2050697429",
3014
- "dropAfter": "dropAfter_2050697429",
3015
- "hoverContent": "hoverContent_2050697429",
3016
- "hoverTitle": "hoverTitle_2050697429",
3017
- "hoverPath": "hoverPath_2050697429",
3018
- "hoverTime": "hoverTime_2050697429",
3019
- "hoverStatus": "hoverStatus_2050697429",
3020
- "iconButton": "iconButton_2050697429",
3021
- "repoCount": "repoCount_2050697429"
3213
+ "module": "module_667592273",
3214
+ "css": "css_667592273",
3215
+ "projectRow": "projectRow_667592273",
3216
+ "sessionRow": "sessionRow_667592273",
3217
+ "selected": "selected_667592273",
3218
+ "searchResultRow": "searchResultRow_667592273",
3219
+ "searchResultHeading": "searchResultHeading_667592273",
3220
+ "searchResultTitle": "searchResultTitle_667592273",
3221
+ "searchResultMeta": "searchResultMeta_667592273",
3222
+ "searchResultWorkspace": "searchResultWorkspace_667592273",
3223
+ "searchResultSnippet": "searchResultSnippet_667592273",
3224
+ "rowActions": "rowActions_667592273",
3225
+ "title": "title_667592273",
3226
+ "flatSessionRowWithoutStatus": "flatSessionRowWithoutStatus_667592273",
3227
+ "slot": "slot_667592273",
3228
+ "visuallyHidden": "visuallyHidden_667592273",
3229
+ "folderActive": "folderActive_667592273",
3230
+ "chevron": "chevron_667592273",
3231
+ "folder": "folder_667592273",
3232
+ "arrow": "arrow_667592273",
3233
+ "arrowOpen": "arrowOpen_667592273",
3234
+ "projectText": "projectText_667592273",
3235
+ "strayRow": "strayRow_667592273",
3236
+ "renameInput": "renameInput_667592273",
3237
+ "meta": "meta_667592273",
3238
+ "time": "time_667592273",
3239
+ "dot": "dot_667592273",
3240
+ "menuOpen": "menuOpen_667592273",
3241
+ "dropBefore": "dropBefore_667592273",
3242
+ "dropAfter": "dropAfter_667592273",
3243
+ "hoverContent": "hoverContent_667592273",
3244
+ "hoverTitle": "hoverTitle_667592273",
3245
+ "hoverPath": "hoverPath_667592273",
3246
+ "hoverTime": "hoverTime_667592273",
3247
+ "hoverStatus": "hoverStatus_667592273",
3248
+ "iconButton": "iconButton_667592273",
3249
+ "repoCount": "repoCount_667592273"
3022
3250
  };
3023
3251
  //#endregion
3024
3252
  //#region src/client/sidebar-rows.tsx
@@ -3064,16 +3292,25 @@ window.__ModuleLoader__.load({
3064
3292
  function ProjectRowItem({ row, onToggle, onCreate, actions, home, t, badge }) {
3065
3293
  const active = row.expanded && row.containsCurrent;
3066
3294
  const [menuOpen, setMenuOpen] = (0, react.useState)(false);
3067
- const workspaceMenuItems = [{
3068
- id: "rename",
3069
- label: t("rename"),
3070
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, {})
3071
- }, {
3072
- id: "delete",
3073
- label: t("delete.workspace"),
3074
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, {}),
3075
- danger: true
3076
- }];
3295
+ const workspaceMenuItems = [
3296
+ {
3297
+ id: "rename",
3298
+ label: t("rename"),
3299
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, {})
3300
+ },
3301
+ ...actions?.removeWorktree !== void 0 ? [{
3302
+ id: "removeWorktree",
3303
+ label: t("worktreeRemove.menu"),
3304
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, {}),
3305
+ danger: true
3306
+ }] : [],
3307
+ {
3308
+ id: "delete",
3309
+ label: t("delete.workspace"),
3310
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, {}),
3311
+ danger: true
3312
+ }
3313
+ ];
3077
3314
  const ownRow = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3078
3315
  className: cx$1(sidebar_rows_module_default.projectRow, menuOpen && sidebar_rows_module_default.menuOpen),
3079
3316
  role: "treeitem",
@@ -3109,9 +3346,9 @@ window.__ModuleLoader__.load({
3109
3346
  items: workspaceMenuItems,
3110
3347
  onSelect: (id) => {
3111
3348
  setMenuOpen(false);
3112
- if (id !== "rename" && id !== "delete") return;
3113
3349
  if (id === "rename") actions.rename();
3114
- else actions.delete();
3350
+ else if (id === "removeWorktree") actions.removeWorktree?.();
3351
+ else if (id === "delete") actions.delete();
3115
3352
  },
3116
3353
  portal: true,
3117
3354
  closeOnPointerLeave: true,
@@ -3143,7 +3380,7 @@ window.__ModuleLoader__.load({
3143
3380
  anchor: ownRow,
3144
3381
  content: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorkspaceHoverContent, {
3145
3382
  label: row.label,
3146
- cwd: row.cwd === void 0 ? void 0 : (0, _deepseek_ai_dsh_client_runtime_client.abbreviateHomePath)(row.cwd, home),
3383
+ cwd: row.cwd === void 0 ? void 0 : abbreviateHomePath(row.cwd, home),
3147
3384
  createdAt: row.createdAt,
3148
3385
  t
3149
3386
  }),
@@ -3156,6 +3393,146 @@ window.__ModuleLoader__.load({
3156
3393
  function assertNever(value) {
3157
3394
  throw new Error(`unknown pending interaction: ${String(value)}`);
3158
3395
  }
3396
+ /** Final path segment of an absolute directory ('' for the unknown-cwd cluster). */
3397
+ function pathBasename(path) {
3398
+ if (path === "") return "";
3399
+ const parts = path.split(/[\\/]/);
3400
+ return parts[parts.length - 1] ?? "";
3401
+ }
3402
+ /**
3403
+ * Dashed folder glyph for virtual (unregistered) directory rows. The icon set
3404
+ * ships no dashed variant, so this follows the WorktreeCheck precedent of a
3405
+ * module-local SVG: at 16px a dash pattern is a far stronger "directory-shaped
3406
+ * but not a registered workspace" mark than the outline/solid stroke contrast
3407
+ * it replaces.
3408
+ */
3409
+ function StrayFolderGlyph({ size = 16 }) {
3410
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
3411
+ width: size,
3412
+ height: size,
3413
+ viewBox: "0 0 16 16",
3414
+ fill: "none",
3415
+ "aria-hidden": "true",
3416
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
3417
+ 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",
3418
+ stroke: "currentColor",
3419
+ strokeWidth: "1.15",
3420
+ strokeDasharray: "2 1.6",
3421
+ strokeLinejoin: "round",
3422
+ strokeLinecap: "round"
3423
+ })
3424
+ });
3425
+ }
3426
+ /**
3427
+ * One virtual directory row of the stray (Ungrouped) section: DASHED folder
3428
+ * (the real workspace rows' folder is solid — the dash pattern is the
3429
+ * at-a-glance "this directory is not a registered workspace" mark) +
3430
+ * directory basename + session-count badge; hover reveals the full path plus
3431
+ * one guidance line — ownership when a registered workspace holds the
3432
+ * directory, or the rebuild hint when it is a missing worktree storage slot.
3433
+ * The ⋯ menu carries exactly one action: register (directory probed real and
3434
+ * unregistered) or rebuild (missing but host-confirmed as a storage slot).
3435
+ */
3436
+ function StrayGroupRow({ path, belongsTo, count, expanded, onToggle, onRegister, registering, onRebuild, rebuilding, missingDir, worktreeSlot, home, t }) {
3437
+ const [menuOpen, setMenuOpen] = (0, react.useState)(false);
3438
+ const label = path === "" ? t("stray.unknown") : pathBasename(path);
3439
+ const items = onRegister !== void 0 ? [{
3440
+ id: "register",
3441
+ label: t("stray.register"),
3442
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpen16, {})
3443
+ }] : onRebuild !== void 0 ? [{
3444
+ id: "rebuild",
3445
+ label: t("stray.rebuild"),
3446
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpen16, {})
3447
+ }] : [];
3448
+ const row = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3449
+ className: cx$1(sidebar_rows_module_default.projectRow, sidebar_rows_module_default.strayRow, menuOpen && sidebar_rows_module_default.menuOpen),
3450
+ role: "treeitem",
3451
+ "aria-expanded": expanded,
3452
+ onClick: onToggle,
3453
+ children: [
3454
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3455
+ className: cx$1(sidebar_rows_module_default.slot, sidebar_rows_module_default.folder),
3456
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StrayFolderGlyph, {})
3457
+ }),
3458
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3459
+ className: cx$1(sidebar_rows_module_default.slot, sidebar_rows_module_default.chevron),
3460
+ 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) })
3461
+ }),
3462
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3463
+ className: sidebar_rows_module_default.projectText,
3464
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3465
+ className: sidebar_rows_module_default.title,
3466
+ children: label
3467
+ })
3468
+ }),
3469
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3470
+ className: sidebar_rows_module_default.repoCount,
3471
+ children: String(count)
3472
+ }),
3473
+ items.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3474
+ className: sidebar_rows_module_default.rowActions,
3475
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
3476
+ open: menuOpen,
3477
+ onClose: () => {
3478
+ setMenuOpen(false);
3479
+ },
3480
+ items,
3481
+ onSelect: (id) => {
3482
+ setMenuOpen(false);
3483
+ if (id === "register") onRegister?.();
3484
+ if (id === "rebuild") onRebuild?.();
3485
+ },
3486
+ portal: true,
3487
+ closeOnPointerLeave: true,
3488
+ anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3489
+ type: "button",
3490
+ className: sidebar_rows_module_default.iconButton,
3491
+ "aria-label": onRegister !== void 0 ? t("stray.register.aria", { name: label }) : t("stray.rebuild.aria", { name: label }),
3492
+ disabled: registering === true || rebuilding === true,
3493
+ onClick: (e) => {
3494
+ e.stopPropagation();
3495
+ setMenuOpen((v) => !v);
3496
+ },
3497
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEllipsisOutline16, {})
3498
+ })
3499
+ })
3500
+ })
3501
+ ]
3502
+ });
3503
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.HoverCard, {
3504
+ anchor: row,
3505
+ content: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3506
+ className: sidebar_rows_module_default.hoverContent,
3507
+ children: [
3508
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3509
+ className: sidebar_rows_module_default.hoverTitle,
3510
+ children: label
3511
+ }),
3512
+ path !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3513
+ className: sidebar_rows_module_default.hoverPath,
3514
+ children: abbreviateHomePath(path, home)
3515
+ }),
3516
+ belongsTo !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3517
+ className: sidebar_rows_module_default.hoverStatus,
3518
+ children: t("stray.belongsTo", { name: belongsTo })
3519
+ }),
3520
+ missingDir === true && worktreeSlot === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3521
+ className: sidebar_rows_module_default.hoverStatus,
3522
+ children: t("stray.worktreeSlot")
3523
+ }),
3524
+ missingDir === true && worktreeSlot !== true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3525
+ className: sidebar_rows_module_default.hoverStatus,
3526
+ children: t("stray.missingDir")
3527
+ })
3528
+ ]
3529
+ }),
3530
+ disabled: menuOpen,
3531
+ copyText: path === "" ? void 0 : path,
3532
+ copyLabel: t("copy"),
3533
+ copiedLabel: t("hover.copied")
3534
+ });
3535
+ }
3159
3536
  /** Session status presentation; pending interaction is primary and live activity outranks completion. */
3160
3537
  function sessionStatuses(node, t) {
3161
3538
  const subagents = node.runningSubagentCount === 0 ? void 0 : {
@@ -3425,8 +3802,8 @@ window.__ModuleLoader__.load({
3425
3802
  return reason instanceof Error ? reason.message : String(reason);
3426
3803
  }
3427
3804
  //#endregion
3428
- //#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\GroupedSidebar.module.css?inline
3429
- 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.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";
3805
+ //#region \0git-worktree-css:C:\Users\OYW\.dsh\gitworktree\dsh-worktree-feature-0.1.2-alpha.5\src\client\GroupedSidebar.module.css?inline
3806
+ const css = "/* Native WorkspaceBrowser.module_871918107.css_871918107 + WorkspacePicker.module_871918107.css_871918107 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_871918107 {\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_871918107.rail_871918107 {\n padding-right: 0;\n}\n\n.iconButton_871918107 {\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 corner-shape: round;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.iconButton_871918107:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.sectionHeader_871918107 {\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_871918107:not(.rail_871918107) .sectionHeader_871918107 {\n margin-top: 2px;\n margin-right: -4px;\n}\n\n.sectionLabel_871918107 {\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_871918107 {\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_871918107 {\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_871918107 {\n max-width: 100%;\n padding-left: 0;\n}\n\n.headerActions_871918107 {\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_871918107 {\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_871918107 {\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 corner-shape: round;\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_871918107 {\n border: 0.5px solid var(--dsw-alias-border-l4);\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_871918107 {\n cursor: pointer;\n width: 28px;\n height: 28px;\n color: inherit;\n background: 0 0;\n border: none;\n border-radius: 50%;\n corner-shape: round;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.searchExpanded_871918107 .searchButton_871918107 {\n width: 28px;\n height: 30px;\n}\n\n.searchButton_871918107:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.searchExpanded_871918107 .searchButton_871918107:hover {\n background: 0 0;\n}\n\n.searchInput_871918107 {\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_871918107 .searchInput_871918107 {\n opacity: 1;\n pointer-events: auto;\n margin-left: -2px;\n}\n\n.searchInput_871918107::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.clearButton_871918107 {\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 corner-shape: round;\n flex: none;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n}\n\n.clearButton_871918107:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.rail_871918107 .sectionHeader_871918107 {\n justify-content: flex-start;\n gap: 0;\n margin-bottom: 12px;\n padding-left: 0;\n}\n\n.rail_871918107 .headerActions_871918107 {\n max-width: none;\n}\n\n.rail_871918107 .iconButton_871918107 {\n width: 36px;\n height: 36px;\n color: var(--dsw-alias-label-primary);\n}\n\n.rail_871918107 .search_871918107 {\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_871918107 .searchButton_871918107 {\n width: 36px;\n height: 36px;\n color: var(--dsw-alias-label-primary);\n}\n\n.rail_871918107 .searchButton_871918107:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.listArea_871918107 {\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_871918107 .listArea_871918107 {\n margin-left: 0;\n margin-right: 0;\n padding-left: 0;\n}\n\n.treeBody_871918107 {\n flex-direction: column;\n flex: 1;\n min-height: 0;\n display: flex;\n position: relative;\n}\n\n.fade_871918107 {\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_871918107 {\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_871918107 {\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_871918107 > * + *,\n.searchTree_871918107 > [role=treeitem] + [role=treeitem],\n.groupSection_871918107 > * + * {\n margin-top: 2px;\n}\n\n.searchStatus_871918107,\n.searchWarning_871918107 {\n color: var(--dsw-alias-label-tertiary);\n padding: 10px 12px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.searchWarning_871918107 {\n color: var(--dsw-alias-label-secondary);\n}\n\n.groupSection_871918107 {\n position: relative;\n}\n\n.groupSection_871918107 + .groupSection_871918107 {\n margin-top: 4px;\n}\n\n/* P3: workspace drag insertion markers (unused in P2). */\n.listTopDropIndicator_871918107,\n.workspaceDropBefore_871918107:before,\n.workspaceDropAfter_871918107: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_871918107 {\n top: -8px;\n left: 0;\n right: var(--dsh-session-list-edge-inset);\n}\n\n.listTopDropActive_871918107 > .workspaceDropBefore_871918107:first-child:before {\n display: none;\n}\n\n.workspaceDropBefore_871918107:before {\n top: -8px;\n}\n\n.workspaceDropAfter_871918107:after {\n bottom: -8px;\n}\n\n.sessionOverflowButton_871918107 {\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_871918107 > .sessionOverflowButton_871918107 {\n margin-top: 0;\n}\n\n.sessionOverflowButton_871918107:hover {\n color: var(--dsw-alias-label-secondary);\n background: 0 0;\n}\n\n.empty_871918107 {\n color: var(--dsw-alias-label-tertiary);\n padding: 16px 12px;\n font-size: 13px;\n}\n\n.renameInput_871918107 {\n box-sizing: border-box;\n border: 0.5px solid var(--dsw-alias-border-l4);\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_871918107:disabled {\n color: var(--dsw-alias-label-dimmed);\n}\n\n.renameError_871918107 {\n color: var(--dsw-alias-state-error-primary);\n margin-top: 8px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.deleteAction_871918107:not(:disabled) {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.deleteStatus_871918107 {\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_871918107 {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin-top: 8px;\n}\n\n.removeFact_871918107 {\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.removeFactWarn_871918107 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.modalAction_871918107 {\n min-width: 72px;\n}\n\n.modalError_871918107,\n.menuStatus_871918107 {\n margin-top: 8px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.modalError_871918107 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.menuStatus_871918107 {\n color: var(--dsw-alias-label-secondary);\n}\n\n/* Aggregation overlay: indent member workspaces and their sessions. */\n.memberIndent_871918107 {\n margin-left: 16px;\n}\n\n.sessionsIndent_871918107 {\n margin-left: 8px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .wide_871918107 {\n animation: none;\n }\n\n .search_871918107,\n .sectionLabel_871918107,\n .searchSlot_871918107,\n .searchInput_871918107,\n .headerActions_871918107 {\n transition: none;\n }\n}\n";
3430
3807
  const tagId = "@laoyuehanni/dsh-git-worktree/GroupedSidebar.module.css";
3431
3808
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId + "\"]") === null) {
3432
3809
  const tag = document.createElement("style");
@@ -3436,48 +3813,51 @@ window.__ModuleLoader__.load({
3436
3813
  document.head.appendChild(tag);
3437
3814
  }
3438
3815
  var GroupedSidebar_module_default = {
3439
- "module": "module_1808205761",
3440
- "css": "css_1808205761",
3441
- "root": "root_1808205761",
3442
- "rail": "rail_1808205761",
3443
- "iconButton": "iconButton_1808205761",
3444
- "sectionHeader": "sectionHeader_1808205761",
3445
- "sectionLabel": "sectionLabel_1808205761",
3446
- "sectionLabelHidden": "sectionLabelHidden_1808205761",
3447
- "searchSlot": "searchSlot_1808205761",
3448
- "searchSlotExpanded": "searchSlotExpanded_1808205761",
3449
- "headerActions": "headerActions_1808205761",
3450
- "headerActionsHidden": "headerActionsHidden_1808205761",
3451
- "search": "search_1808205761",
3452
- "searchExpanded": "searchExpanded_1808205761",
3453
- "searchButton": "searchButton_1808205761",
3454
- "searchInput": "searchInput_1808205761",
3455
- "clearButton": "clearButton_1808205761",
3456
- "listArea": "listArea_1808205761",
3457
- "treeBody": "treeBody_1808205761",
3458
- "fade": "fade_1808205761",
3459
- "wide": "wide_1808205761",
3460
- "list": "list_1808205761",
3461
- "flatList": "flatList_1808205761",
3462
- "searchTree": "searchTree_1808205761",
3463
- "groupSection": "groupSection_1808205761",
3464
- "searchStatus": "searchStatus_1808205761",
3465
- "searchWarning": "searchWarning_1808205761",
3466
- "listTopDropIndicator": "listTopDropIndicator_1808205761",
3467
- "workspaceDropBefore": "workspaceDropBefore_1808205761",
3468
- "workspaceDropAfter": "workspaceDropAfter_1808205761",
3469
- "listTopDropActive": "listTopDropActive_1808205761",
3470
- "sessionOverflowButton": "sessionOverflowButton_1808205761",
3471
- "empty": "empty_1808205761",
3472
- "renameInput": "renameInput_1808205761",
3473
- "renameError": "renameError_1808205761",
3474
- "deleteAction": "deleteAction_1808205761",
3475
- "deleteStatus": "deleteStatus_1808205761",
3476
- "modalAction": "modalAction_1808205761",
3477
- "modalError": "modalError_1808205761",
3478
- "menuStatus": "menuStatus_1808205761",
3479
- "memberIndent": "memberIndent_1808205761",
3480
- "sessionsIndent": "sessionsIndent_1808205761"
3816
+ "module": "module_871918107",
3817
+ "css": "css_871918107",
3818
+ "root": "root_871918107",
3819
+ "rail": "rail_871918107",
3820
+ "iconButton": "iconButton_871918107",
3821
+ "sectionHeader": "sectionHeader_871918107",
3822
+ "sectionLabel": "sectionLabel_871918107",
3823
+ "sectionLabelHidden": "sectionLabelHidden_871918107",
3824
+ "searchSlot": "searchSlot_871918107",
3825
+ "searchSlotExpanded": "searchSlotExpanded_871918107",
3826
+ "headerActions": "headerActions_871918107",
3827
+ "headerActionsHidden": "headerActionsHidden_871918107",
3828
+ "search": "search_871918107",
3829
+ "searchExpanded": "searchExpanded_871918107",
3830
+ "searchButton": "searchButton_871918107",
3831
+ "searchInput": "searchInput_871918107",
3832
+ "clearButton": "clearButton_871918107",
3833
+ "listArea": "listArea_871918107",
3834
+ "treeBody": "treeBody_871918107",
3835
+ "fade": "fade_871918107",
3836
+ "wide": "wide_871918107",
3837
+ "list": "list_871918107",
3838
+ "flatList": "flatList_871918107",
3839
+ "searchTree": "searchTree_871918107",
3840
+ "groupSection": "groupSection_871918107",
3841
+ "searchStatus": "searchStatus_871918107",
3842
+ "searchWarning": "searchWarning_871918107",
3843
+ "listTopDropIndicator": "listTopDropIndicator_871918107",
3844
+ "workspaceDropBefore": "workspaceDropBefore_871918107",
3845
+ "workspaceDropAfter": "workspaceDropAfter_871918107",
3846
+ "listTopDropActive": "listTopDropActive_871918107",
3847
+ "sessionOverflowButton": "sessionOverflowButton_871918107",
3848
+ "empty": "empty_871918107",
3849
+ "renameInput": "renameInput_871918107",
3850
+ "renameError": "renameError_871918107",
3851
+ "deleteAction": "deleteAction_871918107",
3852
+ "deleteStatus": "deleteStatus_871918107",
3853
+ "removeFacts": "removeFacts_871918107",
3854
+ "removeFact": "removeFact_871918107",
3855
+ "removeFactWarn": "removeFactWarn_871918107",
3856
+ "modalAction": "modalAction_871918107",
3857
+ "modalError": "modalError_871918107",
3858
+ "menuStatus": "menuStatus_871918107",
3859
+ "memberIndent": "memberIndent_871918107",
3860
+ "sessionsIndent": "sessionsIndent_871918107"
3481
3861
  };
3482
3862
  //#endregion
3483
3863
  //#region src/client/GroupedSidebar.tsx
@@ -3708,7 +4088,7 @@ window.__ModuleLoader__.load({
3708
4088
  const parsed = Date.parse(createdAt);
3709
4089
  return Number.isNaN(parsed) ? void 0 : parsed;
3710
4090
  }
3711
- function GroupedTree({ groups, sessions, archived, currentSessionId, expandMap, onToggle, expandTo, orderBy, now, home, onOpen, onRename, onFork, onArchive, onWorkspaceRename, onWorkspaceDelete, startSession, t }) {
4091
+ function GroupedTree({ groups, footer, sessions, archived, currentSessionId, expandMap, onToggle, expandTo, orderBy, now, home, onOpen, onRename, onFork, onArchive, onWorkspaceRename, onWorkspaceDelete, onWorktreeRemove, startSession, t }) {
3712
4092
  const descendants = (0, react.useMemo)(() => indexSubagentRunning(sessions.byId), [sessions.byId]);
3713
4093
  const [expandedSessionGroups, setExpandedSessionGroups] = (0, react.useState)([]);
3714
4094
  const empty = groups.length === 0;
@@ -3718,34 +4098,66 @@ window.__ModuleLoader__.load({
3718
4098
  className: GroupedSidebar_module_default.list,
3719
4099
  role: "tree",
3720
4100
  "aria-label": t("section.workspaces"),
3721
- children: [empty && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3722
- className: GroupedSidebar_module_default.empty,
3723
- children: t("empty.none")
3724
- }), groups.map((group) => {
3725
- if (group.kind === "repo") {
3726
- const memberIds = group.members.map((member) => orderedVisibleSessionIds(member.workspace, sessions, archived, orderBy));
3727
- const visibleCount = memberIds.reduce((sum, ids) => sum + ids.length, 0);
3728
- const containsCurrent = group.members.some((member) => member.workspace.sessionIds.includes(currentSessionId ?? "\0"));
3729
- const open = expandMap[group.key] ?? containsCurrent;
3730
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4101
+ children: [
4102
+ empty && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4103
+ className: GroupedSidebar_module_default.empty,
4104
+ children: t("empty.none")
4105
+ }),
4106
+ groups.map((group) => {
4107
+ if (group.kind === "repo") {
4108
+ const memberIds = group.members.map((member) => orderedVisibleSessionIds(member.workspace, sessions, archived, orderBy));
4109
+ const visibleCount = memberIds.reduce((sum, ids) => sum + ids.length, 0);
4110
+ const containsCurrent = group.members.some((member) => member.workspace.sessionIds.includes(currentSessionId ?? "\0"));
4111
+ const open = expandMap[group.key] ?? containsCurrent;
4112
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4113
+ className: GroupedSidebar_module_default.groupSection,
4114
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProjectRowItem, {
4115
+ row: {
4116
+ key: group.key,
4117
+ label: group.repoName ?? group.key,
4118
+ expanded: open,
4119
+ containsCurrent
4120
+ },
4121
+ onToggle: () => {
4122
+ onToggle(group.key);
4123
+ },
4124
+ home,
4125
+ t,
4126
+ badge: String(visibleCount)
4127
+ }), open && group.members.map((member, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemberBlock, {
4128
+ member,
4129
+ indent: true,
4130
+ sessionIds: memberIds[index] ?? [],
4131
+ sessions,
4132
+ currentSessionId,
4133
+ expandMap,
4134
+ onToggle,
4135
+ expandTo,
4136
+ descendants,
4137
+ expandedSessionGroups,
4138
+ setExpandedSessionGroups,
4139
+ now,
4140
+ home,
4141
+ onOpen,
4142
+ onRename,
4143
+ onFork,
4144
+ onArchive,
4145
+ onWorkspaceRename,
4146
+ onWorkspaceDelete,
4147
+ onWorktreeRemove,
4148
+ startSession,
4149
+ t
4150
+ }, member.workspace.workspaceId))]
4151
+ }, group.key);
4152
+ }
4153
+ const member = group.members[0];
4154
+ if (member === void 0) return null;
4155
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3731
4156
  className: GroupedSidebar_module_default.groupSection,
3732
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProjectRowItem, {
3733
- row: {
3734
- key: group.key,
3735
- label: group.repoName ?? group.key,
3736
- expanded: open,
3737
- containsCurrent
3738
- },
3739
- onToggle: () => {
3740
- onToggle(group.key);
3741
- },
3742
- home,
3743
- t,
3744
- badge: String(visibleCount)
3745
- }), open && group.members.map((member, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemberBlock, {
4157
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemberBlock, {
3746
4158
  member,
3747
- indent: true,
3748
- sessionIds: memberIds[index] ?? [],
4159
+ indent: false,
4160
+ sessionIds: orderedVisibleSessionIds(member.workspace, sessions, archived, orderBy),
3749
4161
  sessions,
3750
4162
  currentSessionId,
3751
4163
  expandMap,
@@ -3762,44 +4174,18 @@ window.__ModuleLoader__.load({
3762
4174
  onArchive,
3763
4175
  onWorkspaceRename,
3764
4176
  onWorkspaceDelete,
4177
+ onWorktreeRemove,
3765
4178
  startSession,
3766
4179
  t
3767
- }, member.workspace.workspaceId))]
4180
+ })
3768
4181
  }, group.key);
3769
- }
3770
- const member = group.members[0];
3771
- if (member === void 0) return null;
3772
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3773
- className: GroupedSidebar_module_default.groupSection,
3774
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MemberBlock, {
3775
- member,
3776
- indent: false,
3777
- sessionIds: orderedVisibleSessionIds(member.workspace, sessions, archived, orderBy),
3778
- sessions,
3779
- currentSessionId,
3780
- expandMap,
3781
- onToggle,
3782
- expandTo,
3783
- descendants,
3784
- expandedSessionGroups,
3785
- setExpandedSessionGroups,
3786
- now,
3787
- home,
3788
- onOpen,
3789
- onRename,
3790
- onFork,
3791
- onArchive,
3792
- onWorkspaceRename,
3793
- onWorkspaceDelete,
3794
- startSession,
3795
- t
3796
- })
3797
- }, group.key);
3798
- })]
4182
+ }),
4183
+ footer
4184
+ ]
3799
4185
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: GroupedSidebar_module_default.fade })]
3800
4186
  });
3801
4187
  }
3802
- function MemberBlock({ member, indent, sessionIds, sessions, currentSessionId, expandMap, onToggle, expandTo, descendants, expandedSessionGroups, setExpandedSessionGroups, now, home, onOpen, onRename, onFork, onArchive, onWorkspaceRename, onWorkspaceDelete, startSession, t }) {
4188
+ function MemberBlock({ member, indent, sessionIds, sessions, currentSessionId, expandMap, onToggle, expandTo, descendants, expandedSessionGroups, setExpandedSessionGroups, now, home, onOpen, onRename, onFork, onArchive, onWorkspaceRename, onWorkspaceDelete, onWorktreeRemove, startSession, t }) {
3803
4189
  const key = `ws:${member.workspace.workspaceId}`;
3804
4190
  const containsCurrent = member.workspace.sessionIds.includes(currentSessionId ?? "\0");
3805
4191
  const open = expandMap[key] ?? containsCurrent;
@@ -3812,6 +4198,9 @@ window.__ModuleLoader__.load({
3812
4198
  if (summary !== void 0) nodes.push(sessionNode(summary, descendants));
3813
4199
  }
3814
4200
  const created = createdAtMs(member.workspace.createdAt);
4201
+ const hasRunning = member.workspace.sessionIds.some((id) => sessions.byId[id]?.running === true);
4202
+ const occupied = containsCurrent || hasRunning;
4203
+ const canRemoveWorktree = member.label.type === "linked" && !occupied;
3815
4204
  const body = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProjectRowItem, {
3816
4205
  row: {
3817
4206
  key,
@@ -3834,7 +4223,10 @@ window.__ModuleLoader__.load({
3834
4223
  },
3835
4224
  delete: () => {
3836
4225
  onWorkspaceDelete(member.workspace.workspaceId, member.workspace.title);
3837
- }
4226
+ },
4227
+ ...canRemoveWorktree ? { removeWorktree: () => {
4228
+ onWorktreeRemove(member);
4229
+ } } : {}
3838
4230
  },
3839
4231
  home,
3840
4232
  t
@@ -3868,44 +4260,67 @@ window.__ModuleLoader__.load({
3868
4260
  const { t } = props;
3869
4261
  const workspaces = (0, react.useSyncExternalStore)(props.workspacesList.subscribe, props.workspacesList.getSnapshot);
3870
4262
  const sessions = (0, react.useSyncExternalStore)(props.sessionsList.subscribe, props.sessionsList.getSnapshot);
3871
- const host = (0, react.useSyncExternalStore)(props.hostDescription.subscribe, props.hostDescription.getSnapshot);
4263
+ const host = (0, react.useSyncExternalStore)(props.hostInfo.subscribe, props.hostInfo.getSnapshot);
3872
4264
  const directoryFlowAvailable = (0, react.useSyncExternalStore)(props.directoryFlow.subscribe, props.directoryFlow.getSnapshot);
3873
4265
  const items = workspaces.items;
3874
4266
  const home = host?.home;
3875
4267
  const signature = (0, react.useMemo)(() => [...items].map((item) => item.path).sort().join("\n"), [items]);
4268
+ const cachedBatch = (0, react.useMemo)(() => loadFactsCache(), [signature]);
3876
4269
  const [factsState, setFactsState] = (0, react.useState)(null);
4270
+ const factsEntry = factsForSignature(signature, factsState, cachedBatch);
4271
+ const facts = factsEntry?.facts;
4272
+ const hasFactsForSignature = factsEntry !== null;
3877
4273
  const readyOnce = (0, react.useRef)(false);
3878
4274
  const signalReady = () => {
3879
4275
  if (readyOnce.current) return;
3880
4276
  readyOnce.current = true;
3881
4277
  props.onReady?.();
3882
4278
  };
4279
+ /** Signatures this mount already sent a probe for (once per signature). */
4280
+ const probedSignature = (0, react.useRef)(void 0);
3883
4281
  (0, react.useEffect)(() => {
3884
- if (factsState?.signature === signature) {
4282
+ if (probedSignature.current === signature) {
3885
4283
  signalReady();
3886
4284
  return;
3887
4285
  }
4286
+ if (items.length === 0) {
4287
+ if (workspaces.phase === "ready") {
4288
+ probedSignature.current = signature;
4289
+ signalReady();
4290
+ }
4291
+ return;
4292
+ }
4293
+ if (hasFactsForSignature) signalReady();
3888
4294
  let live = true;
3889
4295
  props.loadFacts(items.map((item) => item.path)).then((facts) => {
3890
4296
  if (!live) return;
3891
- if (facts !== void 0) setFactsState({
3892
- signature,
3893
- facts
3894
- });
4297
+ probedSignature.current = signature;
4298
+ if (facts !== void 0) {
4299
+ setFactsState({
4300
+ signature,
4301
+ facts
4302
+ });
4303
+ saveFactsCache({
4304
+ signature,
4305
+ facts
4306
+ });
4307
+ }
3895
4308
  signalReady();
3896
4309
  }, () => {
3897
- if (live) signalReady();
4310
+ if (!live) return;
4311
+ probedSignature.current = signature;
4312
+ signalReady();
3898
4313
  });
3899
4314
  return () => {
3900
4315
  live = false;
3901
4316
  };
3902
4317
  }, [
3903
4318
  signature,
3904
- factsState?.signature,
4319
+ items,
3905
4320
  props.loadFacts,
3906
- items
4321
+ workspaces.phase,
4322
+ hasFactsForSignature
3907
4323
  ]);
3908
- const facts = factsState?.signature === signature ? factsState.facts : void 0;
3909
4324
  const groups = (0, react.useMemo)(() => deriveSidebarGroups(items, facts), [items, facts]);
3910
4325
  const sessionList = sessions;
3911
4326
  const archived = workspaces.archivedSessionIds;
@@ -4123,7 +4538,197 @@ window.__ModuleLoader__.load({
4123
4538
  setDeleteError(reason instanceof Error ? reason.message : String(reason));
4124
4539
  });
4125
4540
  };
4541
+ const [wtRemoveTarget, setWtRemoveTarget] = (0, react.useState)(null);
4542
+ const [wtInspect, setWtInspect] = (0, react.useState)({ status: "loading" });
4543
+ const [wtRemoving, setWtRemoving] = (0, react.useState)(false);
4544
+ const [wtRemoveError, setWtRemoveError] = (0, react.useState)(null);
4545
+ (0, react.useEffect)(() => {
4546
+ if (wtRemoveTarget === null) return;
4547
+ setWtInspect({ status: "loading" });
4548
+ let live = true;
4549
+ props.inspectWorktree(wtRemoveTarget.workspace.path).then((facts) => {
4550
+ if (live) setWtInspect({
4551
+ status: "ready",
4552
+ dirty: facts.dirty,
4553
+ ahead: facts.ahead
4554
+ });
4555
+ }, (reason) => {
4556
+ if (live) setWtInspect({
4557
+ status: "error",
4558
+ error: reason instanceof Error ? reason.message : String(reason)
4559
+ });
4560
+ });
4561
+ return () => {
4562
+ live = false;
4563
+ };
4564
+ }, [wtRemoveTarget]);
4565
+ const archivedSet = (0, react.useMemo)(() => new Set(archived), [archived]);
4566
+ const wtArchiveIds = wtRemoveTarget === null ? [] : wtRemoveTarget.workspace.sessionIds.filter((id) => {
4567
+ const summary = sessionList.byId[id];
4568
+ return summary !== void 0 && !archivedSet.has(id) && !summary.blank && summary.origin !== "subagent";
4569
+ });
4570
+ const closeWtRemove = () => {
4571
+ if (wtRemoving) return;
4572
+ setWtRemoveTarget(null);
4573
+ setWtRemoveError(null);
4574
+ };
4575
+ const confirmWtRemove = () => {
4576
+ if (wtRemoving || wtRemoveTarget === null || wtInspect.status !== "ready") return;
4577
+ const target = wtRemoveTarget;
4578
+ setWtRemoving(true);
4579
+ setWtRemoveError(null);
4580
+ (async () => {
4581
+ try {
4582
+ await props.removeWorktree(target.workspace.path, wtInspect.dirty > 0);
4583
+ for (const sessionId of wtArchiveIds) await props.archiveSession(sessionId).catch((reason) => {
4584
+ console.warn("session archive rejected during worktree removal:", reason);
4585
+ });
4586
+ await props.deleteWorkspace(target.workspace.workspaceId);
4587
+ setWtRemoving(false);
4588
+ setWtRemoveTarget(null);
4589
+ } catch (reason) {
4590
+ setWtRemoving(false);
4591
+ setWtRemoveError(reason instanceof Error ? reason.message : String(reason));
4592
+ }
4593
+ })();
4594
+ };
4126
4595
  const now = Date.now();
4596
+ const strayGroups = (0, react.useMemo)(() => deriveStrayGroups(items, sessionList, archived), [
4597
+ items,
4598
+ sessionList,
4599
+ archived
4600
+ ]);
4601
+ const strayDescendants = (0, react.useMemo)(() => indexSubagentRunning(sessionList.byId), [sessionList.byId]);
4602
+ const strayProbePaths = (0, react.useMemo)(() => [...new Set(strayGroups.filter((group) => group.belongsTo === void 0 && group.path !== "").map((group) => group.path))], [strayGroups]);
4603
+ const strayProbeSignature = strayProbePaths.join("\n");
4604
+ const [strayDirExists, setStrayDirExists] = (0, react.useState)(void 0);
4605
+ const [straySlotRebuildable, setStraySlotRebuildable] = (0, react.useState)(void 0);
4606
+ (0, react.useEffect)(() => {
4607
+ if (strayProbePaths.length === 0) return;
4608
+ let live = true;
4609
+ props.probeDirectories(strayProbePaths).then((result) => {
4610
+ if (!live) return;
4611
+ setStrayDirExists(result?.exists);
4612
+ setStraySlotRebuildable(result?.rebuildable);
4613
+ }, () => {
4614
+ if (live) {
4615
+ setStrayDirExists(void 0);
4616
+ setStraySlotRebuildable(void 0);
4617
+ }
4618
+ });
4619
+ return () => {
4620
+ live = false;
4621
+ };
4622
+ }, [strayProbeSignature]);
4623
+ const straySectionKey = "stray:section";
4624
+ const strayContainsCurrent = strayGroups.some((group) => group.sessions.some((session) => session.id === sessions.current));
4625
+ const straySectionOpen = expandMap[straySectionKey] ?? strayContainsCurrent;
4626
+ const strayTotal = strayGroups.reduce((sum, group) => sum + group.sessions.length, 0);
4627
+ const [strayRegPath, setStrayRegPath] = (0, react.useState)(null);
4628
+ const [toast, setToast] = (0, react.useState)(null);
4629
+ const registerStrayWorkspace = (path) => {
4630
+ if (strayRegPath !== null) return;
4631
+ setStrayRegPath(path);
4632
+ props.createWorkspace({ path }).then(() => {
4633
+ setStrayRegPath(null);
4634
+ }, (reason) => {
4635
+ setStrayRegPath(null);
4636
+ setToast({
4637
+ seq: Date.now(),
4638
+ text: t("stray.registerFailed", { message: reason instanceof Error ? reason.message : String(reason) })
4639
+ });
4640
+ });
4641
+ };
4642
+ const [strayRebuildPath, setStrayRebuildPath] = (0, react.useState)(null);
4643
+ const rebuildStrayDirectory = (path) => {
4644
+ if (strayRebuildPath !== null) return;
4645
+ setStrayRebuildPath(path);
4646
+ props.ensureDirectory(path).then(() => {
4647
+ setStrayRebuildPath(null);
4648
+ setToast({
4649
+ seq: Date.now(),
4650
+ text: t("stray.rebuildDone")
4651
+ });
4652
+ props.probeDirectories([path]).then((result) => {
4653
+ if (result === void 0) return;
4654
+ setStrayDirExists((current) => ({
4655
+ ...current,
4656
+ ...result.exists
4657
+ }));
4658
+ setStraySlotRebuildable((current) => ({
4659
+ ...current,
4660
+ ...result.rebuildable
4661
+ }));
4662
+ });
4663
+ }, (reason) => {
4664
+ setStrayRebuildPath(null);
4665
+ setToast({
4666
+ seq: Date.now(),
4667
+ text: t("stray.rebuildFailed", { message: reason instanceof Error ? reason.message : String(reason) })
4668
+ });
4669
+ });
4670
+ };
4671
+ const straySection = strayGroups.length === 0 ? void 0 : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4672
+ className: GroupedSidebar_module_default.groupSection,
4673
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProjectRowItem, {
4674
+ row: {
4675
+ key: straySectionKey,
4676
+ label: t("group.ungrouped"),
4677
+ expanded: straySectionOpen,
4678
+ containsCurrent: strayContainsCurrent
4679
+ },
4680
+ onToggle: () => {
4681
+ toggle(straySectionKey);
4682
+ },
4683
+ home,
4684
+ t,
4685
+ badge: String(strayTotal)
4686
+ }), straySectionOpen && strayGroups.map((group) => {
4687
+ const groupOpen = expandMap[group.key] ?? group.sessions.some((session) => session.id === sessions.current);
4688
+ const registrable = group.belongsTo === void 0 && group.path !== "" && strayDirExists?.[group.path] === true;
4689
+ const missingDir = group.belongsTo === void 0 && group.path !== "" && strayDirExists?.[group.path] === false;
4690
+ const rebuildable = missingDir && straySlotRebuildable?.[group.path] === true;
4691
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4692
+ className: cx(GroupedSidebar_module_default.groupSection, GroupedSidebar_module_default.memberIndent),
4693
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StrayGroupRow, {
4694
+ path: group.path,
4695
+ belongsTo: group.belongsTo,
4696
+ count: group.sessions.length,
4697
+ expanded: groupOpen,
4698
+ onToggle: () => {
4699
+ toggle(group.key);
4700
+ },
4701
+ missingDir,
4702
+ worktreeSlot: rebuildable,
4703
+ ...registrable ? {
4704
+ onRegister: () => {
4705
+ registerStrayWorkspace(group.path);
4706
+ },
4707
+ registering: strayRegPath === group.path
4708
+ } : rebuildable ? {
4709
+ onRebuild: () => {
4710
+ rebuildStrayDirectory(group.path);
4711
+ },
4712
+ rebuilding: strayRebuildPath === group.path
4713
+ } : {},
4714
+ home,
4715
+ t
4716
+ }), groupOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4717
+ className: GroupedSidebar_module_default.sessionsIndent,
4718
+ children: group.sessions.map((session) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionNodeItem, {
4719
+ node: sessionNode(session, strayDescendants),
4720
+ currentId: sessions.current,
4721
+ now,
4722
+ onOpen: props.openSession,
4723
+ onRename: onSessionRename,
4724
+ onFork: props.forkSession,
4725
+ onArchive: onSessionArchive,
4726
+ t
4727
+ }, session.id))
4728
+ })]
4729
+ }, group.key);
4730
+ })]
4731
+ });
4127
4732
  const wide = props.wide;
4128
4733
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4129
4734
  className: cx(GroupedSidebar_module_default.root, !wide && GroupedSidebar_module_default.rail),
@@ -4277,6 +4882,7 @@ window.__ModuleLoader__.load({
4277
4882
  t
4278
4883
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupedTree, {
4279
4884
  groups,
4885
+ footer: straySection,
4280
4886
  sessions: sessionList,
4281
4887
  archived,
4282
4888
  currentSessionId: sessions.current,
@@ -4305,6 +4911,10 @@ window.__ModuleLoader__.load({
4305
4911
  });
4306
4912
  setDeleteError(null);
4307
4913
  },
4914
+ onWorktreeRemove: (member) => {
4915
+ setWtRemoveTarget(member);
4916
+ setWtRemoveError(null);
4917
+ },
4308
4918
  startSession: props.startSession,
4309
4919
  t
4310
4920
  }))
@@ -4438,7 +5048,75 @@ window.__ModuleLoader__.load({
4438
5048
  role: "alert",
4439
5049
  children: deleteError
4440
5050
  })]
4441
- })
5051
+ }),
5052
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
5053
+ open: wtRemoveTarget !== null,
5054
+ onClose: closeWtRemove,
5055
+ closeLabel: t("close"),
5056
+ title: t("worktreeRemove.title"),
5057
+ ...wtRemoveTarget === null ? {} : { description: t("worktreeRemove.desc", { path: wtRemoveTarget.workspace.path }) },
5058
+ 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, {
5059
+ variant: "outline",
5060
+ disabled: wtRemoving,
5061
+ onClick: closeWtRemove,
5062
+ children: t("cancel")
5063
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
5064
+ variant: "outline",
5065
+ className: GroupedSidebar_module_default.deleteAction,
5066
+ disabled: wtRemoving || wtInspect.status !== "ready",
5067
+ onClick: confirmWtRemove,
5068
+ children: t("worktreeRemove.menu")
5069
+ })] }),
5070
+ children: [
5071
+ wtRemoveTarget?.label.type === "linked" && wtRemoveTarget.label.branch !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5072
+ className: GroupedSidebar_module_default.removeFact,
5073
+ children: t("worktreeRemove.descBranch", { branch: wtRemoveTarget.label.branch })
5074
+ }),
5075
+ wtInspect.status === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5076
+ className: GroupedSidebar_module_default.deleteStatus,
5077
+ role: "status",
5078
+ children: t("worktreeRemove.inspecting")
5079
+ }),
5080
+ wtInspect.status === "error" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5081
+ className: GroupedSidebar_module_default.renameError,
5082
+ role: "alert",
5083
+ children: wtInspect.error
5084
+ }),
5085
+ wtInspect.status === "ready" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5086
+ className: GroupedSidebar_module_default.removeFacts,
5087
+ children: [
5088
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5089
+ className: cx(GroupedSidebar_module_default.removeFact, wtInspect.dirty > 0 && GroupedSidebar_module_default.removeFactWarn),
5090
+ children: wtInspect.dirty > 0 ? t(wtInspect.dirty === 1 ? "worktreeRemove.dirty.one" : "worktreeRemove.dirty.other", { n: wtInspect.dirty }) : t("worktreeRemove.clean")
5091
+ }),
5092
+ wtInspect.ahead !== void 0 && wtInspect.ahead > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5093
+ className: GroupedSidebar_module_default.removeFact,
5094
+ children: t("worktreeRemove.ahead", { n: wtInspect.ahead })
5095
+ }),
5096
+ wtArchiveIds.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5097
+ className: GroupedSidebar_module_default.removeFact,
5098
+ children: t(wtArchiveIds.length === 1 ? "worktreeRemove.sessions.one" : "worktreeRemove.sessions.other", { n: wtArchiveIds.length })
5099
+ })
5100
+ ]
5101
+ }),
5102
+ wtRemoving && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5103
+ className: GroupedSidebar_module_default.deleteStatus,
5104
+ role: "status",
5105
+ children: t("worktreeRemove.busy")
5106
+ }),
5107
+ wtRemoveError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5108
+ className: GroupedSidebar_module_default.renameError,
5109
+ role: "alert",
5110
+ children: wtRemoveError
5111
+ })
5112
+ ]
5113
+ }),
5114
+ toast !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Toast, {
5115
+ text: toast.text,
5116
+ onDone: () => {
5117
+ setToast(null);
5118
+ }
5119
+ }, toast.seq)
4442
5120
  ]
4443
5121
  });
4444
5122
  }
@@ -4547,6 +5225,29 @@ window.__ModuleLoader__.load({
4547
5225
  "delete.workspace": "Delete workspace",
4548
5226
  "delete.desc": "This removes “{name}” from the workspace list. The folder and session logs will be kept. Its sessions will appear under Ungrouped.",
4549
5227
  "delete.pending": "Deleting workspace…",
5228
+ "worktreeRemove.menu": "Remove worktree",
5229
+ "worktreeRemove.title": "Remove worktree",
5230
+ "worktreeRemove.desc": "This removes the worktree from git and deletes the folder “{path}”.",
5231
+ "worktreeRemove.descBranch": "The branch {branch} is kept.",
5232
+ "worktreeRemove.inspecting": "Inspecting worktree…",
5233
+ "worktreeRemove.dirty.one": "{n} uncommitted file will be deleted with the folder.",
5234
+ "worktreeRemove.dirty.other": "{n} uncommitted files will be deleted with the folder.",
5235
+ "worktreeRemove.clean": "No uncommitted changes.",
5236
+ "worktreeRemove.ahead": "{n} commits ahead of upstream, kept on the branch.",
5237
+ "worktreeRemove.sessions.one": "{n} session in this workspace will be archived too.",
5238
+ "worktreeRemove.sessions.other": "{n} sessions in this workspace will be archived too.",
5239
+ "worktreeRemove.busy": "Removing…",
5240
+ "stray.unknown": "(unknown directory)",
5241
+ "stray.belongsTo": "Stray sessions of “{name}”",
5242
+ "stray.missingDir": "Directory no longer exists — registering is unavailable",
5243
+ "stray.worktreeSlot": "A worktree storage slot: rebuild this directory (e.g. git worktree add) and its historical sessions reattach automatically",
5244
+ "stray.rebuild": "Rebuild empty directory",
5245
+ "stray.rebuild.aria": "Rebuild the directory “{name}”",
5246
+ "stray.rebuildDone": "Directory rebuilt; its historical sessions will reattach automatically",
5247
+ "stray.rebuildFailed": "Rebuild failed: {message}",
5248
+ "stray.register": "Register as workspace",
5249
+ "stray.register.aria": "Register “{name}” as a workspace",
5250
+ "stray.registerFailed": "Registration failed: {message}",
4550
5251
  "menu.fork": "Fork session",
4551
5252
  "menu.archiveSession": "Archive session",
4552
5253
  "sessions.count.one": "{n} session",
@@ -4679,6 +5380,29 @@ window.__ModuleLoader__.load({
4679
5380
  "delete.workspace": "删除工作区",
4680
5381
  "delete.desc": "将把“{name}”从工作区列表中移除。文件夹与会话记录会保留,其会话将显示在“未分组”下。",
4681
5382
  "delete.pending": "正在删除工作区…",
5383
+ "worktreeRemove.menu": "删除工作树",
5384
+ "worktreeRemove.title": "删除工作树",
5385
+ "worktreeRemove.desc": "将从 git 移除该工作树并删除目录“{path}”。",
5386
+ "worktreeRemove.descBranch": "分支 {branch} 将保留。",
5387
+ "worktreeRemove.inspecting": "正在检查工作树…",
5388
+ "worktreeRemove.dirty.one": "{n} 个未提交文件将随目录一并删除。",
5389
+ "worktreeRemove.dirty.other": "{n} 个未提交文件将随目录一并删除。",
5390
+ "worktreeRemove.clean": "无未提交改动。",
5391
+ "worktreeRemove.ahead": "分支领先上游 {n} 个提交,提交将保留在分支上。",
5392
+ "worktreeRemove.sessions.one": "该工作区下的 {n} 个会话将一并归档。",
5393
+ "worktreeRemove.sessions.other": "该工作区下的 {n} 个会话将一并归档。",
5394
+ "worktreeRemove.busy": "删除中…",
5395
+ "stray.unknown": "(目录未知)",
5396
+ "stray.belongsTo": "属于“{name}”的失联会话",
5397
+ "stray.missingDir": "目录已不存在,无法注册",
5398
+ "stray.worktreeSlot": "工作树存放位:重建此目录(如 git worktree add)后,其历史会话将自动归位",
5399
+ "stray.rebuild": "重建空目录",
5400
+ "stray.rebuild.aria": "重建目录“{name}”",
5401
+ "stray.rebuildDone": "目录已重建,其历史会话将自动归位",
5402
+ "stray.rebuildFailed": "重建失败:{message}",
5403
+ "stray.register": "注册为工作区",
5404
+ "stray.register.aria": "将“{name}”注册为工作区",
5405
+ "stray.registerFailed": "注册失败:{message}",
4682
5406
  "menu.fork": "分叉会话",
4683
5407
  "menu.archiveSession": "归档会话",
4684
5408
  "sessions.count.one": "{n} 个会话",
@@ -4713,16 +5437,33 @@ window.__ModuleLoader__.load({
4713
5437
  /** Dictionary namespace owned by this plugin. */
4714
5438
  const NS = "git-worktree";
4715
5439
  /**
5440
+ * The host service stores (ctx.workspaces.list, ctx.sessions.list) expose
5441
+ * getSnapshot/subscribe as PROTOTYPE methods of the controller's model
5442
+ * instance; a detached method reference loses its receiver and crashes inside
5443
+ * React's bare useSyncExternalStore call (the framework's own hooks wrap the
5444
+ * source and always call through the object). Every store crosses the inject
5445
+ * boundary as a closure-bounded literal instead — the same shape the
5446
+ * hand-built hostInfo/directoryFlow sources below already use.
5447
+ */
5448
+ function boundStore(source) {
5449
+ return {
5450
+ getSnapshot: () => source.getSnapshot(),
5451
+ subscribe: (listener) => source.subscribe(listener)
5452
+ };
5453
+ }
5454
+ /**
4716
5455
  * Namespace of the git-worktree settings section. Spelled here rather than
4717
5456
  * imported: a client package must not depend on a Host package.
4718
5457
  */
4719
5458
  const GIT_WORKTREE_NS = "git-worktree";
4720
- /** Required services: the slot ledger, session/workspace runtime, copy, and
4721
- * the settings scope backing the plugin configuration card. */
5459
+ /** Required services: the slot ledger, session/workspace runtimes, the
5460
+ * workspace navigation/directory face, copy, and the settings scope backing
5461
+ * the plugin configuration card. */
4722
5462
  const inject = [
4723
5463
  "slots",
4724
5464
  "sessions",
4725
5465
  "workspaces",
5466
+ "uiWorkspace",
4726
5467
  "locale",
4727
5468
  "connection",
4728
5469
  "remote",
@@ -4733,10 +5474,13 @@ window.__ModuleLoader__.load({
4733
5474
  zh,
4734
5475
  en
4735
5476
  }), "git-worktree: dictionaries");
4736
- const chipInjected = () => ({ adoptWorktree: async (path) => {
4737
- const workspace = await ctx.workspaces.create({ path });
4738
- ctx.workspaces.startSession(workspace.workspaceId);
4739
- } });
5477
+ const chipInjected = () => ({
5478
+ adoptWorktree: async (path) => {
5479
+ const workspace = await ctx.workspaces.create({ path });
5480
+ ctx.uiWorkspace.startSession(workspace.workspaceId);
5481
+ },
5482
+ sessionsList: boundStore(ctx.sessions.list)
5483
+ });
4740
5484
  ctx.slots.inject("conversation.input.left", () => ctx.slots.register({
4741
5485
  name: "conversation.input.left",
4742
5486
  id: "git-worktree",
@@ -4797,34 +5541,21 @@ window.__ModuleLoader__.load({
4797
5541
  }
4798
5542
  });
4799
5543
  };
4800
- const syncGroupingSeat = () => {
4801
- const snapshot = groupingScope.getSnapshot();
4802
- if (snapshot.status !== "ready") return seatReady;
4803
- const enabled = snapshot.value?.groupSidebar ?? true;
4804
- if (enabled === groupingEnabled) return seatReady;
4805
- groupingEnabled = enabled;
4806
- if (groupingDisposer !== void 0) {
4807
- groupingDisposer();
4808
- groupingDisposer = void 0;
4809
- }
5544
+ /** Inject the `sidebar.workspaces` occupant (priority -1 shadows the native
5545
+ * browser at priority 0) and arm its readiness epoch. */
5546
+ const registerGroupingSeat = () => {
4810
5547
  const epoch = ++seatEpoch;
4811
5548
  seatReady = new Promise((resolve) => {
4812
5549
  seatReadyResolve = resolve;
4813
5550
  });
4814
- if (!enabled) {
4815
- afterPaint().then(() => {
4816
- if (epoch === seatEpoch) finishSeat();
4817
- });
4818
- return seatReady;
4819
- }
4820
5551
  const injectFace = () => ({
4821
- workspacesList: ctx.workspaces.list,
4822
- sessionsList: ctx.sessions.list,
5552
+ workspacesList: boundStore(ctx.workspaces.list),
5553
+ sessionsList: boundStore(ctx.sessions.list),
4823
5554
  openSession: (sessionId) => {
4824
5555
  ctx.sessions.open(sessionId);
4825
5556
  },
4826
5557
  startSession: (workspaceId) => {
4827
- ctx.workspaces.startSession(workspaceId);
5558
+ ctx.uiWorkspace.startSession(workspaceId);
4828
5559
  },
4829
5560
  loadFacts: async (paths) => {
4830
5561
  const result = await requestGroupWorktrees(paths);
@@ -4859,9 +5590,38 @@ window.__ModuleLoader__.load({
4859
5590
  archiveSession: async (sessionId) => {
4860
5591
  await ctx.workspaces.archiveSession(sessionId);
4861
5592
  },
5593
+ inspectWorktree: async (path) => {
5594
+ const result = await requestInspectWorktree(path);
5595
+ if (!result.ok) throw new Error(result.error);
5596
+ return {
5597
+ dirty: result.dirty,
5598
+ ahead: result.ahead
5599
+ };
5600
+ },
5601
+ removeWorktree: async (path, force) => {
5602
+ const result = await requestRemoveWorktree(path, force);
5603
+ if (!result.ok) throw new Error(result.error);
5604
+ },
5605
+ probeDirectories: async (paths) => {
5606
+ const result = await requestPathExists(paths);
5607
+ return result.ok ? {
5608
+ exists: result.exists,
5609
+ ...result.rebuildable === void 0 ? {} : { rebuildable: result.rebuildable }
5610
+ } : void 0;
5611
+ },
5612
+ ensureDirectory: async (path) => {
5613
+ const result = await requestEnsureDirectory(path);
5614
+ if (!result.ok) throw new Error(result.error);
5615
+ },
4862
5616
  createWorkspace: (input) => ctx.workspaces.create(input),
4863
- pickDirectory: () => ctx.workspaces.pickDirectory(),
4864
- hostDescription: ctx.get("connection").hostDescription,
5617
+ pickDirectory: () => ctx.uiWorkspace.pickDirectory(),
5618
+ hostInfo: (() => {
5619
+ const generation = ctx.get("connection").generation;
5620
+ return {
5621
+ getSnapshot: () => ctx.remote.$host,
5622
+ subscribe: (listener) => generation.subscribe(listener)
5623
+ };
5624
+ })(),
4865
5625
  directoryFlow: {
4866
5626
  getSnapshot: () => ctx.slots.entries("sidebar.workspaces.directoryFlow").length > 0,
4867
5627
  subscribe: (listener) => ctx.slots.subscribe("sidebar.workspaces.directoryFlow", listener)
@@ -4879,6 +5639,38 @@ window.__ModuleLoader__.load({
4879
5639
  seatTimer = window.setTimeout(() => {
4880
5640
  if (epoch === seatEpoch) finishSeat();
4881
5641
  }, SEAT_READY_TIMEOUT_MS);
5642
+ };
5643
+ const syncGroupingSeat = () => {
5644
+ const snapshot = groupingScope.getSnapshot();
5645
+ if (snapshot.status !== "ready") {
5646
+ if (groupingEnabled === void 0) {
5647
+ groupingEnabled = loadGroupSidebarBoot() ?? true;
5648
+ if (groupingEnabled) registerGroupingSeat();
5649
+ }
5650
+ return seatReady;
5651
+ }
5652
+ const enabled = snapshot.value?.groupSidebar ?? true;
5653
+ if (enabled === groupingEnabled) {
5654
+ saveGroupSidebarBoot(enabled);
5655
+ return seatReady;
5656
+ }
5657
+ groupingEnabled = enabled;
5658
+ saveGroupSidebarBoot(enabled);
5659
+ if (groupingDisposer !== void 0) {
5660
+ groupingDisposer();
5661
+ groupingDisposer = void 0;
5662
+ }
5663
+ const epoch = ++seatEpoch;
5664
+ seatReady = new Promise((resolve) => {
5665
+ seatReadyResolve = resolve;
5666
+ });
5667
+ if (!enabled) {
5668
+ afterPaint().then(() => {
5669
+ if (epoch === seatEpoch) finishSeat();
5670
+ });
5671
+ return seatReady;
5672
+ }
5673
+ registerGroupingSeat();
4882
5674
  return seatReady;
4883
5675
  };
4884
5676
  const waitForGroupingSeat = async (enabled) => {
@@ -4895,7 +5687,7 @@ window.__ModuleLoader__.load({
4895
5687
  inject: () => ({
4896
5688
  hooks: { gitWorktreeCard: store },
4897
5689
  ...form.actions(),
4898
- pickDirectory: () => ctx.workspaces.pickDirectory()
5690
+ pickDirectory: () => ctx.uiWorkspace.pickDirectory()
4899
5691
  })
4900
5692
  }, GitWorktreeCard));
4901
5693
  syncGroupingSeat();