@laoyuehanni/dsh-git-worktree 0.4.14 → 0.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/README.zh.md +7 -2
- package/docs/DETAIL.md +4 -2
- package/docs/DETAIL.zh.md +4 -2
- package/lib/client.js +2490 -380
- package/lib/deferred-worktree.d.ts +104 -0
- package/lib/deferred-worktree.js +292 -0
- package/lib/git.d.ts +19 -0
- package/lib/git.js +81 -4
- package/lib/index.d.ts +13 -0
- package/lib/index.js +162 -4
- package/lib/normalize.d.ts +13 -0
- package/lib/normalize.js +51 -0
- package/lib/routes.d.ts +33 -2
- package/lib/routes.js +250 -79
- package/lib/wire.d.ts +99 -3
- package/lib/wire.js +11 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -6,8 +6,8 @@ window.__ModuleLoader__.load((() => {
|
|
|
6
6
|
var exports = module.exports;
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
let react = require("react");
|
|
9
|
-
let react_dom = require("react-dom");
|
|
10
9
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
10
|
+
let react_dom = require("react-dom");
|
|
11
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
12
|
//#region src/normalize.ts
|
|
13
13
|
/**
|
|
@@ -92,6 +92,8 @@ window.__ModuleLoader__.load((() => {
|
|
|
92
92
|
* {@link PushResult}. A cancel (499) kills `git push`; the remote only moves
|
|
93
93
|
* a ref once the whole pack has arrived, so a stopped transfer changes nothing. */
|
|
94
94
|
const ROUTE_PUSH = `${ROUTE_PREFIX}/push`;
|
|
95
|
+
/** POST ROUTE_PREFIX/group — git belonging facts for a batch of workspace paths. */
|
|
96
|
+
const ROUTE_GROUP = `${ROUTE_PREFIX}/group`;
|
|
95
97
|
/** POST ROUTE_PREFIX/inspect — pre-delete facts for one worktree directory. */
|
|
96
98
|
const ROUTE_INSPECT = `${ROUTE_PREFIX}/inspect`;
|
|
97
99
|
/** POST ROUTE_PREFIX/remove — delete one linked worktree (git registration + folder). */
|
|
@@ -104,6 +106,17 @@ window.__ModuleLoader__.load((() => {
|
|
|
104
106
|
/** POST ROUTE_PREFIX/purge — delete a NON-git directory sitting DIRECTLY in
|
|
105
107
|
* the storage root (an orphaned leftover whose .git is already gone). */
|
|
106
108
|
const ROUTE_PURGE = `${ROUTE_PREFIX}/purge`;
|
|
109
|
+
/** POST ROUTE_PREFIX/session-cwd — move an active blank session's working
|
|
110
|
+
* directory to a worktree directory via the host `workingDirectory` service. */
|
|
111
|
+
const ROUTE_SESSION_CWD = `${ROUTE_PREFIX}/session-cwd`;
|
|
112
|
+
/** GET ROUTE_PREFIX/deferred?sessionId=<id> — read a session's deferred worktree state. */
|
|
113
|
+
const ROUTE_DEFERRED = `${ROUTE_PREFIX}/deferred`;
|
|
114
|
+
/** GET ROUTE_PREFIX/deferred/events?sessionId=<id> — SSE stream of deferred worktree updates. */
|
|
115
|
+
const ROUTE_DEFERRED_EVENTS = `${ROUTE_PREFIX}/deferred/events`;
|
|
116
|
+
/** POST ROUTE_PREFIX/deferred/arm — arm a deferred worktree creation for a blank session. */
|
|
117
|
+
const ROUTE_DEFERRED_ARM = `${ROUTE_PREFIX}/deferred/arm`;
|
|
118
|
+
/** POST ROUTE_PREFIX/deferred/action — cancel, retry, or withdraw a deferred worktree. */
|
|
119
|
+
const ROUTE_DEFERRED_ACTION = `${ROUTE_PREFIX}/deferred/action`;
|
|
107
120
|
//#endregion
|
|
108
121
|
//#region src/client/api.ts
|
|
109
122
|
/** Read-only history requests can be cancelled when the user browses another branch. */
|
|
@@ -299,12 +312,51 @@ window.__ModuleLoader__.load((() => {
|
|
|
299
312
|
* @param name - explicit name for the new branch; omitted, the host
|
|
300
313
|
* derives `<branch>-wt`, suffixing past taken names.
|
|
301
314
|
*/
|
|
302
|
-
function requestWorktreeCutout(repoPath, branch, name) {
|
|
315
|
+
function requestWorktreeCutout(repoPath, branch, name, options) {
|
|
316
|
+
const trimmed = name?.trim();
|
|
303
317
|
return post(ROUTE_WORKTREE, {
|
|
304
318
|
repoPath,
|
|
305
319
|
branch,
|
|
306
320
|
cutout: true,
|
|
307
|
-
...
|
|
321
|
+
...trimmed !== void 0 && trimmed !== "" ? { name: trimmed } : {},
|
|
322
|
+
...options?.random === true ? { random: true } : {}
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Move a session's working directory to `path` via the host `workingDirectory` service.
|
|
327
|
+
* @param sessionId - target session id.
|
|
328
|
+
* @param path - absolute target directory (existing worktree).
|
|
329
|
+
*/
|
|
330
|
+
function requestSetSessionDirectory(sessionId, path) {
|
|
331
|
+
return post(ROUTE_SESSION_CWD, {
|
|
332
|
+
sessionId,
|
|
333
|
+
path
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
/** Build the SSE stream URL for one session's deferred worktree state. */
|
|
337
|
+
function deferredWorktreeEventsUrl(sessionId) {
|
|
338
|
+
return `${ROUTE_DEFERRED_EVENTS}?sessionId=${encodeURIComponent(sessionId)}`;
|
|
339
|
+
}
|
|
340
|
+
/** Read one session's current deferred worktree snapshot. */
|
|
341
|
+
async function fetchDeferredWorktree(sessionId) {
|
|
342
|
+
try {
|
|
343
|
+
return await readEnvelope(await fetch(`${ROUTE_DEFERRED}?sessionId=${encodeURIComponent(sessionId)}`, { cache: "no-store" }));
|
|
344
|
+
} catch (cause) {
|
|
345
|
+
return {
|
|
346
|
+
ok: false,
|
|
347
|
+
error: cause instanceof Error ? cause.message : String(cause)
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/** Arm a deferred worktree creation for a blank session. */
|
|
352
|
+
function requestArmDeferredWorktree(body) {
|
|
353
|
+
return post(ROUTE_DEFERRED_ARM, body);
|
|
354
|
+
}
|
|
355
|
+
/** Cancel, retry, or withdraw a deferred worktree on a session. */
|
|
356
|
+
function requestDeferredWorktreeAction(sessionId, action) {
|
|
357
|
+
return post(ROUTE_DEFERRED_ACTION, {
|
|
358
|
+
sessionId,
|
|
359
|
+
action
|
|
308
360
|
});
|
|
309
361
|
}
|
|
310
362
|
/**
|
|
@@ -403,6 +455,15 @@ window.__ModuleLoader__.load((() => {
|
|
|
403
455
|
return postStream(ROUTE_PUSH, body, live);
|
|
404
456
|
}
|
|
405
457
|
/**
|
|
458
|
+
* Git belonging facts for a batch of workspace directories; a path outside
|
|
459
|
+
* any git repository answers null, a failed route call answers the error
|
|
460
|
+
* envelope (the sidebar then renders flat, its degrade shape).
|
|
461
|
+
* @param paths - absolute workspace directories to probe.
|
|
462
|
+
*/
|
|
463
|
+
async function requestGroupWorktrees(paths) {
|
|
464
|
+
return post(ROUTE_GROUP, { paths });
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
406
467
|
* Pre-delete facts for one worktree directory: the uncommitted-file count
|
|
407
468
|
* (lost with the folder) and the branch's ahead count (kept).
|
|
408
469
|
* @param path - absolute worktree directory.
|
|
@@ -454,6 +515,229 @@ window.__ModuleLoader__.load((() => {
|
|
|
454
515
|
return post(ROUTE_PURGE, { path });
|
|
455
516
|
}
|
|
456
517
|
//#endregion
|
|
518
|
+
//#region src/client/worktree-remove-flow.ts
|
|
519
|
+
/**
|
|
520
|
+
* Remove one worktree completely. A refused git removal rethrows UNLESS the
|
|
521
|
+
* directory is actually gone (the Windows half-removal shape: git already
|
|
522
|
+
* unregistered and emptied the tree, then failed the final rmdir — the git
|
|
523
|
+
* half is done, so the flow continues with the DSH half). Session archives
|
|
524
|
+
* never abort the flow (a rejected archive is logged and skipped); a failed
|
|
525
|
+
* workspace unregistration DOES reject — the caller's UI owns the retry.
|
|
526
|
+
*/
|
|
527
|
+
async function removeWorktreeFully(deps, target) {
|
|
528
|
+
try {
|
|
529
|
+
await deps.removeWorktree(target.path, target.force);
|
|
530
|
+
} catch (reason) {
|
|
531
|
+
if ((await deps.probeDirectories([target.path]).catch(() => void 0))?.exists[target.path] !== false) throw reason;
|
|
532
|
+
}
|
|
533
|
+
for (const sessionId of target.archiveSessionIds ?? []) await deps.archiveSession(sessionId).catch((reason) => {
|
|
534
|
+
console.warn("session archive rejected during worktree removal:", reason);
|
|
535
|
+
});
|
|
536
|
+
if (target.workspaceId !== void 0) await deps.deleteWorkspace(target.workspaceId);
|
|
537
|
+
}
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region src/client/worktree-prune.ts
|
|
540
|
+
/** Canonical-ish key for cross-source path comparison: both sides come from
|
|
541
|
+
* the same host, but the scan assembles `<rootDir>/<child>` while the
|
|
542
|
+
* workspace model stores its own canonical spelling — separators are the
|
|
543
|
+
* only drift worth papering over. */
|
|
544
|
+
function pathKey(path) {
|
|
545
|
+
return path.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
546
|
+
}
|
|
547
|
+
/** Freshest `updatedAt` across QUALIFYING sessions (non-blank, non-subagent
|
|
548
|
+
* — the same qualification the archive set uses); 0 when nothing qualifies,
|
|
549
|
+
* which reads as "least active in the room". Shared by the lazy prune's
|
|
550
|
+
* plan input and the manager dialog's last-use column so the two activity
|
|
551
|
+
* figures can never drift apart. */
|
|
552
|
+
function freshestUpdatedAt(summaries) {
|
|
553
|
+
let latest = 0;
|
|
554
|
+
for (const summary of summaries) {
|
|
555
|
+
if (summary === void 0 || summary.blank || summary.origin === "subagent") continue;
|
|
556
|
+
if (summary.updatedAt > latest) latest = summary.updatedAt;
|
|
557
|
+
}
|
|
558
|
+
return latest;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Which worktrees the lazy prune removes, least-recently-active first.
|
|
562
|
+
* The cap counts every valid worktree INCLUDING the excluded ones (the
|
|
563
|
+
* fresh creation counts against the cap it may have just overfilled), but
|
|
564
|
+
* excluded directories are never candidates: the plan deletes the
|
|
565
|
+
* overflow's worth of the least-active non-excluded paths, so a cap
|
|
566
|
+
* tighter than the exclusion set simply deletes nothing this round.
|
|
567
|
+
* Ties (two never-used directories) break alphabetically for a stable,
|
|
568
|
+
* testable order.
|
|
569
|
+
*/
|
|
570
|
+
function planPrune(input) {
|
|
571
|
+
const keep = Math.max(1, Math.floor(input.keep));
|
|
572
|
+
const overflow = Math.max(0, input.paths.length - keep);
|
|
573
|
+
if (overflow === 0) return [];
|
|
574
|
+
const excluded = new Set([...input.exclude].map(pathKey));
|
|
575
|
+
return input.paths.filter((path) => !excluded.has(pathKey(path))).slice().sort((a, b) => (input.activity[pathKey(a)] ?? 0) - (input.activity[pathKey(b)] ?? 0) || pathKey(a).localeCompare(pathKey(b))).slice(0, overflow);
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Walk the plan sequentially: a candidate with uncommitted changes is
|
|
579
|
+
* SKIPPED, never forced (the manager dialog is where those get a human
|
|
580
|
+
* decision); a removal that throws is recorded and the walk continues, so
|
|
581
|
+
* one locked directory cannot strand the rest. Every removal rides the
|
|
582
|
+
* shared flow with `force: false`, always.
|
|
583
|
+
*/
|
|
584
|
+
async function runAutoPrune(deps, targets) {
|
|
585
|
+
const report = {
|
|
586
|
+
removed: [],
|
|
587
|
+
skippedDirty: [],
|
|
588
|
+
failed: []
|
|
589
|
+
};
|
|
590
|
+
for (const target of targets) try {
|
|
591
|
+
if ((await deps.inspectWorktree(target.path)).dirty > 0) {
|
|
592
|
+
report.skippedDirty.push(target.path);
|
|
593
|
+
continue;
|
|
594
|
+
}
|
|
595
|
+
await removeWorktreeFully(deps, {
|
|
596
|
+
...target,
|
|
597
|
+
force: false
|
|
598
|
+
});
|
|
599
|
+
report.removed.push(target.path);
|
|
600
|
+
} catch (reason) {
|
|
601
|
+
report.failed.push({
|
|
602
|
+
path: target.path,
|
|
603
|
+
message: reason instanceof Error ? reason.message : String(reason)
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
return report;
|
|
607
|
+
}
|
|
608
|
+
//#endregion
|
|
609
|
+
//#region src/client/session-directory.ts
|
|
610
|
+
/**
|
|
611
|
+
* Unified Session working-directory resolution and dual-mode worktree
|
|
612
|
+
* ownership helpers.
|
|
613
|
+
*
|
|
614
|
+
* Supports both:
|
|
615
|
+
* 1. Standalone workspace mode: a worktree is registered as its own Workspace
|
|
616
|
+
* (`workspace.path === worktreePath`).
|
|
617
|
+
* 2. Shared workspace mode (`switchSessionDirectory`): a session stays under
|
|
618
|
+
* its parent repository Workspace while its projected `workingDirectory`
|
|
619
|
+
* points at `worktreePath` (or a subdirectory inside it).
|
|
620
|
+
*/
|
|
621
|
+
function readProjectedString(values, key) {
|
|
622
|
+
if (values === void 0) return void 0;
|
|
623
|
+
const value = values[key];
|
|
624
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Select a Session's effective working directory from a sessions list snapshot,
|
|
628
|
+
* matching DSH's `selectSessionDirectory` precedence:
|
|
629
|
+
* 1. `projectionsBySession[sessionId].values.workingDirectory`
|
|
630
|
+
* 2. `byId[sessionId].projectionValues.workingDirectory`
|
|
631
|
+
* 3. `byId[sessionId].cwd` (original session header directory)
|
|
632
|
+
*/
|
|
633
|
+
function selectSessionDirectory(state, sessionId) {
|
|
634
|
+
const projected = readProjectedString(state.projectionsBySession?.[sessionId]?.values, "workingDirectory") ?? readProjectedString(state.byId[sessionId]?.projectionValues, "workingDirectory");
|
|
635
|
+
if (projected !== void 0) return projected;
|
|
636
|
+
const cwd = state.byId[sessionId]?.cwd;
|
|
637
|
+
return typeof cwd === "string" && cwd.length > 0 ? cwd : void 0;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Whether `sessionId` is currently managed by official `forgeWorktree`
|
|
641
|
+
* projection (checks both `projectionsBySession` and `byId.projectionValues`).
|
|
642
|
+
*/
|
|
643
|
+
function hasForgeManagedWorktree(state, sessionId) {
|
|
644
|
+
const fromProjections = state.projectionsBySession?.[sessionId]?.values?.forgeWorktree;
|
|
645
|
+
if (fromProjections !== void 0 && fromProjections !== null) return true;
|
|
646
|
+
const fromSummary = state.byId[sessionId]?.projectionValues?.forgeWorktree;
|
|
647
|
+
return fromSummary !== void 0 && fromSummary !== null;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Resolve a Session's effective directory at gesture/service time:
|
|
651
|
+
* live connected projection face → sessions list snapshot → owning workspace path.
|
|
652
|
+
*/
|
|
653
|
+
function resolveEffectiveSessionPath(sessions, sessionId, workspaces) {
|
|
654
|
+
const liveValue = sessions.binding?.(sessionId)?.session?.projections?.faceOf?.("workingDirectory")?.getSnapshot();
|
|
655
|
+
if (typeof liveValue === "string" && liveValue.length > 0) return liveValue;
|
|
656
|
+
const fromList = selectSessionDirectory(sessions.list.getSnapshot(), sessionId);
|
|
657
|
+
if (fromList !== void 0) return fromList;
|
|
658
|
+
return workspaces.find((ws) => ws.sessionIds.includes(sessionId))?.path;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Normalize a directory path into a slash-canonical comparison key (`/` separators,
|
|
662
|
+
* no trailing slash except root, lowercased for Windows case-insensitivity).
|
|
663
|
+
*/
|
|
664
|
+
function canonicalPathKey(raw) {
|
|
665
|
+
return pathKey(raw);
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Whether `candidate` equals `worktreePath` or lies inside it as a subdirectory.
|
|
669
|
+
* Guards against sibling-prefix collisions (`/repo/wt` vs `/repo/wt2`).
|
|
670
|
+
*/
|
|
671
|
+
function isPathWithinWorktree(candidate, worktreePath) {
|
|
672
|
+
if (candidate === void 0 || candidate.length === 0) return false;
|
|
673
|
+
const target = canonicalPathKey(worktreePath);
|
|
674
|
+
const dir = canonicalPathKey(candidate);
|
|
675
|
+
if (target === "" || dir === "") return false;
|
|
676
|
+
if (dir === target) return true;
|
|
677
|
+
const prefix = target.endsWith("/") ? target : `${target}/`;
|
|
678
|
+
return dir.startsWith(prefix);
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Find an existing unarchived blank session under `parentWorkspace` whose
|
|
682
|
+
* effective working directory already matches `targetPath` exactly.
|
|
683
|
+
*
|
|
684
|
+
* Mirrors DSH's `connectWorkspace` blank-session reuse without stealing blank
|
|
685
|
+
* sessions belonging to the main checkout or a different worktree.
|
|
686
|
+
*/
|
|
687
|
+
function findReusableBlankSessionInWorktree(parentWorkspace, targetPath, sessionsState, archivedSessionIds) {
|
|
688
|
+
const archived = new Set(archivedSessionIds);
|
|
689
|
+
const targetKey = canonicalPathKey(targetPath);
|
|
690
|
+
for (const sessionId of parentWorkspace.sessionIds) {
|
|
691
|
+
if (archived.has(sessionId)) continue;
|
|
692
|
+
const summary = sessionsState.byId[sessionId];
|
|
693
|
+
if (summary === void 0 || summary.blank !== true || summary.origin === "subagent") continue;
|
|
694
|
+
const effectiveDir = selectSessionDirectory(sessionsState, sessionId);
|
|
695
|
+
if (effectiveDir !== void 0 && canonicalPathKey(effectiveDir) === targetKey) return sessionId;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Compute removal/prune ownership facts for `worktreePath` across both
|
|
700
|
+
* standalone-workspace and shared-workspace (session-directory) sessions.
|
|
701
|
+
*/
|
|
702
|
+
function collectWorktreeOwnership(worktreePath, workspaces, sessionsState, archivedSessionIds) {
|
|
703
|
+
const targetKey = canonicalPathKey(worktreePath);
|
|
704
|
+
const standaloneWorkspace = workspaces.find((item) => canonicalPathKey(item.path) === targetKey);
|
|
705
|
+
const archived = new Set(archivedSessionIds);
|
|
706
|
+
const memberIds = /* @__PURE__ */ new Set();
|
|
707
|
+
for (const sessionId of Object.keys(sessionsState.byId)) if (isPathWithinWorktree(selectSessionDirectory(sessionsState, sessionId), worktreePath)) memberIds.add(sessionId);
|
|
708
|
+
if (standaloneWorkspace !== void 0) for (const sessionId of standaloneWorkspace.sessionIds) {
|
|
709
|
+
const effectiveDir = selectSessionDirectory(sessionsState, sessionId);
|
|
710
|
+
if (effectiveDir === void 0 || isPathWithinWorktree(effectiveDir, worktreePath)) memberIds.add(sessionId);
|
|
711
|
+
}
|
|
712
|
+
let running = false;
|
|
713
|
+
let hasSessionBinding = false;
|
|
714
|
+
const archiveIds = [];
|
|
715
|
+
const activitySummaries = [];
|
|
716
|
+
for (const sessionId of memberIds) {
|
|
717
|
+
const summary = sessionsState.byId[sessionId];
|
|
718
|
+
if (summary === void 0) continue;
|
|
719
|
+
if (typeof summary.updatedAt === "number") activitySummaries.push({
|
|
720
|
+
updatedAt: summary.updatedAt,
|
|
721
|
+
...summary.blank === void 0 ? {} : { blank: summary.blank },
|
|
722
|
+
...summary.origin === void 0 ? {} : { origin: summary.origin }
|
|
723
|
+
});
|
|
724
|
+
if (summary.running === true) running = true;
|
|
725
|
+
if (summary.origin === "subagent") continue;
|
|
726
|
+
if (!archived.has(sessionId)) {
|
|
727
|
+
hasSessionBinding = true;
|
|
728
|
+
if (!summary.blank) archiveIds.push(sessionId);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
const mode = standaloneWorkspace !== void 0 ? "standalone" : hasSessionBinding ? "session" : "none";
|
|
732
|
+
return {
|
|
733
|
+
running,
|
|
734
|
+
workspaceId: standaloneWorkspace?.workspaceId,
|
|
735
|
+
archiveIds,
|
|
736
|
+
activity: freshestUpdatedAt(activitySummaries),
|
|
737
|
+
mode
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
//#endregion
|
|
457
741
|
//#region src/client/head-poll.ts
|
|
458
742
|
/**
|
|
459
743
|
* Shared poll of the checked-out branch while the page is visible.
|
|
@@ -2205,9 +2489,9 @@ window.__ModuleLoader__.load((() => {
|
|
|
2205
2489
|
let nextSeq = 0;
|
|
2206
2490
|
let queue = [];
|
|
2207
2491
|
let mountedHosts = 0;
|
|
2208
|
-
const listeners$
|
|
2209
|
-
function notify() {
|
|
2210
|
-
for (const listener of listeners$
|
|
2492
|
+
const listeners$2 = /* @__PURE__ */ new Set();
|
|
2493
|
+
function notify$1() {
|
|
2494
|
+
for (const listener of listeners$2) listener();
|
|
2211
2495
|
}
|
|
2212
2496
|
/**
|
|
2213
2497
|
* Push a toast message onto the global sequential queue.
|
|
@@ -2225,13 +2509,13 @@ window.__ModuleLoader__.load((() => {
|
|
|
2225
2509
|
tone
|
|
2226
2510
|
};
|
|
2227
2511
|
queue = [...queue, entry];
|
|
2228
|
-
notify();
|
|
2512
|
+
notify$1();
|
|
2229
2513
|
}
|
|
2230
2514
|
/** Dismiss the currently visible head toast (if its seq still matches). */
|
|
2231
2515
|
function shiftToast(seq) {
|
|
2232
2516
|
if (queue[0]?.seq !== seq) return;
|
|
2233
2517
|
queue = queue.slice(1);
|
|
2234
|
-
notify();
|
|
2518
|
+
notify$1();
|
|
2235
2519
|
}
|
|
2236
2520
|
/** Current head toast waiting to be rendered, or undefined when empty. */
|
|
2237
2521
|
function peekToast() {
|
|
@@ -2239,9 +2523,9 @@ window.__ModuleLoader__.load((() => {
|
|
|
2239
2523
|
}
|
|
2240
2524
|
/** Subscribe to queue changes. */
|
|
2241
2525
|
function subscribeToasts(listener) {
|
|
2242
|
-
listeners$
|
|
2526
|
+
listeners$2.add(listener);
|
|
2243
2527
|
return () => {
|
|
2244
|
-
listeners$
|
|
2528
|
+
listeners$2.delete(listener);
|
|
2245
2529
|
};
|
|
2246
2530
|
}
|
|
2247
2531
|
/** Register one mounted `shell.overlay` host and return its unregister disposer. */
|
|
@@ -4240,10 +4524,10 @@ window.__ModuleLoader__.load((() => {
|
|
|
4240
4524
|
let jobs = [];
|
|
4241
4525
|
let lastId = 0;
|
|
4242
4526
|
const aborts = /* @__PURE__ */ new Map();
|
|
4243
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
4527
|
+
const listeners$1 = /* @__PURE__ */ new Set();
|
|
4244
4528
|
function publish(next) {
|
|
4245
4529
|
jobs = next;
|
|
4246
|
-
for (const listener of [...listeners]) listener();
|
|
4530
|
+
for (const listener of [...listeners$1]) listener();
|
|
4247
4531
|
}
|
|
4248
4532
|
/**
|
|
4249
4533
|
* The job running for a directory.
|
|
@@ -4258,9 +4542,9 @@ window.__ModuleLoader__.load((() => {
|
|
|
4258
4542
|
* @returns the unsubscribe.
|
|
4259
4543
|
*/
|
|
4260
4544
|
function subscribeSyncJobs(listener) {
|
|
4261
|
-
listeners.add(listener);
|
|
4545
|
+
listeners$1.add(listener);
|
|
4262
4546
|
return () => {
|
|
4263
|
-
listeners.delete(listener);
|
|
4547
|
+
listeners$1.delete(listener);
|
|
4264
4548
|
};
|
|
4265
4549
|
}
|
|
4266
4550
|
/**
|
|
@@ -4339,7 +4623,7 @@ window.__ModuleLoader__.load((() => {
|
|
|
4339
4623
|
*/
|
|
4340
4624
|
function recordPushFailure(cwd, failure) {
|
|
4341
4625
|
pushFailures.set(cwd, failure);
|
|
4342
|
-
for (const listener of [...listeners]) listener();
|
|
4626
|
+
for (const listener of [...listeners$1]) listener();
|
|
4343
4627
|
}
|
|
4344
4628
|
/**
|
|
4345
4629
|
* Take the failed push waiting for a directory (it is forgotten once taken).
|
|
@@ -4959,10 +5243,9 @@ window.__ModuleLoader__.load((() => {
|
|
|
4959
5243
|
}), document.body);
|
|
4960
5244
|
}
|
|
4961
5245
|
/** The tool-row entry registered into conversation.input.left. */
|
|
4962
|
-
function BranchChipDock({ sessionId, useSessions, useSession, adoptWorktree, describeWorktreeRemoval, removeWorktree, pruneWorktrees, openGraphByDefault, t }) {
|
|
4963
|
-
const
|
|
5246
|
+
function BranchChipDock({ sessionId, useSessions, useSession, adoptWorktree, isSwitchSessionDirectory, armDeferredWorktree, describeWorktreeRemoval, removeWorktree, pruneWorktrees, openGraphByDefault, t }) {
|
|
5247
|
+
const cwd = useSessions((state) => selectSessionDirectory(state, sessionId));
|
|
4964
5248
|
const session = useSession((s) => s);
|
|
4965
|
-
const cwd = summary?.cwd;
|
|
4966
5249
|
const [repo, refresh] = useRepoStatus(cwd);
|
|
4967
5250
|
const syncJob = useSyncJob(cwd);
|
|
4968
5251
|
const [menuOpen, setMenuOpen] = (0, react.useState)(false);
|
|
@@ -5361,15 +5644,25 @@ window.__ModuleLoader__.load((() => {
|
|
|
5361
5644
|
refresh,
|
|
5362
5645
|
t
|
|
5363
5646
|
]);
|
|
5647
|
+
const adoptOptions = (0, react.useCallback)(() => ({
|
|
5648
|
+
...session.blank && repo.facts?.main === true ? { reuseBlankSessionId: sessionId } : {},
|
|
5649
|
+
...repo.facts?.repoRoot === void 0 ? {} : { repoRoot: repo.facts.repoRoot }
|
|
5650
|
+
}), [
|
|
5651
|
+
repo.facts?.main,
|
|
5652
|
+
repo.facts?.repoRoot,
|
|
5653
|
+
session.blank,
|
|
5654
|
+
sessionId
|
|
5655
|
+
]);
|
|
5364
5656
|
/** Worktree-group flow: hop the session into the EXISTING worktree
|
|
5365
5657
|
* directory. No git action, no confirm — the row menu's hop IS the jump
|
|
5366
5658
|
* (a directory jump is reversible and touches nothing), and the owner's
|
|
5367
|
-
* adoptWorktree
|
|
5659
|
+
* adoptWorktree opens the worktree (either as a standalone Workspace or by
|
|
5660
|
+
* switching the session's working directory when shared mode is enabled). */
|
|
5368
5661
|
const doAdoptWorktree = (0, react.useCallback)((path) => {
|
|
5369
5662
|
if (blocked()) return;
|
|
5370
5663
|
busyRef.current = true;
|
|
5371
5664
|
setBusy(true);
|
|
5372
|
-
adoptWorktree(path).then(() => {
|
|
5665
|
+
adoptWorktree(path, adoptOptions()).then(() => {
|
|
5373
5666
|
setMenuOpen(false);
|
|
5374
5667
|
}).catch((cause) => {
|
|
5375
5668
|
showError(cause instanceof Error ? cause.message : String(cause));
|
|
@@ -5378,21 +5671,44 @@ window.__ModuleLoader__.load((() => {
|
|
|
5378
5671
|
setBusy(false);
|
|
5379
5672
|
});
|
|
5380
5673
|
}, [
|
|
5674
|
+
adoptOptions,
|
|
5381
5675
|
adoptWorktree,
|
|
5382
5676
|
blocked,
|
|
5383
5677
|
showError
|
|
5384
5678
|
]);
|
|
5385
|
-
/** Worktree flow:
|
|
5386
|
-
*
|
|
5387
|
-
*
|
|
5388
|
-
*
|
|
5389
|
-
* pre-create fetch surfaces as a toast without undoing the creation. */
|
|
5679
|
+
/** Worktree flow: in shared-workspace mode (`switchSessionDirectory`), new
|
|
5680
|
+
* worktrees are armed lazily until the first user message arrives while
|
|
5681
|
+
* existing worktrees still switch immediately; in standalone-workspace mode,
|
|
5682
|
+
* POST /worktree runs immediately and opens the workspace. */
|
|
5390
5683
|
const doWorktree = (0, react.useCallback)((branch, cutout, name) => runGuarded(async () => {
|
|
5391
5684
|
if (cwd === void 0) return "no session directory";
|
|
5392
|
-
const
|
|
5685
|
+
const customName = name?.trim();
|
|
5686
|
+
if (isSwitchSessionDirectory?.() === true && armDeferredWorktree !== void 0) {
|
|
5687
|
+
const targetBranch = repo.facts?.branches.find((entry) => entry.name === branch)?.kind === "remote" ? localBranchName(branch) : branch;
|
|
5688
|
+
const existing = cutout ? void 0 : repo.facts?.worktrees.find((w) => !w.main && w.branch === targetBranch);
|
|
5689
|
+
if (existing !== void 0) try {
|
|
5690
|
+
await adoptWorktree(existing.path, adoptOptions());
|
|
5691
|
+
return;
|
|
5692
|
+
} catch (cause) {
|
|
5693
|
+
return cause instanceof Error ? cause.message : String(cause);
|
|
5694
|
+
}
|
|
5695
|
+
try {
|
|
5696
|
+
await armDeferredWorktree({
|
|
5697
|
+
repoPath: cwd,
|
|
5698
|
+
branch,
|
|
5699
|
+
cutout,
|
|
5700
|
+
...customName !== void 0 && customName !== "" ? { name: customName } : {},
|
|
5701
|
+
...cutout && (customName === void 0 || customName === "") ? { random: true } : {}
|
|
5702
|
+
}, adoptOptions());
|
|
5703
|
+
return;
|
|
5704
|
+
} catch (cause) {
|
|
5705
|
+
return cause instanceof Error ? cause.message : String(cause);
|
|
5706
|
+
}
|
|
5707
|
+
}
|
|
5708
|
+
const result = cutout ? customName !== void 0 && customName !== "" ? await requestWorktreeCutout(cwd, branch, customName) : await requestWorktreeCutout(cwd, branch, void 0, { random: true }) : await requestWorktree(cwd, branch);
|
|
5393
5709
|
if (!result.ok) return result.error;
|
|
5394
5710
|
try {
|
|
5395
|
-
await adoptWorktree(result.path);
|
|
5711
|
+
await adoptWorktree(result.path, adoptOptions());
|
|
5396
5712
|
} catch (cause) {
|
|
5397
5713
|
return cause instanceof Error ? cause.message : String(cause);
|
|
5398
5714
|
}
|
|
@@ -5405,10 +5721,14 @@ window.__ModuleLoader__.load((() => {
|
|
|
5405
5721
|
else if (report.failed.length > 0) pushToast(t("pruneFailed", { n: report.failed.length }));
|
|
5406
5722
|
}).catch(() => {});
|
|
5407
5723
|
}), [
|
|
5724
|
+
adoptOptions,
|
|
5408
5725
|
adoptWorktree,
|
|
5409
|
-
|
|
5726
|
+
armDeferredWorktree,
|
|
5410
5727
|
cwd,
|
|
5728
|
+
isSwitchSessionDirectory,
|
|
5729
|
+
pruneWorktrees,
|
|
5411
5730
|
pushToast,
|
|
5731
|
+
repo.facts?.worktrees,
|
|
5412
5732
|
runGuarded,
|
|
5413
5733
|
t
|
|
5414
5734
|
]);
|
|
@@ -5421,13 +5741,14 @@ window.__ModuleLoader__.load((() => {
|
|
|
5421
5741
|
}, [facts, inLinkedWorktree]);
|
|
5422
5742
|
const localNames = (0, react.useMemo)(() => rows.filter((row) => row.kind !== "remote").map((row) => row.name), [rows]);
|
|
5423
5743
|
if (facts === null) return null;
|
|
5424
|
-
const confirmLocalName = confirm === null ? "" : localBranchName(confirm.branch);
|
|
5744
|
+
const confirmLocalName = confirm === null ? "" : confirm.remote === true ? localBranchName(confirm.branch) : confirm.branch;
|
|
5425
5745
|
const isCutout = confirm?.kind === "worktree-cutout";
|
|
5426
5746
|
const cutoutDraft = isCutout ? confirm.draft ?? "" : "";
|
|
5427
|
-
const
|
|
5428
|
-
const
|
|
5747
|
+
const cutoutBlank = cutoutDraft.trim() === "";
|
|
5748
|
+
const cutoutIssue = isCutout && !cutoutBlank ? branchNameIssue(cutoutDraft) : null;
|
|
5749
|
+
const cutoutDuplicate = isCutout && !cutoutBlank && cutoutIssue === null && localNames.includes(cutoutDraft);
|
|
5429
5750
|
const cutoutValid = cutoutIssue === null && !cutoutDuplicate;
|
|
5430
|
-
const cutoutHint = cutoutDuplicate ? t("menuNewBranchExists") : cutoutIssue !== null
|
|
5751
|
+
const cutoutHint = cutoutDuplicate ? t("menuNewBranchExists") : cutoutIssue !== null ? t("menuNewBranchBad") : void 0;
|
|
5431
5752
|
const existingWorktree = confirm === null || confirm.kind !== "worktree" ? void 0 : facts.worktrees.find((w) => w.branch === confirmLocalName);
|
|
5432
5753
|
const removalFactsNow = confirm?.kind === "remove-worktree" && confirm.path !== void 0 && removalPath === confirm.path ? removalFacts : void 0;
|
|
5433
5754
|
const removalDetails = confirm?.kind === "remove-worktree" && confirm.path !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [removalFactsNow === void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -5474,7 +5795,7 @@ window.__ModuleLoader__.load((() => {
|
|
|
5474
5795
|
draft: value
|
|
5475
5796
|
} : current);
|
|
5476
5797
|
},
|
|
5477
|
-
draftPlaceholder: t("
|
|
5798
|
+
draftPlaceholder: t("cutoutNewBranchPlaceholder"),
|
|
5478
5799
|
...cutoutValid ? {} : { draftInvalid: true },
|
|
5479
5800
|
...cutoutHint === void 0 ? {} : { draftHint: cutoutHint }
|
|
5480
5801
|
} : {},
|
|
@@ -5531,9 +5852,11 @@ window.__ModuleLoader__.load((() => {
|
|
|
5531
5852
|
});
|
|
5532
5853
|
},
|
|
5533
5854
|
onCutWorktree: (base) => {
|
|
5855
|
+
const row = rows.find((r) => r.name === base);
|
|
5534
5856
|
setConfirm({
|
|
5535
5857
|
kind: "worktree-cutout",
|
|
5536
|
-
branch: base
|
|
5858
|
+
branch: base,
|
|
5859
|
+
remote: row?.kind === "remote"
|
|
5537
5860
|
});
|
|
5538
5861
|
},
|
|
5539
5862
|
onRemoveWorktree: stageRemoveWorktree,
|
|
@@ -5586,17 +5909,7 @@ window.__ModuleLoader__.load((() => {
|
|
|
5586
5909
|
}),
|
|
5587
5910
|
confirmBundle !== null && !menuOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChipConfirm, {
|
|
5588
5911
|
anchorRef: chipRef,
|
|
5589
|
-
...confirmBundle
|
|
5590
|
-
...isCutout ? { draft: cutoutDraft } : {},
|
|
5591
|
-
...isCutout ? { onDraftChange: (value) => {
|
|
5592
|
-
setConfirm((current) => current?.kind === "worktree-cutout" ? {
|
|
5593
|
-
...current,
|
|
5594
|
-
draft: value
|
|
5595
|
-
} : current);
|
|
5596
|
-
} } : {},
|
|
5597
|
-
draftPlaceholder: t("menuNewBranchPlaceholder"),
|
|
5598
|
-
...isCutout && !cutoutValid ? { draftInvalid: true } : {},
|
|
5599
|
-
...cutoutHint === void 0 ? {} : { draftHint: cutoutHint }
|
|
5912
|
+
...confirmBundle
|
|
5600
5913
|
}),
|
|
5601
5914
|
pushBranch !== null && cwd !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PushDialog, {
|
|
5602
5915
|
repoPath: cwd,
|
|
@@ -5700,9 +6013,12 @@ window.__ModuleLoader__.load((() => {
|
|
|
5700
6013
|
this.failed = false;
|
|
5701
6014
|
this.publish();
|
|
5702
6015
|
},
|
|
5703
|
-
setFetchBeforeCreate: (value) => this.setSimpleFlag("fetchBeforeCreate", value),
|
|
5704
|
-
setOpenGraphByDefault: (value) => this.setSimpleFlag("openGraphByDefault", value),
|
|
5705
|
-
setAutoPruneWorktrees: (value) => this.setSimpleFlag("autoPruneWorktrees", value),
|
|
6016
|
+
setFetchBeforeCreate: (value) => this.setSimpleFlag("fetchBeforeCreate", value, false),
|
|
6017
|
+
setOpenGraphByDefault: (value) => this.setSimpleFlag("openGraphByDefault", value, false),
|
|
6018
|
+
setAutoPruneWorktrees: (value) => this.setSimpleFlag("autoPruneWorktrees", value, false),
|
|
6019
|
+
setHideOfficialWorktreeEntry: (value) => this.setSimpleFlag("hideOfficialWorktreeEntry", value, true),
|
|
6020
|
+
setSwitchSessionDirectory: (value) => this.setSimpleFlag("switchSessionDirectory", value, false),
|
|
6021
|
+
setManageOfficialWorktrees: (value) => this.setSimpleFlag("manageOfficialWorktrees", value, false),
|
|
5706
6022
|
editKeepWorktrees: (text) => {
|
|
5707
6023
|
this.keepDraft = text;
|
|
5708
6024
|
this.failed = false;
|
|
@@ -5748,8 +6064,8 @@ window.__ModuleLoader__.load((() => {
|
|
|
5748
6064
|
* snapping back with no explanation. The failure is recorded instead and
|
|
5749
6065
|
* the card renders a retry note beside the switch.
|
|
5750
6066
|
*/
|
|
5751
|
-
async setSimpleFlag(field, value) {
|
|
5752
|
-
if (value === (this.scope.getSnapshot().value?.[field] ??
|
|
6067
|
+
async setSimpleFlag(field, value, fallback) {
|
|
6068
|
+
if (value === (this.scope.getSnapshot().value?.[field] ?? fallback)) return;
|
|
5753
6069
|
try {
|
|
5754
6070
|
await this.scope.set(field, value);
|
|
5755
6071
|
if (this.switchFailed === field) this.switchFailed = null;
|
|
@@ -5837,6 +6153,9 @@ window.__ModuleLoader__.load((() => {
|
|
|
5837
6153
|
fetchBeforeCreate: this.scope.getSnapshot().value?.fetchBeforeCreate ?? false,
|
|
5838
6154
|
openGraphByDefault: this.scope.getSnapshot().value?.openGraphByDefault ?? false,
|
|
5839
6155
|
autoPruneWorktrees: this.scope.getSnapshot().value?.autoPruneWorktrees ?? false,
|
|
6156
|
+
hideOfficialWorktreeEntry: this.scope.getSnapshot().value?.hideOfficialWorktreeEntry ?? true,
|
|
6157
|
+
switchSessionDirectory: this.scope.getSnapshot().value?.switchSessionDirectory ?? false,
|
|
6158
|
+
manageOfficialWorktrees: this.scope.getSnapshot().value?.manageOfficialWorktrees ?? false,
|
|
5840
6159
|
keepWorktreesText: keepText,
|
|
5841
6160
|
keepWorktreesValid: keepParsed !== void 0 && keepParsed >= 1,
|
|
5842
6161
|
switchFailed: this.switchFailed,
|
|
@@ -5855,69 +6174,651 @@ window.__ModuleLoader__.load((() => {
|
|
|
5855
6174
|
}
|
|
5856
6175
|
};
|
|
5857
6176
|
//#endregion
|
|
5858
|
-
//#region src/client/
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
/** Append one finished run (newest first), trimming the tail past
|
|
5864
|
-
* {@link MAX_RUNS}. Best-effort: a storage write that throws (private mode,
|
|
5865
|
-
* quota) swallows — the toast already told the user what happened. */
|
|
5866
|
-
function recordPruneRun(entry) {
|
|
5867
|
-
try {
|
|
5868
|
-
const next = [entry, ...readPruneHistory()].slice(0, MAX_RUNS);
|
|
5869
|
-
localStorage.setItem(KEY, JSON.stringify(next));
|
|
5870
|
-
} catch {}
|
|
6177
|
+
//#region src/client/action-bus.ts
|
|
6178
|
+
let currentAction = null;
|
|
6179
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
6180
|
+
function notify() {
|
|
6181
|
+
for (const listener of [...listeners]) listener();
|
|
5871
6182
|
}
|
|
5872
|
-
/**
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
* into its render — a top-level `Array.isArray` alone would let `[1, 2]`
|
|
5876
|
-
* through and take the whole card down with a TypeError. Only the fields the
|
|
5877
|
-
* card actually touches are checked; their element shapes stay trusted (a
|
|
5878
|
-
* malformed member degrades one line, not the page). */
|
|
5879
|
-
function isPruneRunEntry(value) {
|
|
5880
|
-
if (typeof value !== "object" || value === null) return false;
|
|
5881
|
-
const entry = value;
|
|
5882
|
-
return typeof entry.at === "number" && Array.isArray(entry.removed) && Array.isArray(entry.skippedDirty) && Array.isArray(entry.failed);
|
|
6183
|
+
/** Read the currently active overlay action, or null when idle. */
|
|
6184
|
+
function getWorktreeAction() {
|
|
6185
|
+
return currentAction;
|
|
5883
6186
|
}
|
|
5884
|
-
/**
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
}
|
|
5894
|
-
|
|
5895
|
-
|
|
6187
|
+
/** Subscribe to active overlay action changes. */
|
|
6188
|
+
function subscribeWorktreeAction(listener) {
|
|
6189
|
+
listeners.add(listener);
|
|
6190
|
+
return () => {
|
|
6191
|
+
listeners.delete(listener);
|
|
6192
|
+
};
|
|
6193
|
+
}
|
|
6194
|
+
/** Open the worktree manager modal, optionally pre-scoped to one repository. */
|
|
6195
|
+
function openManageWorktrees(repoFilter) {
|
|
6196
|
+
currentAction = repoFilter === void 0 ? { kind: "manage" } : {
|
|
6197
|
+
kind: "manage",
|
|
6198
|
+
repoFilter
|
|
6199
|
+
};
|
|
6200
|
+
notify();
|
|
6201
|
+
}
|
|
6202
|
+
/** Open the create-worktree-from-branch modal for a repository workspace. */
|
|
6203
|
+
function openCreateWorktree(repoPath, repoName) {
|
|
6204
|
+
currentAction = {
|
|
6205
|
+
kind: "create",
|
|
6206
|
+
repoPath,
|
|
6207
|
+
repoName
|
|
6208
|
+
};
|
|
6209
|
+
notify();
|
|
6210
|
+
}
|
|
6211
|
+
/** Open the guarded worktree removal confirmation modal for a linked worktree path. */
|
|
6212
|
+
function openRemoveWorktree(path, branch) {
|
|
6213
|
+
currentAction = {
|
|
6214
|
+
kind: "remove",
|
|
6215
|
+
path,
|
|
6216
|
+
branch
|
|
6217
|
+
};
|
|
6218
|
+
notify();
|
|
6219
|
+
}
|
|
6220
|
+
/** Dismiss the active overlay action. */
|
|
6221
|
+
function closeWorktreeAction() {
|
|
6222
|
+
if (currentAction === null) return;
|
|
6223
|
+
currentAction = null;
|
|
6224
|
+
notify();
|
|
5896
6225
|
}
|
|
5897
6226
|
//#endregion
|
|
5898
|
-
//#region src/client/
|
|
6227
|
+
//#region src/client/workspace-git-cache.ts
|
|
6228
|
+
/** Whether cached git facts identify a linked worktree (not the main checkout). */
|
|
6229
|
+
function isLinkedWorktreeFacts(facts) {
|
|
6230
|
+
return facts !== void 0 && facts !== null && facts.main === false;
|
|
6231
|
+
}
|
|
5899
6232
|
/**
|
|
5900
|
-
*
|
|
5901
|
-
*
|
|
6233
|
+
* Create a client-lifetime cache of workspace git facts.
|
|
6234
|
+
* @param fetchFacts - batch group-facts transport (defaults to `requestGroupWorktrees`).
|
|
5902
6235
|
*/
|
|
5903
|
-
function
|
|
5904
|
-
|
|
5905
|
-
const
|
|
5906
|
-
const
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
n: 0
|
|
5911
|
-
};
|
|
5912
|
-
if (diff < HOUR) return {
|
|
5913
|
-
unit: "minutes",
|
|
5914
|
-
n: Math.floor(diff / MIN)
|
|
5915
|
-
};
|
|
5916
|
-
if (diff < DAY) return {
|
|
5917
|
-
unit: "hours",
|
|
5918
|
-
n: Math.floor(diff / HOUR)
|
|
6236
|
+
function createWorkspaceGitCache(fetchFacts = (paths) => requestGroupWorktrees([...paths])) {
|
|
6237
|
+
let snapshot = /* @__PURE__ */ new Map();
|
|
6238
|
+
const inFlight = /* @__PURE__ */ new Set();
|
|
6239
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
6240
|
+
let disposed = false;
|
|
6241
|
+
const emit = () => {
|
|
6242
|
+
for (const listener of [...listeners]) listener();
|
|
5919
6243
|
};
|
|
5920
|
-
|
|
6244
|
+
const probe = async (paths, force) => {
|
|
6245
|
+
if (disposed || paths.length === 0) return;
|
|
6246
|
+
const toQuery = [];
|
|
6247
|
+
const queuedKeys = /* @__PURE__ */ new Set();
|
|
6248
|
+
for (const raw of paths) {
|
|
6249
|
+
if (raw.length === 0) continue;
|
|
6250
|
+
const key = pathKey(raw);
|
|
6251
|
+
if (queuedKeys.has(key) || inFlight.has(key)) continue;
|
|
6252
|
+
if (!force && snapshot.has(key)) continue;
|
|
6253
|
+
queuedKeys.add(key);
|
|
6254
|
+
toQuery.push(raw);
|
|
6255
|
+
}
|
|
6256
|
+
if (toQuery.length === 0) return;
|
|
6257
|
+
for (const key of queuedKeys) inFlight.add(key);
|
|
6258
|
+
try {
|
|
6259
|
+
const response = await fetchFacts(toQuery);
|
|
6260
|
+
if (disposed || !response.ok) return;
|
|
6261
|
+
const next = new Map(snapshot);
|
|
6262
|
+
let changed = false;
|
|
6263
|
+
for (const queried of toQuery) {
|
|
6264
|
+
if (!Object.prototype.hasOwnProperty.call(response.facts, queried)) continue;
|
|
6265
|
+
const value = response.facts[queried] ?? null;
|
|
6266
|
+
const key = pathKey(queried);
|
|
6267
|
+
const prev = next.get(key);
|
|
6268
|
+
if (!(prev === value || prev !== void 0 && prev !== null && value !== null && prev.repoRoot === value.repoRoot && prev.repoName === value.repoName && prev.branch === value.branch && prev.main === value.main && prev.baseBranch === value.baseBranch) || !next.has(key)) {
|
|
6269
|
+
next.set(key, value);
|
|
6270
|
+
changed = true;
|
|
6271
|
+
}
|
|
6272
|
+
}
|
|
6273
|
+
if (changed) {
|
|
6274
|
+
snapshot = next;
|
|
6275
|
+
emit();
|
|
6276
|
+
}
|
|
6277
|
+
} catch {} finally {
|
|
6278
|
+
for (const key of queuedKeys) inFlight.delete(key);
|
|
6279
|
+
}
|
|
6280
|
+
};
|
|
6281
|
+
return {
|
|
6282
|
+
getSnapshot: () => snapshot,
|
|
6283
|
+
subscribe: (listener) => {
|
|
6284
|
+
listeners.add(listener);
|
|
6285
|
+
return () => {
|
|
6286
|
+
listeners.delete(listener);
|
|
6287
|
+
};
|
|
6288
|
+
},
|
|
6289
|
+
get: (path) => snapshot.get(pathKey(path)),
|
|
6290
|
+
syncPaths: async (paths, pruneMissing = false) => {
|
|
6291
|
+
if (disposed) return;
|
|
6292
|
+
if (pruneMissing) {
|
|
6293
|
+
const keep = new Set(paths.filter((p) => p.length > 0).map(pathKey));
|
|
6294
|
+
let pruned = false;
|
|
6295
|
+
const next = /* @__PURE__ */ new Map();
|
|
6296
|
+
for (const [key, value] of snapshot) if (keep.has(key)) next.set(key, value);
|
|
6297
|
+
else pruned = true;
|
|
6298
|
+
if (pruned) {
|
|
6299
|
+
snapshot = next;
|
|
6300
|
+
emit();
|
|
6301
|
+
}
|
|
6302
|
+
}
|
|
6303
|
+
await probe(paths, false);
|
|
6304
|
+
},
|
|
6305
|
+
invalidate: (path) => {
|
|
6306
|
+
const key = pathKey(path);
|
|
6307
|
+
if (!snapshot.has(key)) return;
|
|
6308
|
+
const next = new Map(snapshot);
|
|
6309
|
+
next.delete(key);
|
|
6310
|
+
snapshot = next;
|
|
6311
|
+
emit();
|
|
6312
|
+
},
|
|
6313
|
+
refresh: (paths) => probe(paths, true),
|
|
6314
|
+
dispose: () => {
|
|
6315
|
+
disposed = true;
|
|
6316
|
+
listeners.clear();
|
|
6317
|
+
inFlight.clear();
|
|
6318
|
+
}
|
|
6319
|
+
};
|
|
6320
|
+
}
|
|
6321
|
+
//#endregion
|
|
6322
|
+
//#region src/client/context-menus.ts
|
|
6323
|
+
/** Icon keys dispatched through `contextMenu.icon`. */
|
|
6324
|
+
const CONTEXT_MENU_ICON_KEYS = {
|
|
6325
|
+
create: "git-worktree.create",
|
|
6326
|
+
manage: "git-worktree.manage",
|
|
6327
|
+
remove: "git-worktree.remove"
|
|
6328
|
+
};
|
|
6329
|
+
/** Order constants positioned cleanly against DSH built-in menu entries. */
|
|
6330
|
+
const CONTEXT_MENU_ORDER = {
|
|
6331
|
+
/** After `workspace.rename` (100) and `open-in-app.workspace` (200), before `workspace.delete` (300). */
|
|
6332
|
+
workspace: 250,
|
|
6333
|
+
/** After `session.id` (450) and `open-in-app.openWith` (500), before `session.archive` (600, afterContent). */
|
|
6334
|
+
session: 520,
|
|
6335
|
+
/** After `session-log-download.export` (100) and `open-in-app.openWith` (500), before `feedback` (600). */
|
|
6336
|
+
sessionHeader: 520
|
|
6337
|
+
};
|
|
6338
|
+
/**
|
|
6339
|
+
* Register native context menu contributions for workspaces, session rows, and
|
|
6340
|
+
* session headers. Returns a single disposer removing all three registrations.
|
|
6341
|
+
*/
|
|
6342
|
+
function registerNativeContextMenus(deps) {
|
|
6343
|
+
const { contextMenus, gitCache, resolveSessionPath, t } = deps;
|
|
6344
|
+
const observers = [gitCache, ...deps.extraObservers ?? []];
|
|
6345
|
+
const resolveLinkedWorktreeSession = (sessionId) => {
|
|
6346
|
+
const cwd = resolveSessionPath(sessionId);
|
|
6347
|
+
if (cwd === void 0) return [];
|
|
6348
|
+
const facts = gitCache.get(cwd);
|
|
6349
|
+
if (facts === void 0) {
|
|
6350
|
+
gitCache.syncPaths([cwd]);
|
|
6351
|
+
return [];
|
|
6352
|
+
}
|
|
6353
|
+
if (!isLinkedWorktreeFacts(facts)) return [];
|
|
6354
|
+
return [{
|
|
6355
|
+
id: "remove",
|
|
6356
|
+
label: t("contextMenu.removeWorktree"),
|
|
6357
|
+
icon: { key: CONTEXT_MENU_ICON_KEYS.remove },
|
|
6358
|
+
danger: true,
|
|
6359
|
+
separatorBefore: true,
|
|
6360
|
+
run: () => {
|
|
6361
|
+
openRemoveWorktree(cwd, facts.branch);
|
|
6362
|
+
}
|
|
6363
|
+
}];
|
|
6364
|
+
};
|
|
6365
|
+
const disposers = [
|
|
6366
|
+
contextMenus.register({
|
|
6367
|
+
id: "git-worktree.workspace",
|
|
6368
|
+
target: "workspace",
|
|
6369
|
+
order: CONTEXT_MENU_ORDER.workspace,
|
|
6370
|
+
observe: () => observers,
|
|
6371
|
+
resolve: ({ path }) => {
|
|
6372
|
+
const facts = gitCache.get(path);
|
|
6373
|
+
if (facts === void 0) {
|
|
6374
|
+
gitCache.syncPaths([path]);
|
|
6375
|
+
return [];
|
|
6376
|
+
}
|
|
6377
|
+
if (facts === null) return [];
|
|
6378
|
+
if (!facts.main) return [{
|
|
6379
|
+
id: "remove",
|
|
6380
|
+
label: t("contextMenu.removeWorktree"),
|
|
6381
|
+
icon: { key: CONTEXT_MENU_ICON_KEYS.remove },
|
|
6382
|
+
danger: true,
|
|
6383
|
+
separatorBefore: true,
|
|
6384
|
+
run: () => {
|
|
6385
|
+
openRemoveWorktree(path, facts.branch);
|
|
6386
|
+
}
|
|
6387
|
+
}];
|
|
6388
|
+
return [{
|
|
6389
|
+
id: "create",
|
|
6390
|
+
label: t("contextMenu.newWorktree"),
|
|
6391
|
+
icon: { key: CONTEXT_MENU_ICON_KEYS.create },
|
|
6392
|
+
separatorBefore: true,
|
|
6393
|
+
run: () => {
|
|
6394
|
+
openCreateWorktree(path, facts.repoName);
|
|
6395
|
+
}
|
|
6396
|
+
}, {
|
|
6397
|
+
id: "manage",
|
|
6398
|
+
label: t("contextMenu.manageWorktrees"),
|
|
6399
|
+
icon: { key: CONTEXT_MENU_ICON_KEYS.manage },
|
|
6400
|
+
run: () => {
|
|
6401
|
+
openManageWorktrees({
|
|
6402
|
+
repoRoot: facts.repoRoot,
|
|
6403
|
+
repoName: facts.repoName
|
|
6404
|
+
});
|
|
6405
|
+
}
|
|
6406
|
+
}];
|
|
6407
|
+
}
|
|
6408
|
+
}),
|
|
6409
|
+
contextMenus.register({
|
|
6410
|
+
id: "git-worktree.session",
|
|
6411
|
+
target: "session",
|
|
6412
|
+
order: CONTEXT_MENU_ORDER.session,
|
|
6413
|
+
observe: () => observers,
|
|
6414
|
+
resolve: ({ sessionId }) => resolveLinkedWorktreeSession(sessionId)
|
|
6415
|
+
}),
|
|
6416
|
+
contextMenus.register({
|
|
6417
|
+
id: "git-worktree.sessionHeader",
|
|
6418
|
+
target: "sessionHeader",
|
|
6419
|
+
order: CONTEXT_MENU_ORDER.sessionHeader,
|
|
6420
|
+
observe: () => observers,
|
|
6421
|
+
resolve: ({ sessionId }) => resolveLinkedWorktreeSession(sessionId)
|
|
6422
|
+
})
|
|
6423
|
+
];
|
|
6424
|
+
return () => {
|
|
6425
|
+
for (const dispose of disposers) dispose();
|
|
6426
|
+
};
|
|
6427
|
+
}
|
|
6428
|
+
//#endregion
|
|
6429
|
+
//#region \0git-worktree-css:/home/runner/work/dsh-git-worktree/dsh-git-worktree/src/client/DeferredWorktreeDock.module.css?inline
|
|
6430
|
+
var DeferredWorktreeDock_module_default = {
|
|
6431
|
+
"input": "input_129068444",
|
|
6432
|
+
"dock": "dock_129068444",
|
|
6433
|
+
"card": "card_129068444",
|
|
6434
|
+
"armedCard": "armedCard_129068444",
|
|
6435
|
+
"armedInfo": "armedInfo_129068444",
|
|
6436
|
+
"header": "header_129068444",
|
|
6437
|
+
"glyph": "glyph_129068444",
|
|
6438
|
+
"glyphFailed": "glyphFailed_129068444",
|
|
6439
|
+
"title": "title_129068444",
|
|
6440
|
+
"branch": "branch_129068444",
|
|
6441
|
+
"code": "code_129068444",
|
|
6442
|
+
"steps": "steps_129068444",
|
|
6443
|
+
"step": "step_129068444",
|
|
6444
|
+
"stepMark": "stepMark_129068444",
|
|
6445
|
+
"done": "done_129068444",
|
|
6446
|
+
"failed": "failed_129068444",
|
|
6447
|
+
"runningDot": "runningDot_129068444",
|
|
6448
|
+
"waitingRing": "waitingRing_129068444",
|
|
6449
|
+
"details": "details_129068444",
|
|
6450
|
+
"message": "message_129068444",
|
|
6451
|
+
"note": "note_129068444",
|
|
6452
|
+
"footer": "footer_129068444",
|
|
6453
|
+
"actions": "actions_129068444"
|
|
6454
|
+
};
|
|
6455
|
+
//#endregion
|
|
6456
|
+
//#region src/client/DeferredWorktreeDock.tsx
|
|
6457
|
+
/**
|
|
6458
|
+
* Composer-top dock card (`conversation.input.dock`) for deferred worktree
|
|
6459
|
+
* creation in shared-workspace mode (`switchSessionDirectory`).
|
|
6460
|
+
*
|
|
6461
|
+
* - `armed`: compact bar explaining that the worktree will be created on the
|
|
6462
|
+
* first user message, with a one-click Cancel button (zero disk writes until
|
|
6463
|
+
* the message is sent).
|
|
6464
|
+
* - `running`: live step progress card while the first turn waits in
|
|
6465
|
+
* maintenance (`fetch` [optional] -> `create` -> `copy` -> `switch`).
|
|
6466
|
+
* - `failed`: failure card with phase indicator, branch/base/reason details,
|
|
6467
|
+
* and Retry / Continue-without-worktree actions.
|
|
6468
|
+
*/
|
|
6469
|
+
const localDeferredListeners = /* @__PURE__ */ new Map();
|
|
6470
|
+
/** Push a locally armed/cancelled deferred state to any mounted dock for `sessionId`. */
|
|
6471
|
+
function notifyDeferredWorktreeState(sessionId, state) {
|
|
6472
|
+
const listeners = localDeferredListeners.get(sessionId);
|
|
6473
|
+
if (listeners === void 0) return;
|
|
6474
|
+
for (const listener of [...listeners]) listener(state);
|
|
6475
|
+
}
|
|
6476
|
+
function subscribeLocalDeferred(sessionId, listener) {
|
|
6477
|
+
let set = localDeferredListeners.get(sessionId);
|
|
6478
|
+
if (set === void 0) {
|
|
6479
|
+
set = /* @__PURE__ */ new Set();
|
|
6480
|
+
localDeferredListeners.set(sessionId, set);
|
|
6481
|
+
}
|
|
6482
|
+
set.add(listener);
|
|
6483
|
+
return () => {
|
|
6484
|
+
set.delete(listener);
|
|
6485
|
+
if (set.size === 0) localDeferredListeners.delete(sessionId);
|
|
6486
|
+
};
|
|
6487
|
+
}
|
|
6488
|
+
function CheckMark() {
|
|
6489
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
6490
|
+
width: "14",
|
|
6491
|
+
height: "14",
|
|
6492
|
+
viewBox: "0 0 14 14",
|
|
6493
|
+
fill: "none",
|
|
6494
|
+
"aria-hidden": "true",
|
|
6495
|
+
className: DeferredWorktreeDock_module_default.done,
|
|
6496
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
6497
|
+
d: "M3 7.2L5.8 10L11 4.5",
|
|
6498
|
+
stroke: "currentColor",
|
|
6499
|
+
strokeWidth: "1.6",
|
|
6500
|
+
strokeLinecap: "round",
|
|
6501
|
+
strokeLinejoin: "round"
|
|
6502
|
+
})
|
|
6503
|
+
});
|
|
6504
|
+
}
|
|
6505
|
+
function StepIcon({ state }) {
|
|
6506
|
+
if (state === "done") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6507
|
+
className: DeferredWorktreeDock_module_default.stepMark,
|
|
6508
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckMark, {})
|
|
6509
|
+
});
|
|
6510
|
+
if (state === "running") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6511
|
+
className: DeferredWorktreeDock_module_default.stepMark,
|
|
6512
|
+
"aria-hidden": "true",
|
|
6513
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: DeferredWorktreeDock_module_default.runningDot })
|
|
6514
|
+
});
|
|
6515
|
+
if (state === "failed") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6516
|
+
className: DeferredWorktreeDock_module_default.stepMark,
|
|
6517
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular, {
|
|
6518
|
+
size: 14,
|
|
6519
|
+
className: DeferredWorktreeDock_module_default.failed
|
|
6520
|
+
})
|
|
6521
|
+
});
|
|
6522
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6523
|
+
className: DeferredWorktreeDock_module_default.stepMark,
|
|
6524
|
+
"aria-hidden": "true",
|
|
6525
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: DeferredWorktreeDock_module_default.waitingRing })
|
|
6526
|
+
});
|
|
6527
|
+
}
|
|
6528
|
+
function stepStateOf(phases, current, failed, phase) {
|
|
6529
|
+
const at = phases.indexOf(current);
|
|
6530
|
+
const index = phases.indexOf(phase);
|
|
6531
|
+
if (index === at) return failed ? "failed" : "running";
|
|
6532
|
+
return index < at ? "done" : "waiting";
|
|
6533
|
+
}
|
|
6534
|
+
function describeArmedTarget(spec, t) {
|
|
6535
|
+
if (spec.cutout) {
|
|
6536
|
+
const explicit = spec.name?.trim();
|
|
6537
|
+
if (explicit !== void 0 && explicit !== "") return t("deferred.armedCutout", {
|
|
6538
|
+
base: spec.branch,
|
|
6539
|
+
name: explicit
|
|
6540
|
+
});
|
|
6541
|
+
return t("deferred.armedRandom", { base: spec.branch });
|
|
6542
|
+
}
|
|
6543
|
+
return t("deferred.armedBranch", { branch: spec.branch });
|
|
6544
|
+
}
|
|
6545
|
+
const PHASE_LABEL_KEY = {
|
|
6546
|
+
fetch: "deferred.phaseFetch",
|
|
6547
|
+
create: "deferred.phaseCreate",
|
|
6548
|
+
copy: "deferred.phaseCopy",
|
|
6549
|
+
switch: "deferred.phaseSwitch"
|
|
6550
|
+
};
|
|
6551
|
+
/** Composer-top deferred worktree status & progress dock card. */
|
|
6552
|
+
function DeferredWorktreeDock({ sessionId, shouldProbeDeferred, onDeferredCompleted, t }) {
|
|
6553
|
+
const [state, setState] = (0, react.useState)(null);
|
|
6554
|
+
const [acting, setActing] = (0, react.useState)(false);
|
|
6555
|
+
const [sawFetch, setSawFetch] = (0, react.useState)(false);
|
|
6556
|
+
const completedCallbackRef = (0, react.useRef)(onDeferredCompleted);
|
|
6557
|
+
completedCallbackRef.current = onDeferredCompleted;
|
|
6558
|
+
const shouldProbeRef = (0, react.useRef)(shouldProbeDeferred);
|
|
6559
|
+
shouldProbeRef.current = shouldProbeDeferred;
|
|
6560
|
+
const applySnapshot = (0, react.useCallback)((snapshot, sid) => {
|
|
6561
|
+
setState(snapshot.state);
|
|
6562
|
+
if (snapshot.state === null) setSawFetch(false);
|
|
6563
|
+
else if (snapshot.state.kind !== "armed" && snapshot.state.phase === "fetch") setSawFetch(true);
|
|
6564
|
+
if (snapshot.completed !== void 0) completedCallbackRef.current?.(sid, snapshot.completed);
|
|
6565
|
+
}, []);
|
|
6566
|
+
(0, react.useEffect)(() => {
|
|
6567
|
+
setState(null);
|
|
6568
|
+
setActing(false);
|
|
6569
|
+
setSawFetch(false);
|
|
6570
|
+
if (sessionId === void 0 || sessionId === "") return;
|
|
6571
|
+
let active = true;
|
|
6572
|
+
const unsubLocal = subscribeLocalDeferred(sessionId, (nextState) => {
|
|
6573
|
+
if (!active) return;
|
|
6574
|
+
applySnapshot({ state: nextState }, sessionId);
|
|
6575
|
+
});
|
|
6576
|
+
if (shouldProbeRef.current?.(sessionId) ?? true) fetchDeferredWorktree(sessionId).then((res) => {
|
|
6577
|
+
if (active && res.ok && res.state !== null) applySnapshot({ state: res.state }, sessionId);
|
|
6578
|
+
});
|
|
6579
|
+
return () => {
|
|
6580
|
+
active = false;
|
|
6581
|
+
unsubLocal();
|
|
6582
|
+
};
|
|
6583
|
+
}, [sessionId, applySnapshot]);
|
|
6584
|
+
const needsStream = state !== null;
|
|
6585
|
+
(0, react.useEffect)(() => {
|
|
6586
|
+
if (!needsStream || sessionId === void 0 || sessionId === "") return;
|
|
6587
|
+
if (typeof EventSource !== "function") return;
|
|
6588
|
+
let active = true;
|
|
6589
|
+
const source = new EventSource(deferredWorktreeEventsUrl(sessionId));
|
|
6590
|
+
source.onmessage = (event) => {
|
|
6591
|
+
if (!active) return;
|
|
6592
|
+
try {
|
|
6593
|
+
const parsed = JSON.parse(event.data);
|
|
6594
|
+
applySnapshot(parsed, sessionId);
|
|
6595
|
+
} catch {}
|
|
6596
|
+
};
|
|
6597
|
+
source.onerror = () => {
|
|
6598
|
+
fetchDeferredWorktree(sessionId).then((res) => {
|
|
6599
|
+
if (active && res.ok) applySnapshot({ state: res.state }, sessionId);
|
|
6600
|
+
});
|
|
6601
|
+
};
|
|
6602
|
+
return () => {
|
|
6603
|
+
active = false;
|
|
6604
|
+
source.close();
|
|
6605
|
+
};
|
|
6606
|
+
}, [
|
|
6607
|
+
needsStream,
|
|
6608
|
+
sessionId,
|
|
6609
|
+
applySnapshot
|
|
6610
|
+
]);
|
|
6611
|
+
const sendAction = (0, react.useCallback)((action) => {
|
|
6612
|
+
if (sessionId === void 0 || acting) return;
|
|
6613
|
+
setActing(true);
|
|
6614
|
+
requestDeferredWorktreeAction(sessionId, action).then((res) => {
|
|
6615
|
+
if (res.ok) applySnapshot({ state: res.state }, sessionId);
|
|
6616
|
+
}).finally(() => {
|
|
6617
|
+
setActing(false);
|
|
6618
|
+
});
|
|
6619
|
+
}, [
|
|
6620
|
+
acting,
|
|
6621
|
+
applySnapshot,
|
|
6622
|
+
sessionId
|
|
6623
|
+
]);
|
|
6624
|
+
if (state === null || sessionId === void 0) return null;
|
|
6625
|
+
if (state.kind === "armed") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6626
|
+
className: DeferredWorktreeDock_module_default.dock,
|
|
6627
|
+
"data-git-worktree-deferred": "armed",
|
|
6628
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
6629
|
+
className: `${DeferredWorktreeDock_module_default.card} ${DeferredWorktreeDock_module_default.armedCard}`,
|
|
6630
|
+
"aria-label": t("deferred.armedTitle"),
|
|
6631
|
+
children: [
|
|
6632
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, {
|
|
6633
|
+
size: 14,
|
|
6634
|
+
className: DeferredWorktreeDock_module_default.glyph
|
|
6635
|
+
}),
|
|
6636
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6637
|
+
className: DeferredWorktreeDock_module_default.armedInfo,
|
|
6638
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6639
|
+
className: DeferredWorktreeDock_module_default.title,
|
|
6640
|
+
children: t("deferred.armedTitle")
|
|
6641
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6642
|
+
className: DeferredWorktreeDock_module_default.branch,
|
|
6643
|
+
children: describeArmedTarget(state.spec, t)
|
|
6644
|
+
})]
|
|
6645
|
+
}),
|
|
6646
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6647
|
+
size: "sm",
|
|
6648
|
+
variant: "ghost",
|
|
6649
|
+
disabled: acting,
|
|
6650
|
+
onClick: () => {
|
|
6651
|
+
sendAction("cancel");
|
|
6652
|
+
},
|
|
6653
|
+
children: t("deferred.armedCancel")
|
|
6654
|
+
})
|
|
6655
|
+
]
|
|
6656
|
+
})
|
|
6657
|
+
});
|
|
6658
|
+
const running = state.kind === "running";
|
|
6659
|
+
const failed = state.kind === "failed";
|
|
6660
|
+
const phases = sawFetch || state.phase === "fetch" ? [
|
|
6661
|
+
"fetch",
|
|
6662
|
+
"create",
|
|
6663
|
+
"copy",
|
|
6664
|
+
"switch"
|
|
6665
|
+
] : [
|
|
6666
|
+
"create",
|
|
6667
|
+
"copy",
|
|
6668
|
+
"switch"
|
|
6669
|
+
];
|
|
6670
|
+
const title = t(running ? "deferred.runningTitle" : "deferred.failedTitle");
|
|
6671
|
+
const branchBadge = state.resolvedBranch ?? (state.spec.cutout ? state.spec.name?.trim() : state.spec.branch);
|
|
6672
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6673
|
+
className: DeferredWorktreeDock_module_default.dock,
|
|
6674
|
+
"data-git-worktree-deferred": running ? state.phase : "failed",
|
|
6675
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
6676
|
+
className: DeferredWorktreeDock_module_default.card,
|
|
6677
|
+
"aria-label": title,
|
|
6678
|
+
"aria-busy": running,
|
|
6679
|
+
children: [
|
|
6680
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6681
|
+
className: DeferredWorktreeDock_module_default.header,
|
|
6682
|
+
children: [
|
|
6683
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, {
|
|
6684
|
+
size: 14,
|
|
6685
|
+
className: failed ? DeferredWorktreeDock_module_default.glyphFailed : DeferredWorktreeDock_module_default.glyph
|
|
6686
|
+
}),
|
|
6687
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6688
|
+
className: DeferredWorktreeDock_module_default.title,
|
|
6689
|
+
children: title
|
|
6690
|
+
}),
|
|
6691
|
+
branchBadge !== void 0 && branchBadge !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6692
|
+
className: DeferredWorktreeDock_module_default.branch,
|
|
6693
|
+
children: branchBadge
|
|
6694
|
+
})
|
|
6695
|
+
]
|
|
6696
|
+
}),
|
|
6697
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
6698
|
+
className: DeferredWorktreeDock_module_default.steps,
|
|
6699
|
+
children: phases.map((phase) => {
|
|
6700
|
+
const stepState = stepStateOf(phases, state.phase, failed, phase);
|
|
6701
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
6702
|
+
className: DeferredWorktreeDock_module_default.step,
|
|
6703
|
+
"data-state": stepState,
|
|
6704
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepIcon, { state: stepState }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t(PHASE_LABEL_KEY[phase]) })]
|
|
6705
|
+
}, phase);
|
|
6706
|
+
})
|
|
6707
|
+
}),
|
|
6708
|
+
failed && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
|
|
6709
|
+
className: DeferredWorktreeDock_module_default.details,
|
|
6710
|
+
children: [
|
|
6711
|
+
branchBadge !== void 0 && branchBadge !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("deferred.labelBranch") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
6712
|
+
className: DeferredWorktreeDock_module_default.code,
|
|
6713
|
+
children: branchBadge
|
|
6714
|
+
})] }),
|
|
6715
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("deferred.labelBase") }),
|
|
6716
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
6717
|
+
className: DeferredWorktreeDock_module_default.code,
|
|
6718
|
+
children: state.spec.branch
|
|
6719
|
+
}),
|
|
6720
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: t("deferred.labelReason") }),
|
|
6721
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
6722
|
+
className: DeferredWorktreeDock_module_default.message,
|
|
6723
|
+
children: state.message
|
|
6724
|
+
})
|
|
6725
|
+
]
|
|
6726
|
+
}),
|
|
6727
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6728
|
+
className: DeferredWorktreeDock_module_default.note,
|
|
6729
|
+
children: t("deferred.waitingNote")
|
|
6730
|
+
}),
|
|
6731
|
+
failed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6732
|
+
className: DeferredWorktreeDock_module_default.footer,
|
|
6733
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6734
|
+
className: DeferredWorktreeDock_module_default.actions,
|
|
6735
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6736
|
+
size: "sm",
|
|
6737
|
+
variant: "primary",
|
|
6738
|
+
disabled: acting,
|
|
6739
|
+
onClick: () => {
|
|
6740
|
+
sendAction("retry");
|
|
6741
|
+
},
|
|
6742
|
+
children: t("deferred.retry")
|
|
6743
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6744
|
+
size: "sm",
|
|
6745
|
+
variant: "ghost",
|
|
6746
|
+
disabled: acting,
|
|
6747
|
+
onClick: () => {
|
|
6748
|
+
sendAction("withdraw");
|
|
6749
|
+
},
|
|
6750
|
+
children: t("deferred.withdraw")
|
|
6751
|
+
})]
|
|
6752
|
+
})
|
|
6753
|
+
})
|
|
6754
|
+
]
|
|
6755
|
+
})
|
|
6756
|
+
});
|
|
6757
|
+
}
|
|
6758
|
+
//#endregion
|
|
6759
|
+
//#region src/client/prune-history.ts
|
|
6760
|
+
const KEY = "git-worktree:prune-history";
|
|
6761
|
+
/** The log is a recent-activity trail, not an archive: the oldest runs fall
|
|
6762
|
+
* off once this many are kept. */
|
|
6763
|
+
const MAX_RUNS = 20;
|
|
6764
|
+
/** Append one finished run (newest first), trimming the tail past
|
|
6765
|
+
* {@link MAX_RUNS}. Best-effort: a storage write that throws (private mode,
|
|
6766
|
+
* quota) swallows — the toast already told the user what happened. */
|
|
6767
|
+
function recordPruneRun(entry) {
|
|
6768
|
+
try {
|
|
6769
|
+
const next = [entry, ...readPruneHistory()].slice(0, MAX_RUNS);
|
|
6770
|
+
localStorage.setItem(KEY, JSON.stringify(next));
|
|
6771
|
+
} catch {}
|
|
6772
|
+
}
|
|
6773
|
+
/** Structural check of ONE stored run. The payload is browser-local JSON an
|
|
6774
|
+
* older build (or anything else holding this key) may have written in a
|
|
6775
|
+
* different shape, and the settings card reads `run.removed.length` straight
|
|
6776
|
+
* into its render — a top-level `Array.isArray` alone would let `[1, 2]`
|
|
6777
|
+
* through and take the whole card down with a TypeError. Only the fields the
|
|
6778
|
+
* card actually touches are checked; their element shapes stay trusted (a
|
|
6779
|
+
* malformed member degrades one line, not the page). */
|
|
6780
|
+
function isPruneRunEntry(value) {
|
|
6781
|
+
if (typeof value !== "object" || value === null) return false;
|
|
6782
|
+
const entry = value;
|
|
6783
|
+
return typeof entry.at === "number" && Array.isArray(entry.removed) && Array.isArray(entry.skippedDirty) && Array.isArray(entry.failed);
|
|
6784
|
+
}
|
|
6785
|
+
/** The recorded runs, newest first; an unreadable/foreign payload reads as
|
|
6786
|
+
* "no history" rather than throwing into the settings render — entry by
|
|
6787
|
+
* entry, so one bad record costs its own line and nothing else. */
|
|
6788
|
+
function readPruneHistory() {
|
|
6789
|
+
try {
|
|
6790
|
+
const raw = localStorage.getItem(KEY);
|
|
6791
|
+
if (raw === null) return [];
|
|
6792
|
+
const parsed = JSON.parse(raw);
|
|
6793
|
+
return Array.isArray(parsed) ? parsed.filter(isPruneRunEntry) : [];
|
|
6794
|
+
} catch {
|
|
6795
|
+
return [];
|
|
6796
|
+
}
|
|
6797
|
+
}
|
|
6798
|
+
//#endregion
|
|
6799
|
+
//#region src/client/relative-time.ts
|
|
6800
|
+
/**
|
|
6801
|
+
* Compact relative time for trailing labels, as a structured bucket the
|
|
6802
|
+
* renderer localizes ("now"/"5min"/"3h"/"2d"/"4mo"/"1y" in en).
|
|
6803
|
+
*/
|
|
6804
|
+
function relativeTime(updatedAt, now) {
|
|
6805
|
+
const MIN = 6e4;
|
|
6806
|
+
const HOUR = 36e5;
|
|
6807
|
+
const DAY = 864e5;
|
|
6808
|
+
const diff = Math.max(0, now - updatedAt);
|
|
6809
|
+
if (diff < MIN) return {
|
|
6810
|
+
unit: "now",
|
|
6811
|
+
n: 0
|
|
6812
|
+
};
|
|
6813
|
+
if (diff < HOUR) return {
|
|
6814
|
+
unit: "minutes",
|
|
6815
|
+
n: Math.floor(diff / MIN)
|
|
6816
|
+
};
|
|
6817
|
+
if (diff < DAY) return {
|
|
6818
|
+
unit: "hours",
|
|
6819
|
+
n: Math.floor(diff / HOUR)
|
|
6820
|
+
};
|
|
6821
|
+
if (diff < 30 * DAY) return {
|
|
5921
6822
|
unit: "days",
|
|
5922
6823
|
n: Math.floor(diff / DAY)
|
|
5923
6824
|
};
|
|
@@ -5985,8 +6886,27 @@ window.__ModuleLoader__.load((() => {
|
|
|
5985
6886
|
}
|
|
5986
6887
|
//#endregion
|
|
5987
6888
|
//#region src/client/scan-groups.ts
|
|
5988
|
-
/**
|
|
5989
|
-
*
|
|
6889
|
+
/**
|
|
6890
|
+
* Filter scanned worktree entries to those belonging to one repository.
|
|
6891
|
+
* Prefers exact canonical `repoRoot` matching when the host supplies it and
|
|
6892
|
+
* falls back to `repoName` for older host responses. Orphan entries (repoName
|
|
6893
|
+
* === null) are excluded while scoped.
|
|
6894
|
+
*/
|
|
6895
|
+
function filterScanEntriesByRepo(entries, repo) {
|
|
6896
|
+
const targetRoot = pathKey(repo.repoRoot);
|
|
6897
|
+
return entries.filter((entry) => {
|
|
6898
|
+
if (entry.repoName === null) return false;
|
|
6899
|
+
if (entry.repoRoot !== void 0) return pathKey(entry.repoRoot) === targetRoot;
|
|
6900
|
+
return entry.repoName === repo.repoName;
|
|
6901
|
+
});
|
|
6902
|
+
}
|
|
6903
|
+
const SOURCE_ORDER = {
|
|
6904
|
+
project: 0,
|
|
6905
|
+
official: 1,
|
|
6906
|
+
legacy: 2
|
|
6907
|
+
};
|
|
6908
|
+
/** Group the scan for display: project groups first, official worktree groups
|
|
6909
|
+
* next, legacy groups behind them, repositories alphabetical within a source,
|
|
5990
6910
|
* rows within a group by branch name, all numeric-aware so `feat/v2` sorts
|
|
5991
6911
|
* past `feat/v10`. Grouping is display-order only — the removal flows
|
|
5992
6912
|
* address rows by path. */
|
|
@@ -6008,7 +6928,7 @@ window.__ModuleLoader__.load((() => {
|
|
|
6008
6928
|
else bucket.list.push(entry);
|
|
6009
6929
|
}
|
|
6010
6930
|
const cmp = (a, b) => a.localeCompare(b, void 0, { numeric: true });
|
|
6011
|
-
const groups = [...byKey.values()].sort((a, b) => a.source === b.source ? cmp(a.repoName, b.repoName) : a.source
|
|
6931
|
+
const groups = [...byKey.values()].sort((a, b) => a.source === b.source ? cmp(a.repoName, b.repoName) : SOURCE_ORDER[a.source] - SOURCE_ORDER[b.source]).map(({ source, repoName, list }) => ({
|
|
6012
6932
|
repoName,
|
|
6013
6933
|
source,
|
|
6014
6934
|
entries: list.slice().sort((a, b) => cmp(a.branch ?? "", b.branch ?? ""))
|
|
@@ -6020,102 +6940,16 @@ window.__ModuleLoader__.load((() => {
|
|
|
6020
6940
|
}] : groups;
|
|
6021
6941
|
}
|
|
6022
6942
|
//#endregion
|
|
6023
|
-
//#region src/client/worktree-remove-flow.ts
|
|
6024
|
-
/**
|
|
6025
|
-
* Remove one worktree completely. A refused git removal rethrows UNLESS the
|
|
6026
|
-
* directory is actually gone (the Windows half-removal shape: git already
|
|
6027
|
-
* unregistered and emptied the tree, then failed the final rmdir — the git
|
|
6028
|
-
* half is done, so the flow continues with the DSH half). Session archives
|
|
6029
|
-
* never abort the flow (a rejected archive is logged and skipped); a failed
|
|
6030
|
-
* workspace unregistration DOES reject — the caller's UI owns the retry.
|
|
6031
|
-
*/
|
|
6032
|
-
async function removeWorktreeFully(deps, target) {
|
|
6033
|
-
try {
|
|
6034
|
-
await deps.removeWorktree(target.path, target.force);
|
|
6035
|
-
} catch (reason) {
|
|
6036
|
-
if ((await deps.probeDirectories([target.path]).catch(() => void 0))?.exists[target.path] !== false) throw reason;
|
|
6037
|
-
}
|
|
6038
|
-
for (const sessionId of target.archiveSessionIds ?? []) await deps.archiveSession(sessionId).catch((reason) => {
|
|
6039
|
-
console.warn("session archive rejected during worktree removal:", reason);
|
|
6040
|
-
});
|
|
6041
|
-
if (target.workspaceId !== void 0) await deps.deleteWorkspace(target.workspaceId);
|
|
6042
|
-
}
|
|
6043
|
-
//#endregion
|
|
6044
|
-
//#region src/client/worktree-prune.ts
|
|
6045
|
-
/** Canonical-ish key for cross-source path comparison: both sides come from
|
|
6046
|
-
* the same host, but the scan assembles `<rootDir>/<child>` while the
|
|
6047
|
-
* workspace model stores its own canonical spelling — separators are the
|
|
6048
|
-
* only drift worth papering over. */
|
|
6049
|
-
function pathKey(path) {
|
|
6050
|
-
return path.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
6051
|
-
}
|
|
6052
|
-
/** Freshest `updatedAt` across QUALIFYING sessions (non-blank, non-subagent
|
|
6053
|
-
* — the same qualification the archive set uses); 0 when nothing qualifies,
|
|
6054
|
-
* which reads as "least active in the room". Shared by the lazy prune's
|
|
6055
|
-
* plan input and the manager dialog's last-use column so the two activity
|
|
6056
|
-
* figures can never drift apart. */
|
|
6057
|
-
function freshestUpdatedAt(summaries) {
|
|
6058
|
-
let latest = 0;
|
|
6059
|
-
for (const summary of summaries) {
|
|
6060
|
-
if (summary === void 0 || summary.blank || summary.origin === "subagent") continue;
|
|
6061
|
-
if (summary.updatedAt > latest) latest = summary.updatedAt;
|
|
6062
|
-
}
|
|
6063
|
-
return latest;
|
|
6064
|
-
}
|
|
6065
|
-
/**
|
|
6066
|
-
* Which worktrees the lazy prune removes, least-recently-active first.
|
|
6067
|
-
* The cap counts every valid worktree INCLUDING the excluded ones (the
|
|
6068
|
-
* fresh creation counts against the cap it may have just overfilled), but
|
|
6069
|
-
* excluded directories are never candidates: the plan deletes the
|
|
6070
|
-
* overflow's worth of the least-active non-excluded paths, so a cap
|
|
6071
|
-
* tighter than the exclusion set simply deletes nothing this round.
|
|
6072
|
-
* Ties (two never-used directories) break alphabetically for a stable,
|
|
6073
|
-
* testable order.
|
|
6074
|
-
*/
|
|
6075
|
-
function planPrune(input) {
|
|
6076
|
-
const keep = Math.max(1, Math.floor(input.keep));
|
|
6077
|
-
const overflow = Math.max(0, input.paths.length - keep);
|
|
6078
|
-
if (overflow === 0) return [];
|
|
6079
|
-
const excluded = new Set([...input.exclude].map(pathKey));
|
|
6080
|
-
return input.paths.filter((path) => !excluded.has(pathKey(path))).slice().sort((a, b) => (input.activity[pathKey(a)] ?? 0) - (input.activity[pathKey(b)] ?? 0) || pathKey(a).localeCompare(pathKey(b))).slice(0, overflow);
|
|
6081
|
-
}
|
|
6082
|
-
/**
|
|
6083
|
-
* Walk the plan sequentially: a candidate with uncommitted changes is
|
|
6084
|
-
* SKIPPED, never forced (the manager dialog is where those get a human
|
|
6085
|
-
* decision); a removal that throws is recorded and the walk continues, so
|
|
6086
|
-
* one locked directory cannot strand the rest. Every removal rides the
|
|
6087
|
-
* shared flow with `force: false`, always.
|
|
6088
|
-
*/
|
|
6089
|
-
async function runAutoPrune(deps, targets) {
|
|
6090
|
-
const report = {
|
|
6091
|
-
removed: [],
|
|
6092
|
-
skippedDirty: [],
|
|
6093
|
-
failed: []
|
|
6094
|
-
};
|
|
6095
|
-
for (const target of targets) try {
|
|
6096
|
-
if ((await deps.inspectWorktree(target.path)).dirty > 0) {
|
|
6097
|
-
report.skippedDirty.push(target.path);
|
|
6098
|
-
continue;
|
|
6099
|
-
}
|
|
6100
|
-
await removeWorktreeFully(deps, {
|
|
6101
|
-
...target,
|
|
6102
|
-
force: false
|
|
6103
|
-
});
|
|
6104
|
-
report.removed.push(target.path);
|
|
6105
|
-
} catch (reason) {
|
|
6106
|
-
report.failed.push({
|
|
6107
|
-
path: target.path,
|
|
6108
|
-
message: reason instanceof Error ? reason.message : String(reason)
|
|
6109
|
-
});
|
|
6110
|
-
}
|
|
6111
|
-
return report;
|
|
6112
|
-
}
|
|
6113
|
-
//#endregion
|
|
6114
6943
|
//#region \0git-worktree-css:/home/runner/work/dsh-git-worktree/dsh-git-worktree/src/client/WorktreeManagerModal.module.css?inline
|
|
6115
6944
|
var WorktreeManagerModal_module_default = {
|
|
6116
6945
|
"dialog": "dialog_854325390",
|
|
6117
6946
|
"body": "body_854325390",
|
|
6118
6947
|
"toolbar": "toolbar_854325390",
|
|
6948
|
+
"scopeBar": "scopeBar_854325390",
|
|
6949
|
+
"scopeInfo": "scopeInfo_854325390",
|
|
6950
|
+
"scopeName": "scopeName_854325390",
|
|
6951
|
+
"scopeToggle": "scopeToggle_854325390",
|
|
6952
|
+
"emptyAction": "emptyAction_854325390",
|
|
6119
6953
|
"count": "count_854325390",
|
|
6120
6954
|
"refresh": "refresh_854325390",
|
|
6121
6955
|
"status": "status_854325390",
|
|
@@ -6166,7 +7000,12 @@ window.__ModuleLoader__.load((() => {
|
|
|
6166
7000
|
}
|
|
6167
7001
|
return ids;
|
|
6168
7002
|
}
|
|
6169
|
-
|
|
7003
|
+
/** Build the hover tooltip for the open-session action button on a manager row. */
|
|
7004
|
+
function openWorktreeTooltip(source, t) {
|
|
7005
|
+
const base = t("manager.openSession");
|
|
7006
|
+
return source === "official" ? `${base}\n${t("manager.openSessionOfficialHint")}` : base;
|
|
7007
|
+
}
|
|
7008
|
+
function WorktreeManagerModal({ open, onClose, face, t, initialRepoFilter }) {
|
|
6170
7009
|
const [scan, setScan] = (0, react.useState)({ status: "loading" });
|
|
6171
7010
|
const [refreshing, setRefreshing] = (0, react.useState)(false);
|
|
6172
7011
|
const [openingPath, setOpeningPath] = (0, react.useState)(null);
|
|
@@ -6175,6 +7014,7 @@ window.__ModuleLoader__.load((() => {
|
|
|
6175
7014
|
const [removeTarget, setRemoveTarget] = (0, react.useState)(null);
|
|
6176
7015
|
const [removing, setRemoving] = (0, react.useState)(false);
|
|
6177
7016
|
const [removeError, setRemoveError] = (0, react.useState)(null);
|
|
7017
|
+
const [scopedToRepo, setScopedToRepo] = (0, react.useState)(initialRepoFilter !== void 0);
|
|
6178
7018
|
const [now, setNow] = (0, react.useState)(() => Date.now());
|
|
6179
7019
|
const scanGenRef = (0, react.useRef)(0);
|
|
6180
7020
|
const workspaceAt = (0, react.useMemo)(() => {
|
|
@@ -6201,9 +7041,13 @@ window.__ModuleLoader__.load((() => {
|
|
|
6201
7041
|
truncated: truncated === true
|
|
6202
7042
|
});
|
|
6203
7043
|
const valid = entries.filter((entry) => entry.repoName !== null);
|
|
6204
|
-
const workspaces = face.workspaces();
|
|
6205
7044
|
const running = /* @__PURE__ */ new Set();
|
|
6206
|
-
|
|
7045
|
+
if (face.describeWorktreeOwnership !== void 0) {
|
|
7046
|
+
for (const entry of entries) if (face.describeWorktreeOwnership(entry.path).running) running.add(pathKey(entry.path));
|
|
7047
|
+
} else {
|
|
7048
|
+
const workspaces = face.workspaces();
|
|
7049
|
+
for (const workspace of workspaces) for (const sessionId of workspace.sessionIds) if (face.sessionById(sessionId)?.running === true) running.add(pathKey(workspace.path));
|
|
7050
|
+
}
|
|
6207
7051
|
setRunningPaths(running);
|
|
6208
7052
|
const facts = await mapLimit(valid, INSPECT_CONCURRENCY, async (entry) => {
|
|
6209
7053
|
try {
|
|
@@ -6232,20 +7076,25 @@ window.__ModuleLoader__.load((() => {
|
|
|
6232
7076
|
setRemoveTarget(null);
|
|
6233
7077
|
setRemoveError(null);
|
|
6234
7078
|
setOpeningPath(null);
|
|
7079
|
+
setScopedToRepo(initialRepoFilter !== void 0);
|
|
6235
7080
|
loadWorktrees(true);
|
|
6236
7081
|
return () => {
|
|
6237
7082
|
scanGenRef.current += 1;
|
|
6238
7083
|
};
|
|
6239
|
-
}, [
|
|
7084
|
+
}, [
|
|
7085
|
+
open,
|
|
7086
|
+
loadWorktrees,
|
|
7087
|
+
initialRepoFilter?.repoRoot
|
|
7088
|
+
]);
|
|
6240
7089
|
const closeRemove = () => {
|
|
6241
7090
|
if (removing) return;
|
|
6242
7091
|
setRemoveTarget(null);
|
|
6243
7092
|
setRemoveError(null);
|
|
6244
7093
|
};
|
|
6245
|
-
const handleOpenWorktree = (path) => {
|
|
7094
|
+
const handleOpenWorktree = (path, repoRoot) => {
|
|
6246
7095
|
if (face.openWorktree === void 0 || openingPath !== null) return;
|
|
6247
7096
|
setOpeningPath(path);
|
|
6248
|
-
face.openWorktree(path).then(() => {
|
|
7097
|
+
face.openWorktree(path, repoRoot).then(() => {
|
|
6249
7098
|
setOpeningPath(null);
|
|
6250
7099
|
onClose();
|
|
6251
7100
|
}, (reason) => {
|
|
@@ -6263,15 +7112,16 @@ window.__ModuleLoader__.load((() => {
|
|
|
6263
7112
|
const target = removeTarget;
|
|
6264
7113
|
setRemoving(true);
|
|
6265
7114
|
setRemoveError(null);
|
|
7115
|
+
const ownership = face.describeWorktreeOwnership?.(target.path);
|
|
6266
7116
|
const workspace = workspaceAt(target.path);
|
|
7117
|
+
const targetWorkspaceId = ownership !== void 0 ? ownership.workspaceId : workspace?.workspaceId;
|
|
7118
|
+
const targetArchiveIds = ownership !== void 0 ? [...ownership.archiveIds] : workspace === void 0 ? [] : archiveIdsFor(face, workspace.sessionIds);
|
|
6267
7119
|
(target.kind === "orphan" ? (async () => {
|
|
6268
7120
|
await face.purgeDirectory(target.path);
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
await face.deleteWorkspace(workspace.workspaceId);
|
|
6274
|
-
}
|
|
7121
|
+
for (const sessionId of targetArchiveIds) await face.archiveSession(sessionId).catch((reason) => {
|
|
7122
|
+
console.warn("session archive rejected during folder purge:", reason);
|
|
7123
|
+
});
|
|
7124
|
+
if (targetWorkspaceId !== void 0) await face.deleteWorkspace(targetWorkspaceId);
|
|
6275
7125
|
})() : removeWorktreeFully({
|
|
6276
7126
|
removeWorktree: face.removeWorktree,
|
|
6277
7127
|
probeDirectories: face.probeDirectories,
|
|
@@ -6280,11 +7130,12 @@ window.__ModuleLoader__.load((() => {
|
|
|
6280
7130
|
}, {
|
|
6281
7131
|
path: target.path,
|
|
6282
7132
|
force: (inspects[target.path]?.dirty ?? 0) > 0,
|
|
6283
|
-
...
|
|
6284
|
-
archiveSessionIds:
|
|
7133
|
+
...targetWorkspaceId === void 0 ? {} : { workspaceId: targetWorkspaceId },
|
|
7134
|
+
archiveSessionIds: targetArchiveIds
|
|
6285
7135
|
})).then(() => {
|
|
6286
7136
|
setRemoving(false);
|
|
6287
7137
|
setRemoveTarget(null);
|
|
7138
|
+
face.onWorktreeRemoved?.(target.path);
|
|
6288
7139
|
loadWorktrees(false);
|
|
6289
7140
|
}, (reason) => {
|
|
6290
7141
|
setRemoving(false);
|
|
@@ -6292,12 +7143,16 @@ window.__ModuleLoader__.load((() => {
|
|
|
6292
7143
|
});
|
|
6293
7144
|
};
|
|
6294
7145
|
const activityOf = (path) => {
|
|
7146
|
+
if (face.describeWorktreeOwnership !== void 0) return face.describeWorktreeOwnership(path).activity;
|
|
6295
7147
|
const workspace = workspaceAt(path);
|
|
6296
7148
|
if (workspace === void 0) return 0;
|
|
6297
7149
|
return freshestUpdatedAt(workspace.sessionIds.map((id) => face.sessionById(id)));
|
|
6298
7150
|
};
|
|
6299
|
-
const
|
|
6300
|
-
const
|
|
7151
|
+
const activeScope = scopedToRepo ? initialRepoFilter : void 0;
|
|
7152
|
+
const visibleEntries = scan.status === "ready" ? activeScope === void 0 ? scan.entries : filterScanEntriesByRepo(scan.entries, activeScope) : [];
|
|
7153
|
+
const validCount = visibleEntries.filter((entry) => entry.repoName !== null).length;
|
|
7154
|
+
const orphanCount = visibleEntries.length - validCount;
|
|
7155
|
+
const totalCount = scan.status === "ready" ? scan.entries.length : 0;
|
|
6301
7156
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
6302
7157
|
open,
|
|
6303
7158
|
onClose,
|
|
@@ -6332,6 +7187,23 @@ window.__ModuleLoader__.load((() => {
|
|
|
6332
7187
|
scan.status === "ready" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6333
7188
|
className: WorktreeManagerModal_module_default.body,
|
|
6334
7189
|
children: [
|
|
7190
|
+
initialRepoFilter !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7191
|
+
className: WorktreeManagerModal_module_default.scopeBar,
|
|
7192
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7193
|
+
className: WorktreeManagerModal_module_default.scopeInfo,
|
|
7194
|
+
children: activeScope !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("manager.scopeRepo") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7195
|
+
className: WorktreeManagerModal_module_default.scopeName,
|
|
7196
|
+
children: initialRepoFilter.repoName
|
|
7197
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("manager.showAllRepos") })
|
|
7198
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7199
|
+
type: "button",
|
|
7200
|
+
className: WorktreeManagerModal_module_default.scopeToggle,
|
|
7201
|
+
onClick: () => {
|
|
7202
|
+
setScopedToRepo((prev) => !prev);
|
|
7203
|
+
},
|
|
7204
|
+
children: activeScope !== void 0 ? t("manager.showAllRepos") : t("manager.scopeBack", { repo: initialRepoFilter.repoName })
|
|
7205
|
+
})]
|
|
7206
|
+
}),
|
|
6335
7207
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6336
7208
|
className: WorktreeManagerModal_module_default.toolbar,
|
|
6337
7209
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -6355,13 +7227,20 @@ window.__ModuleLoader__.load((() => {
|
|
|
6355
7227
|
role: "status",
|
|
6356
7228
|
children: t("manager.truncated")
|
|
6357
7229
|
}),
|
|
6358
|
-
|
|
7230
|
+
visibleEntries.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6359
7231
|
className: WorktreeManagerModal_module_default.empty,
|
|
6360
|
-
children: t("manager.
|
|
7232
|
+
children: activeScope !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("manager.emptyScoped", { repo: activeScope.repoName }) }), totalCount > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7233
|
+
type: "button",
|
|
7234
|
+
className: `${WorktreeManagerModal_module_default.scopeToggle} ${WorktreeManagerModal_module_default.emptyAction}`,
|
|
7235
|
+
onClick: () => {
|
|
7236
|
+
setScopedToRepo(false);
|
|
7237
|
+
},
|
|
7238
|
+
children: t("manager.showAllRepos")
|
|
7239
|
+
})] }) : t("manager.empty")
|
|
6361
7240
|
}),
|
|
6362
7241
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6363
7242
|
className: WorktreeManagerModal_module_default.list,
|
|
6364
|
-
children: groupScanEntries(
|
|
7243
|
+
children: groupScanEntries(visibleEntries).map((group) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6365
7244
|
className: WorktreeManagerModal_module_default.group,
|
|
6366
7245
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6367
7246
|
className: WorktreeManagerModal_module_default.groupHead,
|
|
@@ -6378,7 +7257,7 @@ window.__ModuleLoader__.load((() => {
|
|
|
6378
7257
|
}),
|
|
6379
7258
|
group.repoName !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
6380
7259
|
tone: "neutral",
|
|
6381
|
-
children: t(group.source === "legacy" ? "manager.sourceLegacy" : "manager.sourceProject")
|
|
7260
|
+
children: t(group.source === "legacy" ? "manager.sourceLegacy" : group.source === "official" ? "manager.sourceOfficial" : "manager.sourceProject")
|
|
6382
7261
|
}),
|
|
6383
7262
|
group.repoName !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6384
7263
|
className: WorktreeManagerModal_module_default.groupCount,
|
|
@@ -6387,7 +7266,9 @@ window.__ModuleLoader__.load((() => {
|
|
|
6387
7266
|
]
|
|
6388
7267
|
}), group.entries.map((entry) => {
|
|
6389
7268
|
const unknown = entry.repoName === null;
|
|
6390
|
-
const
|
|
7269
|
+
const ownership = unknown ? void 0 : face.describeWorktreeOwnership?.(entry.path);
|
|
7270
|
+
const activity = unknown ? 0 : ownership !== void 0 ? ownership.activity : activityOf(entry.path);
|
|
7271
|
+
const bindingMode = unknown ? "none" : ownership?.mode ?? (workspaceAt(entry.path) !== void 0 ? "standalone" : "none");
|
|
6391
7272
|
const running = !unknown && runningPaths.has(pathKey(entry.path));
|
|
6392
7273
|
const dirty = inspects[entry.path]?.dirty ?? 0;
|
|
6393
7274
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -6401,6 +7282,14 @@ window.__ModuleLoader__.load((() => {
|
|
|
6401
7282
|
className: WorktreeManagerModal_module_default.rowBranch,
|
|
6402
7283
|
children: entry.branch ?? "—"
|
|
6403
7284
|
}),
|
|
7285
|
+
bindingMode === "standalone" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
7286
|
+
tone: "neutral",
|
|
7287
|
+
children: t("manager.modeStandalone")
|
|
7288
|
+
}),
|
|
7289
|
+
bindingMode === "session" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
7290
|
+
tone: "neutral",
|
|
7291
|
+
children: t("manager.modeSession")
|
|
7292
|
+
}),
|
|
6404
7293
|
!unknown && dirty > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6405
7294
|
className: WorktreeManagerModal_module_default.rowDirty,
|
|
6406
7295
|
role: "status",
|
|
@@ -6422,10 +7311,10 @@ window.__ModuleLoader__.load((() => {
|
|
|
6422
7311
|
type: "button",
|
|
6423
7312
|
className: WorktreeManagerModal_module_default.rowAction,
|
|
6424
7313
|
disabled: openingPath !== null,
|
|
6425
|
-
title:
|
|
7314
|
+
title: openWorktreeTooltip(entry.source, t),
|
|
6426
7315
|
"aria-label": t("manager.openSession"),
|
|
6427
7316
|
onClick: () => {
|
|
6428
|
-
handleOpenWorktree(entry.path);
|
|
7317
|
+
handleOpenWorktree(entry.path, entry.repoRoot);
|
|
6429
7318
|
},
|
|
6430
7319
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRightUpOutlineRegular, { size: 14 })
|
|
6431
7320
|
}),
|
|
@@ -6519,9 +7408,10 @@ window.__ModuleLoader__.load((() => {
|
|
|
6519
7408
|
children: t("worktreeRemove.ahead", { n: inspects[removeTarget.path]?.ahead ?? 0 })
|
|
6520
7409
|
}),
|
|
6521
7410
|
removeTarget !== null && (() => {
|
|
6522
|
-
const
|
|
6523
|
-
|
|
6524
|
-
|
|
7411
|
+
const ids = face.describeWorktreeOwnership !== void 0 ? face.describeWorktreeOwnership(removeTarget.path).archiveIds : (() => {
|
|
7412
|
+
const workspace = workspaceAt(removeTarget.path);
|
|
7413
|
+
return workspace === void 0 ? [] : archiveIdsFor(face, workspace.sessionIds);
|
|
7414
|
+
})();
|
|
6525
7415
|
if (ids.length === 0) return null;
|
|
6526
7416
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6527
7417
|
className: WorktreeManagerModal_module_default.removeFact,
|
|
@@ -6666,10 +7556,97 @@ window.__ModuleLoader__.load((() => {
|
|
|
6666
7556
|
})]
|
|
6667
7557
|
})]
|
|
6668
7558
|
}),
|
|
6669
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
6670
|
-
className: GitWorktreeCard_module_default.hint,
|
|
6671
|
-
children: [t("cardRootDirHint"), state.overridden ? ` ${t("cardOverridden")}` : ""]
|
|
6672
|
-
}),
|
|
7559
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
7560
|
+
className: GitWorktreeCard_module_default.hint,
|
|
7561
|
+
children: [t("cardRootDirHint"), state.overridden ? ` ${t("cardOverridden")}` : ""]
|
|
7562
|
+
}),
|
|
7563
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7564
|
+
className: `${GitWorktreeCard_module_default.field} ${GitWorktreeCard_module_default.toggleRow}`,
|
|
7565
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
7566
|
+
className: GitWorktreeCard_module_default.toggleText,
|
|
7567
|
+
children: [
|
|
7568
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7569
|
+
className: GitWorktreeCard_module_default.toggleLabel,
|
|
7570
|
+
children: t("cardOpenGraphLabel")
|
|
7571
|
+
}),
|
|
7572
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7573
|
+
className: GitWorktreeCard_module_default.toggleHint,
|
|
7574
|
+
children: t("cardOpenGraphHint")
|
|
7575
|
+
}),
|
|
7576
|
+
state.switchFailed === "openGraphByDefault" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7577
|
+
className: GitWorktreeCard_module_default.switchBad,
|
|
7578
|
+
role: "alert",
|
|
7579
|
+
children: t("cardSwitchFailed")
|
|
7580
|
+
})
|
|
7581
|
+
]
|
|
7582
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7583
|
+
className: GitWorktreeCard_module_default.toggleControl,
|
|
7584
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
7585
|
+
label: t("cardOpenGraphLabel"),
|
|
7586
|
+
disabled: lockInput,
|
|
7587
|
+
checked: state.openGraphByDefault,
|
|
7588
|
+
onChange: props.setOpenGraphByDefault
|
|
7589
|
+
})
|
|
7590
|
+
})]
|
|
7591
|
+
}),
|
|
7592
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7593
|
+
className: `${GitWorktreeCard_module_default.field} ${GitWorktreeCard_module_default.toggleRow}`,
|
|
7594
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
7595
|
+
className: GitWorktreeCard_module_default.toggleText,
|
|
7596
|
+
children: [
|
|
7597
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7598
|
+
className: GitWorktreeCard_module_default.toggleLabel,
|
|
7599
|
+
children: t("cardHideOfficialWorktreeLabel")
|
|
7600
|
+
}),
|
|
7601
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7602
|
+
className: GitWorktreeCard_module_default.toggleHint,
|
|
7603
|
+
children: t("cardHideOfficialWorktreeHint")
|
|
7604
|
+
}),
|
|
7605
|
+
state.switchFailed === "hideOfficialWorktreeEntry" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7606
|
+
className: GitWorktreeCard_module_default.switchBad,
|
|
7607
|
+
role: "alert",
|
|
7608
|
+
children: t("cardSwitchFailed")
|
|
7609
|
+
})
|
|
7610
|
+
]
|
|
7611
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7612
|
+
className: GitWorktreeCard_module_default.toggleControl,
|
|
7613
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
7614
|
+
label: t("cardHideOfficialWorktreeLabel"),
|
|
7615
|
+
disabled: lockInput,
|
|
7616
|
+
checked: state.hideOfficialWorktreeEntry,
|
|
7617
|
+
onChange: props.setHideOfficialWorktreeEntry
|
|
7618
|
+
})
|
|
7619
|
+
})]
|
|
7620
|
+
}),
|
|
7621
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7622
|
+
className: `${GitWorktreeCard_module_default.field} ${GitWorktreeCard_module_default.toggleRow}`,
|
|
7623
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
7624
|
+
className: GitWorktreeCard_module_default.toggleText,
|
|
7625
|
+
children: [
|
|
7626
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7627
|
+
className: GitWorktreeCard_module_default.toggleLabel,
|
|
7628
|
+
children: t("cardSwitchSessionDirLabel")
|
|
7629
|
+
}),
|
|
7630
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7631
|
+
className: GitWorktreeCard_module_default.toggleHint,
|
|
7632
|
+
children: t("cardSwitchSessionDirHint")
|
|
7633
|
+
}),
|
|
7634
|
+
state.switchFailed === "switchSessionDirectory" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7635
|
+
className: GitWorktreeCard_module_default.switchBad,
|
|
7636
|
+
role: "alert",
|
|
7637
|
+
children: t("cardSwitchFailed")
|
|
7638
|
+
})
|
|
7639
|
+
]
|
|
7640
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7641
|
+
className: GitWorktreeCard_module_default.toggleControl,
|
|
7642
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
7643
|
+
label: t("cardSwitchSessionDirLabel"),
|
|
7644
|
+
disabled: lockInput,
|
|
7645
|
+
checked: state.switchSessionDirectory,
|
|
7646
|
+
onChange: props.setSwitchSessionDirectory
|
|
7647
|
+
})
|
|
7648
|
+
})]
|
|
7649
|
+
}),
|
|
6673
7650
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6674
7651
|
className: `${GitWorktreeCard_module_default.field} ${GitWorktreeCard_module_default.toggleRow}`,
|
|
6675
7652
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -6677,13 +7654,13 @@ window.__ModuleLoader__.load((() => {
|
|
|
6677
7654
|
children: [
|
|
6678
7655
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6679
7656
|
className: GitWorktreeCard_module_default.toggleLabel,
|
|
6680
|
-
children: t("
|
|
7657
|
+
children: t("cardManageOfficialWorktreesLabel")
|
|
6681
7658
|
}),
|
|
6682
7659
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6683
7660
|
className: GitWorktreeCard_module_default.toggleHint,
|
|
6684
|
-
children: t("
|
|
7661
|
+
children: t("cardManageOfficialWorktreesHint")
|
|
6685
7662
|
}),
|
|
6686
|
-
state.switchFailed === "
|
|
7663
|
+
state.switchFailed === "manageOfficialWorktrees" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6687
7664
|
className: GitWorktreeCard_module_default.switchBad,
|
|
6688
7665
|
role: "alert",
|
|
6689
7666
|
children: t("cardSwitchFailed")
|
|
@@ -6692,10 +7669,10 @@ window.__ModuleLoader__.load((() => {
|
|
|
6692
7669
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6693
7670
|
className: GitWorktreeCard_module_default.toggleControl,
|
|
6694
7671
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
6695
|
-
label: t("
|
|
7672
|
+
label: t("cardManageOfficialWorktreesLabel"),
|
|
6696
7673
|
disabled: lockInput,
|
|
6697
|
-
checked: state.
|
|
6698
|
-
onChange: props.
|
|
7674
|
+
checked: state.manageOfficialWorktrees,
|
|
7675
|
+
onChange: props.setManageOfficialWorktrees
|
|
6699
7676
|
})
|
|
6700
7677
|
})]
|
|
6701
7678
|
}),
|
|
@@ -6828,103 +7805,739 @@ window.__ModuleLoader__.load((() => {
|
|
|
6828
7805
|
placeholder: t("cardPostCreateCopyFilesPlaceholder"),
|
|
6829
7806
|
value: state.postCreateCopyFilesText,
|
|
6830
7807
|
onChange: (event) => {
|
|
6831
|
-
props.editPostCreateCopyFiles(event.target.value);
|
|
7808
|
+
props.editPostCreateCopyFiles(event.target.value);
|
|
7809
|
+
}
|
|
7810
|
+
}),
|
|
7811
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7812
|
+
className: GitWorktreeCard_module_default.toggleHint,
|
|
7813
|
+
children: t("cardPostCreateCopyFilesHint")
|
|
7814
|
+
}),
|
|
7815
|
+
!state.postCreateCopyFilesValid && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7816
|
+
className: GitWorktreeCard_module_default.copyFilesBad,
|
|
7817
|
+
role: "alert",
|
|
7818
|
+
children: t("cardPostCreateCopyFilesBad")
|
|
7819
|
+
})
|
|
7820
|
+
]
|
|
7821
|
+
}),
|
|
7822
|
+
history.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7823
|
+
className: `${GitWorktreeCard_module_default.field} ${GitWorktreeCard_module_default.historyRow}`,
|
|
7824
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7825
|
+
className: GitWorktreeCard_module_default.fieldLabel,
|
|
7826
|
+
children: t("cardPruneHistoryLabel")
|
|
7827
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
|
|
7828
|
+
className: GitWorktreeCard_module_default.history,
|
|
7829
|
+
children: [shownHistory.map((run) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
7830
|
+
className: GitWorktreeCard_module_default.historyRun,
|
|
7831
|
+
children: [
|
|
7832
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7833
|
+
className: GitWorktreeCard_module_default.historyTime,
|
|
7834
|
+
children: timeLabel(run.at, historyNow, t)
|
|
7835
|
+
}),
|
|
7836
|
+
run.removed.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
7837
|
+
className: GitWorktreeCard_module_default.historyLine,
|
|
7838
|
+
children: [t("cardPruneHistoryRun", { n: run.removed.length }), run.removed.map((item) => ` ${labelOfRemoved(item)}`).join(" ·")]
|
|
7839
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7840
|
+
className: GitWorktreeCard_module_default.historyLine,
|
|
7841
|
+
children: t("cardPruneHistoryNone")
|
|
7842
|
+
}),
|
|
7843
|
+
run.skippedDirty.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7844
|
+
className: GitWorktreeCard_module_default.historyLine,
|
|
7845
|
+
children: t("cardPruneHistorySkipped", { n: run.skippedDirty.length })
|
|
7846
|
+
}),
|
|
7847
|
+
run.failed.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7848
|
+
className: GitWorktreeCard_module_default.historyLine,
|
|
7849
|
+
children: t("cardPruneHistoryFailed", { n: run.failed.length })
|
|
7850
|
+
})
|
|
7851
|
+
]
|
|
7852
|
+
}, run.at)), history.length > HISTORY_PREVIEW && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7853
|
+
type: "button",
|
|
7854
|
+
className: GitWorktreeCard_module_default.historyMore,
|
|
7855
|
+
onClick: () => {
|
|
7856
|
+
setHistoryAll((value) => !value);
|
|
7857
|
+
},
|
|
7858
|
+
children: historyAll ? t("cardPruneHistoryLess") : t("cardPruneHistoryMore", { n: history.length })
|
|
7859
|
+
}) })]
|
|
7860
|
+
})]
|
|
7861
|
+
}),
|
|
7862
|
+
history.length === 0 && state.autoPruneWorktrees && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7863
|
+
className: `${GitWorktreeCard_module_default.field} ${GitWorktreeCard_module_default.historyRow}`,
|
|
7864
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7865
|
+
className: GitWorktreeCard_module_default.fieldLabel,
|
|
7866
|
+
children: t("cardPruneHistoryLabel")
|
|
7867
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7868
|
+
className: GitWorktreeCard_module_default.toggleHint,
|
|
7869
|
+
children: t("cardPruneHistoryEmpty")
|
|
7870
|
+
})]
|
|
7871
|
+
}),
|
|
7872
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorktreeManagerModal, {
|
|
7873
|
+
open: managerOpen,
|
|
7874
|
+
onClose: () => {
|
|
7875
|
+
setManagerOpen(false);
|
|
7876
|
+
},
|
|
7877
|
+
face: props.manager,
|
|
7878
|
+
t
|
|
7879
|
+
}),
|
|
7880
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7881
|
+
className: GitWorktreeCard_module_default.footer,
|
|
7882
|
+
children: [
|
|
7883
|
+
state.failed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
7884
|
+
className: GitWorktreeCard_module_default.failed,
|
|
7885
|
+
role: "status",
|
|
7886
|
+
children: t("cardSaveFailed")
|
|
7887
|
+
}) : null,
|
|
7888
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
7889
|
+
size: "sm",
|
|
7890
|
+
variant: "outline",
|
|
7891
|
+
disabled: lockActions,
|
|
7892
|
+
onClick: props.discard,
|
|
7893
|
+
children: t("cardDiscard")
|
|
7894
|
+
}),
|
|
7895
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
7896
|
+
size: "sm",
|
|
7897
|
+
variant: "primary",
|
|
7898
|
+
disabled: lockActions,
|
|
7899
|
+
onClick: props.save,
|
|
7900
|
+
children: t(state.saving ? "cardSaving" : "cardSave")
|
|
7901
|
+
})
|
|
7902
|
+
]
|
|
7903
|
+
})
|
|
7904
|
+
]
|
|
7905
|
+
});
|
|
7906
|
+
}
|
|
7907
|
+
//#endregion
|
|
7908
|
+
//#region \0git-worktree-css:/home/runner/work/dsh-git-worktree/dsh-git-worktree/src/client/LegacySessionMenuItem.module.css?inline
|
|
7909
|
+
var LegacySessionMenuItem_module_default = {
|
|
7910
|
+
"workspaces": "workspaces_1028657986",
|
|
7911
|
+
"session": "session_1028657986",
|
|
7912
|
+
"menu": "menu_1028657986",
|
|
7913
|
+
"item": "item_1028657986",
|
|
7914
|
+
"contextMenus": "contextMenus_1028657986",
|
|
7915
|
+
"separator": "separator_1028657986"
|
|
7916
|
+
};
|
|
7917
|
+
//#endregion
|
|
7918
|
+
//#region src/client/LegacySessionMenuItem.tsx
|
|
7919
|
+
/**
|
|
7920
|
+
* Fallback session-menu entry for older DSH hosts (0.2.0-rc.1) that expose
|
|
7921
|
+
* `sidebar.workspaces.session.menu.item` without the structured `contextMenus`
|
|
7922
|
+
* service. Automatically unregistered on hosts where `ctx.contextMenus` is active.
|
|
7923
|
+
*/
|
|
7924
|
+
/** Render the guarded "Remove this worktree" button only for linked worktree sessions. */
|
|
7925
|
+
function LegacySessionMenuItem({ sessionId, gitCache, resolveSessionPath, useMenuOpenState, t }) {
|
|
7926
|
+
(0, react.useSyncExternalStore)(gitCache.subscribe, gitCache.getSnapshot, gitCache.getSnapshot);
|
|
7927
|
+
const menuState = useMenuOpenState?.();
|
|
7928
|
+
const cwd = resolveSessionPath(sessionId);
|
|
7929
|
+
if (cwd === void 0) return null;
|
|
7930
|
+
const facts = gitCache.get(cwd);
|
|
7931
|
+
if (!isLinkedWorktreeFacts(facts)) return null;
|
|
7932
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
7933
|
+
className: LegacySessionMenuItem_module_default.separator,
|
|
7934
|
+
role: "separator"
|
|
7935
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
7936
|
+
type: "button",
|
|
7937
|
+
role: "menuitem",
|
|
7938
|
+
className: LegacySessionMenuItem_module_default.item,
|
|
7939
|
+
onClick: () => {
|
|
7940
|
+
menuState?.[1](false);
|
|
7941
|
+
openRemoveWorktree(cwd, facts.branch);
|
|
7942
|
+
},
|
|
7943
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutlineRegular, { size: 14 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("contextMenu.removeWorktree") })]
|
|
7944
|
+
})] });
|
|
7945
|
+
}
|
|
7946
|
+
//#endregion
|
|
7947
|
+
//#region \0git-worktree-css:/home/runner/work/dsh-git-worktree/dsh-git-worktree/src/client/SidebarWorktreeBadge.module.css?inline
|
|
7948
|
+
var SidebarWorktreeBadge_module_default = {
|
|
7949
|
+
"session": "session_327715589",
|
|
7950
|
+
"row": "row_327715589",
|
|
7951
|
+
"trailing": "trailing_327715589",
|
|
7952
|
+
"hover": "hover_327715589",
|
|
7953
|
+
"trailingBadge": "trailingBadge_327715589",
|
|
7954
|
+
"hoverItem": "hoverItem_327715589",
|
|
7955
|
+
"hoverIcon": "hoverIcon_327715589",
|
|
7956
|
+
"hoverBody": "hoverBody_327715589",
|
|
7957
|
+
"hoverBranch": "hoverBranch_327715589",
|
|
7958
|
+
"hoverNote": "hoverNote_327715589"
|
|
7959
|
+
};
|
|
7960
|
+
//#endregion
|
|
7961
|
+
//#region src/client/SidebarWorktreeBadge.tsx
|
|
7962
|
+
/**
|
|
7963
|
+
* Native sidebar decorations for linked worktree sessions (DSH 0.2.2-rc.5+):
|
|
7964
|
+
* - `SidebarWorktreeTrailing` renders a subtle branch icon in `sidebar.session.row.trailing`
|
|
7965
|
+
* - `SidebarWorktreeHover` renders repository + branch identity in `sidebar.session.row.hover`
|
|
7966
|
+
*
|
|
7967
|
+
* Non-worktree sessions (main checkouts and non-git directories) return null so
|
|
7968
|
+
* ordinary sidebar rows stay completely untouched.
|
|
7969
|
+
*/
|
|
7970
|
+
const NOOP_SUBSCRIBE = () => () => {};
|
|
7971
|
+
const NOOP_SNAPSHOT = () => void 0;
|
|
7972
|
+
function useLinkedWorktreeFacts(sessionId, gitCache, resolvePath, sessionsObservable, shouldDecorateSession) {
|
|
7973
|
+
(0, react.useSyncExternalStore)(gitCache.subscribe, gitCache.getSnapshot, gitCache.getSnapshot);
|
|
7974
|
+
(0, react.useSyncExternalStore)(sessionsObservable?.subscribe ?? NOOP_SUBSCRIBE, sessionsObservable?.getSnapshot ?? NOOP_SNAPSHOT, sessionsObservable?.getSnapshot ?? NOOP_SNAPSHOT);
|
|
7975
|
+
const cwd = resolvePath(sessionId);
|
|
7976
|
+
if (cwd === void 0) return null;
|
|
7977
|
+
if (shouldDecorateSession !== void 0 && !shouldDecorateSession(sessionId, cwd)) return null;
|
|
7978
|
+
const facts = gitCache.get(cwd);
|
|
7979
|
+
return isLinkedWorktreeFacts(facts) ? facts : null;
|
|
7980
|
+
}
|
|
7981
|
+
/** Subtle non-interactive branch marker shown in `sidebar.session.row.trailing` for worktree sessions. */
|
|
7982
|
+
function SidebarWorktreeTrailing({ sessionId, gitCache, resolveSessionPath, sessionsObservable, shouldDecorateSession, t }) {
|
|
7983
|
+
const facts = useLinkedWorktreeFacts(sessionId, gitCache, resolveSessionPath, sessionsObservable, shouldDecorateSession);
|
|
7984
|
+
if (facts === null) return null;
|
|
7985
|
+
const label = facts.branch !== null ? t("sidebar.worktreeBadgeWithBranch", {
|
|
7986
|
+
repo: facts.repoName,
|
|
7987
|
+
branch: facts.branch
|
|
7988
|
+
}) : t("sidebar.worktreeBadge", { repo: facts.repoName });
|
|
7989
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7990
|
+
className: SidebarWorktreeBadge_module_default.trailingBadge,
|
|
7991
|
+
role: "img",
|
|
7992
|
+
"aria-label": label,
|
|
7993
|
+
title: label,
|
|
7994
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, { size: 13 })
|
|
7995
|
+
});
|
|
7996
|
+
}
|
|
7997
|
+
/** Worktree branch and base-branch detail shown inside `sidebar.session.row.hover` (mounted only while hovered). */
|
|
7998
|
+
function SidebarWorktreeHover({ sessionId, gitCache, resolveSessionPath, sessionsObservable, shouldDecorateSession, t }) {
|
|
7999
|
+
const facts = useLinkedWorktreeFacts(sessionId, gitCache, resolveSessionPath, sessionsObservable, shouldDecorateSession);
|
|
8000
|
+
if (facts === null) return null;
|
|
8001
|
+
const note = facts.baseBranch !== void 0 && facts.baseBranch !== "" && facts.baseBranch !== facts.branch ? t("sidebar.worktreeHoverFrom", { base: facts.baseBranch }) : t("sidebar.worktreeHoverLabel");
|
|
8002
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8003
|
+
className: SidebarWorktreeBadge_module_default.hoverItem,
|
|
8004
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8005
|
+
className: SidebarWorktreeBadge_module_default.hoverIcon,
|
|
8006
|
+
"aria-hidden": "true",
|
|
8007
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, { size: 12 })
|
|
8008
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
8009
|
+
className: SidebarWorktreeBadge_module_default.hoverBody,
|
|
8010
|
+
children: [facts.branch !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8011
|
+
className: SidebarWorktreeBadge_module_default.hoverBranch,
|
|
8012
|
+
children: facts.branch
|
|
8013
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8014
|
+
className: SidebarWorktreeBadge_module_default.hoverNote,
|
|
8015
|
+
children: note
|
|
8016
|
+
})]
|
|
8017
|
+
})]
|
|
8018
|
+
});
|
|
8019
|
+
}
|
|
8020
|
+
//#endregion
|
|
8021
|
+
//#region \0git-worktree-css:/home/runner/work/dsh-git-worktree/dsh-git-worktree/src/client/WorktreeActionHost.module.css?inline
|
|
8022
|
+
var WorktreeActionHost_module_default = {
|
|
8023
|
+
"createDialog": "createDialog_1401658256",
|
|
8024
|
+
"body": "body_1401658256",
|
|
8025
|
+
"searchInput": "searchInput_1401658256",
|
|
8026
|
+
"list": "list_1401658256",
|
|
8027
|
+
"branchRow": "branchRow_1401658256",
|
|
8028
|
+
"cutoutRow": "cutoutRow_1401658256",
|
|
8029
|
+
"branchIcon": "branchIcon_1401658256",
|
|
8030
|
+
"branchName": "branchName_1401658256",
|
|
8031
|
+
"status": "status_1401658256",
|
|
8032
|
+
"empty": "empty_1401658256",
|
|
8033
|
+
"error": "error_1401658256",
|
|
8034
|
+
"removeFacts": "removeFacts_1401658256",
|
|
8035
|
+
"removeFact": "removeFact_1401658256",
|
|
8036
|
+
"removeFactWarn": "removeFactWarn_1401658256",
|
|
8037
|
+
"removeConfirm": "removeConfirm_1401658256"
|
|
8038
|
+
};
|
|
8039
|
+
//#endregion
|
|
8040
|
+
//#region src/client/WorktreeActionHost.tsx
|
|
8041
|
+
/**
|
|
8042
|
+
* Root `shell.overlay` host for worktree dialogs triggered from native sidebar
|
|
8043
|
+
* or header context menus (`manage`, `create`, `remove`).
|
|
8044
|
+
*
|
|
8045
|
+
* Mounting here decouples modal lifecycles from any single composer `BranchChip`
|
|
8046
|
+
* so actions work for background workspaces, archived/inactive sessions, and
|
|
8047
|
+
* non-conversation routes alike.
|
|
8048
|
+
*/
|
|
8049
|
+
function describeWorktreeError(raw, fallbackBranch, t) {
|
|
8050
|
+
const failure = explainGitOpFailure(raw);
|
|
8051
|
+
if (failure?.kind === "worktreeOccupied") return t("gitFailWorktreeOccupied", { branch: failure.branch ?? fallbackBranch });
|
|
8052
|
+
if (failure?.kind === "worktreePathExists") return t("gitFailWorktreePathExists");
|
|
8053
|
+
return t("errorGeneric", { message: raw });
|
|
8054
|
+
}
|
|
8055
|
+
function RemoveWorktreeModal({ path, branch, describeWorktreeRemoval, removeWorktree, onRemoved, onClose, t }) {
|
|
8056
|
+
const [inspect, setInspect] = (0, react.useState)(null);
|
|
8057
|
+
const [inspectError, setInspectError] = (0, react.useState)(null);
|
|
8058
|
+
const [removing, setRemoving] = (0, react.useState)(false);
|
|
8059
|
+
const [removeError, setRemoveError] = (0, react.useState)(null);
|
|
8060
|
+
const facts = describeWorktreeRemoval(path);
|
|
8061
|
+
(0, react.useEffect)(() => {
|
|
8062
|
+
let active = true;
|
|
8063
|
+
setInspect(null);
|
|
8064
|
+
setInspectError(null);
|
|
8065
|
+
setRemoveError(null);
|
|
8066
|
+
requestInspectWorktree(path).then((result) => {
|
|
8067
|
+
if (!active) return;
|
|
8068
|
+
if (result.ok) setInspect({
|
|
8069
|
+
dirty: result.dirty,
|
|
8070
|
+
ahead: result.ahead
|
|
8071
|
+
});
|
|
8072
|
+
else setInspectError(result.error);
|
|
8073
|
+
});
|
|
8074
|
+
return () => {
|
|
8075
|
+
active = false;
|
|
8076
|
+
};
|
|
8077
|
+
}, [path]);
|
|
8078
|
+
const handleClose = () => {
|
|
8079
|
+
if (removing) return;
|
|
8080
|
+
onClose();
|
|
8081
|
+
};
|
|
8082
|
+
const handleConfirm = () => {
|
|
8083
|
+
if (removing || facts.running) return;
|
|
8084
|
+
setRemoving(true);
|
|
8085
|
+
setRemoveError(null);
|
|
8086
|
+
removeWorktree(path, (inspect?.dirty ?? 0) > 0).then(() => {
|
|
8087
|
+
setRemoving(false);
|
|
8088
|
+
onRemoved(path);
|
|
8089
|
+
emitToast(t("contextMenu.removeDone"), "success");
|
|
8090
|
+
onClose();
|
|
8091
|
+
}, (reason) => {
|
|
8092
|
+
setRemoving(false);
|
|
8093
|
+
setRemoveError(reason instanceof Error ? reason.message : String(reason));
|
|
8094
|
+
});
|
|
8095
|
+
};
|
|
8096
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
8097
|
+
open: true,
|
|
8098
|
+
onClose: handleClose,
|
|
8099
|
+
closeLabel: t("close"),
|
|
8100
|
+
title: t("worktreeRemove.title"),
|
|
8101
|
+
description: t("worktreeRemove.desc", { path }),
|
|
8102
|
+
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, {
|
|
8103
|
+
variant: "outline",
|
|
8104
|
+
disabled: removing,
|
|
8105
|
+
onClick: handleClose,
|
|
8106
|
+
children: t("cancel")
|
|
8107
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
8108
|
+
variant: "outline",
|
|
8109
|
+
className: WorktreeActionHost_module_default.removeConfirm,
|
|
8110
|
+
disabled: removing || facts.running,
|
|
8111
|
+
onClick: handleConfirm,
|
|
8112
|
+
children: t("worktreeRemove.menu")
|
|
8113
|
+
})] }),
|
|
8114
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8115
|
+
className: WorktreeActionHost_module_default.removeFacts,
|
|
8116
|
+
children: [
|
|
8117
|
+
branch !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8118
|
+
className: WorktreeActionHost_module_default.removeFact,
|
|
8119
|
+
children: t("worktreeRemove.descBranch", { branch })
|
|
8120
|
+
}),
|
|
8121
|
+
facts.running && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8122
|
+
className: `${WorktreeActionHost_module_default.removeFact} ${WorktreeActionHost_module_default.removeFactWarn}`,
|
|
8123
|
+
role: "alert",
|
|
8124
|
+
children: t("manager.running")
|
|
8125
|
+
}),
|
|
8126
|
+
inspect === null && inspectError === null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8127
|
+
className: WorktreeActionHost_module_default.status,
|
|
8128
|
+
role: "status",
|
|
8129
|
+
children: t("worktreeRemove.inspecting")
|
|
8130
|
+
}),
|
|
8131
|
+
inspect !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8132
|
+
className: inspect.dirty > 0 ? `${WorktreeActionHost_module_default.removeFact} ${WorktreeActionHost_module_default.removeFactWarn}` : WorktreeActionHost_module_default.removeFact,
|
|
8133
|
+
children: inspect.dirty > 0 ? t(inspect.dirty === 1 ? "worktreeRemove.dirty.one" : "worktreeRemove.dirty.other", { n: inspect.dirty }) : t("worktreeRemove.clean")
|
|
8134
|
+
}), inspect.ahead !== void 0 && inspect.ahead > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8135
|
+
className: WorktreeActionHost_module_default.removeFact,
|
|
8136
|
+
children: t("worktreeRemove.ahead", { n: inspect.ahead })
|
|
8137
|
+
})] }),
|
|
8138
|
+
inspectError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8139
|
+
className: WorktreeActionHost_module_default.error,
|
|
8140
|
+
role: "alert",
|
|
8141
|
+
children: inspectError
|
|
8142
|
+
}),
|
|
8143
|
+
facts.archiveCount > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8144
|
+
className: WorktreeActionHost_module_default.removeFact,
|
|
8145
|
+
children: t(facts.archiveCount === 1 ? "worktreeRemove.sessions.one" : "worktreeRemove.sessions.other", { n: facts.archiveCount })
|
|
8146
|
+
}),
|
|
8147
|
+
removing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8148
|
+
className: WorktreeActionHost_module_default.status,
|
|
8149
|
+
role: "status",
|
|
8150
|
+
children: t("worktreeRemove.busy")
|
|
8151
|
+
}),
|
|
8152
|
+
removeError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8153
|
+
className: WorktreeActionHost_module_default.error,
|
|
8154
|
+
role: "alert",
|
|
8155
|
+
children: removeError
|
|
8156
|
+
})
|
|
8157
|
+
]
|
|
8158
|
+
})
|
|
8159
|
+
});
|
|
8160
|
+
}
|
|
8161
|
+
/**
|
|
8162
|
+
* Validate an optional new branch name typed in the cutout-from-branch dialog.
|
|
8163
|
+
* Blank input is valid and triggers host-side random `<base>-<4hex>` naming.
|
|
8164
|
+
*/
|
|
8165
|
+
function validateCutoutBranchDraft(draft, existingLocals) {
|
|
8166
|
+
if (draft.trim() === "") return null;
|
|
8167
|
+
if (branchNameIssue(draft) !== null) return "invalid";
|
|
8168
|
+
if (existingLocals.has(draft)) return "duplicate";
|
|
8169
|
+
return null;
|
|
8170
|
+
}
|
|
8171
|
+
function CreateWorktreeModal({ repoPath, repoName, adoptWorktree, isSwitchSessionDirectory, armDeferredWorktree, pruneWorktrees, onCreated, onClose, t }) {
|
|
8172
|
+
const [status, setStatus] = (0, react.useState)(null);
|
|
8173
|
+
const [loadError, setLoadError] = (0, react.useState)(null);
|
|
8174
|
+
const [query, setQuery] = (0, react.useState)("");
|
|
8175
|
+
const [cutoutBase, setCutoutBase] = (0, react.useState)(null);
|
|
8176
|
+
const [cutoutDraft, setCutoutDraft] = (0, react.useState)("");
|
|
8177
|
+
const [creating, setCreating] = (0, react.useState)(false);
|
|
8178
|
+
const [createError, setCreateError] = (0, react.useState)(null);
|
|
8179
|
+
const inputRef = (0, react.useRef)(null);
|
|
8180
|
+
const cutoutInputRef = (0, react.useRef)(null);
|
|
8181
|
+
(0, react.useEffect)(() => {
|
|
8182
|
+
let active = true;
|
|
8183
|
+
setStatus(null);
|
|
8184
|
+
setLoadError(null);
|
|
8185
|
+
setCreateError(null);
|
|
8186
|
+
setCutoutBase(null);
|
|
8187
|
+
setCutoutDraft("");
|
|
8188
|
+
setQuery("");
|
|
8189
|
+
fetchStatus(repoPath).then((result) => {
|
|
8190
|
+
if (!active) return;
|
|
8191
|
+
if (!result.ok) {
|
|
8192
|
+
setLoadError(result.error);
|
|
8193
|
+
return;
|
|
8194
|
+
}
|
|
8195
|
+
if (!result.repo) {
|
|
8196
|
+
setLoadError(t("createModal.loadFailed", { message: "not a git repository" }));
|
|
8197
|
+
return;
|
|
8198
|
+
}
|
|
8199
|
+
setStatus(result);
|
|
8200
|
+
});
|
|
8201
|
+
return () => {
|
|
8202
|
+
active = false;
|
|
8203
|
+
};
|
|
8204
|
+
}, [repoPath, t]);
|
|
8205
|
+
(0, react.useEffect)(() => {
|
|
8206
|
+
if (status !== null && cutoutBase === null) inputRef.current?.focus();
|
|
8207
|
+
}, [status, cutoutBase]);
|
|
8208
|
+
(0, react.useEffect)(() => {
|
|
8209
|
+
if (cutoutBase !== null) cutoutInputRef.current?.focus();
|
|
8210
|
+
}, [cutoutBase]);
|
|
8211
|
+
const trimmed = query.trim();
|
|
8212
|
+
const lower = trimmed.toLowerCase();
|
|
8213
|
+
const worktreeByBranch = (0, react.useMemo)(() => {
|
|
8214
|
+
const map = /* @__PURE__ */ new Map();
|
|
8215
|
+
if (status === null) return map;
|
|
8216
|
+
for (const wt of status.worktrees) if (!wt.main && wt.branch !== null && wt.branch !== void 0) map.set(wt.branch, wt.path);
|
|
8217
|
+
return map;
|
|
8218
|
+
}, [status]);
|
|
8219
|
+
const localBranchSet = (0, react.useMemo)(() => {
|
|
8220
|
+
const set = /* @__PURE__ */ new Set();
|
|
8221
|
+
if (status === null) return set;
|
|
8222
|
+
for (const entry of status.branches) if (entry.kind === "local") set.add(entry.name);
|
|
8223
|
+
return set;
|
|
8224
|
+
}, [status]);
|
|
8225
|
+
const filteredBranches = (0, react.useMemo)(() => {
|
|
8226
|
+
if (status === null) return [];
|
|
8227
|
+
if (lower === "") return status.branches;
|
|
8228
|
+
return status.branches.filter((entry) => entry.name.toLowerCase().includes(lower));
|
|
8229
|
+
}, [status, lower]);
|
|
8230
|
+
const cutoutDraftError = cutoutBase === null ? null : validateCutoutBranchDraft(cutoutDraft, localBranchSet);
|
|
8231
|
+
const cutoutDraftHint = cutoutDraftError === "duplicate" ? t("menuNewBranchExists") : cutoutDraftError === "invalid" ? t("menuNewBranchBad") : void 0;
|
|
8232
|
+
const finishWorktree = async (targetPath, warnings) => {
|
|
8233
|
+
onCreated(targetPath);
|
|
8234
|
+
await adoptWorktree(targetPath, status === null ? void 0 : { repoRoot: status.repoRoot });
|
|
8235
|
+
if (warnings?.fetchWarning !== void 0) emitToast(t("fetchWarning", { message: warnings.fetchWarning }));
|
|
8236
|
+
if (warnings?.excludeWarning !== void 0) emitToast(t("excludeWarning", { message: warnings.excludeWarning }));
|
|
8237
|
+
if (warnings?.copyWarning !== void 0) emitToast(t("copyWarning", { message: warnings.copyWarning }));
|
|
8238
|
+
if (pruneWorktrees !== void 0) pruneWorktrees(targetPath).then((report) => {
|
|
8239
|
+
if (report === void 0) return;
|
|
8240
|
+
if (report.removed.length > 0) emitToast(t("pruneDone", { n: report.removed.length }));
|
|
8241
|
+
if (report.failed.length > 0) emitToast(t("pruneFailed", { n: report.failed.length }));
|
|
8242
|
+
});
|
|
8243
|
+
onClose();
|
|
8244
|
+
};
|
|
8245
|
+
const armDeferred = (spec) => {
|
|
8246
|
+
if (armDeferredWorktree === void 0 || status === null) return;
|
|
8247
|
+
armDeferredWorktree(spec, { repoRoot: status.repoRoot }).then(() => {
|
|
8248
|
+
setCreating(false);
|
|
8249
|
+
onClose();
|
|
8250
|
+
}, (reason) => {
|
|
8251
|
+
setCreating(false);
|
|
8252
|
+
setCreateError(reason instanceof Error ? reason.message : String(reason));
|
|
8253
|
+
});
|
|
8254
|
+
};
|
|
8255
|
+
const openCutoutPrompt = (base) => {
|
|
8256
|
+
if (creating) return;
|
|
8257
|
+
setCreateError(null);
|
|
8258
|
+
setCutoutDraft("");
|
|
8259
|
+
setCutoutBase(base);
|
|
8260
|
+
};
|
|
8261
|
+
const closeCutoutPrompt = () => {
|
|
8262
|
+
if (creating) return;
|
|
8263
|
+
setCreateError(null);
|
|
8264
|
+
setCutoutBase(null);
|
|
8265
|
+
setCutoutDraft("");
|
|
8266
|
+
};
|
|
8267
|
+
const submitCutout = () => {
|
|
8268
|
+
if (creating || status === null || cutoutBase === null || cutoutDraftError !== null) return;
|
|
8269
|
+
const custom = cutoutDraft.trim();
|
|
8270
|
+
setCreating(true);
|
|
8271
|
+
setCreateError(null);
|
|
8272
|
+
if (isSwitchSessionDirectory?.() === true && armDeferredWorktree !== void 0) {
|
|
8273
|
+
armDeferred(custom === "" ? {
|
|
8274
|
+
repoPath,
|
|
8275
|
+
branch: cutoutBase,
|
|
8276
|
+
cutout: true,
|
|
8277
|
+
random: true
|
|
8278
|
+
} : {
|
|
8279
|
+
repoPath,
|
|
8280
|
+
branch: cutoutBase,
|
|
8281
|
+
cutout: true,
|
|
8282
|
+
name: custom
|
|
8283
|
+
});
|
|
8284
|
+
return;
|
|
8285
|
+
}
|
|
8286
|
+
(custom === "" ? requestWorktreeCutout(repoPath, cutoutBase, void 0, { random: true }) : requestWorktreeCutout(repoPath, cutoutBase, custom)).then(async (result) => {
|
|
8287
|
+
if (!result.ok) {
|
|
8288
|
+
setCreating(false);
|
|
8289
|
+
setCreateError(describeWorktreeError(result.error, custom === "" ? cutoutBase : custom, t));
|
|
8290
|
+
return;
|
|
8291
|
+
}
|
|
8292
|
+
try {
|
|
8293
|
+
await finishWorktree(result.path, result);
|
|
8294
|
+
} catch (reason) {
|
|
8295
|
+
setCreating(false);
|
|
8296
|
+
setCreateError(reason instanceof Error ? reason.message : String(reason));
|
|
8297
|
+
}
|
|
8298
|
+
}, (reason) => {
|
|
8299
|
+
setCreating(false);
|
|
8300
|
+
setCreateError(reason instanceof Error ? reason.message : String(reason));
|
|
8301
|
+
});
|
|
8302
|
+
};
|
|
8303
|
+
const pickBranch = (entry) => {
|
|
8304
|
+
if (creating || status === null) return;
|
|
8305
|
+
setCreateError(null);
|
|
8306
|
+
const existingWt = worktreeByBranch.get(entry.name);
|
|
8307
|
+
if (existingWt !== void 0) {
|
|
8308
|
+
setCreating(true);
|
|
8309
|
+
finishWorktree(existingWt).catch((reason) => {
|
|
8310
|
+
setCreating(false);
|
|
8311
|
+
setCreateError(reason instanceof Error ? reason.message : String(reason));
|
|
8312
|
+
});
|
|
8313
|
+
return;
|
|
8314
|
+
}
|
|
8315
|
+
if (entry.kind === "local" && status.worktrees.some((wt) => wt.main && wt.branch === entry.name)) {
|
|
8316
|
+
openCutoutPrompt(entry.name);
|
|
8317
|
+
return;
|
|
8318
|
+
}
|
|
8319
|
+
setCreating(true);
|
|
8320
|
+
if (isSwitchSessionDirectory?.() === true && armDeferredWorktree !== void 0) {
|
|
8321
|
+
armDeferred({
|
|
8322
|
+
repoPath,
|
|
8323
|
+
branch: entry.name,
|
|
8324
|
+
cutout: false
|
|
8325
|
+
});
|
|
8326
|
+
return;
|
|
8327
|
+
}
|
|
8328
|
+
requestWorktree(repoPath, entry.name).then(async (result) => {
|
|
8329
|
+
if (!result.ok) {
|
|
8330
|
+
setCreating(false);
|
|
8331
|
+
setCreateError(describeWorktreeError(result.error, entry.name, t));
|
|
8332
|
+
return;
|
|
8333
|
+
}
|
|
8334
|
+
try {
|
|
8335
|
+
await finishWorktree(result.path, result);
|
|
8336
|
+
} catch (reason) {
|
|
8337
|
+
setCreating(false);
|
|
8338
|
+
setCreateError(reason instanceof Error ? reason.message : String(reason));
|
|
8339
|
+
}
|
|
8340
|
+
}, (reason) => {
|
|
8341
|
+
setCreating(false);
|
|
8342
|
+
setCreateError(reason instanceof Error ? reason.message : String(reason));
|
|
8343
|
+
});
|
|
8344
|
+
};
|
|
8345
|
+
const handleClose = () => {
|
|
8346
|
+
if (creating) return;
|
|
8347
|
+
onClose();
|
|
8348
|
+
};
|
|
8349
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
8350
|
+
open: true,
|
|
8351
|
+
onClose: handleClose,
|
|
8352
|
+
closeLabel: t("close"),
|
|
8353
|
+
title: t("createModal.title", { repo: repoName }),
|
|
8354
|
+
className: WorktreeActionHost_module_default.createDialog ?? "",
|
|
8355
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8356
|
+
className: WorktreeActionHost_module_default.body,
|
|
8357
|
+
children: [
|
|
8358
|
+
status === null && loadError === null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8359
|
+
className: WorktreeActionHost_module_default.status,
|
|
8360
|
+
role: "status",
|
|
8361
|
+
children: t("createModal.loading")
|
|
8362
|
+
}),
|
|
8363
|
+
loadError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8364
|
+
className: WorktreeActionHost_module_default.error,
|
|
8365
|
+
role: "alert",
|
|
8366
|
+
children: t("createModal.loadFailed", { message: loadError })
|
|
8367
|
+
}),
|
|
8368
|
+
status !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
8369
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
8370
|
+
ref: inputRef,
|
|
8371
|
+
type: "text",
|
|
8372
|
+
className: WorktreeActionHost_module_default.searchInput,
|
|
8373
|
+
value: query,
|
|
8374
|
+
disabled: creating,
|
|
8375
|
+
placeholder: t("createModal.searchPlaceholder"),
|
|
8376
|
+
onChange: (event) => {
|
|
8377
|
+
setQuery(event.target.value);
|
|
8378
|
+
setCreateError(null);
|
|
6832
8379
|
}
|
|
6833
8380
|
}),
|
|
6834
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
6835
|
-
className:
|
|
6836
|
-
|
|
8381
|
+
creating && cutoutBase === null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8382
|
+
className: WorktreeActionHost_module_default.status,
|
|
8383
|
+
role: "status",
|
|
8384
|
+
children: t("createModal.creating")
|
|
6837
8385
|
}),
|
|
6838
|
-
|
|
6839
|
-
className:
|
|
8386
|
+
createError !== null && cutoutBase === null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8387
|
+
className: WorktreeActionHost_module_default.error,
|
|
6840
8388
|
role: "alert",
|
|
6841
|
-
children:
|
|
6842
|
-
})
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
className: `${GitWorktreeCard_module_default.field} ${GitWorktreeCard_module_default.historyRow}`,
|
|
6847
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6848
|
-
className: GitWorktreeCard_module_default.fieldLabel,
|
|
6849
|
-
children: t("cardPruneHistoryLabel")
|
|
6850
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
|
|
6851
|
-
className: GitWorktreeCard_module_default.history,
|
|
6852
|
-
children: [shownHistory.map((run) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
6853
|
-
className: GitWorktreeCard_module_default.historyRun,
|
|
8389
|
+
children: createError
|
|
8390
|
+
}),
|
|
8391
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8392
|
+
className: WorktreeActionHost_module_default.list,
|
|
8393
|
+
role: "listbox",
|
|
6854
8394
|
children: [
|
|
6855
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
children:
|
|
8395
|
+
trimmed === "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
8396
|
+
type: "button",
|
|
8397
|
+
role: "option",
|
|
8398
|
+
"aria-selected": false,
|
|
8399
|
+
className: `${WorktreeActionHost_module_default.branchRow} ${WorktreeActionHost_module_default.cutoutRow}`,
|
|
8400
|
+
disabled: creating,
|
|
8401
|
+
onClick: () => {
|
|
8402
|
+
openCutoutPrompt(status.currentBranch);
|
|
8403
|
+
},
|
|
8404
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8405
|
+
className: WorktreeActionHost_module_default.branchIcon,
|
|
8406
|
+
"aria-hidden": "true",
|
|
8407
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlusOutlineRegular, { size: 14 })
|
|
8408
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8409
|
+
className: WorktreeActionHost_module_default.branchName,
|
|
8410
|
+
children: t("createModal.cutFromBranch", { base: status.currentBranch })
|
|
8411
|
+
})]
|
|
6865
8412
|
}),
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
8413
|
+
filteredBranches.map((entry) => {
|
|
8414
|
+
const hasWorktree = worktreeByBranch.has(entry.name);
|
|
8415
|
+
const isCurrent = entry.kind === "local" && entry.name === status.currentBranch;
|
|
8416
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
8417
|
+
type: "button",
|
|
8418
|
+
role: "option",
|
|
8419
|
+
"aria-selected": false,
|
|
8420
|
+
className: WorktreeActionHost_module_default.branchRow,
|
|
8421
|
+
disabled: creating,
|
|
8422
|
+
onClick: () => {
|
|
8423
|
+
pickBranch(entry);
|
|
8424
|
+
},
|
|
8425
|
+
children: [
|
|
8426
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8427
|
+
className: WorktreeActionHost_module_default.branchIcon,
|
|
8428
|
+
"aria-hidden": "true",
|
|
8429
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, { size: 14 })
|
|
8430
|
+
}),
|
|
8431
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8432
|
+
className: WorktreeActionHost_module_default.branchName,
|
|
8433
|
+
children: entry.name
|
|
8434
|
+
}),
|
|
8435
|
+
isCurrent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
8436
|
+
tone: "neutral",
|
|
8437
|
+
children: t("createModal.tagCurrent")
|
|
8438
|
+
}),
|
|
8439
|
+
hasWorktree && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
8440
|
+
tone: "neutral",
|
|
8441
|
+
children: t("createModal.tagWorktree")
|
|
8442
|
+
}),
|
|
8443
|
+
entry.kind === "remote" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
8444
|
+
tone: "neutral",
|
|
8445
|
+
children: t("createModal.tagRemote")
|
|
8446
|
+
})
|
|
8447
|
+
]
|
|
8448
|
+
}, `${entry.kind}:${entry.name}`);
|
|
6869
8449
|
}),
|
|
6870
|
-
|
|
6871
|
-
className:
|
|
6872
|
-
children: t("
|
|
8450
|
+
filteredBranches.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8451
|
+
className: WorktreeActionHost_module_default.empty,
|
|
8452
|
+
children: t("createModal.noMatches")
|
|
6873
8453
|
})
|
|
6874
8454
|
]
|
|
6875
|
-
}, run.at)), history.length > HISTORY_PREVIEW && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
6876
|
-
type: "button",
|
|
6877
|
-
className: GitWorktreeCard_module_default.historyMore,
|
|
6878
|
-
onClick: () => {
|
|
6879
|
-
setHistoryAll((value) => !value);
|
|
6880
|
-
},
|
|
6881
|
-
children: historyAll ? t("cardPruneHistoryLess") : t("cardPruneHistoryMore", { n: history.length })
|
|
6882
|
-
}) })]
|
|
6883
|
-
})]
|
|
6884
|
-
}),
|
|
6885
|
-
history.length === 0 && state.autoPruneWorktrees && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6886
|
-
className: `${GitWorktreeCard_module_default.field} ${GitWorktreeCard_module_default.historyRow}`,
|
|
6887
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6888
|
-
className: GitWorktreeCard_module_default.fieldLabel,
|
|
6889
|
-
children: t("cardPruneHistoryLabel")
|
|
6890
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6891
|
-
className: GitWorktreeCard_module_default.toggleHint,
|
|
6892
|
-
children: t("cardPruneHistoryEmpty")
|
|
6893
|
-
})]
|
|
6894
|
-
}),
|
|
6895
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorktreeManagerModal, {
|
|
6896
|
-
open: managerOpen,
|
|
6897
|
-
onClose: () => {
|
|
6898
|
-
setManagerOpen(false);
|
|
6899
|
-
},
|
|
6900
|
-
face: props.manager,
|
|
6901
|
-
t
|
|
6902
|
-
}),
|
|
6903
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6904
|
-
className: GitWorktreeCard_module_default.footer,
|
|
6905
|
-
children: [
|
|
6906
|
-
state.failed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6907
|
-
className: GitWorktreeCard_module_default.failed,
|
|
6908
|
-
role: "status",
|
|
6909
|
-
children: t("cardSaveFailed")
|
|
6910
|
-
}) : null,
|
|
6911
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6912
|
-
size: "sm",
|
|
6913
|
-
variant: "outline",
|
|
6914
|
-
disabled: lockActions,
|
|
6915
|
-
onClick: props.discard,
|
|
6916
|
-
children: t("cardDiscard")
|
|
6917
|
-
}),
|
|
6918
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6919
|
-
size: "sm",
|
|
6920
|
-
variant: "primary",
|
|
6921
|
-
disabled: lockActions,
|
|
6922
|
-
onClick: props.save,
|
|
6923
|
-
children: t(state.saving ? "cardSaving" : "cardSave")
|
|
6924
8455
|
})
|
|
6925
|
-
]
|
|
6926
|
-
|
|
6927
|
-
|
|
8456
|
+
] })
|
|
8457
|
+
]
|
|
8458
|
+
})
|
|
8459
|
+
}), cutoutBase !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
8460
|
+
open: true,
|
|
8461
|
+
onClose: closeCutoutPrompt,
|
|
8462
|
+
closeLabel: t("close"),
|
|
8463
|
+
title: t("cutoutFlyAsk", { branch: cutoutBase }),
|
|
8464
|
+
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, {
|
|
8465
|
+
variant: "outline",
|
|
8466
|
+
disabled: creating,
|
|
8467
|
+
onClick: closeCutoutPrompt,
|
|
8468
|
+
children: t("cancel")
|
|
8469
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
8470
|
+
variant: "primary",
|
|
8471
|
+
disabled: creating || cutoutDraftError !== null,
|
|
8472
|
+
onClick: submitCutout,
|
|
8473
|
+
children: creating ? t("worktreeBusy") : t("actionConfirm")
|
|
8474
|
+
})] }),
|
|
8475
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8476
|
+
className: WorktreeActionHost_module_default.body,
|
|
8477
|
+
children: [
|
|
8478
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
8479
|
+
ref: cutoutInputRef,
|
|
8480
|
+
type: "text",
|
|
8481
|
+
className: WorktreeActionHost_module_default.searchInput,
|
|
8482
|
+
value: cutoutDraft,
|
|
8483
|
+
disabled: creating,
|
|
8484
|
+
placeholder: t("cutoutNewBranchPlaceholder"),
|
|
8485
|
+
"aria-invalid": cutoutDraftError !== null,
|
|
8486
|
+
onChange: (event) => {
|
|
8487
|
+
setCutoutDraft(event.target.value);
|
|
8488
|
+
setCreateError(null);
|
|
8489
|
+
},
|
|
8490
|
+
onKeyDown: (event) => {
|
|
8491
|
+
if (event.key === "Enter") {
|
|
8492
|
+
event.preventDefault();
|
|
8493
|
+
submitCutout();
|
|
8494
|
+
}
|
|
8495
|
+
}
|
|
8496
|
+
}),
|
|
8497
|
+
cutoutDraftHint !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8498
|
+
className: WorktreeActionHost_module_default.error,
|
|
8499
|
+
role: "status",
|
|
8500
|
+
children: cutoutDraftHint
|
|
8501
|
+
}),
|
|
8502
|
+
createError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8503
|
+
className: WorktreeActionHost_module_default.error,
|
|
8504
|
+
role: "alert",
|
|
8505
|
+
children: createError
|
|
8506
|
+
})
|
|
8507
|
+
]
|
|
8508
|
+
})
|
|
8509
|
+
})] });
|
|
8510
|
+
}
|
|
8511
|
+
/** Root overlay component listening to the global worktree action bus. */
|
|
8512
|
+
function WorktreeActionHost({ manager, adoptWorktree, isSwitchSessionDirectory, armDeferredWorktree, describeWorktreeRemoval, removeWorktree, pruneWorktrees, onWorktreeCreated, onWorktreeRemoved, t }) {
|
|
8513
|
+
const action = (0, react.useSyncExternalStore)(subscribeWorktreeAction, getWorktreeAction, getWorktreeAction);
|
|
8514
|
+
if (action === null) return null;
|
|
8515
|
+
if (action.kind === "manage") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorktreeManagerModal, {
|
|
8516
|
+
open: true,
|
|
8517
|
+
face: manager,
|
|
8518
|
+
initialRepoFilter: action.repoFilter,
|
|
8519
|
+
onClose: closeWorktreeAction,
|
|
8520
|
+
t
|
|
8521
|
+
});
|
|
8522
|
+
if (action.kind === "remove") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RemoveWorktreeModal, {
|
|
8523
|
+
path: action.path,
|
|
8524
|
+
branch: action.branch,
|
|
8525
|
+
describeWorktreeRemoval,
|
|
8526
|
+
removeWorktree,
|
|
8527
|
+
onRemoved: onWorktreeRemoved,
|
|
8528
|
+
onClose: closeWorktreeAction,
|
|
8529
|
+
t
|
|
8530
|
+
});
|
|
8531
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CreateWorktreeModal, {
|
|
8532
|
+
repoPath: action.repoPath,
|
|
8533
|
+
repoName: action.repoName,
|
|
8534
|
+
adoptWorktree,
|
|
8535
|
+
isSwitchSessionDirectory,
|
|
8536
|
+
armDeferredWorktree,
|
|
8537
|
+
pruneWorktrees,
|
|
8538
|
+
onCreated: onWorktreeCreated,
|
|
8539
|
+
onClose: closeWorktreeAction,
|
|
8540
|
+
t
|
|
6928
8541
|
});
|
|
6929
8542
|
}
|
|
6930
8543
|
//#endregion
|
|
@@ -6971,6 +8584,7 @@ window.__ModuleLoader__.load((() => {
|
|
|
6971
8584
|
menuExpandAll: "Expand all",
|
|
6972
8585
|
menuCollapseAll: "Collapse all",
|
|
6973
8586
|
menuNewBranchPlaceholder: "New branch name",
|
|
8587
|
+
cutoutNewBranchPlaceholder: "New branch name (blank = random)",
|
|
6974
8588
|
menuNewBranchBad: "Git will not accept this name",
|
|
6975
8589
|
menuNewBranchExists: "A branch with this name already exists",
|
|
6976
8590
|
menuFetch: "Fetch",
|
|
@@ -7076,6 +8690,12 @@ window.__ModuleLoader__.load((() => {
|
|
|
7076
8690
|
cardSwitchFailed: "This switch did not save. Try again.",
|
|
7077
8691
|
cardOpenGraphLabel: "Open the commit graph by default",
|
|
7078
8692
|
cardOpenGraphHint: "Clicking the branch button in the composer opens the graph.",
|
|
8693
|
+
cardHideOfficialWorktreeLabel: "Take over official new-worktree entry",
|
|
8694
|
+
cardHideOfficialWorktreeHint: "Hide the default new-worktree control in the top-right of blank sessions and manage worktrees from this plugin instead (keeps the right-side changes & review panel).",
|
|
8695
|
+
cardSwitchSessionDirLabel: "Switch worktree directory in current workspace (DSH official style)",
|
|
8696
|
+
cardSwitchSessionDirHint: "Open worktrees by switching the session working directory under its repository workspace instead of creating extra sidebar workspaces. New worktrees are created lazily when the first message is sent.",
|
|
8697
|
+
cardManageOfficialWorktreesLabel: "Manage official worktrees",
|
|
8698
|
+
cardManageOfficialWorktreesHint: "Include worktrees under <repo>/.agents/worktrees in the worktree manager for browsing, opening, or manual removal (never touched by auto-prune).",
|
|
7079
8699
|
cardManageWorktrees: "Manage worktrees…",
|
|
7080
8700
|
cardManageHint: "Browse and remove worktrees across repositories — including directories never registered as workspaces.",
|
|
7081
8701
|
cardFetchBeforeCreateLabel: "Fetch upstream before creating",
|
|
@@ -7106,7 +8726,10 @@ window.__ModuleLoader__.load((() => {
|
|
|
7106
8726
|
"manager.countOrphans": ", {n} unrecognized",
|
|
7107
8727
|
"manager.orphans": "Unrecognized directories",
|
|
7108
8728
|
"manager.sourceProject": "in project",
|
|
8729
|
+
"manager.sourceOfficial": "DSH official",
|
|
7109
8730
|
"manager.sourceLegacy": "legacy location",
|
|
8731
|
+
"manager.modeStandalone": "Standalone workspace",
|
|
8732
|
+
"manager.modeSession": "Session dir",
|
|
7110
8733
|
"manager.activityNever": "no sessions",
|
|
7111
8734
|
"manager.dirty.one": "{n} uncommitted file",
|
|
7112
8735
|
"manager.dirty.other": "{n} uncommitted files",
|
|
@@ -7119,8 +8742,50 @@ window.__ModuleLoader__.load((() => {
|
|
|
7119
8742
|
"manager.removeAria": "Remove the worktree “{path}”",
|
|
7120
8743
|
"manager.refresh": "Refresh",
|
|
7121
8744
|
"manager.openSession": "Open session in this worktree",
|
|
8745
|
+
"manager.openSessionOfficialHint": "Reuse the native DSH worktree directory to continue the conversation",
|
|
7122
8746
|
"manager.copyPath": "Copy path",
|
|
7123
8747
|
"manager.openFailed": "Could not open worktree: {message}",
|
|
8748
|
+
"manager.scopeRepo": "Current repository",
|
|
8749
|
+
"manager.showAllRepos": "Show all repositories",
|
|
8750
|
+
"manager.scopeBack": "Only {repo}",
|
|
8751
|
+
"manager.emptyScoped": "No worktrees found for {repo}.",
|
|
8752
|
+
"contextMenu.newWorktree": "New worktree from branch…",
|
|
8753
|
+
"contextMenu.manageWorktrees": "Manage worktrees…",
|
|
8754
|
+
"contextMenu.removeWorktree": "Remove this worktree…",
|
|
8755
|
+
"contextMenu.removeDone": "Worktree removed",
|
|
8756
|
+
"sidebar.worktreeBadge": "Git worktree · {repo}",
|
|
8757
|
+
"sidebar.worktreeBadgeWithBranch": "Git worktree · {repo} ({branch})",
|
|
8758
|
+
"sidebar.worktreeHover": "Worktree · {repo}",
|
|
8759
|
+
"sidebar.worktreeHoverWithBranch": "Worktree · {repo} / {branch}",
|
|
8760
|
+
"sidebar.worktreeHoverLabel": "Worktree",
|
|
8761
|
+
"sidebar.worktreeHoverFrom": "Worktree · from {base}",
|
|
8762
|
+
"createModal.title": "New worktree · {repo}",
|
|
8763
|
+
"createModal.loading": "Loading branches…",
|
|
8764
|
+
"createModal.loadFailed": "Could not load branches: {message}",
|
|
8765
|
+
"createModal.searchPlaceholder": "Search existing branches",
|
|
8766
|
+
"createModal.cutFromBranch": "New branch and worktree from {base}…",
|
|
8767
|
+
"createModal.noMatches": "No matching branches",
|
|
8768
|
+
"createModal.tagCurrent": "current",
|
|
8769
|
+
"createModal.tagWorktree": "worktree",
|
|
8770
|
+
"createModal.tagRemote": "remote",
|
|
8771
|
+
"createModal.creating": "Creating worktree…",
|
|
8772
|
+
"deferred.armedTitle": "Will create a worktree when you send the first message",
|
|
8773
|
+
"deferred.armedRandom": "Random branch from {base}",
|
|
8774
|
+
"deferred.armedCutout": "New branch {name} from {base}",
|
|
8775
|
+
"deferred.armedBranch": "Branch {branch}",
|
|
8776
|
+
"deferred.armedCancel": "Cancel",
|
|
8777
|
+
"deferred.runningTitle": "Creating worktree",
|
|
8778
|
+
"deferred.failedTitle": "Failed to create worktree",
|
|
8779
|
+
"deferred.phaseFetch": "Syncing upstream remotes",
|
|
8780
|
+
"deferred.phaseCreate": "Creating branch and worktree",
|
|
8781
|
+
"deferred.phaseCopy": "Copying configuration files",
|
|
8782
|
+
"deferred.phaseSwitch": "Switching session directory",
|
|
8783
|
+
"deferred.labelBranch": "Branch",
|
|
8784
|
+
"deferred.labelBase": "Base",
|
|
8785
|
+
"deferred.labelReason": "Reason",
|
|
8786
|
+
"deferred.waitingNote": "Your message will be sent once the worktree is ready",
|
|
8787
|
+
"deferred.retry": "Retry",
|
|
8788
|
+
"deferred.withdraw": "Continue without worktree",
|
|
7124
8789
|
fetchWarning: "Upstream sync failed; created from the local state: {message}",
|
|
7125
8790
|
excludeWarning: "The ignore rule for the repository could not be written; `.dsh/` will show as untracked: {message}",
|
|
7126
8791
|
copyWarning: "Some configuration files could not be copied: {message}",
|
|
@@ -7141,8 +8806,8 @@ window.__ModuleLoader__.load((() => {
|
|
|
7141
8806
|
"worktreeRemove.dirty.other": "{n} uncommitted files will be deleted with the folder.",
|
|
7142
8807
|
"worktreeRemove.clean": "No uncommitted changes.",
|
|
7143
8808
|
"worktreeRemove.ahead": "{n} commits ahead of upstream, kept on the branch.",
|
|
7144
|
-
"worktreeRemove.sessions.one": "{n} session
|
|
7145
|
-
"worktreeRemove.sessions.other": "{n} sessions
|
|
8809
|
+
"worktreeRemove.sessions.one": "{n} session associated with this worktree will be archived too.",
|
|
8810
|
+
"worktreeRemove.sessions.other": "{n} sessions associated with this worktree will be archived too.",
|
|
7146
8811
|
"worktreeRemove.busy": "Removing…",
|
|
7147
8812
|
"hover.copied": "Copied",
|
|
7148
8813
|
"time.now": "now",
|
|
@@ -7197,6 +8862,7 @@ window.__ModuleLoader__.load((() => {
|
|
|
7197
8862
|
menuExpandAll: "全部展开",
|
|
7198
8863
|
menuCollapseAll: "全部折叠",
|
|
7199
8864
|
menuNewBranchPlaceholder: "新分支名称",
|
|
8865
|
+
cutoutNewBranchPlaceholder: "新分支名(留空随机生成)",
|
|
7200
8866
|
menuNewBranchBad: "Git 不接受该名称",
|
|
7201
8867
|
menuNewBranchExists: "同名分支已存在",
|
|
7202
8868
|
menuFetch: "提取",
|
|
@@ -7302,6 +8968,12 @@ window.__ModuleLoader__.load((() => {
|
|
|
7302
8968
|
cardSwitchFailed: "该开关未保存,请重试。",
|
|
7303
8969
|
cardOpenGraphLabel: "默认展开 Git 图谱",
|
|
7304
8970
|
cardOpenGraphHint: "点击对话框里的分支图标时直接打开提交图谱。",
|
|
8971
|
+
cardHideOfficialWorktreeLabel: "接管官方新建工作树入口",
|
|
8972
|
+
cardHideOfficialWorktreeHint: "隐藏空白会话右上角默认的新建工作树按钮,统一由左下角分支菜单管理(不影响右侧变更与评审面板)。",
|
|
8973
|
+
cardSwitchSessionDirLabel: "在当前工作区下切换工作树目录(同 DSH 官方方式)",
|
|
8974
|
+
cardSwitchSessionDirHint: "新建或打开工作树时不再新增侧边栏工作区,直接在所属仓库下切换会话工作目录;新建工作树将在发送首条消息时延迟创建(已有独立工作区不受影响)。",
|
|
8975
|
+
cardManageOfficialWorktreesLabel: "管理官方创建的工作树",
|
|
8976
|
+
cardManageOfficialWorktreesHint: "在工作树管理弹窗中一并扫描并管理 <repo>/.agents/worktrees 下的官方工作树(仅支持查看、打开与手动删除,不参与自动清理)。",
|
|
7305
8977
|
cardManageWorktrees: "管理工作树…",
|
|
7306
8978
|
cardManageHint: "跨仓库查看并删除全部工作树,包含从未注册为工作区的目录。",
|
|
7307
8979
|
cardFetchBeforeCreateLabel: "创建工作树前同步上游",
|
|
@@ -7332,7 +9004,10 @@ window.__ModuleLoader__.load((() => {
|
|
|
7332
9004
|
"manager.countOrphans": ",{n} 个无法识别",
|
|
7333
9005
|
"manager.orphans": "无法识别的目录",
|
|
7334
9006
|
"manager.sourceProject": "项目内",
|
|
9007
|
+
"manager.sourceOfficial": "DSH 官方",
|
|
7335
9008
|
"manager.sourceLegacy": "历史位置",
|
|
9009
|
+
"manager.modeStandalone": "独立工作区",
|
|
9010
|
+
"manager.modeSession": "会话目录",
|
|
7336
9011
|
"manager.activityNever": "无会话",
|
|
7337
9012
|
"manager.dirty.one": "{n} 个未提交文件",
|
|
7338
9013
|
"manager.dirty.other": "{n} 个未提交文件",
|
|
@@ -7345,8 +9020,50 @@ window.__ModuleLoader__.load((() => {
|
|
|
7345
9020
|
"manager.removeAria": "删除工作树“{path}”",
|
|
7346
9021
|
"manager.refresh": "刷新",
|
|
7347
9022
|
"manager.openSession": "在此工作树中打开会话",
|
|
9023
|
+
"manager.openSessionOfficialHint": "复用 DSH 原生工作树目录继续对话",
|
|
7348
9024
|
"manager.copyPath": "复制路径",
|
|
7349
9025
|
"manager.openFailed": "无法打开工作树:{message}",
|
|
9026
|
+
"manager.scopeRepo": "当前仓库",
|
|
9027
|
+
"manager.showAllRepos": "显示全部仓库",
|
|
9028
|
+
"manager.scopeBack": "仅看 {repo}",
|
|
9029
|
+
"manager.emptyScoped": "当前仓库 {repo} 暂无工作树。",
|
|
9030
|
+
"contextMenu.newWorktree": "从分支新建工作树…",
|
|
9031
|
+
"contextMenu.manageWorktrees": "管理工作树…",
|
|
9032
|
+
"contextMenu.removeWorktree": "删除此工作树…",
|
|
9033
|
+
"contextMenu.removeDone": "已删除工作树",
|
|
9034
|
+
"sidebar.worktreeBadge": "Git 工作树 · {repo}",
|
|
9035
|
+
"sidebar.worktreeBadgeWithBranch": "Git 工作树 · {repo}({branch})",
|
|
9036
|
+
"sidebar.worktreeHover": "工作树 · {repo}",
|
|
9037
|
+
"sidebar.worktreeHoverWithBranch": "工作树 · {repo} / {branch}",
|
|
9038
|
+
"sidebar.worktreeHoverLabel": "工作树",
|
|
9039
|
+
"sidebar.worktreeHoverFrom": "工作树 · 基于 {base}",
|
|
9040
|
+
"createModal.title": "新建工作树 · {repo}",
|
|
9041
|
+
"createModal.loading": "正在加载分支…",
|
|
9042
|
+
"createModal.loadFailed": "分支加载失败:{message}",
|
|
9043
|
+
"createModal.searchPlaceholder": "搜索已有分支",
|
|
9044
|
+
"createModal.cutFromBranch": "从 {base} 新建分支并创建工作树…",
|
|
9045
|
+
"createModal.noMatches": "没有匹配的分支",
|
|
9046
|
+
"createModal.tagCurrent": "当前",
|
|
9047
|
+
"createModal.tagWorktree": "已有工作树",
|
|
9048
|
+
"createModal.tagRemote": "远程",
|
|
9049
|
+
"createModal.creating": "正在创建工作树…",
|
|
9050
|
+
"deferred.armedTitle": "将在发送首条消息时创建工作树",
|
|
9051
|
+
"deferred.armedRandom": "基于 {base} 随机生成分支",
|
|
9052
|
+
"deferred.armedCutout": "基于 {base} 新建分支 {name}",
|
|
9053
|
+
"deferred.armedBranch": "分支 {branch}",
|
|
9054
|
+
"deferred.armedCancel": "取消",
|
|
9055
|
+
"deferred.runningTitle": "正在创建工作树",
|
|
9056
|
+
"deferred.failedTitle": "创建工作树失败",
|
|
9057
|
+
"deferred.phaseFetch": "同步上游远程分支",
|
|
9058
|
+
"deferred.phaseCreate": "创建分支与工作树",
|
|
9059
|
+
"deferred.phaseCopy": "复制配置文件",
|
|
9060
|
+
"deferred.phaseSwitch": "切换会话工作目录",
|
|
9061
|
+
"deferred.labelBranch": "分支",
|
|
9062
|
+
"deferred.labelBase": "基于",
|
|
9063
|
+
"deferred.labelReason": "原因",
|
|
9064
|
+
"deferred.waitingNote": "消息会在工作树建好后发送",
|
|
9065
|
+
"deferred.retry": "重试",
|
|
9066
|
+
"deferred.withdraw": "不使用工作树",
|
|
7350
9067
|
fetchWarning: "上游同步失败,已按本地状态创建:{message}",
|
|
7351
9068
|
excludeWarning: "仓库忽略规则写入失败,`.dsh/` 将显示为未跟踪目录:{message}",
|
|
7352
9069
|
copyWarning: "部分配置文件未能复制到新工作树:{message}",
|
|
@@ -7367,8 +9084,8 @@ window.__ModuleLoader__.load((() => {
|
|
|
7367
9084
|
"worktreeRemove.dirty.other": "{n} 个未提交文件将随目录一并删除。",
|
|
7368
9085
|
"worktreeRemove.clean": "无未提交改动。",
|
|
7369
9086
|
"worktreeRemove.ahead": "分支领先上游 {n} 个提交,提交将保留在分支上。",
|
|
7370
|
-
"worktreeRemove.sessions.one": "
|
|
7371
|
-
"worktreeRemove.sessions.other": "
|
|
9087
|
+
"worktreeRemove.sessions.one": "此工作树关联的 {n} 个会话将一并归档。",
|
|
9088
|
+
"worktreeRemove.sessions.other": "此工作树关联的 {n} 个会话将一并归档。",
|
|
7372
9089
|
"worktreeRemove.busy": "删除中…",
|
|
7373
9090
|
"hover.copied": "已复制",
|
|
7374
9091
|
"time.now": "刚刚",
|
|
@@ -7414,6 +9131,39 @@ window.__ModuleLoader__.load((() => {
|
|
|
7414
9131
|
}
|
|
7415
9132
|
//#endregion
|
|
7416
9133
|
//#region src/client/index.ts
|
|
9134
|
+
/**
|
|
9135
|
+
* dsh-git-worktree browser half: the composer branch chip + worktree toggle
|
|
9136
|
+
* (conversation.input.left) for blank sessions and the plugin configuration
|
|
9137
|
+
* card on the Plugins tab (the `git-worktree` settings namespace — the
|
|
9138
|
+
* worktree storage root — edited through the settings scope). Repo facts and
|
|
9139
|
+
* worktree creation flow through the host half's own routes; adopting a
|
|
9140
|
+
* freshly created worktree registers it and starts a session through the
|
|
9141
|
+
* framework's uiWorkspace navigation.
|
|
9142
|
+
*/
|
|
9143
|
+
const resolveForgePanelCancelWorktree = (remote) => {
|
|
9144
|
+
if (typeof remote !== "object" || remote === null) return void 0;
|
|
9145
|
+
const forgePanel = remote.forgePanel;
|
|
9146
|
+
if (typeof forgePanel !== "object" || forgePanel === null) return void 0;
|
|
9147
|
+
const cancel = forgePanel.cancelWorktree;
|
|
9148
|
+
return typeof cancel === "function" ? cancel.bind(forgePanel) : void 0;
|
|
9149
|
+
};
|
|
9150
|
+
/**
|
|
9151
|
+
* Null renderer used to shadow official `forge-panel.worktree` at higher
|
|
9152
|
+
* precedence (priority -10). While mounted on a blank session, it also cancels
|
|
9153
|
+
* any leftover official `forgeWorktree` request that may have been persisted on
|
|
9154
|
+
* that reused blank session before this plugin hid the toggle, preventing
|
|
9155
|
+
* silent nested `.agents/worktrees/...` creation on the first user turn.
|
|
9156
|
+
*/
|
|
9157
|
+
function HiddenOfficialWorktreeEntry(props) {
|
|
9158
|
+
const sessionId = props?.sessionId;
|
|
9159
|
+
const cancel = props?.cancelOfficialWorktree;
|
|
9160
|
+
(0, react.useEffect)(() => {
|
|
9161
|
+
if (sessionId !== void 0 && cancel !== void 0) cancel(sessionId);
|
|
9162
|
+
}, [sessionId, cancel]);
|
|
9163
|
+
return null;
|
|
9164
|
+
}
|
|
9165
|
+
/** Official forge-panel worktree toggle slot entry id. */
|
|
9166
|
+
const OFFICIAL_WORKTREE_SLOT_ID = "forge-panel.worktree";
|
|
7417
9167
|
/** Dictionary namespace owned by this plugin. */
|
|
7418
9168
|
const NS = "git-worktree";
|
|
7419
9169
|
/**
|
|
@@ -7428,6 +9178,8 @@ window.__ModuleLoader__.load((() => {
|
|
|
7428
9178
|
*/
|
|
7429
9179
|
const PLUGIN_PACKAGE = "@laoyuehanni/dsh-git-worktree";
|
|
7430
9180
|
const hasSyncedRef = (ref) => ref !== void 0 && typeof ref.get === "function" && typeof ref.subscribe === "function";
|
|
9181
|
+
const isObservable = (value) => typeof value === "object" && value !== null && typeof value.getSnapshot === "function" && typeof value.subscribe === "function";
|
|
9182
|
+
const hasContextMenus = (value) => typeof value === "object" && value !== null && typeof value.contextMenus?.register === "function";
|
|
7431
9183
|
/** Required services: the slot ledger, session/workspace runtimes, the
|
|
7432
9184
|
* workspace navigation/directory face, copy, and the config forms backing
|
|
7433
9185
|
* the plugin configuration card. */
|
|
@@ -7450,50 +9202,201 @@ window.__ModuleLoader__.load((() => {
|
|
|
7450
9202
|
const openGraphRef = hasSyncedRef(config?.openGraphByDefault) ? config.openGraphByDefault : void 0;
|
|
7451
9203
|
const autoPruneRef = hasSyncedRef(config?.autoPruneWorktrees) ? config.autoPruneWorktrees : void 0;
|
|
7452
9204
|
const keepWorktreesRef = hasSyncedRef(config?.keepWorktrees) ? config.keepWorktrees : void 0;
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
9205
|
+
const hideOfficialRef = hasSyncedRef(config?.hideOfficialWorktreeEntry) ? config.hideOfficialWorktreeEntry : void 0;
|
|
9206
|
+
const switchSessionDirRef = hasSyncedRef(config?.switchSessionDirectory) ? config.switchSessionDirectory : void 0;
|
|
9207
|
+
const readHideOfficialEntry = () => {
|
|
9208
|
+
if (hideOfficialRef !== void 0) return hideOfficialRef.get() ?? true;
|
|
9209
|
+
const section = groupingForm.getSnapshot();
|
|
9210
|
+
return section.status === "ready" ? section.value?.hideOfficialWorktreeEntry ?? true : true;
|
|
9211
|
+
};
|
|
9212
|
+
const readSwitchSessionDirectory = () => {
|
|
9213
|
+
if (switchSessionDirRef !== void 0) return switchSessionDirRef.get() === true;
|
|
9214
|
+
const section = groupingForm.getSnapshot();
|
|
9215
|
+
return section.status === "ready" && section.value?.switchSessionDirectory === true;
|
|
9216
|
+
};
|
|
9217
|
+
const gitCache = createWorkspaceGitCache();
|
|
9218
|
+
const armedDeferredSessions = /* @__PURE__ */ new Set();
|
|
9219
|
+
let forgePanelCancelWorktree;
|
|
9220
|
+
if (typeof ctx.inject === "function") ctx.inject.bind(ctx)(["remote.forgePanel"], (forgeCtx) => {
|
|
9221
|
+
const cancel = resolveForgePanelCancelWorktree(forgeCtx.remote);
|
|
9222
|
+
if (cancel === void 0) return;
|
|
9223
|
+
forgePanelCancelWorktree = cancel;
|
|
9224
|
+
forgeCtx.effect(() => () => {
|
|
9225
|
+
if (forgePanelCancelWorktree === cancel) forgePanelCancelWorktree = void 0;
|
|
9226
|
+
}, "git-worktree: optional forgePanel.cancelWorktree bridge");
|
|
9227
|
+
});
|
|
9228
|
+
const cancelOfficialWorktree = (sessionId) => {
|
|
9229
|
+
const cancel = forgePanelCancelWorktree;
|
|
9230
|
+
if (cancel === void 0) return;
|
|
9231
|
+
cancel(sessionId).catch(() => {});
|
|
9232
|
+
};
|
|
9233
|
+
/**
|
|
9234
|
+
* Dual-mode worktree ownership facts read from live snapshots:
|
|
9235
|
+
* - `workspaceId` is present ONLY for a standalone workspace on `path`
|
|
9236
|
+
* (never a parent repository workspace in shared-directory mode);
|
|
9237
|
+
* - `running`, `archiveIds`, and `activity` include every session whose
|
|
9238
|
+
* effective `workingDirectory` sits inside `path`.
|
|
9239
|
+
*/
|
|
9240
|
+
const ownershipFacts = (path) => {
|
|
7459
9241
|
const workspaces = ctx.workspaces.list.getSnapshot();
|
|
7460
|
-
const workspace = workspaces.items.find((item) => pathKey(item.path) === pathKey(path));
|
|
7461
|
-
if (workspace === void 0) return {
|
|
7462
|
-
running: false,
|
|
7463
|
-
workspaceId: void 0,
|
|
7464
|
-
archiveIds: []
|
|
7465
|
-
};
|
|
7466
9242
|
const sessions = ctx.sessions.list.getSnapshot();
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
9243
|
+
return collectWorktreeOwnership(path, workspaces.items.map((item) => ({
|
|
9244
|
+
workspaceId: item.workspaceId,
|
|
9245
|
+
path: item.path,
|
|
9246
|
+
sessionIds: item.sessionIds
|
|
9247
|
+
})), sessions, workspaces.archivedSessionIds);
|
|
9248
|
+
};
|
|
9249
|
+
const resolveRepoRootForWorktree = async (targetPath, hint) => {
|
|
9250
|
+
if (hint !== void 0 && hint.length > 0) return hint;
|
|
9251
|
+
const cached = gitCache.get(targetPath);
|
|
9252
|
+
if (cached !== void 0 && cached !== null) return cached.repoRoot;
|
|
9253
|
+
const probed = await requestGroupWorktrees([targetPath]);
|
|
9254
|
+
if (probed.ok) {
|
|
9255
|
+
const facts = probed.facts[targetPath];
|
|
9256
|
+
if (facts !== void 0 && facts !== null) return facts.repoRoot;
|
|
7476
9257
|
}
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
9258
|
+
};
|
|
9259
|
+
const adoptWorktree = async (path, options) => {
|
|
9260
|
+
const workspacesSnapshot = ctx.workspaces.list.getSnapshot();
|
|
9261
|
+
const targetKey = pathKey(path);
|
|
9262
|
+
const existingWorkspace = workspacesSnapshot.items.find((item) => pathKey(item.path) === targetKey);
|
|
9263
|
+
if (existingWorkspace !== void 0) {
|
|
9264
|
+
ctx.uiWorkspace.startSession(existingWorkspace.workspaceId);
|
|
9265
|
+
return;
|
|
9266
|
+
}
|
|
9267
|
+
if (readSwitchSessionDirectory()) {
|
|
9268
|
+
const repoRoot = await resolveRepoRootForWorktree(path, options?.repoRoot);
|
|
9269
|
+
if (repoRoot !== void 0 && pathKey(repoRoot) === targetKey) {
|
|
9270
|
+
const workspace = await ctx.workspaces.create({ path });
|
|
9271
|
+
ctx.uiWorkspace.startSession(workspace.workspaceId);
|
|
9272
|
+
return;
|
|
9273
|
+
}
|
|
9274
|
+
const sessionsApi = ctx.sessions;
|
|
9275
|
+
const uiWs = ctx.uiWorkspace;
|
|
9276
|
+
if (options?.reuseBlankSessionId !== void 0 && options.reuseBlankSessionId.length > 0) {
|
|
9277
|
+
const blankId = options.reuseBlankSessionId;
|
|
9278
|
+
cancelOfficialWorktree(blankId);
|
|
9279
|
+
await requestDeferredWorktreeAction(options.reuseBlankSessionId, "cancel").catch(() => {});
|
|
9280
|
+
armedDeferredSessions.delete(options.reuseBlankSessionId);
|
|
9281
|
+
notifyDeferredWorktreeState(options.reuseBlankSessionId, null);
|
|
9282
|
+
const moved = await requestSetSessionDirectory(options.reuseBlankSessionId, path);
|
|
9283
|
+
if (!moved.ok) throw new Error(moved.error);
|
|
9284
|
+
sessionsApi.refreshProjections?.(blankId).catch(() => {});
|
|
9285
|
+
gitCache.refresh([path]);
|
|
9286
|
+
return;
|
|
9287
|
+
}
|
|
9288
|
+
if (typeof sessionsApi.create === "function" && typeof uiWs.openSession === "function") {
|
|
9289
|
+
if (repoRoot !== void 0) {
|
|
9290
|
+
const existingParent = workspacesSnapshot.items.find((item) => pathKey(item.path) === pathKey(repoRoot));
|
|
9291
|
+
if (existingParent !== void 0) {
|
|
9292
|
+
const reusableBlank = findReusableBlankSessionInWorktree({
|
|
9293
|
+
workspaceId: existingParent.workspaceId,
|
|
9294
|
+
path: existingParent.path,
|
|
9295
|
+
sessionIds: existingParent.sessionIds
|
|
9296
|
+
}, path, ctx.sessions.list.getSnapshot(), workspacesSnapshot.archivedSessionIds);
|
|
9297
|
+
if (reusableBlank !== void 0) {
|
|
9298
|
+
const reusableId = reusableBlank;
|
|
9299
|
+
cancelOfficialWorktree(reusableId);
|
|
9300
|
+
uiWs.openSession(reusableId);
|
|
9301
|
+
gitCache.refresh([path]);
|
|
9302
|
+
return;
|
|
9303
|
+
}
|
|
9304
|
+
}
|
|
9305
|
+
const parentWorkspace = existingParent ?? await ctx.workspaces.create({ path: repoRoot });
|
|
9306
|
+
const newSessionId = await sessionsApi.create({ workspaceId: parentWorkspace.workspaceId });
|
|
9307
|
+
cancelOfficialWorktree(newSessionId);
|
|
9308
|
+
const moved = await requestSetSessionDirectory(newSessionId, path);
|
|
9309
|
+
if (!moved.ok) throw new Error(moved.error);
|
|
9310
|
+
uiWs.openSession(newSessionId);
|
|
9311
|
+
sessionsApi.refreshProjections?.(newSessionId).catch(() => {});
|
|
9312
|
+
gitCache.refresh([path]);
|
|
9313
|
+
return;
|
|
9314
|
+
}
|
|
9315
|
+
}
|
|
9316
|
+
}
|
|
9317
|
+
const workspace = await ctx.workspaces.create({ path });
|
|
9318
|
+
ctx.uiWorkspace.startSession(workspace.workspaceId);
|
|
9319
|
+
};
|
|
9320
|
+
const armDeferredWorktree = async (spec, options) => {
|
|
9321
|
+
const sessionsApi = ctx.sessions;
|
|
9322
|
+
const uiWs = ctx.uiWorkspace;
|
|
9323
|
+
if (options?.reuseBlankSessionId !== void 0 && options.reuseBlankSessionId.length > 0) {
|
|
9324
|
+
const blankId = options.reuseBlankSessionId;
|
|
9325
|
+
cancelOfficialWorktree(blankId);
|
|
9326
|
+
const armed = await requestArmDeferredWorktree({
|
|
9327
|
+
sessionId: options.reuseBlankSessionId,
|
|
9328
|
+
repoPath: spec.repoPath,
|
|
9329
|
+
branch: spec.branch,
|
|
9330
|
+
cutout: spec.cutout,
|
|
9331
|
+
...spec.name === void 0 ? {} : { name: spec.name },
|
|
9332
|
+
...spec.random === void 0 ? {} : { random: spec.random }
|
|
9333
|
+
});
|
|
9334
|
+
if (!armed.ok) throw new Error(armed.error);
|
|
9335
|
+
armedDeferredSessions.add(options.reuseBlankSessionId);
|
|
9336
|
+
notifyDeferredWorktreeState(options.reuseBlankSessionId, armed.state);
|
|
9337
|
+
return;
|
|
9338
|
+
}
|
|
9339
|
+
if (typeof sessionsApi.create !== "function" || typeof uiWs.openSession !== "function") throw new Error("Host does not support deferred session worktree creation");
|
|
9340
|
+
const repoRoot = await resolveRepoRootForWorktree(spec.repoPath, options?.repoRoot);
|
|
9341
|
+
if (repoRoot === void 0) throw new Error("Could not resolve repository root for deferred worktree creation");
|
|
9342
|
+
const workspacesSnapshot = ctx.workspaces.list.getSnapshot();
|
|
9343
|
+
const existingParent = workspacesSnapshot.items.find((item) => pathKey(item.path) === pathKey(repoRoot));
|
|
9344
|
+
if (existingParent !== void 0) {
|
|
9345
|
+
const sessionsSnap = ctx.sessions.list.getSnapshot();
|
|
9346
|
+
const archived = new Set(workspacesSnapshot.archivedSessionIds);
|
|
9347
|
+
const activeMainId = Object.entries(sessionsSnap.byId).find(([, summary]) => (summary?.retainedBy?.mainView ?? 0) > 0)?.[0];
|
|
9348
|
+
if (activeMainId !== void 0 && !archived.has(activeMainId) && existingParent.sessionIds.includes(activeMainId)) {
|
|
9349
|
+
const activeSummary = sessionsSnap.byId[activeMainId];
|
|
9350
|
+
const activeDir = selectSessionDirectory(sessionsSnap, activeMainId);
|
|
9351
|
+
if (activeSummary?.blank === true && activeSummary.origin !== "subagent" && activeDir !== void 0 && pathKey(activeDir) === pathKey(repoRoot)) {
|
|
9352
|
+
const currentDeferred = await fetchDeferredWorktree(activeMainId);
|
|
9353
|
+
if (currentDeferred.ok && currentDeferred.state === null) {
|
|
9354
|
+
cancelOfficialWorktree(activeMainId);
|
|
9355
|
+
const armed = await requestArmDeferredWorktree({
|
|
9356
|
+
sessionId: activeMainId,
|
|
9357
|
+
repoPath: spec.repoPath,
|
|
9358
|
+
branch: spec.branch,
|
|
9359
|
+
cutout: spec.cutout,
|
|
9360
|
+
...spec.name === void 0 ? {} : { name: spec.name },
|
|
9361
|
+
...spec.random === void 0 ? {} : { random: spec.random }
|
|
9362
|
+
});
|
|
9363
|
+
if (!armed.ok) throw new Error(armed.error);
|
|
9364
|
+
armedDeferredSessions.add(activeMainId);
|
|
9365
|
+
notifyDeferredWorktreeState(activeMainId, armed.state);
|
|
9366
|
+
return;
|
|
9367
|
+
}
|
|
9368
|
+
}
|
|
9369
|
+
}
|
|
9370
|
+
}
|
|
9371
|
+
const parentWorkspace = existingParent ?? await ctx.workspaces.create({ path: repoRoot });
|
|
9372
|
+
const newSessionId = await sessionsApi.create({ workspaceId: parentWorkspace.workspaceId });
|
|
9373
|
+
cancelOfficialWorktree(newSessionId);
|
|
9374
|
+
const armed = await requestArmDeferredWorktree({
|
|
9375
|
+
sessionId: newSessionId,
|
|
9376
|
+
repoPath: spec.repoPath,
|
|
9377
|
+
branch: spec.branch,
|
|
9378
|
+
cutout: spec.cutout,
|
|
9379
|
+
...spec.name === void 0 ? {} : { name: spec.name },
|
|
9380
|
+
...spec.random === void 0 ? {} : { random: spec.random }
|
|
9381
|
+
});
|
|
9382
|
+
if (!armed.ok) throw new Error(armed.error);
|
|
9383
|
+
armedDeferredSessions.add(newSessionId);
|
|
9384
|
+
notifyDeferredWorktreeState(newSessionId, armed.state);
|
|
9385
|
+
uiWs.openSession(newSessionId);
|
|
7482
9386
|
};
|
|
7483
9387
|
const chipInjected = () => ({
|
|
7484
|
-
adoptWorktree
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
},
|
|
9388
|
+
adoptWorktree,
|
|
9389
|
+
isSwitchSessionDirectory: readSwitchSessionDirectory,
|
|
9390
|
+
armDeferredWorktree,
|
|
7488
9391
|
describeWorktreeRemoval: (path) => {
|
|
7489
|
-
const facts =
|
|
9392
|
+
const facts = ownershipFacts(path);
|
|
7490
9393
|
return {
|
|
7491
9394
|
running: facts.running,
|
|
7492
9395
|
archiveCount: facts.archiveIds.length
|
|
7493
9396
|
};
|
|
7494
9397
|
},
|
|
7495
9398
|
removeWorktree: async (path, force) => {
|
|
7496
|
-
const facts =
|
|
9399
|
+
const facts = ownershipFacts(path);
|
|
7497
9400
|
await removeWorktreeFully({
|
|
7498
9401
|
removeWorktree: async (target, targetForce) => {
|
|
7499
9402
|
const result = await requestRemoveWorktree(target, targetForce);
|
|
@@ -7525,26 +9428,27 @@ window.__ModuleLoader__.load((() => {
|
|
|
7525
9428
|
const scan = await requestWorktreesAll(workspaces.items.map((workspace) => workspace.path));
|
|
7526
9429
|
if (!scan.ok) return void 0;
|
|
7527
9430
|
const sessions = ctx.sessions.list.getSnapshot();
|
|
7528
|
-
const
|
|
9431
|
+
const workspaceRows = workspaces.items.map((workspace) => ({
|
|
9432
|
+
workspaceId: workspace.workspaceId,
|
|
9433
|
+
path: workspace.path,
|
|
9434
|
+
sessionIds: workspace.sessionIds
|
|
9435
|
+
}));
|
|
9436
|
+
const archivedIds = workspaces.archivedSessionIds;
|
|
7529
9437
|
const activity = {};
|
|
7530
9438
|
const workspaceIdByPath = /* @__PURE__ */ new Map();
|
|
7531
9439
|
const archiveIdsByPath = /* @__PURE__ */ new Map();
|
|
7532
9440
|
const exclude = /* @__PURE__ */ new Set([pathKey(createdPath)]);
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
const
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
if (summary.blank || summary.origin === "subagent") continue;
|
|
7542
|
-
if (!archived.has(sessionId)) archiveIds.push(sessionId);
|
|
7543
|
-
}
|
|
7544
|
-
activity[key] = freshestUpdatedAt(workspace.sessionIds.map((id) => sessions.byId[id]));
|
|
7545
|
-
archiveIdsByPath.set(key, archiveIds);
|
|
9441
|
+
const validPaths = scan.worktrees.filter((entry) => entry.repoName !== null && entry.source !== "official").map((entry) => entry.path);
|
|
9442
|
+
for (const worktreePath of validPaths) {
|
|
9443
|
+
const key = pathKey(worktreePath);
|
|
9444
|
+
const owned = collectWorktreeOwnership(worktreePath, workspaceRows, sessions, archivedIds);
|
|
9445
|
+
if (owned.running) exclude.add(key);
|
|
9446
|
+
if (owned.workspaceId !== void 0) workspaceIdByPath.set(key, owned.workspaceId);
|
|
9447
|
+
activity[key] = owned.activity;
|
|
9448
|
+
archiveIdsByPath.set(key, owned.archiveIds);
|
|
7546
9449
|
}
|
|
7547
|
-
const
|
|
9450
|
+
const mainSessionId = Object.entries(sessions.byId).find(([, summary]) => (summary?.retainedBy?.mainView ?? 0) > 0)?.[0];
|
|
9451
|
+
const currentCwd = mainSessionId === void 0 ? void 0 : selectSessionDirectory(sessions, mainSessionId);
|
|
7548
9452
|
if (currentCwd !== void 0) exclude.add(pathKey(currentCwd));
|
|
7549
9453
|
const report = await runAutoPrune({
|
|
7550
9454
|
inspectWorktree: async (path) => {
|
|
@@ -7563,7 +9467,7 @@ window.__ModuleLoader__.load((() => {
|
|
|
7563
9467
|
archiveSession: (sessionId) => ctx.workspaces.archiveSession(sessionId),
|
|
7564
9468
|
deleteWorkspace: (workspaceId) => ctx.workspaces.delete(workspaceId)
|
|
7565
9469
|
}, planPrune({
|
|
7566
|
-
paths:
|
|
9470
|
+
paths: validPaths,
|
|
7567
9471
|
activity,
|
|
7568
9472
|
keep,
|
|
7569
9473
|
exclude
|
|
@@ -7603,11 +9507,96 @@ window.__ModuleLoader__.load((() => {
|
|
|
7603
9507
|
locale: NS,
|
|
7604
9508
|
inject: chipInjected
|
|
7605
9509
|
}, BranchChipDock));
|
|
9510
|
+
const handledCompletions = /* @__PURE__ */ new Set();
|
|
9511
|
+
const onDeferredCompleted = (sessionId, completed) => {
|
|
9512
|
+
armedDeferredSessions.delete(sessionId);
|
|
9513
|
+
const key = `${sessionId}\0${pathKey(completed.path)}`;
|
|
9514
|
+
if (handledCompletions.has(key)) return;
|
|
9515
|
+
handledCompletions.add(key);
|
|
9516
|
+
ctx.sessions.refreshProjections?.(sessionId).catch(() => {});
|
|
9517
|
+
gitCache.refresh([completed.path]);
|
|
9518
|
+
const t = ctx.locale.bind(NS);
|
|
9519
|
+
if (completed.fetchWarning !== void 0) emitToast(t("fetchWarning", { message: completed.fetchWarning }));
|
|
9520
|
+
if (completed.excludeWarning !== void 0) emitToast(t("excludeWarning", { message: completed.excludeWarning }));
|
|
9521
|
+
if (completed.copyWarning !== void 0) emitToast(t("copyWarning", { message: completed.copyWarning }));
|
|
9522
|
+
const prune = chipInjected().pruneWorktrees;
|
|
9523
|
+
if (prune !== void 0) prune(completed.path).then((report) => {
|
|
9524
|
+
if (report === void 0) return;
|
|
9525
|
+
if (report.removed.length > 0) emitToast(t("pruneDone", { n: report.removed.length }));
|
|
9526
|
+
if (report.failed.length > 0) emitToast(t("pruneFailed", { n: report.failed.length }));
|
|
9527
|
+
}).catch(() => {});
|
|
9528
|
+
};
|
|
9529
|
+
ctx.slots.inject("conversation.input.dock", () => ctx.slots.register({
|
|
9530
|
+
name: "conversation.input.dock",
|
|
9531
|
+
id: "git-worktree-deferred",
|
|
9532
|
+
order: 5,
|
|
9533
|
+
locale: NS,
|
|
9534
|
+
inject: () => ({
|
|
9535
|
+
shouldProbeDeferred: (sessionId) => readSwitchSessionDirectory() || armedDeferredSessions.has(sessionId),
|
|
9536
|
+
onDeferredCompleted
|
|
9537
|
+
})
|
|
9538
|
+
}, DeferredWorktreeDock));
|
|
9539
|
+
let pluginDisposed = false;
|
|
9540
|
+
let officialEntryDisposer;
|
|
9541
|
+
const syncOfficialEntryOverride = () => {
|
|
9542
|
+
if (pluginDisposed) return;
|
|
9543
|
+
const shouldHide = readHideOfficialEntry();
|
|
9544
|
+
if (shouldHide && officialEntryDisposer === void 0) officialEntryDisposer = ctx.slots.inject("conversation.hero.options", () => ctx.slots.register({
|
|
9545
|
+
name: "conversation.hero.options",
|
|
9546
|
+
id: OFFICIAL_WORKTREE_SLOT_ID,
|
|
9547
|
+
priority: -10,
|
|
9548
|
+
inject: () => ({ cancelOfficialWorktree })
|
|
9549
|
+
}, HiddenOfficialWorktreeEntry));
|
|
9550
|
+
else if (!shouldHide && officialEntryDisposer !== void 0) {
|
|
9551
|
+
officialEntryDisposer();
|
|
9552
|
+
officialEntryDisposer = void 0;
|
|
9553
|
+
}
|
|
9554
|
+
};
|
|
9555
|
+
syncOfficialEntryOverride();
|
|
9556
|
+
const unsubHideOfficialSynced = hideOfficialRef?.subscribe(syncOfficialEntryOverride);
|
|
9557
|
+
const unsubHideOfficialForm = groupingForm.subscribe(syncOfficialEntryOverride);
|
|
9558
|
+
ctx.effect(() => () => {
|
|
9559
|
+
unsubHideOfficialSynced?.();
|
|
9560
|
+
unsubHideOfficialForm();
|
|
9561
|
+
officialEntryDisposer?.();
|
|
9562
|
+
officialEntryDisposer = void 0;
|
|
9563
|
+
}, "git-worktree: official worktree entry override lifecycle");
|
|
7606
9564
|
ctx.slots.inject("shell.overlay", () => ctx.slots.register({
|
|
7607
9565
|
name: "shell.overlay",
|
|
7608
9566
|
id: "git-worktree-toasts",
|
|
7609
9567
|
order: 20
|
|
7610
9568
|
}, WorktreeToastHost));
|
|
9569
|
+
let lastSyncedPathSignature = "";
|
|
9570
|
+
const syncWorkspaceGitFacts = () => {
|
|
9571
|
+
const workspaces = ctx.workspaces.list.getSnapshot();
|
|
9572
|
+
const sessions = ctx.sessions.list.getSnapshot();
|
|
9573
|
+
const archived = new Set(workspaces.archivedSessionIds);
|
|
9574
|
+
const seen = /* @__PURE__ */ new Map();
|
|
9575
|
+
for (const workspace of workspaces.items) if (workspace.path.length > 0) seen.set(pathKey(workspace.path), workspace.path);
|
|
9576
|
+
for (const sessionId of Object.keys(sessions.byId)) {
|
|
9577
|
+
if (archived.has(sessionId)) continue;
|
|
9578
|
+
const dir = selectSessionDirectory(sessions, sessionId);
|
|
9579
|
+
if (dir !== void 0 && dir.length > 0) seen.set(pathKey(dir), dir);
|
|
9580
|
+
}
|
|
9581
|
+
const signature = [...seen.keys()].sort().join("\0");
|
|
9582
|
+
if (signature === lastSyncedPathSignature) return;
|
|
9583
|
+
lastSyncedPathSignature = signature;
|
|
9584
|
+
gitCache.syncPaths([...seen.values()], true);
|
|
9585
|
+
};
|
|
9586
|
+
const resolveSessionPathFromCtx = (sessionId) => resolveEffectiveSessionPath(ctx.sessions, sessionId, ctx.workspaces.list.getSnapshot().items.map((item) => ({
|
|
9587
|
+
workspaceId: item.workspaceId,
|
|
9588
|
+
path: item.path,
|
|
9589
|
+
sessionIds: item.sessionIds
|
|
9590
|
+
})));
|
|
9591
|
+
syncWorkspaceGitFacts();
|
|
9592
|
+
const unsubscribeWorkspaces = isObservable(ctx.workspaces.list) ? ctx.workspaces.list.subscribe(syncWorkspaceGitFacts) : void 0;
|
|
9593
|
+
const unsubscribeSessions = isObservable(ctx.sessions.list) ? ctx.sessions.list.subscribe(syncWorkspaceGitFacts) : void 0;
|
|
9594
|
+
ctx.effect(() => () => {
|
|
9595
|
+
pluginDisposed = true;
|
|
9596
|
+
unsubscribeWorkspaces?.();
|
|
9597
|
+
unsubscribeSessions?.();
|
|
9598
|
+
gitCache.dispose();
|
|
9599
|
+
}, "git-worktree: workspace git cache lifecycle");
|
|
7611
9600
|
const managerFace = () => ({
|
|
7612
9601
|
listWorktrees: async () => {
|
|
7613
9602
|
const result = await requestWorktreesAll(ctx.workspaces.list.getSnapshot().items.map((workspace) => workspace.path));
|
|
@@ -7665,10 +9654,111 @@ window.__ModuleLoader__.load((() => {
|
|
|
7665
9654
|
},
|
|
7666
9655
|
archiveSession: (sessionId) => ctx.workspaces.archiveSession(sessionId),
|
|
7667
9656
|
deleteWorkspace: (workspaceId) => ctx.workspaces.delete(workspaceId),
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
9657
|
+
describeWorktreeOwnership: (path) => ownershipFacts(path),
|
|
9658
|
+
openWorktree: async (path, repoRoot) => {
|
|
9659
|
+
await adoptWorktree(path, repoRoot === void 0 ? void 0 : { repoRoot });
|
|
9660
|
+
},
|
|
9661
|
+
onWorktreeRemoved: (path) => {
|
|
9662
|
+
gitCache.invalidate(path);
|
|
9663
|
+
}
|
|
9664
|
+
});
|
|
9665
|
+
ctx.slots.inject("shell.overlay", () => ctx.slots.register({
|
|
9666
|
+
name: "shell.overlay",
|
|
9667
|
+
id: "git-worktree-actions",
|
|
9668
|
+
order: 18,
|
|
9669
|
+
locale: NS,
|
|
9670
|
+
inject: () => {
|
|
9671
|
+
const chip = chipInjected();
|
|
9672
|
+
return {
|
|
9673
|
+
manager: managerFace(),
|
|
9674
|
+
adoptWorktree: chip.adoptWorktree,
|
|
9675
|
+
isSwitchSessionDirectory: chip.isSwitchSessionDirectory,
|
|
9676
|
+
armDeferredWorktree: chip.armDeferredWorktree,
|
|
9677
|
+
describeWorktreeRemoval: chip.describeWorktreeRemoval,
|
|
9678
|
+
removeWorktree: chip.removeWorktree,
|
|
9679
|
+
pruneWorktrees: chip.pruneWorktrees,
|
|
9680
|
+
onWorktreeCreated: (path) => {
|
|
9681
|
+
gitCache.refresh([path]);
|
|
9682
|
+
},
|
|
9683
|
+
onWorktreeRemoved: (path) => {
|
|
9684
|
+
gitCache.invalidate(path);
|
|
9685
|
+
}
|
|
9686
|
+
};
|
|
7671
9687
|
}
|
|
9688
|
+
}, WorktreeActionHost));
|
|
9689
|
+
const sessionMenuInjected = () => ({
|
|
9690
|
+
gitCache,
|
|
9691
|
+
resolveSessionPath: resolveSessionPathFromCtx
|
|
9692
|
+
});
|
|
9693
|
+
const badgeInjected = () => ({
|
|
9694
|
+
gitCache,
|
|
9695
|
+
resolveSessionPath: resolveSessionPathFromCtx,
|
|
9696
|
+
sessionsObservable: isObservable(ctx.sessions.list) ? ctx.sessions.list : void 0,
|
|
9697
|
+
shouldDecorateSession: (sessionId) => {
|
|
9698
|
+
return !hasForgeManagedWorktree(ctx.sessions.list.getSnapshot(), sessionId);
|
|
9699
|
+
}
|
|
9700
|
+
});
|
|
9701
|
+
ctx.slots.inject("sidebar.session.row.trailing", () => ctx.slots.register({
|
|
9702
|
+
name: "sidebar.session.row.trailing",
|
|
9703
|
+
id: "git-worktree",
|
|
9704
|
+
order: 10,
|
|
9705
|
+
locale: NS,
|
|
9706
|
+
inject: badgeInjected
|
|
9707
|
+
}, SidebarWorktreeTrailing));
|
|
9708
|
+
ctx.slots.inject("sidebar.session.row.hover", () => ctx.slots.register({
|
|
9709
|
+
name: "sidebar.session.row.hover",
|
|
9710
|
+
id: "git-worktree",
|
|
9711
|
+
order: 20,
|
|
9712
|
+
locale: NS,
|
|
9713
|
+
inject: badgeInjected
|
|
9714
|
+
}, SidebarWorktreeHover));
|
|
9715
|
+
let legacyMenuDisposer;
|
|
9716
|
+
const mountLegacySessionMenu = () => {
|
|
9717
|
+
if (pluginDisposed || legacyMenuDisposer !== void 0) return;
|
|
9718
|
+
legacyMenuDisposer = ctx.slots.inject("sidebar.workspaces.session.menu.item", () => ctx.slots.register({
|
|
9719
|
+
name: "sidebar.workspaces.session.menu.item",
|
|
9720
|
+
id: "git-worktree-remove",
|
|
9721
|
+
order: 500,
|
|
9722
|
+
locale: NS,
|
|
9723
|
+
inject: sessionMenuInjected
|
|
9724
|
+
}, LegacySessionMenuItem));
|
|
9725
|
+
};
|
|
9726
|
+
const unmountLegacySessionMenu = () => {
|
|
9727
|
+
legacyMenuDisposer?.();
|
|
9728
|
+
legacyMenuDisposer = void 0;
|
|
9729
|
+
};
|
|
9730
|
+
mountLegacySessionMenu();
|
|
9731
|
+
ctx.effect(() => unmountLegacySessionMenu, "git-worktree: legacy session menu lifecycle");
|
|
9732
|
+
if (typeof ctx.inject === "function") ctx.inject.bind(ctx)(["contextMenus"], (menuCtx) => {
|
|
9733
|
+
if (!hasContextMenus(menuCtx)) return;
|
|
9734
|
+
unmountLegacySessionMenu();
|
|
9735
|
+
const icons = [
|
|
9736
|
+
[CONTEXT_MENU_ICON_KEYS.create, _deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular],
|
|
9737
|
+
[CONTEXT_MENU_ICON_KEYS.manage, _deepseek_ai_dsh_client_ui_primitives.IconFolderCloseRegular],
|
|
9738
|
+
[CONTEXT_MENU_ICON_KEYS.remove, _deepseek_ai_dsh_client_ui_primitives.IconTrashOutlineRegular]
|
|
9739
|
+
];
|
|
9740
|
+
const iconDisposer = menuCtx.slots.inject("contextMenu.icon", function* () {
|
|
9741
|
+
for (const [key, Icon] of icons) yield menuCtx.slots.register({
|
|
9742
|
+
name: "contextMenu.icon",
|
|
9743
|
+
key
|
|
9744
|
+
}, Icon);
|
|
9745
|
+
});
|
|
9746
|
+
const extraObservers = [];
|
|
9747
|
+
if (isObservable(ctx.locale)) extraObservers.push(ctx.locale);
|
|
9748
|
+
if (isObservable(ctx.sessions.list)) extraObservers.push(ctx.sessions.list);
|
|
9749
|
+
if (isObservable(ctx.workspaces.list)) extraObservers.push(ctx.workspaces.list);
|
|
9750
|
+
const menuDisposer = registerNativeContextMenus({
|
|
9751
|
+
contextMenus: menuCtx.contextMenus,
|
|
9752
|
+
gitCache,
|
|
9753
|
+
resolveSessionPath: resolveSessionPathFromCtx,
|
|
9754
|
+
t: ctx.locale.bind(NS),
|
|
9755
|
+
extraObservers
|
|
9756
|
+
});
|
|
9757
|
+
menuCtx.effect(() => () => {
|
|
9758
|
+
menuDisposer();
|
|
9759
|
+
iconDisposer();
|
|
9760
|
+
mountLegacySessionMenu();
|
|
9761
|
+
}, "git-worktree: native context menus");
|
|
7672
9762
|
});
|
|
7673
9763
|
const form = new CardForm(groupingForm);
|
|
7674
9764
|
const store = form.bind();
|
|
@@ -7727,32 +9817,52 @@ window.__ModuleLoader__.load((() => {
|
|
|
7727
9817
|
[
|
|
7728
9818
|
"src/client/BranchChip.module.css",
|
|
7729
9819
|
"@laoyuehanni/dsh-git-worktree/BranchChip.module.css",
|
|
7730
|
-
"/* Branch chip row inside the composer tool row (conversation.input_1594205807.left_1594205807,\n * right of the mode chips). A single chip button: the branch picker (the\n * worktree toggle that used to share this dock is gone — worktree actions\n * live in the branch menu's right-click).\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. */\n\n.dock_1594205807 {\n display: inline-flex;\n align-items: stretch;\n height: 28px;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n min-height: 28px;\n overflow: hidden;\n}\n\n.chip_1594205807 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n padding: 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@media (hover: hover) {\n .chip_1594205807:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.branch_1594205807 {\n max-width: 16em;\n overflow: hidden;\n text-overflow: ellipsis;\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 with --dsw-menu-backdrop-filter). */\n.popCard_1594205807 {\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: var(--dsw-radius-xl, 20px);\n background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n display: flex;\n flex-direction: column;\n gap: 2px;\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n\n.popAsk_1594205807 {\n margin: 0;\n padding: 6px 8px;\n font-size: 13px;\n line-height: 20px;\n color: inherit;\n overflow-wrap: anywhere;\n}\n\n.popSubject_1594205807 {\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.popDetails_1594205807 {\n padding: 0 8px 2px;\n}\n\n.popDetail_1594205807 {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n overflow-wrap: anywhere;\n}\n\n.popDetailWarn_1594205807 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.popActions_1594205807 {\n display: flex;\n gap: 2px;\n padding: 2px;\n}\n\n.popActions_1594205807 button {\n flex: 1 1 0;\n height: 28px;\n border: none;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n white-space: nowrap;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .popActions_1594205807 button:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.popActions_1594205807 button:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n.popActions_1594205807 button:last-child {\n color: var(--dsw-alias-link);\n font-weight: 500;\n}\n\n.popActions_1594205807 button.popConfirmDanger_1594205807 {\n color: var(--dsw-alias-state-error-primary);\n font-weight: 500;\n}\n\n@media (hover: hover) {\n .popActions_1594205807 button.popConfirmDanger_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover));\n }\n}\n\n/* ── Branch picker popup (BranchMenu) ──────────────────────────────\n * Upward-opening card pinned above the chip, in the Menu's card chrome\n * (r20, elevation-prominent hairline, --dsw-specific-menu with\n * --dsw-menu-backdrop-filter). */\n.menuCard_1594205807 {\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: var(--dsw-radius-xl, 20px);\n background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n\n/* Left tool strip (IDEA branch-panel posture at popup scale). */\n.menuToolbar_1594205807 {\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 var(--dsw-alias-border-l2);\n}\n\n.menuToolButton_1594205807 {\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: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: inherit;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .menuToolButton_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.menuToolButton_1594205807:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n.menuToolButtonRunning_1594205807 svg {\n animation: menuToolPulse 700ms ease-in-out infinite alternate;\n}\n\n.menuToolButtonRunning_1594205807: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_1594205807 {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.menuMainHidden_1594205807 {\n display: none;\n}\n\n.menuHeading_1594205807 {\n padding: 6px 8px 4px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 0;\n}\n\n.menuRows_1594205807 {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n}\n\n.menuRow_1594205807 {\n box-sizing: border-box;\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: var(--dsw-radius-sm, 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@media (hover: hover) {\n .menuRow_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.menuRowSelected_1594205807 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n@media (hover: hover) {\n .menuRowSelected_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-active);\n }\n}\n\n.menuRowPicked_1594205807 {\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 16%, transparent);\n}\n\n@media (hover: hover) {\n .menuRowPicked_1594205807:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 20%, transparent);\n }\n}\n\n.menuRowLabel_1594205807 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.menuRowArrow_1594205807 {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n flex-shrink: 0;\n font-size: 11px;\n line-height: 20px;\n font-weight: 400;\n font-variant-numeric: tabular-nums;\n}\n\n.menuRowAhead_1594205807 { color: var(--dsw-alias-state-success-primary); }\n.menuRowBehind_1594205807 { color: var(--dsw-alias-link); }\n.menuRowGone_1594205807 { color: var(--dsw-alias-state-warn-primary); }\n.menuRowOutgoing_1594205807 { display: inline-flex; transform: rotate(180deg); }\n\n.menuSearchMark_1594205807 {\n background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 32%, transparent);\n border-radius: var(--dsw-radius-xs, 4px);\n}\n\n.menuGroup_1594205807 {\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: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\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@media (hover: hover) {\n .menuGroup_1594205807:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.menuGroupTop_1594205807 {\n color: var(--dsw-alias-label-primary);\n font-weight: 500;\n}\n\n.menuGroupLabel_1594205807 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.menuGroupChevron_1594205807 {\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_1594205807 {\n transform: rotate(90deg);\n}\n\n.menuGroupCount_1594205807 {\n flex-shrink: 0;\n font-size: 12px;\n line-height: 20px;\n font-weight: 400;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.menuEmpty_1594205807 {\n padding: 10px 8px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n text-align: center;\n}\n\n.menuSearchWrap_1594205807 {\n flex-shrink: 0;\n margin-top: 2px;\n padding-top: 4px;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n.menuSearch_1594205807 {\n box-sizing: border-box;\n width: 100%;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuSearch_1594205807::placeholder {\n color: var(--dsw-alias-label-secondary);\n}\n\n.menuSearch_1594205807:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.menuCreate_1594205807 {\n box-sizing: border-box;\n width: 248px;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuCreate_1594205807::placeholder {\n color: var(--dsw-alias-label-secondary);\n}\n\n.menuCreate_1594205807:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.menuCreate_1594205807:disabled {\n opacity: 0.5;\n}\n\n.menuCreateHintBad_1594205807 {\n margin: 0;\n padding: 0 8px;\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-state-error-primary);\n}\n\n/* ── Row context menu (BranchMenu right-click) ───────────────────── */\n.ctxCard_1594205807 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1001;\n width: max-content;\n max-width: 280px;\n padding: 4px;\n border: 0;\n border-radius: var(--dsw-radius-md, 12px);\n background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.ctxHeader_1594205807 {\n padding: 4px 8px 2px;\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-label-secondary);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.ctxItem_1594205807 {\n display: inline-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: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n text-align: left;\n white-space: nowrap;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .ctxItem_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.ctxItem_1594205807:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover);\n outline: none;\n}\n\n.ctxItem_1594205807:disabled {\n cursor: default;\n opacity: 0.45;\n}\n\n.ctxItem_1594205807 svg {\n flex-shrink: 0;\n opacity: 0.75;\n}\n\n.ctxItemDanger_1594205807 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n@media (hover: hover) {\n .ctxItemDanger_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover));\n }\n}\n\n.ctxItemLabel_1594205807 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.menuCard_1594205807.menuCardGraph_1594205807 {\n width: min(1060px, calc(100vw - 24px));\n height: 700px;\n}\n\n.menuCardGraph_1594205807 .menuMain_1594205807 {\n flex: 0 0 236px;\n}\n\n.menuToolActive_1594205807 {\n color: var(--dsw-alias-state-business-primary);\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent);\n}\n\n@media (max-width: 800px) {\n .menuCardGraph_1594205807 .menuMain_1594205807 {\n flex-basis: 180px;\n }\n}\n\n@media (max-width: 640px) {\n .menuCardGraph_1594205807 .menuMain_1594205807 {\n flex-basis: 176px;\n }\n}\n"
|
|
9820
|
+
"/* Branch chip row inside the composer tool row (conversation.input_1594205807.left_1594205807,\n * right of the mode chips). A single chip button: the branch picker (the\n * worktree toggle that used to share this dock is gone — worktree actions\n * live in the branch menu's right-click).\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. */\n\n.dock_1594205807 {\n display: inline-flex;\n align-items: stretch;\n height: 28px;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n min-height: 28px;\n overflow: hidden;\n}\n\n.chip_1594205807 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n padding: 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@media (hover: hover) {\n .chip_1594205807:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.branch_1594205807 {\n max-width: 16em;\n overflow: hidden;\n text-overflow: ellipsis;\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 with --dsw-menu-backdrop-filter). */\n.popCard_1594205807 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1000;\n width: max-content;\n min-width: 248px;\n max-width: min(300px, 80vw);\n padding: 10px 12px 8px;\n border: 0;\n border-radius: var(--dsw-radius-lg, 14px);\n background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n display: flex;\n flex-direction: column;\n gap: 8px;\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n\n.popAsk_1594205807 {\n margin: 0;\n padding: 0 2px;\n font-size: 13px;\n line-height: 19px;\n color: inherit;\n overflow-wrap: anywhere;\n}\n\n.popSubject_1594205807 {\n margin: 0;\n padding: 0 2px;\n font-size: 13px;\n line-height: 19px;\n font-weight: 500;\n color: inherit;\n overflow-wrap: anywhere;\n}\n\n.popDetails_1594205807 {\n padding: 0 2px;\n}\n\n.popDetail_1594205807 {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n overflow-wrap: anywhere;\n}\n\n.popDetailWarn_1594205807 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.popActions_1594205807 {\n display: flex;\n gap: 6px;\n padding: 2px 0 0;\n}\n\n.popActions_1594205807 button {\n flex: 1 1 0;\n height: 30px;\n border: none;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n white-space: nowrap;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .popActions_1594205807 button:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.popActions_1594205807 button:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n.popActions_1594205807 button:last-child {\n color: var(--dsw-alias-link);\n font-weight: 500;\n}\n\n.popActions_1594205807 button.popConfirmDanger_1594205807 {\n color: var(--dsw-alias-state-error-primary);\n font-weight: 500;\n}\n\n@media (hover: hover) {\n .popActions_1594205807 button.popConfirmDanger_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover));\n }\n}\n\n/* ── Branch picker popup (BranchMenu) ──────────────────────────────\n * Upward-opening card pinned above the chip, in the Menu's card chrome\n * (r20, elevation-prominent hairline, --dsw-specific-menu with\n * --dsw-menu-backdrop-filter). */\n.menuCard_1594205807 {\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: var(--dsw-radius-xl, 20px);\n background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n\n/* Left tool strip (IDEA branch-panel posture at popup scale). */\n.menuToolbar_1594205807 {\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 var(--dsw-alias-border-l2);\n}\n\n.menuToolButton_1594205807 {\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: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: inherit;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .menuToolButton_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.menuToolButton_1594205807:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n.menuToolButtonRunning_1594205807 svg {\n animation: menuToolPulse 700ms ease-in-out infinite alternate;\n}\n\n.menuToolButtonRunning_1594205807: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_1594205807 {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.menuMainHidden_1594205807 {\n display: none;\n}\n\n.menuHeading_1594205807 {\n padding: 6px 8px 4px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 0;\n}\n\n.menuRows_1594205807 {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n}\n\n.menuRow_1594205807 {\n box-sizing: border-box;\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: var(--dsw-radius-sm, 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@media (hover: hover) {\n .menuRow_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.menuRowSelected_1594205807 {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n@media (hover: hover) {\n .menuRowSelected_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-active);\n }\n}\n\n.menuRowPicked_1594205807 {\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 16%, transparent);\n}\n\n@media (hover: hover) {\n .menuRowPicked_1594205807:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 20%, transparent);\n }\n}\n\n.menuRowLabel_1594205807 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.menuRowArrow_1594205807 {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n flex-shrink: 0;\n font-size: 11px;\n line-height: 20px;\n font-weight: 400;\n font-variant-numeric: tabular-nums;\n}\n\n.menuRowAhead_1594205807 { color: var(--dsw-alias-state-success-primary); }\n.menuRowBehind_1594205807 { color: var(--dsw-alias-link); }\n.menuRowGone_1594205807 { color: var(--dsw-alias-state-warn-primary); }\n.menuRowOutgoing_1594205807 { display: inline-flex; transform: rotate(180deg); }\n\n.menuSearchMark_1594205807 {\n background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 32%, transparent);\n border-radius: var(--dsw-radius-xs, 4px);\n}\n\n.menuGroup_1594205807 {\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: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\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@media (hover: hover) {\n .menuGroup_1594205807:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.menuGroupTop_1594205807 {\n color: var(--dsw-alias-label-primary);\n font-weight: 500;\n}\n\n.menuGroupLabel_1594205807 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.menuGroupChevron_1594205807 {\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_1594205807 {\n transform: rotate(90deg);\n}\n\n.menuGroupCount_1594205807 {\n flex-shrink: 0;\n font-size: 12px;\n line-height: 20px;\n font-weight: 400;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.menuEmpty_1594205807 {\n padding: 10px 8px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary);\n text-align: center;\n}\n\n.menuSearchWrap_1594205807 {\n flex-shrink: 0;\n margin-top: 2px;\n padding-top: 4px;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n.menuSearch_1594205807 {\n box-sizing: border-box;\n width: 100%;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuSearch_1594205807::placeholder {\n color: var(--dsw-alias-label-secondary);\n}\n\n.menuSearch_1594205807:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.menuCreate_1594205807 {\n box-sizing: border-box;\n width: 100%;\n min-width: 220px;\n height: 32px;\n padding: 0 10px;\n border: 1px solid var(--dsw-alias-border-l2, rgba(255, 255, 255, 0.1));\n border-radius: var(--dsw-radius-sm, 8px);\n background: var(--dsw-alias-bg-layer-1, rgba(255, 255, 255, 0.04));\n color: inherit;\n font: inherit;\n font-size: 13px;\n font-weight: 400;\n line-height: 20px;\n transition: border-color 120ms ease, background-color 120ms ease;\n}\n\n.menuCreate_1594205807::placeholder {\n color: var(--dsw-alias-label-tertiary, var(--dsw-alias-label-secondary));\n}\n\n.menuCreate_1594205807:focus {\n outline: none;\n border-color: var(--dsw-alias-link);\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.menuCreate_1594205807:disabled {\n opacity: 0.5;\n}\n\n.menuCreateHintBad_1594205807 {\n margin: 0;\n padding: 0 2px;\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-state-error-primary);\n}\n\n/* ── Row context menu (BranchMenu right-click) ───────────────────── */\n.ctxCard_1594205807 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1001;\n width: max-content;\n max-width: 280px;\n padding: 4px;\n border: 0;\n border-radius: var(--dsw-radius-md, 12px);\n background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.ctxHeader_1594205807 {\n padding: 4px 8px 2px;\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-label-secondary);\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.ctxItem_1594205807 {\n display: inline-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: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n text-align: left;\n white-space: nowrap;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .ctxItem_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.ctxItem_1594205807:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover);\n outline: none;\n}\n\n.ctxItem_1594205807:disabled {\n cursor: default;\n opacity: 0.45;\n}\n\n.ctxItem_1594205807 svg {\n flex-shrink: 0;\n opacity: 0.75;\n}\n\n.ctxItemDanger_1594205807 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n@media (hover: hover) {\n .ctxItemDanger_1594205807:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover));\n }\n}\n\n.ctxItemLabel_1594205807 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.menuCard_1594205807.menuCardGraph_1594205807 {\n width: min(1060px, calc(100vw - 24px));\n height: 700px;\n}\n\n.menuCardGraph_1594205807 .menuMain_1594205807 {\n flex: 0 0 236px;\n}\n\n.menuToolActive_1594205807 {\n color: var(--dsw-alias-state-business-primary);\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent);\n}\n\n@media (max-width: 800px) {\n .menuCardGraph_1594205807 .menuMain_1594205807 {\n flex-basis: 180px;\n }\n}\n\n@media (max-width: 640px) {\n .menuCardGraph_1594205807 .menuMain_1594205807 {\n flex-basis: 176px;\n }\n}\n"
|
|
7731
9821
|
],
|
|
7732
9822
|
[
|
|
7733
9823
|
"src/client/CommitGraph.module.css",
|
|
7734
9824
|
"@laoyuehanni/dsh-git-worktree/CommitGraph.module.css",
|
|
7735
9825
|
".panel_486748374 {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n min-height: 0;\n border-left: 0.5px solid var(--dsw-alias-border-l2);\n font-size: 12px;\n color: var(--dsw-alias-label-primary);\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n\n.heading_486748374 {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n padding: 8px 10px 8px 12px;\n flex-shrink: 0;\n}\n\n.branch_486748374 {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n font-weight: 500;\n min-width: 0;\n flex: 0 1 auto;\n}\n\n.loaded_486748374 {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n}\n\n.headingActions_486748374 {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n margin-left: auto;\n flex-shrink: 0;\n}\n\n.iconButton_486748374 {\n display: grid;\n place-items: center;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n width: 24px;\n height: 24px;\n padding: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n cursor: pointer;\n flex-shrink: 0;\n}\n\n.iconButtonActive_486748374 {\n color: var(--dsw-alias-state-business-primary);\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent);\n}\n\n.closeIcon_486748374 {\n stroke-width: 1.8px;\n stroke-linecap: round;\n}\n\n@media (hover: hover) {\n .iconButton_486748374:hover:not(:disabled),\n .textButton_486748374:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.iconButton_486748374:disabled,\n.textButton_486748374:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n.search_486748374,\n.authorFilter_486748374 {\n box-sizing: border-box;\n min-width: 0;\n height: 28px;\n border: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n background: var(--dsw-alias-interactive-bg-hover);\n color: inherit;\n padding: 4px 8px;\n font: inherit;\n}\n\n.search_486748374 {\n width: 150px;\n flex: 0 1 150px;\n}\n\n.authorFilter_486748374 {\n width: 108px;\n flex: 0 1 108px;\n cursor: pointer;\n}\n\n.authorFilter_486748374 option {\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-primary);\n}\n\n.search_486748374:focus-visible,\n.authorFilter_486748374:focus-visible,\n.iconButton_486748374:focus-visible,\n.textButton_486748374:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -1px;\n}\n\n.search_486748374::placeholder {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.columns_486748374 {\n display: flex;\n align-items: center;\n gap: 8px;\n height: 25px;\n padding: 0 14px 0 8px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n flex-shrink: 0;\n}\n\n.columns_486748374 > span:first-child { flex: 0 0 auto; }\n.columns_486748374 > span:nth-child(2) { flex: 1; }\n.columns_486748374 > span:nth-child(3) { width: 70px; }\n.columns_486748374 > span:last-child { width: 99px; }\n\n.list_486748374 {\n flex: 1 1 0%;\n min-height: 58px;\n overflow: auto;\n padding: 0 6px;\n scrollbar-width: thin;\n}\n\n.row_486748374 {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n height: 36px;\n padding: 0 7px 0 2px;\n border: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: inherit;\n text-align: left;\n font: inherit;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .row_486748374:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.selected_486748374 {\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 14%, transparent);\n}\n\n@media (hover: hover) {\n .selected_486748374:hover {\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 18%, transparent);\n }\n}\n\n.row_486748374:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.graph_486748374 {\n flex-shrink: 0;\n overflow: visible;\n}\n\n.graph_486748374 path {\n fill: none;\n stroke-width: 1.5px;\n}\n\n.subject_486748374 {\n flex: 1 1 auto;\n min-width: 40px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.author_486748374 {\n flex: 0 0 70px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-label-secondary);\n font-size: 11px;\n}\n\n.date_486748374 {\n flex: 0 0 44px;\n color: var(--dsw-alias-label-secondary);\n font-size: 11px;\n}\n\n.hash_486748374 {\n flex: 0 0 47px;\n font-size: 10px;\n font-family: var(--ds-font-family-code, monospace);\n color: var(--dsw-alias-label-tertiary);\n}\n\n.state_486748374 {\n padding: 16px;\n color: var(--dsw-alias-label-secondary);\n overflow-wrap: anywhere;\n}\n\n.footer_486748374 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 4px 13px;\n min-height: 27px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 11px;\n flex-shrink: 0;\n}\n\n.error_486748374 {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--dsw-alias-state-error-primary);\n}\n\n.textButton_486748374 {\n border: 0;\n background: transparent;\n padding: 4px 6px;\n border-radius: var(--dsw-radius-sm, 8px);\n color: var(--dsw-alias-link);\n font: inherit;\n font-size: 11px;\n font-weight: 500;\n cursor: pointer;\n align-self: flex-start;\n flex-shrink: 0;\n}\n\n.detailHost_486748374 {\n display: flex;\n flex: 0 0 auto;\n min-height: 0;\n max-height: min(316px, 44%);\n}\n\n.detail_486748374 {\n box-sizing: border-box;\n display: flex;\n flex: 1;\n flex-direction: column;\n min-width: 0;\n min-height: 0;\n padding: 12px 16px 10px;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n.detailTitle_486748374 {\n font-size: 13px;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 0;\n}\n\n.meta_486748374 {\n display: flex;\n flex-wrap: wrap;\n gap: 5px 12px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 10px;\n padding: 6px 0;\n flex-shrink: 0;\n}\n\n.meta_486748374 code {\n font-family: var(--ds-font-family-code, monospace);\n}\n\n.messageScroll_486748374 {\n min-height: 0;\n overflow: hidden;\n}\n\n.message_486748374 {\n margin: 2px 0;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n\n.expanded_486748374 .messageScroll_486748374 {\n overflow: auto;\n scrollbar-width: thin;\n}\n\n.expanded_486748374 .message_486748374 {\n display: block;\n -webkit-line-clamp: unset;\n}\n\n.files_486748374 {\n display: flex;\n align-items: center;\n gap: 9px;\n color: var(--dsw-alias-label-tertiary);\n font-size: 10px;\n padding-top: 7px;\n flex-shrink: 0;\n white-space: nowrap;\n}\n\n.fileName_486748374 {\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n flex: 1;\n}\n\n.added_486748374 {\n color: var(--dsw-alias-file-diff-added-marker, var(--dsw-alias-state-success-primary));\n}\n\n.removed_486748374 {\n color: var(--dsw-alias-file-diff-deleted-marker, var(--dsw-alias-state-error-primary));\n}\n\n@media (max-width: 900px) {\n .author_486748374,\n .hash_486748374,\n .columns_486748374 > span:nth-child(3) {\n display: none;\n }\n .columns_486748374 > span:last-child {\n width: 44px;\n }\n}\n\n@media (max-height: 600px) {\n .detail_486748374 {\n padding: 7px 12px;\n }\n .meta_486748374 {\n padding: 3px 0;\n }\n}\n"
|
|
7736
9826
|
],
|
|
9827
|
+
[
|
|
9828
|
+
"src/client/DeferredWorktreeDock.module.css",
|
|
9829
|
+
"@laoyuehanni/dsh-git-worktree/DeferredWorktreeDock.module.css",
|
|
9830
|
+
"/* Deferred worktree card docked above the composer (`conversation.input_129068444.dock_129068444`),\n aligned with the native composer dock width and panel elevation tokens. */\n.dock_129068444 {\n box-sizing: border-box;\n width: calc(\n 100% -\n var(--dsh-composer-side-clearance, 0px) -\n var(--dsh-composer-side-clearance, 0px) -\n var(--dsh-composer-dock-inset, 0px) -\n var(--dsh-composer-dock-inset, 0px) -\n var(--dsh-composer-dock-inset, 0px) -\n var(--dsh-composer-dock-inset, 0px)\n );\n margin: 0 auto;\n}\n\n.card_129068444 {\n position: relative;\n isolation: isolate;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: 100%;\n max-width: calc(var(--dsh-composer-card-max-width, 760px) - 4 * var(--dsh-composer-dock-inset, 0px));\n margin: 0 auto;\n padding: 10px 10px 8px 12px;\n border: 0;\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n border-radius: var(--dsw-radius-md, 12px);\n box-shadow: var(--dsw-elevation-panel, var(--dsw-shadow-lv2));\n color: var(--dsw-alias-label-primary);\n font-size: 13px;\n line-height: 20px;\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n\n.card_129068444::before {\n position: absolute;\n z-index: -1;\n inset: 0;\n border-radius: inherit;\n background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n content: '';\n pointer-events: none;\n}\n\n.armedCard_129068444 {\n flex-direction: row;\n align-items: center;\n gap: 8px;\n padding: 7px 8px 7px 12px;\n}\n\n.armedInfo_129068444 {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n flex-wrap: wrap;\n gap: 6px;\n min-width: 0;\n}\n\n.header_129068444 {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n padding-right: 4px;\n}\n\n.glyph_129068444 {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.glyphFailed_129068444 {\n flex: none;\n color: var(--dsw-alias-state-error-primary);\n}\n\n.title_129068444 {\n flex: none;\n font-weight: 500;\n}\n\n.branch_129068444,\n.code_129068444 {\n min-width: 0;\n overflow: hidden;\n color: var(--dsw-alias-label-tertiary);\n font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, monospace);\n font-size: 12px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.steps_129068444 {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin: 0;\n padding: 0 0 0 22px;\n list-style: none;\n}\n\n.step_129068444 {\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: 22px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.step_129068444[data-state='running'] {\n color: var(--dsw-alias-label-primary);\n}\n\n.step_129068444[data-state='failed'] {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.stepMark_129068444 {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 14px;\n height: 14px;\n}\n\n.done_129068444 {\n color: var(--dsw-alias-state-success-primary);\n}\n\n.failed_129068444 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.runningDot_129068444 {\n box-sizing: border-box;\n width: 12px;\n height: 12px;\n border: 2px solid color-mix(in srgb, var(--dsw-alias-state-business-primary) 25%, transparent);\n border-top-color: var(--dsw-alias-state-business-primary);\n border-radius: 50%;\n animation: deferredSpin 0.85s linear infinite;\n}\n\n.waitingRing_129068444 {\n box-sizing: border-box;\n width: 12px;\n height: 12px;\n border: 1.5px solid var(--dsw-alias-label-dimmed, var(--dsw-alias-label-tertiary));\n border-radius: 50%;\n}\n\n.details_129068444 {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n gap: 2px 12px;\n margin: 2px 0 0 22px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.details_129068444 dt {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.details_129068444 dd {\n margin: 0;\n}\n\n.message_129068444 {\n max-height: 120px;\n overflow-y: auto;\n overflow-wrap: anywhere;\n white-space: pre-wrap;\n}\n\n.note_129068444 {\n margin: 0 0 0 22px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.footer_129068444 {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 6px;\n min-height: 28px;\n}\n\n.actions_129068444 {\n display: inline-flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 6px;\n margin-left: auto;\n}\n\n@keyframes deferredSpin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .runningDot_129068444 {\n animation: none;\n border-color: var(--dsw-alias-state-business-primary);\n }\n}\n"
|
|
9831
|
+
],
|
|
7737
9832
|
[
|
|
7738
9833
|
"src/client/GitWorktreeCard.module.css",
|
|
7739
9834
|
"@laoyuehanni/dsh-git-worktree/GitWorktreeCard.module.css",
|
|
7740
9835
|
"/* git-worktree bundle configuration on the Plugins page.\n * Visual language mirrors DSH settings cards: semantic alias tokens only,\n * native Switch/Tag/Button primitives, font-weight <= 500. */\n\n.summary_1463286416 {\n margin: 0;\n font-size: 13px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.page_1463286416 {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.note_1463286416 {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.field_1463286416 {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.fieldLabel_1463286416 {\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-secondary);\n}\n\n.rootRow_1463286416 {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n min-width: 0;\n}\n\n.rootValue_1463286416 {\n font-size: 13px;\n line-height: 1.5;\n color: var(--dsw-alias-label-primary);\n overflow-wrap: anywhere;\n}\n\n.hint_1463286416 {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.footer_1463286416 {\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_1463286416 {\n flex: 1;\n min-width: 0;\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-error-primary);\n}\n\n.toggleRow_1463286416 {\n margin-top: 8px;\n flex-direction: row;\n align-items: flex-start;\n justify-content: space-between;\n gap: 12px;\n}\n\n.toggleText_1463286416 {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.toggleLabel_1463286416 {\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-primary);\n font-weight: 500;\n}\n\n.toggleHint_1463286416 {\n color: var(--dsw-alias-label-tertiary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.toggleControl_1463286416 {\n display: flex;\n align-items: center;\n flex: none;\n margin-top: 2px;\n}\n\n.manageRow_1463286416 {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.keepRow_1463286416 {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.keepControl_1463286416 {\n display: flex;\n justify-content: flex-start;\n}\n\n.keepInput_1463286416 {\n width: 96px;\n appearance: none;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-sm, 8px);\n background: var(--dsw-alias-bg-layer-2);\n font: inherit;\n font-size: 13px;\n color: var(--dsw-alias-label-primary);\n padding: 6px 10px;\n}\n\n.keepInput_1463286416:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.keepInput_1463286416:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.keepBad_1463286416,\n.copyFilesBad_1463286416,\n.switchBad_1463286416 {\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-state-error-primary);\n}\n\n.copyFilesRow_1463286416 {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.copyFilesInput_1463286416 {\n width: 100%;\n box-sizing: border-box;\n appearance: none;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-sm, 8px);\n background: var(--dsw-alias-bg-layer-2);\n font: inherit;\n font-family: var(--ds-font-family-code, monospace);\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-primary);\n padding: 6px 10px;\n resize: vertical;\n min-height: 64px;\n}\n\n.copyFilesInput_1463286416[aria-invalid='true'] {\n border-color: var(--dsw-alias-state-error-primary);\n}\n\n.copyFilesInput_1463286416:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.copyFilesInput_1463286416:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.historyRow_1463286416 {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.history_1463286416 {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.historyRun_1463286416 {\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 6px 8px;\n border: 0.5px solid var(--dsw-alias-border-l2);\n border-radius: var(--dsw-radius-sm, 8px);\n}\n\n.historyTime_1463286416 {\n font-size: 12px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n\n.historyLine_1463286416 {\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-label-secondary);\n overflow-wrap: anywhere;\n}\n\n.historyMore_1463286416 {\n align-self: flex-start;\n padding: 0;\n border: none;\n background: none;\n font: inherit;\n font-size: 12px;\n line-height: 16px;\n font-weight: 500;\n color: var(--dsw-alias-link);\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .historyMore_1463286416:hover {\n text-decoration: underline;\n }\n}\n"
|
|
7741
9836
|
],
|
|
9837
|
+
[
|
|
9838
|
+
"src/client/LegacySessionMenuItem.module.css",
|
|
9839
|
+
"@laoyuehanni/dsh-git-worktree/LegacySessionMenuItem.module.css",
|
|
9840
|
+
"/* Legacy `sidebar.workspaces_1028657986.session_1028657986.menu_1028657986.item_1028657986` entry for hosts without `ctx.contextMenus_1028657986`. */\n\n.separator_1028657986 {\n height: 1px;\n margin: 4px 8px;\n background: var(--dsw-alias-border-l2);\n}\n\n.item_1028657986 {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 6px 10px;\n border: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-state-error-primary);\n font: inherit;\n font-size: 13px;\n line-height: 18px;\n text-align: left;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .item_1028657986:hover {\n background: var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover));\n }\n}\n\n.item_1028657986:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n"
|
|
9841
|
+
],
|
|
7742
9842
|
[
|
|
7743
9843
|
"src/client/PushDialog.module.css",
|
|
7744
9844
|
"@laoyuehanni/dsh-git-worktree/PushDialog.module.css",
|
|
7745
9845
|
".dialog_517543419 {\n width: min(420px, 100%);\n max-height: 100%;\n gap: 0;\n padding: 0;\n overflow: visible;\n border-radius: var(--dsw-radius-xl, 20px);\n font-size: 13px;\n line-height: 20px;\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n\n.header_517543419 {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 14px 12px 10px 16px;\n}\n\n.header_517543419 h2 {\n flex: 1;\n min-width: 0;\n margin: 0;\n font-size: 15px;\n line-height: 24px;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.header_517543419 h2 span {\n color: var(--dsw-alias-label-secondary);\n font-weight: 400;\n}\n\n.close_517543419,\n.refresh_517543419 {\n display: grid;\n place-items: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-tertiary);\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .close_517543419:hover:not(:disabled),\n .refresh_517543419:hover:not(:disabled),\n .textButton_517543419:hover:not(:disabled),\n .scope_517543419:hover:not(:disabled),\n .editorClose_517543419:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.body_517543419 {\n padding: 0 12px;\n min-height: 0;\n}\n\n.mapping_517543419 {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 6px;\n min-height: 34px;\n padding: 3px 10px;\n border-radius: var(--dsw-radius-md, 12px);\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.mapping_517543419 > svg {\n flex: none;\n color: var(--dsw-alias-label-secondary);\n}\n\n.source_517543419 {\n min-width: 0;\n max-width: min(200px, 50%);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.arrow_517543419 {\n color: var(--dsw-alias-label-tertiary);\n}\n\n.destination_517543419 {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n min-width: 0;\n max-width: 100%;\n}\n\n.remote_517543419 {\n color: var(--dsw-alias-label-secondary);\n overflow-wrap: anywhere;\n}\n\n.textButton_517543419,\n.scope_517543419 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n border: 0;\n border-radius: var(--dsw-radius-xs, 4px);\n padding: 2px 4px;\n background: transparent;\n color: var(--dsw-alias-link);\n font: inherit;\n cursor: pointer;\n max-width: 100%;\n}\n\n.chevron_517543419 {\n flex: none;\n}\n\n.targetWrap_517543419 {\n position: relative;\n min-width: 0;\n max-width: 180px;\n}\n\n.targetName_517543419 {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.badge_517543419 {\n font-size: 11px;\n line-height: 18px;\n padding: 0 5px;\n border-radius: var(--dsw-radius-xs, 4px);\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-secondary);\n}\n\n/* Floating target editor: elevation shadow carries the hairline stroke (border: 0). */\n.editor_517543419 {\n position: absolute;\n z-index: 5;\n top: calc(100% + 5px);\n left: 0;\n width: 200px;\n max-width: calc(100vw - 64px);\n padding: 10px;\n border: 0;\n border-radius: var(--dsw-radius-lg, 16px);\n background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l3);\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n}\n\n.editorEnd_517543419 {\n left: auto;\n right: 0;\n}\n\n.editorHead_517543419 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 6px;\n margin-bottom: 5px;\n}\n\n.editor_517543419 label {\n display: block;\n font-size: 11px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.editorClose_517543419 {\n display: grid;\n place-items: center;\n width: 20px;\n height: 20px;\n flex: none;\n margin: -3px -4px 0 0;\n padding: 0;\n border: 0;\n border-radius: var(--dsw-radius-xs, 4px);\n background: transparent;\n color: var(--dsw-alias-label-tertiary);\n cursor: pointer;\n}\n\n.editor_517543419 input {\n box-sizing: border-box;\n width: 100%;\n padding: 5px 7px;\n font: inherit;\n border: 0.5px solid var(--dsw-alias-border-l3);\n border-radius: var(--dsw-radius-sm, 8px);\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n}\n\n.editor_517543419 input[aria-invalid='true'] {\n border-color: var(--dsw-alias-state-error-primary);\n}\n\n.commits_517543419 {\n padding: 8px 10px 12px;\n min-height: 96px;\n}\n\n.count_517543419 {\n font-size: 11px;\n color: var(--dsw-alias-label-tertiary);\n margin-bottom: 6px;\n}\n\n.previewStatus_517543419 {\n margin-left: 8px;\n}\n\n.list_517543419 {\n list-style: none;\n margin: 0;\n padding: 0 5px 0 0;\n max-height: min(168px, 28vh);\n overflow-y: auto;\n overscroll-behavior: contain;\n}\n\n.list_517543419 li {\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: 28px;\n}\n\n.list_517543419 svg {\n width: 14px;\n height: 14px;\n flex: none;\n fill: none;\n stroke: var(--dsw-alias-label-tertiary);\n stroke-width: 1.5;\n}\n\n.list_517543419 li span {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.empty_517543419 {\n display: grid;\n place-items: center;\n min-height: 60px;\n margin: 0;\n font-size: 12px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.hint_517543419 {\n margin: 6px 0 0;\n font-size: 11px;\n line-height: 17px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n.error_517543419 {\n max-height: 120px;\n margin-bottom: 8px;\n overflow: auto;\n font-size: 12px;\n color: var(--dsw-alias-state-error-primary);\n overflow-wrap: anywhere;\n}\n\n.errorSummary_517543419 {\n margin: 0 0 4px;\n font-weight: 500;\n}\n\n.errorSummary_517543419:last-child {\n margin-bottom: 0;\n}\n\n.errorDetail_517543419 {\n max-height: 64px;\n overflow: auto;\n font-size: 11px;\n line-height: 16px;\n white-space: pre-wrap;\n color: var(--dsw-alias-label-secondary);\n}\n\n.footer_517543419 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 8px;\n margin: 0 16px;\n padding: 12px 0 14px;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n.tagOptions_517543419 {\n display: flex;\n align-items: center;\n gap: 4px;\n min-width: 0;\n}\n\n.checkbox_517543419 {\n font-size: 12px;\n white-space: nowrap;\n color: var(--dsw-alias-label-secondary);\n}\n\n.scope_517543419 {\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n}\n\n.actions_517543419 {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-left: auto;\n}\n\n.split_517543419 {\n display: flex;\n border-radius: var(--dsw-radius-sm, 8px);\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n\n.push_517543419,\n.splitArrow_517543419 {\n height: 28px;\n padding: 0 10px;\n border: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 12px;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.push_517543419 {\n min-width: 56px;\n border-radius: var(--dsw-radius-sm, 8px) 0 0 var(--dsw-radius-sm, 8px);\n}\n\n.splitArrow_517543419 {\n position: relative;\n display: grid;\n place-items: center;\n width: 27px;\n padding: 0;\n border-radius: 0 var(--dsw-radius-sm, 8px) var(--dsw-radius-sm, 8px) 0;\n}\n\n.splitArrow_517543419::before {\n content: '';\n position: absolute;\n left: 0;\n top: 7px;\n bottom: 7px;\n border-left: 1px solid currentColor;\n opacity: 0.18;\n}\n\n@media (hover: hover) {\n .push_517543419:hover:not(:disabled),\n .splitArrow_517543419:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-active);\n }\n}\n\n.dialog_517543419 button:disabled,\n.dialog_517543419 input:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.close_517543419:focus-visible,\n.refresh_517543419:focus-visible,\n.textButton_517543419:focus-visible,\n.scope_517543419:focus-visible,\n.editorClose_517543419:focus-visible,\n.push_517543419:focus-visible,\n.splitArrow_517543419:focus-visible,\n.list_517543419:focus-visible,\n.editor_517543419 input:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n@media (max-height: 450px) {\n .list_517543419 { max-height: 70px; }\n .header_517543419 { padding-top: 8px; padding-bottom: 6px; }\n .commits_517543419 { min-height: 65px; }\n .footer_517543419 { padding-block: 8px; }\n}\n"
|
|
7746
9846
|
],
|
|
9847
|
+
[
|
|
9848
|
+
"src/client/SidebarWorktreeBadge.module.css",
|
|
9849
|
+
"@laoyuehanni/dsh-git-worktree/SidebarWorktreeBadge.module.css",
|
|
9850
|
+
"/* Native sidebar decorations for linked worktree sessions, aligned with the\n * native Session row & hover card typography and color tokens:\n * - trailing branch badge inside `sidebar.session_327715589.row_327715589.trailing_327715589`\n * - two-line hover card item inside `sidebar.session_327715589.row_327715589.hover_327715589` */\n\n.trailingBadge_327715589 {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n height: 20px;\n color: var(--dsw-alias-label-tertiary, var(--dsw-alias-label-secondary));\n}\n\n.hoverItem_327715589 {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n min-width: 0;\n}\n\n.hoverIcon_327715589 {\n display: inline-flex;\n flex: none;\n align-items: center;\n height: 16px;\n color: var(--dsw-alias-hovercard-label-tertiary, var(--dsw-alias-label-tertiary));\n}\n\n.hoverBody_327715589 {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.hoverBranch_327715589 {\n overflow: hidden;\n color: var(--dsw-alias-hovercard-label-primary, var(--dsw-alias-label-primary));\n font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, monospace);\n font-size: 12px;\n line-height: 16px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hoverNote_327715589 {\n color: var(--dsw-alias-hovercard-label-tertiary, var(--dsw-alias-label-tertiary));\n font-size: 12px;\n line-height: 16px;\n overflow-wrap: anywhere;\n}\n"
|
|
9851
|
+
],
|
|
7747
9852
|
[
|
|
7748
9853
|
"src/client/SyncProgress.module.css",
|
|
7749
9854
|
"@laoyuehanni/dsh-git-worktree/SyncProgress.module.css",
|
|
7750
9855
|
"/* The floating progress card of a running fetch/update/push. */\n.card_408765909 {\n box-sizing: border-box;\n position: fixed;\n right: 20px;\n bottom: 84px;\n z-index: 1000;\n width: 380px;\n max-width: calc(100vw - 40px);\n padding: 10px 12px 12px;\n border: 0;\n border-radius: var(--dsw-radius-lg, 16px);\n background: var(--dsw-specific-menu, var(--dsw-alias-bg-layer-2));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n color: var(--dsw-alias-label-primary);\n animation: syncCardIn 160ms ease-out;\n}\n\n.head_408765909 {\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: 22px;\n}\n\n.title_408765909 {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.cancel_408765909 {\n flex: none;\n display: grid;\n place-items: center;\n width: 24px;\n height: 24px;\n margin: 0 -4px 0 0;\n padding: 0;\n border: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-tertiary);\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .cancel_408765909:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n }\n}\n\n.cancel_408765909:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 1px;\n}\n\n.track_408765909 {\n position: relative;\n height: 4px;\n margin: 8px 0;\n overflow: hidden;\n border-radius: var(--dsw-radius-xs, 4px);\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.fill_408765909 {\n height: 100%;\n border-radius: var(--dsw-radius-xs, 4px);\n background: var(--dsw-alias-state-business-primary);\n transition: width 150ms linear;\n}\n\n.indeterminate_408765909 {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 40%;\n border-radius: var(--dsw-radius-xs, 4px);\n background: var(--dsw-alias-state-business-primary);\n animation: syncSweep 1.1s ease-in-out infinite;\n}\n\n.detail_408765909 {\n overflow: hidden;\n font-size: 12px;\n line-height: 18px;\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: var(--dsw-alias-label-secondary);\n}\n\n@keyframes syncSweep {\n from { transform: translateX(-100%); }\n to { transform: translateX(250%); }\n}\n\n@keyframes syncCardIn {\n from { opacity: 0; transform: translateY(6px); }\n to { opacity: 1; transform: translateY(0); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .card_408765909 { animation: none; }\n .fill_408765909 { transition: none; }\n .indeterminate_408765909 { width: 100%; opacity: 0.35; animation: none; }\n}\n"
|
|
7751
9856
|
],
|
|
9857
|
+
[
|
|
9858
|
+
"src/client/WorktreeActionHost.module.css",
|
|
9859
|
+
"@laoyuehanni/dsh-git-worktree/WorktreeActionHost.module.css",
|
|
9860
|
+
"/* Root overlay dialogs triggered from sidebar/header context menus. */\n\n.createDialog_1401658256.createDialog_1401658256 {\n width: min(460px, 100%);\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n\n.body_1401658256 {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.searchInput_1401658256 {\n width: 100%;\n height: 34px;\n padding: 0 10px;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-sm, 8px);\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n outline: none;\n box-sizing: border-box;\n}\n\n.searchInput_1401658256:focus {\n border-color: var(--dsw-alias-state-business-primary);\n}\n\n.searchInput_1401658256::placeholder {\n color: var(--dsw-alias-label-dimmed);\n}\n\n.list_1401658256 {\n display: flex;\n flex-direction: column;\n gap: 2px;\n max-height: min(320px, 45vh);\n overflow-y: auto;\n padding: 2px 0;\n}\n\n.branchRow_1401658256 {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 7px 10px;\n border: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 13px;\n text-align: left;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .branchRow_1401658256:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.branchRow_1401658256:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.branchRow_1401658256:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n.cutoutRow_1401658256 {\n color: var(--dsw-alias-link);\n}\n\n.branchIcon_1401658256 {\n display: inline-flex;\n flex-shrink: 0;\n color: var(--dsw-alias-label-secondary);\n}\n\n.cutoutRow_1401658256 .branchIcon_1401658256 {\n color: var(--dsw-alias-link);\n}\n\n.branchName_1401658256 {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.status_1401658256 {\n font-size: 13px;\n color: var(--dsw-alias-label-secondary);\n padding: 6px 0;\n}\n\n.empty_1401658256 {\n font-size: 13px;\n color: var(--dsw-alias-label-dimmed);\n padding: 12px 4px;\n text-align: center;\n}\n\n.error_1401658256 {\n font-size: 12px;\n color: var(--dsw-alias-state-error-primary);\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.removeFacts_1401658256 {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.removeFact_1401658256 {\n font-size: 13px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.removeFactWarn_1401658256 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.removeConfirm_1401658256 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n@media (hover: hover) {\n .removeConfirm_1401658256:hover:not(:disabled) {\n border-color: var(--dsw-alias-state-error-primary);\n background: var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover));\n }\n}\n"
|
|
9861
|
+
],
|
|
7752
9862
|
[
|
|
7753
9863
|
"src/client/WorktreeManagerModal.module.css",
|
|
7754
9864
|
"@laoyuehanni/dsh-git-worktree/WorktreeManagerModal.module.css",
|
|
7755
|
-
"/* The worktree manager dialog opened from the git-worktree settings card.\n * Semantic alias tokens only, mirroring DSH dialog chrome and typography. */\n\n.dialog_854325390.dialog_854325390 {\n width: min(680px, 100%);\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n\n.body_854325390 {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.toolbar_854325390 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n.count_854325390 {\n font-size: 12px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.refresh_854325390 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 24px;\n padding: 0 8px;\n border: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .refresh_854325390:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n }\n}\n\n.refresh_854325390:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n.refresh_854325390:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.status_854325390 {\n font-size: 13px;\n color: var(--dsw-alias-label-secondary);\n padding: 8px 0;\n}\n\n.error_854325390 {\n font-size: 13px;\n color: var(--dsw-alias-state-error-primary);\n white-space: pre-wrap;\n word-break: break-all;\n}\n\n.empty_854325390 {\n font-size: 13px;\n color: var(--dsw-alias-label-dimmed);\n padding: 12px 0;\n}\n\n.warn_854325390 {\n font-size: 12px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.list_854325390 {\n display: flex;\n flex-direction: column;\n gap: 10px;\n max-height: min(420px, 50vh);\n overflow-y: auto;\n padding: 1px;\n}\n\n.group_854325390 {\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-md, 12px);\n overflow: hidden;\n}\n\n.groupHead_854325390 {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 7px 10px;\n background: var(--dsw-alias-bg-module-platform, var(--dsw-alias-bg-layer-2));\n font-size: 12px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n\n.groupIcon_854325390 {\n display: inline-flex;\n flex-shrink: 0;\n color: var(--dsw-alias-label-secondary);\n}\n\n.groupName_854325390 {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.groupCount_854325390 {\n margin-left: auto;\n flex-shrink: 0;\n font-size: 11px;\n font-weight: 400;\n color: var(--dsw-alias-label-secondary);\n}\n\n.row_854325390 {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px 8px 29px;\n border-bottom: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n.row_854325390:last-child {\n border-bottom: 0;\n}\n\n.rowMain_854325390 {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.rowHead_854325390 {\n display: flex;\n align-items: baseline;\n gap: 8px;\n min-width: 0;\n}\n\n.rowBranch_854325390 {\n font-size: 13px;\n font-weight: 500;\n color: inherit;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rowDirty_854325390 {\n font-size: 11px;\n color: var(--dsw-alias-state-error-primary);\n flex-shrink: 0;\n}\n\n.rowActivity_854325390 {\n margin-left: auto;\n flex-shrink: 0;\n font-size: 11px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.rowPath_854325390 {\n font-size: 11px;\n line-height: 16px;\n color: var(--dsw-alias-label-secondary);\n max-width: 100%;\n}\n\n.rowActions_854325390 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n flex-shrink: 0;\n}\n\n.rowAction_854325390 {\n display: grid;\n place-items: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .rowAction_854325390:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n }\n}\n\n.rowAction_854325390:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.rowAction_854325390:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.remove_854325390 {\n appearance: none;\n flex-shrink: 0;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-sm, 8px);\n background: none;\n font: inherit;\n font-size: 12px;\n color: var(--dsw-alias-state-error-primary);\n padding: 4px 10px;\n height: 28px;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .remove_854325390:hover:not(:disabled) {\n border-color: var(--dsw-alias-state-error-primary);\n background: var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover));\n }\n}\n\n.remove_854325390:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.remove_854325390:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.removeConfirm_854325390 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n@media (hover: hover) {\n .removeConfirm_854325390:hover:not(:disabled) {\n border-color: var(--dsw-alias-state-error-primary);\n background: var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover));\n }\n}\n\n.removeFacts_854325390 {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.removeFact_854325390 {\n font-size: 13px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.removeFactWarn_854325390 {\n color: var(--dsw-alias-state-error-primary);\n}\n"
|
|
9865
|
+
"/* The worktree manager dialog opened from the git-worktree settings card.\n * Semantic alias tokens only, mirroring DSH dialog chrome and typography. */\n\n.dialog_854325390.dialog_854325390 {\n width: min(680px, 100%);\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n}\n\n.body_854325390 {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.toolbar_854325390 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n.scopeBar_854325390 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 6px 10px;\n border-radius: var(--dsw-radius-sm, 8px);\n background: var(--dsw-alias-bg-module-platform, var(--dsw-alias-bg-layer-2));\n font-size: 12px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.scopeInfo_854325390 {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n.scopeName_854325390 {\n color: var(--dsw-alias-label-primary);\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.scopeToggle_854325390 {\n flex-shrink: 0;\n border: 0;\n padding: 2px 6px;\n border-radius: var(--dsw-radius-xs, 4px);\n background: transparent;\n color: var(--dsw-alias-link);\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .scopeToggle_854325390:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.scopeToggle_854325390:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.emptyAction_854325390 {\n margin-left: 8px;\n}\n\n.count_854325390 {\n font-size: 12px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.refresh_854325390 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 24px;\n padding: 0 8px;\n border: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .refresh_854325390:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n }\n}\n\n.refresh_854325390:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n.refresh_854325390:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.status_854325390 {\n font-size: 13px;\n color: var(--dsw-alias-label-secondary);\n padding: 8px 0;\n}\n\n.error_854325390 {\n font-size: 13px;\n color: var(--dsw-alias-state-error-primary);\n white-space: pre-wrap;\n word-break: break-all;\n}\n\n.empty_854325390 {\n font-size: 13px;\n color: var(--dsw-alias-label-dimmed);\n padding: 12px 0;\n}\n\n.warn_854325390 {\n font-size: 12px;\n color: var(--dsw-alias-state-warn-primary);\n}\n\n.list_854325390 {\n display: flex;\n flex-direction: column;\n gap: 10px;\n max-height: min(420px, 50vh);\n overflow-y: auto;\n padding: 1px;\n}\n\n.group_854325390 {\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-md, 12px);\n overflow: hidden;\n}\n\n.groupHead_854325390 {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 7px 10px;\n background: var(--dsw-alias-bg-module-platform, var(--dsw-alias-bg-layer-2));\n font-size: 12px;\n font-weight: 500;\n color: var(--dsw-alias-label-primary);\n}\n\n.groupIcon_854325390 {\n display: inline-flex;\n flex-shrink: 0;\n color: var(--dsw-alias-label-secondary);\n}\n\n.groupName_854325390 {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.groupCount_854325390 {\n margin-left: auto;\n flex-shrink: 0;\n font-size: 11px;\n font-weight: 400;\n color: var(--dsw-alias-label-secondary);\n}\n\n.row_854325390 {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px 8px 29px;\n border-bottom: 0.5px solid var(--dsw-alias-border-l2);\n}\n\n.row_854325390:last-child {\n border-bottom: 0;\n}\n\n.rowMain_854325390 {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.rowHead_854325390 {\n display: flex;\n align-items: baseline;\n gap: 8px;\n min-width: 0;\n}\n\n.rowBranch_854325390 {\n font-size: 13px;\n font-weight: 500;\n color: inherit;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.rowDirty_854325390 {\n font-size: 11px;\n color: var(--dsw-alias-state-error-primary);\n flex-shrink: 0;\n}\n\n.rowActivity_854325390 {\n margin-left: auto;\n flex-shrink: 0;\n font-size: 11px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.rowPath_854325390 {\n font-size: 11px;\n line-height: 16px;\n color: var(--dsw-alias-label-secondary);\n max-width: 100%;\n}\n\n.rowActions_854325390 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n flex-shrink: 0;\n}\n\n.rowAction_854325390 {\n display: grid;\n place-items: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: 0;\n border-radius: var(--dsw-radius-sm, 8px);\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .rowAction_854325390:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n }\n}\n\n.rowAction_854325390:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.rowAction_854325390:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.remove_854325390 {\n appearance: none;\n flex-shrink: 0;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: var(--dsw-radius-sm, 8px);\n background: none;\n font: inherit;\n font-size: 12px;\n color: var(--dsw-alias-state-error-primary);\n padding: 4px 10px;\n height: 28px;\n cursor: pointer;\n}\n\n@media (hover: hover) {\n .remove_854325390:hover:not(:disabled) {\n border-color: var(--dsw-alias-state-error-primary);\n background: var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover));\n }\n}\n\n.remove_854325390:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: -2px;\n}\n\n.remove_854325390:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.removeConfirm_854325390 {\n color: var(--dsw-alias-state-error-primary);\n}\n\n@media (hover: hover) {\n .removeConfirm_854325390:hover:not(:disabled) {\n border-color: var(--dsw-alias-state-error-primary);\n background: var(--dsw-alias-interactive-bg-hover-danger, var(--dsw-alias-interactive-bg-hover));\n }\n}\n\n.removeFacts_854325390 {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.removeFact_854325390 {\n font-size: 13px;\n color: var(--dsw-alias-label-secondary);\n}\n\n.removeFactWarn_854325390 {\n color: var(--dsw-alias-state-error-primary);\n}\n"
|
|
7756
9866
|
]
|
|
7757
9867
|
];
|
|
7758
9868
|
const __dsh_remove_fallback = () => {
|