@laoyuehanni/dsh-git-worktree 0.4.9 → 0.4.11
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 +1 -0
- package/README.zh.md +1 -0
- package/lib/client.js +883 -110
- package/lib/graph-preview/asciidoc-xKuVlNk6.js +5 -0
- package/lib/graph-preview/bat-Dx8nnxXE.js +5 -0
- package/lib/graph-preview/bibtex-BzgdqG3s.js +5 -0
- package/lib/graph-preview/c-BGpbtv2-.js +8 -0
- package/lib/graph-preview/clojure-DDsQ0FaV.js +5 -0
- package/lib/graph-preview/cmake-DPsCB_V6.js +5 -0
- package/lib/graph-preview/cpp-CBYrHpV9.js +27 -0
- package/lib/graph-preview/csharp-CFKaLbHg.js +5 -0
- package/lib/graph-preview/css-C6zsnaz5.js +8 -0
- package/lib/graph-preview/csv-DqIVFkK7.js +5 -0
- package/lib/graph-preview/dart-C6DUdjib.js +5 -0
- package/lib/graph-preview/diff-Blb4MjsC.js +5 -0
- package/lib/graph-preview/dotenv-Dkdv7Sm2.js +5 -0
- package/lib/graph-preview/elixir-D0Gskj1z.js +8 -0
- package/lib/graph-preview/erlang-BJwlUj8s.js +8 -0
- package/lib/graph-preview/fish-D7qAeWQz.js +5 -0
- package/lib/graph-preview/fsharp-MCvH12ek.js +8 -0
- package/lib/graph-preview/go-aXtTCanQ.js +5 -0
- package/lib/graph-preview/graphql-DBbDUzBC.js +19 -0
- package/lib/graph-preview/groovy-Bw2Ku4bU.js +5 -0
- package/lib/graph-preview/haskell-CfGsE1Cf.js +5 -0
- package/lib/graph-preview/hcl-DHg_Osgo.js +5 -0
- package/lib/graph-preview/html-DwZ-9Aol.js +15 -0
- package/lib/graph-preview/html-derivative-CdrGiVx_.js +8 -0
- package/lib/graph-preview/http-B769neBI.js +16 -0
- package/lib/graph-preview/ini-C24lZfdM.js +5 -0
- package/lib/graph-preview/java-B6HH4GJL.js +8 -0
- package/lib/graph-preview/javascript-BXA9Hfas.js +5 -0
- package/lib/graph-preview/julia--d6L9eAJ.js +19 -0
- package/lib/graph-preview/kotlin-BHE8CoV9.js +5 -0
- package/lib/graph-preview/latex-BsyjE6iS.js +12 -0
- package/lib/graph-preview/less-BzbdhFUi.js +5 -0
- package/lib/graph-preview/log-Dad54gsi.js +5 -0
- package/lib/graph-preview/lua-DL6V31K-.js +10 -0
- package/lib/graph-preview/make-B2ukzWs3.js +5 -0
- package/lib/graph-preview/markdown-CkmxmzqY.js +5 -0
- package/lib/graph-preview/mdx-BK9ZufRc.js +5 -0
- package/lib/graph-preview/nix-BRl3YduB.js +9 -0
- package/lib/graph-preview/perl-DJHPR3L5.js +19 -0
- package/lib/graph-preview/php-B74oGaLi.js +21 -0
- package/lib/graph-preview/powershell-DvOBVZPr.js +5 -0
- package/lib/graph-preview/preview.js +79431 -0
- package/lib/graph-preview/proto-ClkOcAW0.js +5 -0
- package/lib/graph-preview/python-BjnOIxPe.js +5 -0
- package/lib/graph-preview/r-BSNufAtJ.js +8 -0
- package/lib/graph-preview/rst-CDCHc-qO.js +25 -0
- package/lib/graph-preview/ruby-Dx4dTqam.js +40 -0
- package/lib/graph-preview/rust-COBzcmTx.js +5 -0
- package/lib/graph-preview/scala-pMGZAs9j.js +5 -0
- package/lib/graph-preview/scss-D2N2uO1z.js +8 -0
- package/lib/graph-preview/sql-DBa5L-Wg.js +8 -0
- package/lib/graph-preview/svelte-DQXUqa3J.js +18 -0
- package/lib/graph-preview/swift-DWmMn3lF.js +5 -0
- package/lib/graph-preview/system-verilog-DW0KSMVO.js +5 -0
- package/lib/graph-preview/toml-B7BHZIqX.js +5 -0
- package/lib/graph-preview/vb-eGVhCUXq.js +5 -0
- package/lib/graph-preview/verilog-Ma7yBE30.js +5 -0
- package/lib/graph-preview/vue-k6e1qQTO.js +32 -0
- package/lib/graph-preview/xml-DUa-g8pJ.js +10 -0
- package/lib/graph-preview/yaml-B81N8prR.js +5 -0
- package/lib/history.d.ts +7 -0
- package/lib/history.js +79 -0
- package/lib/index.js +4 -0
- package/lib/routes.d.ts +4 -1
- package/lib/routes.js +29 -0
- package/lib/wire.d.ts +36 -0
- package/lib/wire.js +3 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -59,6 +59,9 @@ window.__ModuleLoader__.load({
|
|
|
59
59
|
/** GET ROUTE_PREFIX/head?path=<absolute dir> — checked-out branch only.
|
|
60
60
|
* A file read of HEAD, not a git process. */
|
|
61
61
|
const ROUTE_HEAD = `${ROUTE_PREFIX}/head`;
|
|
62
|
+
/** Read-only POSTs: bounded history and one commit's full message/summary. */
|
|
63
|
+
const ROUTE_HISTORY = `${ROUTE_PREFIX}/history`;
|
|
64
|
+
const ROUTE_COMMIT = `${ROUTE_PREFIX}/commit`;
|
|
62
65
|
/** POST ROUTE_PREFIX/worktree — create-or-reuse a worktree for a branch. */
|
|
63
66
|
const ROUTE_WORKTREE = `${ROUTE_PREFIX}/worktree`;
|
|
64
67
|
/** POST ROUTE_PREFIX/switch — in-place branch switch of the main checkout. */
|
|
@@ -101,6 +104,28 @@ window.__ModuleLoader__.load({
|
|
|
101
104
|
const ROUTE_PURGE = `${ROUTE_PREFIX}/purge`;
|
|
102
105
|
//#endregion
|
|
103
106
|
//#region src/client/api.ts
|
|
107
|
+
/** Read-only history requests can be cancelled when the user browses another branch. */
|
|
108
|
+
async function graphRead(url, body, signal) {
|
|
109
|
+
try {
|
|
110
|
+
return await readEnvelope(await fetch(url, {
|
|
111
|
+
method: "POST",
|
|
112
|
+
headers: { "content-type": "application/json" },
|
|
113
|
+
body: JSON.stringify(body),
|
|
114
|
+
signal,
|
|
115
|
+
cache: "no-store"
|
|
116
|
+
}));
|
|
117
|
+
} catch (cause) {
|
|
118
|
+
return {
|
|
119
|
+
ok: false,
|
|
120
|
+
error: cause instanceof Error ? cause.message : String(cause)
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const fetchHistory = (body, signal) => graphRead(ROUTE_HISTORY, body, signal);
|
|
125
|
+
const fetchCommit = (repoPath, oid, signal) => graphRead(ROUTE_COMMIT, {
|
|
126
|
+
repoPath,
|
|
127
|
+
oid
|
|
128
|
+
}, signal);
|
|
104
129
|
/** POST one JSON body and parse the uniform envelope. */
|
|
105
130
|
async function post(url, body) {
|
|
106
131
|
return send("POST", url, body);
|
|
@@ -609,13 +634,13 @@ window.__ModuleLoader__.load({
|
|
|
609
634
|
}
|
|
610
635
|
//#endregion
|
|
611
636
|
//#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\PushDialog.module.css?inline
|
|
612
|
-
const css$
|
|
613
|
-
const tagId$
|
|
614
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId$
|
|
637
|
+
const css$5 = ".dialog_1212074589 {\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}\n.header_1212074589 { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 16px; }\n.header_1212074589 h2 { flex: 1; min-width: 0; margin: 0; font-size: 15px; line-height: 24px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.header_1212074589 h2 span { color: var(--dsw-alias-label-secondary); font-weight: 400; }\n.close_1212074589, .refresh_1212074589 { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--dsw-radius-sm); background: transparent; color: var(--dsw-alias-label-tertiary); cursor: pointer; }\n.close_1212074589:hover:not(:disabled), .refresh_1212074589:hover:not(:disabled), .textButton_1212074589:hover:not(:disabled), .scope_1212074589:hover:not(:disabled), .editorClose_1212074589:hover { background: var(--dsw-alias-interactive-bg-hover); }\n.body_1212074589 { padding: 0 12px; min-height: 0; }\n.mapping_1212074589 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 34px; padding: 3px 10px; border-radius: var(--dsw-radius-md); background: var(--dsw-alias-interactive-bg-hover); }\n.mapping_1212074589 > svg { flex: none; color: var(--dsw-alias-label-secondary); }\n/* The branch being pushed may be long; give it up to half the row (the target keeps its own cap). */\n.source_1212074589 { min-width: 0; max-width: min(200px, 50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.arrow_1212074589 { color: var(--dsw-alias-label-tertiary); }\n.destination_1212074589 { display: inline-flex; align-items: center; gap: 3px; min-width: 0; max-width: 100%; }\n.remote_1212074589 { color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }\n.textButton_1212074589, .scope_1212074589 { display: inline-flex; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: var(--dsw-radius-xs); padding: 2px 4px; background: transparent; color: var(--dsw-alias-link); font: inherit; cursor: pointer; max-width: 100%; }\n.chevron_1212074589 { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }\n.targetWrap_1212074589 { position: relative; min-width: 0; max-width: 180px; }\n.targetName_1212074589 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.badge_1212074589 { font-size: 11px; line-height: 18px; padding: 0 5px; border-radius: var(--dsw-radius-xs); background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-secondary); }\n.editor_1212074589 { position: absolute; z-index: 5; top: calc(100% + 5px); left: 0; width: 200px; max-width: calc(100vw - 64px); padding: 10px; border: .5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-lg); background: var(--dsw-alias-bg-layer-2); box-shadow: var(--dsw-elevation-prominent); }\n/* Near the dialog's right edge the editor lines up with the name's right edge instead. */\n.editorEnd_1212074589 { left: auto; right: 0; }\n.editorHead_1212074589 { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; }\n.editor_1212074589 label { display: block; font-size: 11px; color: var(--dsw-alias-label-tertiary); }\n.editorClose_1212074589 { display: grid; place-items: center; width: 20px; height: 20px; flex: none; margin: -3px -4px 0 0; padding: 0; border: 0; border-radius: var(--dsw-radius-xs); background: transparent; color: var(--dsw-alias-label-tertiary); cursor: pointer; }\n.editor_1212074589 input { box-sizing: border-box; width: 100%; padding: 5px 7px; font: inherit; border: .5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }\n.editor_1212074589 input[aria-invalid='true'] { border-color: var(--dsw-alias-state-error-primary); }\n.commits_1212074589 { padding: 8px 10px 12px; min-height: 96px; }\n.count_1212074589 { font-size: 11px; color: var(--dsw-alias-label-tertiary); margin-bottom: 6px; }\n.previewStatus_1212074589 { margin-left: 8px; }\n.list_1212074589 { list-style: none; margin: 0; padding: 0 5px 0 0; max-height: min(168px, 28vh); overflow-y: auto; overscroll-behavior: contain; }\n.list_1212074589 li { display: flex; align-items: center; gap: 8px; min-height: 28px; }\n.list_1212074589 svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--dsw-alias-label-tertiary); stroke-width: 1.5; }\n.list_1212074589 li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.empty_1212074589 { display: grid; place-items: center; min-height: 60px; margin: 0; font-size: 12px; color: var(--dsw-alias-label-tertiary); }\n.hint_1212074589 { margin: 6px 0 0; font-size: 11px; line-height: 17px; color: var(--dsw-alias-label-tertiary); }\n.error_1212074589 { max-height: 120px; margin-bottom: 8px; overflow: auto; font-size: 12px; color: var(--dsw-alias-state-error-primary); overflow-wrap: anywhere; }\n/* A recognised cause leads in plain words; git's own text stays below it, quieter. */\n.errorSummary_1212074589 { margin: 0 0 4px; font-weight: 500; }\n.errorSummary_1212074589:last-child { margin-bottom: 0; }\n.errorDetail_1212074589 { max-height: 64px; overflow: auto; font-size: 11px; line-height: 16px; white-space: pre-wrap; color: var(--dsw-alias-label-secondary); }\n.footer_1212074589 { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 0 16px; padding: 12px 0 14px; border-top: .5px solid var(--dsw-alias-border-l2); }\n.tagOptions_1212074589 { display: flex; align-items: center; gap: 4px; min-width: 0; }\n.checkbox_1212074589 { display: flex; align-items: center; gap: 7px; font-size: 12px; white-space: nowrap; color: var(--dsw-alias-label-secondary); cursor: pointer; }\n.checkbox_1212074589 input { appearance: none; margin: 0; width: 14px; height: 14px; border: 1px solid var(--dsw-alias-label-tertiary); border-radius: var(--dsw-radius-xs); display: grid; place-content: center; cursor: pointer; }\n.checkbox_1212074589 input:checked { background: var(--dsw-alias-button-primary-fill); border-color: var(--dsw-alias-button-primary-fill); }\n.checkbox_1212074589 input:checked::after { content: ''; width: 6px; height: 3px; border: solid var(--dsw-alias-label-primary-foreground); border-width: 0 0 1.5px 1.5px; transform: rotate(-45deg) translateY(-1px); }\n.scope_1212074589 { color: var(--dsw-alias-label-secondary); font-size: 12px; }\n.actions_1212074589 { display: flex; align-items: center; gap: 4px; margin-left: auto; }\n.split_1212074589 { display: flex; border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-button-primary-fill); color: var(--dsw-alias-label-primary-foreground); }\n.push_1212074589, .splitArrow_1212074589 { height: 28px; padding: 0 10px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }\n.push_1212074589 { min-width: 56px; border-radius: var(--dsw-radius-sm) 0 0 var(--dsw-radius-sm); }\n.splitArrow_1212074589 { position: relative; display: grid; place-items: center; width: 27px; padding: 0; border-radius: 0 var(--dsw-radius-sm) var(--dsw-radius-sm) 0; }\n.splitArrow_1212074589::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; border-left: 1px solid currentColor; opacity: .18; }\n.push_1212074589:hover:not(:disabled), .splitArrow_1212074589:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-active); }\n.dialog_1212074589 button:disabled, .dialog_1212074589 input:disabled { opacity: .4; cursor: not-allowed; }\n/* Keyboard focus ring, spelled out like the plugin's other dialogs rather\n * than left to the host's global reset. */\n.close_1212074589:focus-visible, .refresh_1212074589:focus-visible, .textButton_1212074589:focus-visible, .scope_1212074589:focus-visible, .editorClose_1212074589:focus-visible,\n.push_1212074589:focus-visible, .splitArrow_1212074589:focus-visible, .checkbox_1212074589 input:focus-visible, .list_1212074589:focus-visible, .editor_1212074589 input:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: -2px;\n}\n@media (max-height: 450px) { .list_1212074589 { max-height: 70px; } .header_1212074589 { padding-top: 8px; padding-bottom: 6px; } .commits_1212074589 { min-height: 65px; } .footer_1212074589 { padding-block: 8px; } }\n";
|
|
638
|
+
const tagId$5 = "@laoyuehanni/dsh-git-worktree/PushDialog.module.css";
|
|
639
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId$5 + "\"]") === null) {
|
|
615
640
|
const tag = document.createElement("style");
|
|
616
641
|
tag.dataset.plugin = "@laoyuehanni/dsh-git-worktree";
|
|
617
|
-
tag.dataset.pluginCss = tagId$
|
|
618
|
-
tag.textContent = css$
|
|
642
|
+
tag.dataset.pluginCss = tagId$5;
|
|
643
|
+
tag.textContent = css$5;
|
|
619
644
|
document.head.appendChild(tag);
|
|
620
645
|
}
|
|
621
646
|
var PushDialog_module_default = {
|
|
@@ -1477,8 +1502,550 @@ window.__ModuleLoader__.load({
|
|
|
1477
1502
|
return "ignored";
|
|
1478
1503
|
}
|
|
1479
1504
|
//#endregion
|
|
1505
|
+
//#region src/client/commit-graph.ts
|
|
1506
|
+
/** Keep the selection inside the filtered rows, without scanning per row. */
|
|
1507
|
+
function filterCommits(commits, query, author, selected) {
|
|
1508
|
+
const needle = query.trim().toLocaleLowerCase();
|
|
1509
|
+
const visible = [];
|
|
1510
|
+
let matchingSelection = null;
|
|
1511
|
+
for (const [index, item] of commits.entries()) {
|
|
1512
|
+
if (author && item.author !== author) continue;
|
|
1513
|
+
if (needle && !`${item.subject} ${item.oid}`.toLocaleLowerCase().includes(needle)) continue;
|
|
1514
|
+
visible.push({
|
|
1515
|
+
item,
|
|
1516
|
+
index
|
|
1517
|
+
});
|
|
1518
|
+
if (item.oid === selected) matchingSelection = selected;
|
|
1519
|
+
}
|
|
1520
|
+
return {
|
|
1521
|
+
visible,
|
|
1522
|
+
selected: matchingSelection ?? visible[0]?.item.oid ?? null
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1525
|
+
/** Allocate lanes over the entire loaded prefix, so appending a page never
|
|
1526
|
+
* changes earlier nodes. Missing parents continue to the page boundary. */
|
|
1527
|
+
function layoutCommits(commits) {
|
|
1528
|
+
const active = [];
|
|
1529
|
+
let lanes = 1;
|
|
1530
|
+
const rows = [];
|
|
1531
|
+
for (const item of commits) {
|
|
1532
|
+
let lane = active.indexOf(item.oid);
|
|
1533
|
+
const incoming = lane !== -1;
|
|
1534
|
+
if (lane === -1) {
|
|
1535
|
+
lane = active.indexOf(null);
|
|
1536
|
+
if (lane === -1) lane = active.length;
|
|
1537
|
+
active[lane] = item.oid;
|
|
1538
|
+
}
|
|
1539
|
+
const before = [...active];
|
|
1540
|
+
active[lane] = null;
|
|
1541
|
+
const edges = [];
|
|
1542
|
+
for (const parent of new Set(item.parents)) {
|
|
1543
|
+
let target = active.indexOf(parent);
|
|
1544
|
+
if (target === -1) {
|
|
1545
|
+
target = active.indexOf(null);
|
|
1546
|
+
if (target === -1) target = active.length;
|
|
1547
|
+
active[target] = parent;
|
|
1548
|
+
}
|
|
1549
|
+
edges.push({
|
|
1550
|
+
from: lane,
|
|
1551
|
+
to: target,
|
|
1552
|
+
parent: true
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
for (let i = 0; i < before.length; i++) {
|
|
1556
|
+
const oid = before[i];
|
|
1557
|
+
if (oid !== null && oid !== void 0 && oid !== item.oid) edges.push({
|
|
1558
|
+
from: i,
|
|
1559
|
+
to: active.indexOf(oid),
|
|
1560
|
+
parent: false
|
|
1561
|
+
});
|
|
1562
|
+
}
|
|
1563
|
+
lanes = Math.max(lanes, active.length, before.length);
|
|
1564
|
+
while (active.length && active.at(-1) === null) active.pop();
|
|
1565
|
+
rows.push({
|
|
1566
|
+
lane,
|
|
1567
|
+
incoming,
|
|
1568
|
+
edges
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
return {
|
|
1572
|
+
rows,
|
|
1573
|
+
lanes
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
//#endregion
|
|
1577
|
+
//#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\CommitGraph.module.css?inline
|
|
1578
|
+
const css$4 = ".panel_431118584 {\n display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0;\n border-left: .5px solid color-mix(in srgb, currentColor 12%, transparent);\n font-size: 12px; color: var(--dsw-alias-label-primary, #303238);\n}\n.heading_431118584 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px 8px 12px; flex-shrink: 0; }\n.branch_431118584 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; min-width: 0; flex: 0 1 auto; }\n.loaded_431118584 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--dsw-alias-label-tertiary, #929499); font-size: 11px; }\n.heading_431118584 > .iconButton_431118584:first-of-type { margin-left: auto; }\n.iconButton_431118584 { display: grid; place-items: center; border: 0; background: transparent; color: inherit; width: 22px; height: 22px; padding: 0; border-radius: 6px; cursor: pointer; font-size: 14px; flex-shrink: 0; }\n.closeIcon_431118584 { stroke-width: 1.8px; stroke-linecap: round; }\n.iconButton_431118584:hover, .textButton_431118584:hover { background: color-mix(in srgb, currentColor 7%, transparent); }\n.iconButton_431118584:disabled, .textButton_431118584:disabled { opacity: .4; cursor: default; }\n.search_431118584, .authorFilter_431118584 { box-sizing: border-box; min-width: 0; height: 30px; border: 0; border-radius: 7px; background: color-mix(in srgb, currentColor 5%, transparent); color: inherit; padding: 5px 8px; font: inherit; }\n.search_431118584 { width: 150px; flex: 0 1 150px; }\n.authorFilter_431118584 { width: 108px; flex: 0 1 108px; cursor: pointer; }\n.authorFilter_431118584 option { background: var(--dsw-alias-surface-raised, #303238); color: var(--dsw-alias-label-primary, #ededee); }\n.search_431118584:focus-visible, .authorFilter_431118584:focus-visible { outline: 1px solid var(--dsw-alias-label-primary-bluish, #4186f0); }\n.search_431118584::placeholder { color: var(--dsw-alias-label-tertiary, #929499); }\n.columns_431118584 { display: flex; align-items: center; gap: 8px; height: 25px; padding: 0 14px 0 8px; color: var(--dsw-alias-label-tertiary, #929499); font-size: 11px; flex-shrink: 0; }\n.columns_431118584 > span:first-child { flex: 0 0 auto; }\n.columns_431118584 > span:nth-child(2) { flex: 1; }\n.columns_431118584 > span:nth-child(3) { width: 70px; }\n.columns_431118584 > span:last-child { width: 99px; }\n.list_431118584 { flex: 1 1 0%; min-height: 58px; overflow: auto; padding: 0 6px; scrollbar-width: thin; }\n.row_431118584 { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 7px 0 2px; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }\n.row_431118584:hover { background: color-mix(in srgb, currentColor 5%, transparent); }\n.selected_431118584, .selected_431118584:hover { background: color-mix(in srgb, var(--dsw-alias-label-primary-bluish, #4186f0) 14%, transparent); }\n.row_431118584:focus-visible { outline: 1px solid var(--dsw-alias-label-primary-bluish, #4186f0); outline-offset: -1px; }\n.graph_431118584 { flex-shrink: 0; overflow: visible; }\n.graph_431118584 path { fill: none; stroke-width: 1.5px; }\n.subject_431118584 { flex: 1 1 auto; min-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.author_431118584 { flex: 0 0 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsw-alias-label-secondary, #75787e); font-size: 11px; }\n.date_431118584 { flex: 0 0 44px; color: var(--dsw-alias-label-secondary, #75787e); font-size: 11px; }\n.hash_431118584 { flex: 0 0 47px; font-size: 10px; color: var(--dsw-alias-label-tertiary, #929499); }\n.state_431118584 { padding: 16px; color: var(--dsw-alias-label-secondary, #75787e); overflow-wrap: anywhere; }\n.footer_431118584 { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 13px; min-height: 27px; color: var(--dsw-alias-label-tertiary, #929499); font-size: 11px; flex-shrink: 0; }\n.error_431118584 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dsw-alias-label-error, #c86464); }\n.textButton_431118584 { border: 0; background: transparent; padding: 4px 5px; border-radius: 5px; color: var(--dsw-alias-label-primary-bluish, #4186f0); font: inherit; font-size: 11px; cursor: pointer; align-self: flex-start; flex-shrink: 0; }\n.detailHost_431118584 { display: flex; flex: 0 0 auto; min-height: 0; max-height: min(316px, 44%); }\n.detail_431118584 { box-sizing: border-box; display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 16px 10px; border-top: .5px solid color-mix(in srgb, currentColor 12%, transparent); }\n.detailTitle_431118584 { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }\n.meta_431118584 { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--dsw-alias-label-tertiary, #929499); font-size: 10px; padding: 6px 0; flex-shrink: 0; }\n.messageScroll_431118584 { min-height: 0; overflow: hidden; }\n.message_431118584 { margin: 2px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-secondary, #75787e); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }\n.expanded_431118584 .messageScroll_431118584 { overflow: auto; scrollbar-width: thin; }\n.expanded_431118584 .message_431118584 { display: block; -webkit-line-clamp: unset; }\n.files_431118584 { display: flex; align-items: center; gap: 9px; color: var(--dsw-alias-label-tertiary, #929499); font-size: 10px; padding-top: 7px; flex-shrink: 0; white-space: nowrap; }\n.fileName_431118584 { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }\n.added_431118584 { color: #529a77; }\n.removed_431118584 { color: #c66c72; }\n@media (max-width: 900px) {\n .author_431118584, .hash_431118584, .columns_431118584 > span:nth-child(3) { display: none; }\n .columns_431118584 > span:last-child { width: 44px; }\n}\n@media (max-height: 600px) {\n .detail_431118584 { padding: 7px 12px; }\n .meta_431118584 { padding: 3px 0; }\n}\n";
|
|
1579
|
+
const tagId$4 = "@laoyuehanni/dsh-git-worktree/CommitGraph.module.css";
|
|
1580
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId$4 + "\"]") === null) {
|
|
1581
|
+
const tag = document.createElement("style");
|
|
1582
|
+
tag.dataset.plugin = "@laoyuehanni/dsh-git-worktree";
|
|
1583
|
+
tag.dataset.pluginCss = tagId$4;
|
|
1584
|
+
tag.textContent = css$4;
|
|
1585
|
+
document.head.appendChild(tag);
|
|
1586
|
+
}
|
|
1587
|
+
var CommitGraph_module_default = {
|
|
1588
|
+
"panel": "panel_431118584",
|
|
1589
|
+
"heading": "heading_431118584",
|
|
1590
|
+
"branch": "branch_431118584",
|
|
1591
|
+
"loaded": "loaded_431118584",
|
|
1592
|
+
"iconButton": "iconButton_431118584",
|
|
1593
|
+
"closeIcon": "closeIcon_431118584",
|
|
1594
|
+
"textButton": "textButton_431118584",
|
|
1595
|
+
"search": "search_431118584",
|
|
1596
|
+
"authorFilter": "authorFilter_431118584",
|
|
1597
|
+
"columns": "columns_431118584",
|
|
1598
|
+
"list": "list_431118584",
|
|
1599
|
+
"row": "row_431118584",
|
|
1600
|
+
"selected": "selected_431118584",
|
|
1601
|
+
"graph": "graph_431118584",
|
|
1602
|
+
"subject": "subject_431118584",
|
|
1603
|
+
"author": "author_431118584",
|
|
1604
|
+
"date": "date_431118584",
|
|
1605
|
+
"hash": "hash_431118584",
|
|
1606
|
+
"state": "state_431118584",
|
|
1607
|
+
"footer": "footer_431118584",
|
|
1608
|
+
"error": "error_431118584",
|
|
1609
|
+
"detailHost": "detailHost_431118584",
|
|
1610
|
+
"detail": "detail_431118584",
|
|
1611
|
+
"detailTitle": "detailTitle_431118584",
|
|
1612
|
+
"meta": "meta_431118584",
|
|
1613
|
+
"messageScroll": "messageScroll_431118584",
|
|
1614
|
+
"message": "message_431118584",
|
|
1615
|
+
"expanded": "expanded_431118584",
|
|
1616
|
+
"files": "files_431118584",
|
|
1617
|
+
"fileName": "fileName_431118584",
|
|
1618
|
+
"added": "added_431118584",
|
|
1619
|
+
"removed": "removed_431118584"
|
|
1620
|
+
};
|
|
1621
|
+
//#endregion
|
|
1622
|
+
//#region src/client/CommitGraph.tsx
|
|
1623
|
+
const colors = [
|
|
1624
|
+
"#5c91cc",
|
|
1625
|
+
"#ac88d1",
|
|
1626
|
+
"#56a895",
|
|
1627
|
+
"#cf9b61",
|
|
1628
|
+
"#ce7d91",
|
|
1629
|
+
"#7c9daa"
|
|
1630
|
+
];
|
|
1631
|
+
const x = (lane) => 12 + lane * 12;
|
|
1632
|
+
const color = (lane) => colors[lane % colors.length] ?? colors[0] ?? "#5c91cc";
|
|
1633
|
+
function GraphNode({ row, width, filtered }) {
|
|
1634
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
1635
|
+
className: CommitGraph_module_default.graph,
|
|
1636
|
+
width,
|
|
1637
|
+
height: 36,
|
|
1638
|
+
"aria-hidden": "true",
|
|
1639
|
+
children: [!filtered && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [row.incoming && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1640
|
+
d: `M${x(row.lane)} 0V18`,
|
|
1641
|
+
stroke: color(row.lane)
|
|
1642
|
+
}), row.edges.map((edge, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1643
|
+
stroke: color(edge.parent ? edge.to : edge.from),
|
|
1644
|
+
d: edge.parent ? `M${x(edge.from)} 18C${x(edge.from)} 29 ${x(edge.to)} 25 ${x(edge.to)} 36` : `M${x(edge.from)} 0C${x(edge.from)} 18 ${x(edge.to)} 18 ${x(edge.to)} 36`
|
|
1645
|
+
}, i))] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
1646
|
+
cx: x(filtered ? 0 : row.lane),
|
|
1647
|
+
cy: 18,
|
|
1648
|
+
r: 3.6,
|
|
1649
|
+
fill: color(row.lane)
|
|
1650
|
+
})]
|
|
1651
|
+
});
|
|
1652
|
+
}
|
|
1653
|
+
function Detail({ detail, t }) {
|
|
1654
|
+
const [expanded, setExpanded] = (0, react.useState)(false);
|
|
1655
|
+
const [overflows, setOverflows] = (0, react.useState)(false);
|
|
1656
|
+
const messageRef = (0, react.useRef)(null);
|
|
1657
|
+
(0, react.useLayoutEffect)(() => {
|
|
1658
|
+
const el = messageRef.current;
|
|
1659
|
+
if (!el) return;
|
|
1660
|
+
const measure = () => {
|
|
1661
|
+
if (!expanded) setOverflows(el.scrollHeight > el.clientHeight + 1);
|
|
1662
|
+
};
|
|
1663
|
+
measure();
|
|
1664
|
+
const observer = new ResizeObserver(measure);
|
|
1665
|
+
observer.observe(el);
|
|
1666
|
+
return () => observer.disconnect();
|
|
1667
|
+
}, [detail.body, expanded]);
|
|
1668
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
1669
|
+
className: `${CommitGraph_module_default.detail} ${expanded ? CommitGraph_module_default.expanded : ""}`,
|
|
1670
|
+
"aria-label": t("graphDetail"),
|
|
1671
|
+
children: [
|
|
1672
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1673
|
+
className: CommitGraph_module_default.detailTitle,
|
|
1674
|
+
title: detail.subject,
|
|
1675
|
+
children: detail.subject
|
|
1676
|
+
}),
|
|
1677
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1678
|
+
className: CommitGraph_module_default.meta,
|
|
1679
|
+
children: [
|
|
1680
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: detail.author }),
|
|
1681
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", {
|
|
1682
|
+
dateTime: detail.date,
|
|
1683
|
+
children: new Date(detail.date).toLocaleString()
|
|
1684
|
+
}),
|
|
1685
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
1686
|
+
title: detail.oid,
|
|
1687
|
+
children: detail.oid.slice(0, 8)
|
|
1688
|
+
})
|
|
1689
|
+
]
|
|
1690
|
+
}),
|
|
1691
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1692
|
+
className: CommitGraph_module_default.messageScroll,
|
|
1693
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1694
|
+
ref: messageRef,
|
|
1695
|
+
className: CommitGraph_module_default.message,
|
|
1696
|
+
children: detail.body || t("graphNoBody")
|
|
1697
|
+
})
|
|
1698
|
+
}),
|
|
1699
|
+
(overflows || expanded) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1700
|
+
type: "button",
|
|
1701
|
+
className: CommitGraph_module_default.textButton,
|
|
1702
|
+
"aria-expanded": expanded,
|
|
1703
|
+
onClick: () => setExpanded((value) => !value),
|
|
1704
|
+
children: t(expanded ? "graphCollapseBody" : "graphExpandBody")
|
|
1705
|
+
}),
|
|
1706
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1707
|
+
className: CommitGraph_module_default.files,
|
|
1708
|
+
title: detail.firstFile ?? "",
|
|
1709
|
+
children: [
|
|
1710
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1711
|
+
className: CommitGraph_module_default.fileName,
|
|
1712
|
+
children: detail.firstFile ?? t("graphNoFiles")
|
|
1713
|
+
}),
|
|
1714
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("graphFiles", { count: detail.files }) }),
|
|
1715
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1716
|
+
className: CommitGraph_module_default.added,
|
|
1717
|
+
children: ["+", detail.added]
|
|
1718
|
+
}),
|
|
1719
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1720
|
+
className: CommitGraph_module_default.removed,
|
|
1721
|
+
children: ["−", detail.removed]
|
|
1722
|
+
}),
|
|
1723
|
+
detail.binaryFiles > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("graphBinary", { count: detail.binaryFiles }) })
|
|
1724
|
+
]
|
|
1725
|
+
})
|
|
1726
|
+
]
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
/** One branch browser. The owner keys by repository + ref: old async responses
|
|
1730
|
+
* can never replace a different branch's history or selected commit. */
|
|
1731
|
+
function CommitGraph({ repoPath, branchRef, branch, onClose, escapeRef, t }) {
|
|
1732
|
+
const [history, setHistory] = (0, react.useState)(null);
|
|
1733
|
+
const [error, setError] = (0, react.useState)("");
|
|
1734
|
+
const [loading, setLoading] = (0, react.useState)(true);
|
|
1735
|
+
const [revision, setRevision] = (0, react.useState)(0);
|
|
1736
|
+
const [selected, setSelected] = (0, react.useState)(null);
|
|
1737
|
+
const [query, setQuery] = (0, react.useState)("");
|
|
1738
|
+
const [author, setAuthor] = (0, react.useState)("");
|
|
1739
|
+
const [detail, setDetail] = (0, react.useState)(null);
|
|
1740
|
+
const [detailError, setDetailError] = (0, react.useState)("");
|
|
1741
|
+
const [detailRevision, setDetailRevision] = (0, react.useState)(0);
|
|
1742
|
+
const moreRequest = (0, react.useRef)(null);
|
|
1743
|
+
const listRef = (0, react.useRef)(null);
|
|
1744
|
+
const detailHost = (0, react.useRef)(null);
|
|
1745
|
+
const commits = history?.commits ?? [];
|
|
1746
|
+
const graph = (0, react.useMemo)(() => layoutCommits(commits), [commits]);
|
|
1747
|
+
const { visible, selected: selectedOid } = (0, react.useMemo)(() => filterCommits(commits, query, author, selected), [
|
|
1748
|
+
commits,
|
|
1749
|
+
query,
|
|
1750
|
+
author,
|
|
1751
|
+
selected
|
|
1752
|
+
]);
|
|
1753
|
+
const authors = [...new Set(commits.map((item) => item.author))].sort((a, b) => a.localeCompare(b));
|
|
1754
|
+
const filtered = !!query.trim() || !!author;
|
|
1755
|
+
const graphWidth = filtered ? 30 : Math.max(42, graph.lanes * 12 + 14);
|
|
1756
|
+
(0, react.useEffect)(() => {
|
|
1757
|
+
const controller = new AbortController();
|
|
1758
|
+
moreRequest.current?.abort();
|
|
1759
|
+
setHistory(null);
|
|
1760
|
+
setError("");
|
|
1761
|
+
setLoading(true);
|
|
1762
|
+
setSelected(null);
|
|
1763
|
+
setDetail(null);
|
|
1764
|
+
fetchHistory({
|
|
1765
|
+
repoPath,
|
|
1766
|
+
ref: branchRef
|
|
1767
|
+
}, controller.signal).then((result) => {
|
|
1768
|
+
if (controller.signal.aborted) return;
|
|
1769
|
+
setLoading(false);
|
|
1770
|
+
if (result.ok) {
|
|
1771
|
+
setHistory(result);
|
|
1772
|
+
setSelected(result.commits[0]?.oid ?? null);
|
|
1773
|
+
} else setError(result.error);
|
|
1774
|
+
});
|
|
1775
|
+
return () => {
|
|
1776
|
+
controller.abort();
|
|
1777
|
+
moreRequest.current?.abort();
|
|
1778
|
+
};
|
|
1779
|
+
}, [
|
|
1780
|
+
repoPath,
|
|
1781
|
+
branchRef,
|
|
1782
|
+
revision
|
|
1783
|
+
]);
|
|
1784
|
+
(0, react.useEffect)(() => {
|
|
1785
|
+
const controller = new AbortController();
|
|
1786
|
+
setDetail(null);
|
|
1787
|
+
setDetailError("");
|
|
1788
|
+
if (selectedOid !== null) fetchCommit(repoPath, selectedOid, controller.signal).then((result) => {
|
|
1789
|
+
if (controller.signal.aborted) return;
|
|
1790
|
+
if (result.ok) setDetail(result);
|
|
1791
|
+
else setDetailError(result.error);
|
|
1792
|
+
});
|
|
1793
|
+
return () => controller.abort();
|
|
1794
|
+
}, [
|
|
1795
|
+
repoPath,
|
|
1796
|
+
selectedOid,
|
|
1797
|
+
detailRevision
|
|
1798
|
+
]);
|
|
1799
|
+
(0, react.useEffect)(() => {
|
|
1800
|
+
const handler = () => {
|
|
1801
|
+
if (query) {
|
|
1802
|
+
setQuery("");
|
|
1803
|
+
return true;
|
|
1804
|
+
}
|
|
1805
|
+
if (author) {
|
|
1806
|
+
setAuthor("");
|
|
1807
|
+
return true;
|
|
1808
|
+
}
|
|
1809
|
+
const button = detailHost.current?.querySelector("button[aria-expanded=\"true\"]");
|
|
1810
|
+
if (button) {
|
|
1811
|
+
button.click();
|
|
1812
|
+
return true;
|
|
1813
|
+
}
|
|
1814
|
+
return false;
|
|
1815
|
+
};
|
|
1816
|
+
escapeRef.current = handler;
|
|
1817
|
+
return () => {
|
|
1818
|
+
if (escapeRef.current === handler) escapeRef.current = null;
|
|
1819
|
+
};
|
|
1820
|
+
}, [
|
|
1821
|
+
escapeRef,
|
|
1822
|
+
query,
|
|
1823
|
+
author
|
|
1824
|
+
]);
|
|
1825
|
+
const loadMore = async () => {
|
|
1826
|
+
if (loading || history?.next == null || !history.tip) return;
|
|
1827
|
+
moreRequest.current?.abort();
|
|
1828
|
+
const controller = new AbortController();
|
|
1829
|
+
moreRequest.current = controller;
|
|
1830
|
+
setLoading(true);
|
|
1831
|
+
setError("");
|
|
1832
|
+
const result = await fetchHistory({
|
|
1833
|
+
repoPath,
|
|
1834
|
+
ref: branchRef,
|
|
1835
|
+
tip: history.tip,
|
|
1836
|
+
offset: String(history.next)
|
|
1837
|
+
}, controller.signal);
|
|
1838
|
+
if (controller.signal.aborted) return;
|
|
1839
|
+
setLoading(false);
|
|
1840
|
+
if (result.ok) setHistory({
|
|
1841
|
+
...result,
|
|
1842
|
+
commits: [...history.commits, ...result.commits]
|
|
1843
|
+
});
|
|
1844
|
+
else setError(result.error);
|
|
1845
|
+
};
|
|
1846
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1847
|
+
className: CommitGraph_module_default.panel,
|
|
1848
|
+
"data-commit-history": "",
|
|
1849
|
+
role: "region",
|
|
1850
|
+
"aria-label": t("graphTitle"),
|
|
1851
|
+
children: [
|
|
1852
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1853
|
+
className: CommitGraph_module_default.heading,
|
|
1854
|
+
children: [
|
|
1855
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1856
|
+
className: CommitGraph_module_default.branch,
|
|
1857
|
+
title: branch,
|
|
1858
|
+
children: branch
|
|
1859
|
+
}),
|
|
1860
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1861
|
+
className: CommitGraph_module_default.authorFilter,
|
|
1862
|
+
"aria-label": t("graphAuthorFilter"),
|
|
1863
|
+
value: author,
|
|
1864
|
+
onChange: (event) => setAuthor(event.target.value),
|
|
1865
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1866
|
+
value: "",
|
|
1867
|
+
children: t("graphAllAuthors")
|
|
1868
|
+
}), authors.map((name) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1869
|
+
value: name,
|
|
1870
|
+
children: name
|
|
1871
|
+
}, name))]
|
|
1872
|
+
}),
|
|
1873
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1874
|
+
className: CommitGraph_module_default.search,
|
|
1875
|
+
value: query,
|
|
1876
|
+
onChange: (event) => setQuery(event.target.value),
|
|
1877
|
+
placeholder: t("graphSearchPlaceholder"),
|
|
1878
|
+
"aria-label": t("graphSearch"),
|
|
1879
|
+
spellCheck: false
|
|
1880
|
+
}),
|
|
1881
|
+
history && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1882
|
+
className: CommitGraph_module_default.loaded,
|
|
1883
|
+
title: t("graphLoaded", { count: commits.length }),
|
|
1884
|
+
children: t("graphLoaded", { count: commits.length })
|
|
1885
|
+
}),
|
|
1886
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1887
|
+
type: "button",
|
|
1888
|
+
className: CommitGraph_module_default.iconButton,
|
|
1889
|
+
title: t("graphRefresh"),
|
|
1890
|
+
"aria-label": t("graphRefresh"),
|
|
1891
|
+
disabled: loading,
|
|
1892
|
+
onClick: () => setRevision((value) => value + 1),
|
|
1893
|
+
children: "↻"
|
|
1894
|
+
}),
|
|
1895
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1896
|
+
type: "button",
|
|
1897
|
+
className: CommitGraph_module_default.iconButton,
|
|
1898
|
+
title: t("graphCloseWindow"),
|
|
1899
|
+
"aria-label": t("graphCloseWindow"),
|
|
1900
|
+
onClick: onClose,
|
|
1901
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular, {
|
|
1902
|
+
className: CommitGraph_module_default.closeIcon,
|
|
1903
|
+
size: 12
|
|
1904
|
+
})
|
|
1905
|
+
})
|
|
1906
|
+
]
|
|
1907
|
+
}),
|
|
1908
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1909
|
+
className: CommitGraph_module_default.columns,
|
|
1910
|
+
"aria-hidden": "true",
|
|
1911
|
+
children: [
|
|
1912
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1913
|
+
style: { width: graphWidth },
|
|
1914
|
+
children: t("graphColumn")
|
|
1915
|
+
}),
|
|
1916
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("graphCommit") }),
|
|
1917
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("graphAuthor") }),
|
|
1918
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("graphDate") })
|
|
1919
|
+
]
|
|
1920
|
+
}),
|
|
1921
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1922
|
+
ref: listRef,
|
|
1923
|
+
className: CommitGraph_module_default.list,
|
|
1924
|
+
role: "listbox",
|
|
1925
|
+
"aria-label": t("graphCommits"),
|
|
1926
|
+
"aria-busy": loading,
|
|
1927
|
+
onKeyDown: (event) => {
|
|
1928
|
+
if (![
|
|
1929
|
+
"ArrowDown",
|
|
1930
|
+
"ArrowUp",
|
|
1931
|
+
"Home",
|
|
1932
|
+
"End"
|
|
1933
|
+
].includes(event.key) || !visible.length) return;
|
|
1934
|
+
event.preventDefault();
|
|
1935
|
+
event.stopPropagation();
|
|
1936
|
+
const at = visible.findIndex(({ item }) => item.oid === selectedOid);
|
|
1937
|
+
const next = event.key === "Home" ? 0 : event.key === "End" ? visible.length - 1 : Math.max(0, Math.min(visible.length - 1, at + (event.key === "ArrowDown" ? 1 : -1)));
|
|
1938
|
+
const oid = visible[next]?.item.oid;
|
|
1939
|
+
if (oid) {
|
|
1940
|
+
setSelected(oid);
|
|
1941
|
+
const row = listRef.current?.querySelector(`[data-oid="${oid}"]`);
|
|
1942
|
+
row?.focus();
|
|
1943
|
+
row?.scrollIntoView({ block: "nearest" });
|
|
1944
|
+
}
|
|
1945
|
+
},
|
|
1946
|
+
children: [
|
|
1947
|
+
visible.map(({ item, index }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1948
|
+
type: "button",
|
|
1949
|
+
role: "option",
|
|
1950
|
+
"aria-selected": item.oid === selectedOid,
|
|
1951
|
+
"data-oid": item.oid,
|
|
1952
|
+
tabIndex: item.oid === selectedOid ? 0 : -1,
|
|
1953
|
+
className: `${CommitGraph_module_default.row} ${item.oid === selectedOid ? CommitGraph_module_default.selected : ""}`,
|
|
1954
|
+
onClick: () => setSelected(item.oid),
|
|
1955
|
+
children: [
|
|
1956
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(GraphNode, {
|
|
1957
|
+
row: graph.rows[index] ?? {
|
|
1958
|
+
lane: 0,
|
|
1959
|
+
incoming: false,
|
|
1960
|
+
edges: []
|
|
1961
|
+
},
|
|
1962
|
+
width: graphWidth,
|
|
1963
|
+
filtered
|
|
1964
|
+
}),
|
|
1965
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1966
|
+
className: CommitGraph_module_default.subject,
|
|
1967
|
+
title: item.subject,
|
|
1968
|
+
children: item.subject
|
|
1969
|
+
}),
|
|
1970
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1971
|
+
className: CommitGraph_module_default.author,
|
|
1972
|
+
title: item.author,
|
|
1973
|
+
children: item.author
|
|
1974
|
+
}),
|
|
1975
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", {
|
|
1976
|
+
className: CommitGraph_module_default.date,
|
|
1977
|
+
title: item.date,
|
|
1978
|
+
dateTime: item.date,
|
|
1979
|
+
children: new Date(item.date).toLocaleDateString(void 0, {
|
|
1980
|
+
month: "2-digit",
|
|
1981
|
+
day: "2-digit"
|
|
1982
|
+
})
|
|
1983
|
+
}),
|
|
1984
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
1985
|
+
className: CommitGraph_module_default.hash,
|
|
1986
|
+
children: item.oid.slice(0, 7)
|
|
1987
|
+
})
|
|
1988
|
+
]
|
|
1989
|
+
}, item.oid)),
|
|
1990
|
+
!loading && !visible.length && !error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1991
|
+
className: CommitGraph_module_default.state,
|
|
1992
|
+
children: t(commits.length ? "graphNoMatches" : "graphEmpty")
|
|
1993
|
+
}),
|
|
1994
|
+
loading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1995
|
+
className: CommitGraph_module_default.state,
|
|
1996
|
+
role: "status",
|
|
1997
|
+
children: t("graphLoading")
|
|
1998
|
+
})
|
|
1999
|
+
]
|
|
2000
|
+
}),
|
|
2001
|
+
(error || history?.next != null) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2002
|
+
className: CommitGraph_module_default.footer,
|
|
2003
|
+
children: [
|
|
2004
|
+
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2005
|
+
className: CommitGraph_module_default.error,
|
|
2006
|
+
role: "alert",
|
|
2007
|
+
title: error,
|
|
2008
|
+
children: error
|
|
2009
|
+
}),
|
|
2010
|
+
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2011
|
+
type: "button",
|
|
2012
|
+
className: CommitGraph_module_default.textButton,
|
|
2013
|
+
disabled: loading,
|
|
2014
|
+
onClick: () => history ? void loadMore() : setRevision((value) => value + 1),
|
|
2015
|
+
children: t("graphRetry")
|
|
2016
|
+
}),
|
|
2017
|
+
history?.next != null && !error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2018
|
+
type: "button",
|
|
2019
|
+
className: CommitGraph_module_default.textButton,
|
|
2020
|
+
disabled: loading,
|
|
2021
|
+
onClick: () => void loadMore(),
|
|
2022
|
+
children: t("graphMore")
|
|
2023
|
+
})
|
|
2024
|
+
]
|
|
2025
|
+
}),
|
|
2026
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2027
|
+
ref: detailHost,
|
|
2028
|
+
className: CommitGraph_module_default.detailHost,
|
|
2029
|
+
children: [detail && detail.oid === selectedOid && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Detail, {
|
|
2030
|
+
detail,
|
|
2031
|
+
t
|
|
2032
|
+
}, detail.oid), selectedOid && detail?.oid !== selectedOid && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2033
|
+
className: CommitGraph_module_default.state,
|
|
2034
|
+
role: detailError ? "alert" : "status",
|
|
2035
|
+
children: [detailError || t("graphLoading"), detailError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2036
|
+
type: "button",
|
|
2037
|
+
className: CommitGraph_module_default.textButton,
|
|
2038
|
+
onClick: () => setDetailRevision((value) => value + 1),
|
|
2039
|
+
children: t("graphRetry")
|
|
2040
|
+
})]
|
|
2041
|
+
})]
|
|
2042
|
+
})
|
|
2043
|
+
]
|
|
2044
|
+
});
|
|
2045
|
+
}
|
|
2046
|
+
//#endregion
|
|
1480
2047
|
//#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\BranchChip.module.css?inline
|
|
1481
|
-
const css$3 = "/* Branch chip row inside the composer tool row (conversation.input_2006230319.left_2006230319,\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 (dsh-worktree select, standard\n * mode select, Workspace Write, MiniMax-M3 High). The corners stop short\n * of the base's full pill (24px) so the silhouette stays a chip rather\n * than a capsule, per the design brief. */\n\n/* Shared trigger geometry — copied 1:1 from the base composer triggers\n * (PermissionSelect .trigger_2006230319 / ModelSelect .trigger_2006230319). */\n.dock_2006230319 {\n display: inline-flex;\n align-items: stretch;\n height: 28px;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #81858c);\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n min-height: 28px;\n overflow: hidden;\n}\n\n.chip_2006230319 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n padding: 0 8px 0 8px;\n border: none;\n border-radius: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.chip_2006230319:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.branch_2006230319 {\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 — host 0.1.2 Menu card;\n * hosts without the token fall back to the old r12-era shadow-lv3). Width is content-driven — it follows\n * the longest line (for remote picks that is the subject line's branch\n * name) — floored at 168px (the Cancel/Confirm pair plus padding: short\n * branch names must not squeeze the buttons into wrapping \"切换中…\"\n * mid-word) and capped at 400px; BranchMenu also clamps it inline to the\n * room right of the card. Beyond the cap the lines wrap. border-box so\n * every width arm includes the card chrome. */\n.popCard_2006230319 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1000;\n width: max-content;\n min-width: 168px;\n max-width: min(400px, 80vw);\n padding: 4px;\n border: 0;\n border-radius: 20px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n /* Elevation-prominent carries the hairline stroke; the lv3 fallback\n * keeps a shadow where the token does not exist. */\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.popAsk_2006230319 {\n margin: 0;\n padding: 6px 8px;\n font-size: 13px;\n line-height: 20px;\n color: inherit;\n /* Branch names are long unbroken tokens — plain wrapping would let them\n * overflow the capped card instead of breaking. */\n overflow-wrap: anywhere;\n}\n\n/* Remote confirm's name line: the branch itself, weight 500 like the leaf\n * rows — the subject the ask line refers to (\"该远程分支\"). A dedicated\n * line keeps the long unbroken token away from the sentence, so wraps\n * happen inside the name instead of shredding the Chinese around it. */\n.popSubject_2006230319 {\n margin: 0;\n padding: 0 8px 2px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n color: inherit;\n overflow-wrap: anywhere;\n}\n\n/* The removal confirm's consequence lines (dirty/ahead/archived sessions):\n * subdued one-row facts under the ask, the dirty count alone in the warning\n * tone — mirroring the manager dialog's fact block. */\n.popDetails_2006230319 {\n padding: 0 8px 2px;\n}\n\n.popDetail_2006230319 {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary, rgba(128, 128, 128, 0.9));\n overflow-wrap: anywhere;\n}\n\n.popDetailWarn_2006230319 {\n color: var(--dsw-alias-status-danger, #d5304f);\n}\n\n.popActions_2006230319 {\n display: flex;\n gap: 2px;\n padding: 2px;\n}\n\n/* Menu-row-like buttons: transparent fill, hover tint, same 13px type.\n * nowrap keeps labels like 切换中… from splitting mid-word when the flyout\n * is pinned to its minimum width by a short branch name. */\n.popActions_2006230319 button {\n flex: 1 1 0;\n height: 28px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.popActions_2006230319 button:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.popActions_2006230319 button:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n.popActions_2006230319 button:last-child {\n color: var(--dsw-alias-label-primary-bluish, #4186f0);\n font-weight: 500;\n}\n\n/* ── Branch picker popup (BranchMenu) ──────────────────────────────\n * Upward-opening card pinned above the chip, in the Menu's card chrome\n * (r20, elevation-prominent hairline, --dsw-specific-menu with\n * --dsw-menu-backdrop-filter — host Menu/PermissionSelect card;\n * hosts without the token fall back to shadow-lv3). Three owner requirements shape the geometry:\n *\n * 1. height cap: min(420px, 60vh) on the card, only the rows area\n * scrolls (.menuRows_2006230319) — heading and search stay pinned;\n * 2. the search field sits pinned at the card's bottom edge, directly\n * above the chip, with the scrolling rows above it;\n * 3. the card is CSS-`bottom`-pinned ~6px above the chip's top and so\n * grows entirely upward — it can never cover the composer or fill\n * the viewport, whatever the branch count.\n *\n * The inline `left`/`bottom` come from BranchMenu's placement pass; the\n * width is fixed here (design 360px — 320 tree + 40 tool strip — and\n * viewport-capped) so horizontal clamping stays deterministic without\n * measuring the card. */\n\n/* The portal lands directly under document.body_2006230319, outside the shell's\n * box-sizing reset — content-box default would add padding/border on top\n * of the declared width (360 became 370, and the width:100% children\n * padded 16px past the card's right clip, shearing off their rounded\n * corners). Every width-declared box in this popup opts back into\n * border-box: the card, the toolbar, the rows, and the search input. */\n.menuCard_2006230319 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1000;\n display: flex;\n flex-direction: row;\n width: min(360px, calc(100vw - 24px));\n max-height: min(420px, 60vh);\n overflow: hidden;\n padding: 4px;\n border: 0;\n border-radius: 20px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n /* Same elevation card as .popCard_2006230319 (host 0.1.2 Menu); lv3 fallback\n * for hosts without the token. */\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): a narrow\n * column of icon-only buttons for actions that do not belong in the tree\n * — locate the checked-out branch, expand/collapse the whole tree.\n * Buttons stack from the BOTTOM up: the card's height shrinks when the\n * repo has few branches, so a top-anchored strip would drift around and\n * the buttons would sit far from the search bar; anchoring to the bottom\n * pins them at a stable spot (beside the search row) whatever the height. */\n.menuToolbar_2006230319 {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n gap: 2px;\n flex-shrink: 0;\n width: 32px;\n padding: 0 2px;\n margin-right: 4px;\n border-right: 0.5px solid color-mix(in srgb, currentColor 12%, transparent);\n}\n\n.menuToolButton_2006230319 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n margin: 0 auto;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n}\n\n.menuToolButton_2006230319:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.menuToolButton_2006230319:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n/* The sync tools while their action runs: a soft opacity pulse. The glyph\n * is a directional arrow, so the circular-refresh spin read as garbled\n * rotation — pulsing keeps the arrow legible while clearly \"live\", and the\n * button keeps full opacity (the usual disabled dim would read as broken\n * for an in-flight network operation). */\n.menuToolButtonRunning_2006230319 svg {\n animation: menuToolPulse 700ms ease-in-out infinite alternate;\n}\n\n.menuToolButtonRunning_2006230319:disabled {\n opacity: 1;\n cursor: progress;\n}\n\n@keyframes menuToolPulse {\n from { opacity: 1; }\n to { opacity: 0.25; }\n}\n\n/* The main column: heading + scrollable rows + pinned search. */\n.menuMain_2006230319 {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n}\n\n/* Non-interactive group heading — the Menu label row's posture. */\n.menuHeading_2006230319 {\n padding: 6px 8px 4px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary, #81858c);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 0;\n}\n\n/* The only scrollable region: shrinks within the capped card so the\n * heading above and the search below stay visible while rows scroll. */\n.menuRows_2006230319 {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n}\n\n/* Menu-row-like buttons: transparent fill, hover tint, same 13px type.\n * Weight 500 mirrors the chip's branch label (the portal escapes the\n * composer's font context, so the match must be explicit — the inherited\n * body weight is 400 and reads visibly lighter than the chip beside it). */\n.menuRow_2006230319 {\n box-sizing: border-box; /* width:100% + padding must stay inside .menuRows_2006230319 */\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n min-height: 28px;\n padding: 4px 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n}\n\n.menuRow_2006230319:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The checked-out branch: a persistent tint a step above the resting rows\n * so it reads as \"you are here\" the moment the list scrolls it into view\n * (BranchMenu centers it on open) — the trailing check alone is easy to\n * miss from a distance. */\n.menuRowSelected_2006230319,\n.menuRowSelected_2006230319:hover:not(:disabled) {\n background: color-mix(in srgb, currentColor 10%, transparent);\n}\n\n/* IDEA-style selection: the clicked row gets a bluish fill, layering over\n * the HEAD tint when the same row is both — selection communicates intent,\n * the HEAD tint communicates position, and they coexist (IDEA 4.4). */\n.menuRowPicked_2006230319,\n.menuRowPicked_2006230319:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-label-primary-bluish, #4186f0) 18%, transparent);\n}\n\n.menuRowLabel_2006230319 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* IDEA-style outgoing green / incoming blue marks, including unpublished refs. */\n.menuRowArrow_2006230319 {\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/* Host state tokens first (they follow the active theme and keep text\n * contrast); IDEA's own hues remain the fallback where a token is absent. */\n.menuRowAhead_2006230319 { color: var(--dsw-alias-state-success-primary, #57965c); }\n.menuRowBehind_2006230319 { color: var(--dsw-alias-link, #589df6); }\n.menuRowGone_2006230319 { color: var(--dsw-alias-state-warn-primary, #b58900); }\n.menuRowOutgoing_2006230319 { display: inline-flex; transform: rotate(180deg); }\n\n/* Search hit highlight (IDEA): the matched substring gets a warm tint\n * behind it — theme-agnostic, legible in both light and dark cards. */\n.menuSearchMark_2006230319 {\n background: color-mix(in srgb, #b58900 38%, transparent);\n border-radius: 2px;\n}\n\n/* Tree group rows (folder headers) — BranchMenu's '/' prefix tree: the\n * same row geometry as .menuRow_2006230319, but labeled in the secondary tone so the\n * leaf rows pop, with a count badge and a chevron that turns on expand. */\n.menuGroup_2006230319 {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n min-height: 28px;\n padding: 4px 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #81858c);\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n}\n\n.menuGroup_2006230319:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The two top-level section headers (local/remote branches) step ABOVE the\n * folder headers they contain: primary label tone like the leaf rows plus\n * a heavier weight, so the nav hierarchy reads group > row > folder — the\n * folder headers keep the secondary tone that alone would leave the\n * sections as the faintest (and most important) rows on the list. */\n.menuGroupTop_2006230319 {\n color: inherit;\n font-weight: 600;\n}\n\n.menuGroupLabel_2006230319 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.menuGroupChevron_2006230319 {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 12px;\n transition: transform 120ms ease;\n}\n\n.menuGroupChevronOpen_2006230319 {\n transform: rotate(90deg);\n}\n\n.menuGroupCount_2006230319 {\n flex-shrink: 0;\n font-size: 12px;\n line-height: 20px;\n font-weight: 400;\n color: color-mix(in srgb, currentColor 55%, transparent);\n}\n\n/* Zero-search-hit state: centered secondary line inside the rows area. */\n.menuEmpty_2006230319 {\n padding: 10px 8px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary, #81858c);\n text-align: center;\n}\n\n/* Bottom-pinned search field, separated from the rows by a hairline.\n * Borderless so it reads as part of the card, focus shown as the\n * standard hover tint rather than an outline. */\n.menuSearchWrap_2006230319 {\n flex-shrink: 0;\n margin-top: 2px;\n padding-top: 4px;\n border-top: 0.5px solid color-mix(in srgb, currentColor 12%, transparent);\n}\n\n.menuSearch_2006230319 {\n box-sizing: border-box; /* width:100% + padding must stay inside the wrap */\n width: 100%;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n /* Weight 500 mirrors the chip's branch label (see .menuRow_2006230319) — the portal\n * escapes the composer's font context and would inherit body's 400. */\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuSearch_2006230319::placeholder {\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n.menuSearch_2006230319:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* ── Create/rename flyouts (BranchMenu row context menu) ────────────\n * Open IN PLACE of the row menu (at its point, clamped) and hold the whole\n * flow in one panel: ask line, input, live hint, and the Cancel/confirm\n * pair — typing the name and pressing the button fires in one stroke, no\n * second confirm step. */\n\n/* The naming input inside the flyout: borderless, part of the card, focus\n * shown as the standard hover tint. Fixed width — the popCard is\n * max-content, so a percentage width would chase the input's own default\n * size instead of the design width. */\n.menuCreate_2006230319 {\n box-sizing: border-box;\n width: 248px;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n /* Weight 500 mirrors the chip's branch label (see .menuSearch_2006230319). */\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuCreate_2006230319::placeholder {\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n.menuCreate_2006230319:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.menuCreate_2006230319:disabled {\n opacity: 0.5;\n}\n\n/* The error line under the input — only rendered while the draft is\n * unacceptable with a non-empty reason; the input itself stays neutral,\n * the line carries the state. */\n.menuCreateHintBad_2006230319 {\n margin: 0;\n padding: 0 8px;\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-label-error);\n}\n\n/* ── Row context menu (BranchMenu right-click) ─────────────────────\n * Cursor-anchored transient over the branch card: translucent menu chrome\n * (--dsw-specific-menu with --dsw-menu-backdrop-filter, elevation-prominent hairline,\n * lv3 fallback) at a smaller radius — r20 would round a launcher this\n * short into a pill, r12 keeps the corners proportionate to a handful of\n * rows (two on a worktree row, up to six plus a header on a branch row).\n * Width hugs the widest item\n * (shrink-to-fit, no design width) with a generous cap for safety —\n * a launcher reads better snug than stretched. Positioned once at open\n * and dismissed rather than re-placed when the page moves (see\n * BranchMenu's ctx placement pass); z-index one step above the popCard so\n * it never slides under the confirm flyout. */\n.ctxCard_2006230319 {\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: 12px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\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/* The target row's name, above the verbs. Unlike the items this one holds\n * a branch name, so it is the one line allowed to hit the 280px cap and\n * ellipsize (the full name rides in a title). Secondary tone and no hover\n * affordance: it is a label, not a seventh item. */\n.ctxHeader_2006230319 {\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/* Menu-item rows: the .menuRow_2006230319 geometry at a hair lighter weight — a\n * launcher's labels read as commands, not data. nowrap: the labels are\n * fixed copy (no branch names), the 280px cap is unreachable by design. */\n.ctxItem_2006230319 {\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: 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.ctxItem_2006230319:hover,\n.ctxItem_2006230319:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The running-session withhold (worktree removal): a disabled item stays\n * visible — the reason it is missing lives on its hover title, and a verb\n * that appears and disappears with session state reads as a bug, not a\n * rule. No hover tint, no pointer; the label dims instead of vanishing. */\n.ctxItem_2006230319:disabled {\n cursor: default;\n opacity: 0.45;\n}\n\n.ctxItem_2006230319:disabled:hover {\n background: transparent;\n}\n\n/* The arrow-key walk lands here, so the focused item must read as strongly\n * as a hovered one — the tint above carries it, the default ring would sit\n * outside the 8px radius. */\n.ctxItem_2006230319:focus-visible {\n outline: none;\n}\n\n/* Leading glyph rides the label tone, a step quieter. */\n.ctxItem_2006230319 svg {\n flex-shrink: 0;\n opacity: 0.75;\n}\n\n.ctxItemLabel_2006230319 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n";
|
|
2048
|
+
const css$3 = "/* Branch chip row inside the composer tool row (conversation.input_2006230319.left_2006230319,\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 (dsh-worktree select, standard\n * mode select, Workspace Write, MiniMax-M3 High). The corners stop short\n * of the base's full pill (24px) so the silhouette stays a chip rather\n * than a capsule, per the design brief. */\n\n/* Shared trigger geometry — copied 1:1 from the base composer triggers\n * (PermissionSelect .trigger_2006230319 / ModelSelect .trigger_2006230319). */\n.dock_2006230319 {\n display: inline-flex;\n align-items: stretch;\n height: 28px;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #81858c);\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n min-height: 28px;\n overflow: hidden;\n}\n\n.chip_2006230319 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 100%;\n padding: 0 8px 0 8px;\n border: none;\n border-radius: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.chip_2006230319:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.branch_2006230319 {\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 — host 0.1.2 Menu card;\n * hosts without the token fall back to the old r12-era shadow-lv3). Width is content-driven — it follows\n * the longest line (for remote picks that is the subject line's branch\n * name) — floored at 168px (the Cancel/Confirm pair plus padding: short\n * branch names must not squeeze the buttons into wrapping \"切换中…\"\n * mid-word) and capped at 400px; BranchMenu also clamps it inline to the\n * room right of the card. Beyond the cap the lines wrap. border-box so\n * every width arm includes the card chrome. */\n.popCard_2006230319 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1000;\n width: max-content;\n min-width: 168px;\n max-width: min(400px, 80vw);\n padding: 4px;\n border: 0;\n border-radius: 20px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n /* Elevation-prominent carries the hairline stroke; the lv3 fallback\n * keeps a shadow where the token does not exist. */\n box-shadow: var(--dsw-elevation-prominent, var(--dsw-shadow-lv3));\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.popAsk_2006230319 {\n margin: 0;\n padding: 6px 8px;\n font-size: 13px;\n line-height: 20px;\n color: inherit;\n /* Branch names are long unbroken tokens — plain wrapping would let them\n * overflow the capped card instead of breaking. */\n overflow-wrap: anywhere;\n}\n\n/* Remote confirm's name line: the branch itself, weight 500 like the leaf\n * rows — the subject the ask line refers to (\"该远程分支\"). A dedicated\n * line keeps the long unbroken token away from the sentence, so wraps\n * happen inside the name instead of shredding the Chinese around it. */\n.popSubject_2006230319 {\n margin: 0;\n padding: 0 8px 2px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n color: inherit;\n overflow-wrap: anywhere;\n}\n\n/* The removal confirm's consequence lines (dirty/ahead/archived sessions):\n * subdued one-row facts under the ask, the dirty count alone in the warning\n * tone — mirroring the manager dialog's fact block. */\n.popDetails_2006230319 {\n padding: 0 8px 2px;\n}\n\n.popDetail_2006230319 {\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary, rgba(128, 128, 128, 0.9));\n overflow-wrap: anywhere;\n}\n\n.popDetailWarn_2006230319 {\n color: var(--dsw-alias-status-danger, #d5304f);\n}\n\n.popActions_2006230319 {\n display: flex;\n gap: 2px;\n padding: 2px;\n}\n\n/* Menu-row-like buttons: transparent fill, hover tint, same 13px type.\n * nowrap keeps labels like 切换中… from splitting mid-word when the flyout\n * is pinned to its minimum width by a short branch name. */\n.popActions_2006230319 button {\n flex: 1 1 0;\n height: 28px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.popActions_2006230319 button:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.popActions_2006230319 button:disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n.popActions_2006230319 button:last-child {\n color: var(--dsw-alias-label-primary-bluish, #4186f0);\n font-weight: 500;\n}\n\n/* ── Branch picker popup (BranchMenu) ──────────────────────────────\n * Upward-opening card pinned above the chip, in the Menu's card chrome\n * (r20, elevation-prominent hairline, --dsw-specific-menu with\n * --dsw-menu-backdrop-filter — host Menu/PermissionSelect card;\n * hosts without the token fall back to shadow-lv3). Three owner requirements shape the geometry:\n *\n * 1. height cap: min(420px, 60vh) on the card, only the rows area\n * scrolls (.menuRows_2006230319) — heading and search stay pinned;\n * 2. the search field sits pinned at the card's bottom edge, directly\n * above the chip, with the scrolling rows above it;\n * 3. the card is CSS-`bottom`-pinned ~6px above the chip's top and so\n * grows entirely upward, leaving the chip and bottom controls visible;\n * the text area above those controls may sit behind the popup.\n *\n * The inline `left`/`bottom` come from BranchMenu's placement pass; the\n * width is fixed here (design 360px — 320 tree + 40 tool strip — and\n * viewport-capped) so horizontal clamping stays deterministic without\n * measuring the card. */\n\n/* The portal lands directly under document.body_2006230319, outside the shell's\n * box-sizing reset — content-box default would add padding/border on top\n * of the declared width (360 became 370, and the width:100% children\n * padded 16px past the card's right clip, shearing off their rounded\n * corners). Every width-declared box in this popup opts back into\n * border-box: the card, the toolbar, the rows, and the search input. */\n.menuCard_2006230319 {\n box-sizing: border-box;\n position: fixed;\n z-index: 1000;\n display: flex;\n flex-direction: row;\n width: min(360px, calc(100vw - 24px));\n max-height: min(420px, 60vh);\n overflow: hidden;\n padding: 4px;\n border: 0;\n border-radius: 20px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\n backdrop-filter: var(--dsw-menu-backdrop-filter);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n /* Same elevation card as .popCard_2006230319 (host 0.1.2 Menu); lv3 fallback\n * for hosts without the token. */\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): a narrow\n * column of icon-only buttons for actions that do not belong in the tree\n * — locate the checked-out branch, expand/collapse the whole tree.\n * Buttons stack from the BOTTOM up: the card's height shrinks when the\n * repo has few branches, so a top-anchored strip would drift around and\n * the buttons would sit far from the search bar; anchoring to the bottom\n * pins them at a stable spot (beside the search row) whatever the height. */\n.menuToolbar_2006230319 {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n gap: 2px;\n flex-shrink: 0;\n width: 32px;\n padding: 0 2px;\n margin-right: 4px;\n border-right: 0.5px solid color-mix(in srgb, currentColor 12%, transparent);\n}\n\n.menuToolButton_2006230319 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n margin: 0 auto;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n}\n\n.menuToolButton_2006230319:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.menuToolButton_2006230319:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n/* The sync tools while their action runs: a soft opacity pulse. The glyph\n * is a directional arrow, so the circular-refresh spin read as garbled\n * rotation — pulsing keeps the arrow legible while clearly \"live\", and the\n * button keeps full opacity (the usual disabled dim would read as broken\n * for an in-flight network operation). */\n.menuToolButtonRunning_2006230319 svg {\n animation: menuToolPulse 700ms ease-in-out infinite alternate;\n}\n\n.menuToolButtonRunning_2006230319:disabled {\n opacity: 1;\n cursor: progress;\n}\n\n@keyframes menuToolPulse {\n from { opacity: 1; }\n to { opacity: 0.25; }\n}\n\n/* The main column: heading + scrollable rows + pinned search. */\n.menuMain_2006230319 {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n}\n\n/* Non-interactive group heading — the Menu label row's posture. */\n.menuHeading_2006230319 {\n padding: 6px 8px 4px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary, #81858c);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 0;\n}\n\n/* The only scrollable region: shrinks within the capped card so the\n * heading above and the search below stay visible while rows scroll. */\n.menuRows_2006230319 {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n}\n\n/* Menu-row-like buttons: transparent fill, hover tint, same 13px type.\n * Weight 500 mirrors the chip's branch label (the portal escapes the\n * composer's font context, so the match must be explicit — the inherited\n * body weight is 400 and reads visibly lighter than the chip beside it). */\n.menuRow_2006230319 {\n box-sizing: border-box; /* width:100% + padding must stay inside .menuRows_2006230319 */\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n min-height: 28px;\n padding: 4px 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n}\n\n.menuRow_2006230319:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The checked-out branch: a persistent tint a step above the resting rows\n * so it reads as \"you are here\" the moment the list scrolls it into view\n * (BranchMenu centers it on open) — the trailing check alone is easy to\n * miss from a distance. */\n.menuRowSelected_2006230319,\n.menuRowSelected_2006230319:hover:not(:disabled) {\n background: color-mix(in srgb, currentColor 10%, transparent);\n}\n\n/* IDEA-style selection: the clicked row gets a bluish fill, layering over\n * the HEAD tint when the same row is both — selection communicates intent,\n * the HEAD tint communicates position, and they coexist (IDEA 4.4). */\n.menuRowPicked_2006230319,\n.menuRowPicked_2006230319:hover:not(:disabled) {\n background: color-mix(in srgb, var(--dsw-alias-label-primary-bluish, #4186f0) 18%, transparent);\n}\n\n.menuRowLabel_2006230319 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* IDEA-style outgoing green / incoming blue marks, including unpublished refs. */\n.menuRowArrow_2006230319 {\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/* Host state tokens first (they follow the active theme and keep text\n * contrast); IDEA's own hues remain the fallback where a token is absent. */\n.menuRowAhead_2006230319 { color: var(--dsw-alias-state-success-primary, #57965c); }\n.menuRowBehind_2006230319 { color: var(--dsw-alias-link, #589df6); }\n.menuRowGone_2006230319 { color: var(--dsw-alias-state-warn-primary, #b58900); }\n.menuRowOutgoing_2006230319 { display: inline-flex; transform: rotate(180deg); }\n\n/* Search hit highlight (IDEA): the matched substring gets a warm tint\n * behind it — theme-agnostic, legible in both light and dark cards. */\n.menuSearchMark_2006230319 {\n background: color-mix(in srgb, #b58900 38%, transparent);\n border-radius: 2px;\n}\n\n/* Tree group rows (folder headers) — BranchMenu's '/' prefix tree: the\n * same row geometry as .menuRow_2006230319, but labeled in the secondary tone so the\n * leaf rows pop, with a count badge and a chevron that turns on expand. */\n.menuGroup_2006230319 {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n min-height: 28px;\n padding: 4px 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: var(--dsw-alias-label-secondary, #81858c);\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n cursor: pointer;\n}\n\n.menuGroup_2006230319:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The two top-level section headers (local/remote branches) step ABOVE the\n * folder headers they contain: primary label tone like the leaf rows plus\n * a heavier weight, so the nav hierarchy reads group > row > folder — the\n * folder headers keep the secondary tone that alone would leave the\n * sections as the faintest (and most important) rows on the list. */\n.menuGroupTop_2006230319 {\n color: inherit;\n font-weight: 600;\n}\n\n.menuGroupLabel_2006230319 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.menuGroupChevron_2006230319 {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 12px;\n height: 12px;\n transition: transform 120ms ease;\n}\n\n.menuGroupChevronOpen_2006230319 {\n transform: rotate(90deg);\n}\n\n.menuGroupCount_2006230319 {\n flex-shrink: 0;\n font-size: 12px;\n line-height: 20px;\n font-weight: 400;\n color: color-mix(in srgb, currentColor 55%, transparent);\n}\n\n/* Zero-search-hit state: centered secondary line inside the rows area. */\n.menuEmpty_2006230319 {\n padding: 10px 8px;\n font-size: 13px;\n line-height: 20px;\n color: var(--dsw-alias-label-secondary, #81858c);\n text-align: center;\n}\n\n/* Bottom-pinned search field, separated from the rows by a hairline.\n * Borderless so it reads as part of the card, focus shown as the\n * standard hover tint rather than an outline. */\n.menuSearchWrap_2006230319 {\n flex-shrink: 0;\n margin-top: 2px;\n padding-top: 4px;\n border-top: 0.5px solid color-mix(in srgb, currentColor 12%, transparent);\n}\n\n.menuSearch_2006230319 {\n box-sizing: border-box; /* width:100% + padding must stay inside the wrap */\n width: 100%;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n /* Weight 500 mirrors the chip's branch label (see .menuRow_2006230319) — the portal\n * escapes the composer's font context and would inherit body's 400. */\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuSearch_2006230319::placeholder {\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n.menuSearch_2006230319:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* ── Create/rename flyouts (BranchMenu row context menu) ────────────\n * Open IN PLACE of the row menu (at its point, clamped) and hold the whole\n * flow in one panel: ask line, input, live hint, and the Cancel/confirm\n * pair — typing the name and pressing the button fires in one stroke, no\n * second confirm step. */\n\n/* The naming input inside the flyout: borderless, part of the card, focus\n * shown as the standard hover tint. Fixed width — the popCard is\n * max-content, so a percentage width would chase the input's own default\n * size instead of the design width. */\n.menuCreate_2006230319 {\n box-sizing: border-box;\n width: 248px;\n height: 30px;\n padding: 0 8px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n /* Weight 500 mirrors the chip's branch label (see .menuSearch_2006230319). */\n font-weight: 500;\n line-height: 20px;\n}\n\n.menuCreate_2006230319::placeholder {\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n.menuCreate_2006230319:focus {\n outline: none;\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n.menuCreate_2006230319:disabled {\n opacity: 0.5;\n}\n\n/* The error line under the input — only rendered while the draft is\n * unacceptable with a non-empty reason; the input itself stays neutral,\n * the line carries the state. */\n.menuCreateHintBad_2006230319 {\n margin: 0;\n padding: 0 8px;\n font-size: 12px;\n line-height: 16px;\n color: var(--dsw-alias-label-error);\n}\n\n/* ── Row context menu (BranchMenu right-click) ─────────────────────\n * Cursor-anchored transient over the branch card: translucent menu chrome\n * (--dsw-specific-menu with --dsw-menu-backdrop-filter, elevation-prominent hairline,\n * lv3 fallback) at a smaller radius — r20 would round a launcher this\n * short into a pill, r12 keeps the corners proportionate to a handful of\n * rows (two on a worktree row, up to six plus a header on a branch row).\n * Width hugs the widest item\n * (shrink-to-fit, no design width) with a generous cap for safety —\n * a launcher reads better snug than stretched. Positioned once at open\n * and dismissed rather than re-placed when the page moves (see\n * BranchMenu's ctx placement pass); z-index one step above the popCard so\n * it never slides under the confirm flyout. */\n.ctxCard_2006230319 {\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: 12px;\n background: var(--dsw-specific-menu, var(--dsw-alias-surface-raised, #ffffff));\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/* The target row's name, above the verbs. Unlike the items this one holds\n * a branch name, so it is the one line allowed to hit the 280px cap and\n * ellipsize (the full name rides in a title). Secondary tone and no hover\n * affordance: it is a label, not a seventh item. */\n.ctxHeader_2006230319 {\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/* Menu-item rows: the .menuRow_2006230319 geometry at a hair lighter weight — a\n * launcher's labels read as commands, not data. nowrap: the labels are\n * fixed copy (no branch names), the 280px cap is unreachable by design. */\n.ctxItem_2006230319 {\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: 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.ctxItem_2006230319:hover,\n.ctxItem_2006230319:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n}\n\n/* The running-session withhold (worktree removal): a disabled item stays\n * visible — the reason it is missing lives on its hover title, and a verb\n * that appears and disappears with session state reads as a bug, not a\n * rule. No hover tint, no pointer; the label dims instead of vanishing. */\n.ctxItem_2006230319:disabled {\n cursor: default;\n opacity: 0.45;\n}\n\n.ctxItem_2006230319:disabled:hover {\n background: transparent;\n}\n\n/* The arrow-key walk lands here, so the focused item must read as strongly\n * as a hovered one — the tint above carries it, the default ring would sit\n * outside the 8px radius. */\n.ctxItem_2006230319:focus-visible {\n outline: none;\n}\n\n/* Leading glyph rides the label tone, a step quieter. */\n.ctxItem_2006230319 svg {\n flex-shrink: 0;\n opacity: 0.75;\n}\n\n.ctxItemLabel_2006230319 {\n flex: 1 1 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.menuCard_2006230319.menuCardGraph_2006230319 {\n width: min(1060px, calc(100vw - 24px));\n height: 700px;\n}\n.menuCardGraph_2006230319 .menuMain_2006230319 { flex: 0 0 236px; }\n.menuToolActive_2006230319 { color: var(--dsw-alias-label-primary-bluish, #4186f0); background: color-mix(in srgb, var(--dsw-alias-label-primary-bluish, #4186f0) 12%, transparent); }\n@media (max-width: 800px) { .menuCardGraph_2006230319 .menuMain_2006230319 { flex-basis: 180px; } }\n@media (max-width: 560px) { .menuCardGraph_2006230319 .menuMain_2006230319 { flex-basis: 128px; } }\n";
|
|
1482
2049
|
const tagId$3 = "@laoyuehanni/dsh-git-worktree/BranchChip.module.css";
|
|
1483
2050
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"" + tagId$3 + "\"]") === null) {
|
|
1484
2051
|
const tag = document.createElement("style");
|
|
@@ -1533,7 +2100,9 @@ window.__ModuleLoader__.load({
|
|
|
1533
2100
|
"ctxCard": "ctxCard_2006230319",
|
|
1534
2101
|
"ctxHeader": "ctxHeader_2006230319",
|
|
1535
2102
|
"ctxItem": "ctxItem_2006230319",
|
|
1536
|
-
"ctxItemLabel": "ctxItemLabel_2006230319"
|
|
2103
|
+
"ctxItemLabel": "ctxItemLabel_2006230319",
|
|
2104
|
+
"menuCardGraph": "menuCardGraph_2006230319",
|
|
2105
|
+
"menuToolActive": "menuToolActive_2006230319"
|
|
1537
2106
|
};
|
|
1538
2107
|
//#endregion
|
|
1539
2108
|
//#region src/client/BranchMenu.tsx
|
|
@@ -1785,8 +2354,21 @@ window.__ModuleLoader__.load({
|
|
|
1785
2354
|
* @param props - anchor, rows, confirm bundle, callbacks, and the class sheet.
|
|
1786
2355
|
* @returns null while closed or unplaced; otherwise the portaled card (+flyout).
|
|
1787
2356
|
*/
|
|
1788
|
-
function BranchMenu({ open, anchorRef, rows, currentBranch, confirm, onSelect, canCreate, canAdopt, canWorktree, onWorktree, onCutWorktree, onRemoveWorktree, worktreeRemovalBlocked, onCreate, onRename, onDelete, busy, onFetch, fetchBusy, onUpdate, onPush, hasRemotes, updateBusy, onClose, t }) {
|
|
2357
|
+
function BranchMenu({ open, repoPath, anchorRef, rows, currentBranch, confirm, onSelect, canCreate, canAdopt, canWorktree, onWorktree, onCutWorktree, onRemoveWorktree, worktreeRemovalBlocked, onCreate, onRename, onDelete, busy, onFetch, fetchBusy, onUpdate, onPush, hasRemotes, updateBusy, onClose, t }) {
|
|
1789
2358
|
const cardRef = (0, react.useRef)(null);
|
|
2359
|
+
const [graphOpen, setGraphOpen] = (0, react.useState)(false);
|
|
2360
|
+
const graphOpenRef = (0, react.useRef)(graphOpen);
|
|
2361
|
+
graphOpenRef.current = graphOpen;
|
|
2362
|
+
const graphEscapeRef = (0, react.useRef)(null);
|
|
2363
|
+
const graphAnimationRef = (0, react.useRef)(null);
|
|
2364
|
+
const graphStartRectRef = (0, react.useRef)(null);
|
|
2365
|
+
const changeGraphOpen = (0, react.useCallback)((value) => {
|
|
2366
|
+
if (value === graphOpenRef.current) return;
|
|
2367
|
+
graphStartRectRef.current = cardRef.current?.getBoundingClientRect() ?? null;
|
|
2368
|
+
graphAnimationRef.current?.cancel();
|
|
2369
|
+
graphAnimationRef.current = null;
|
|
2370
|
+
setGraphOpen(value);
|
|
2371
|
+
}, []);
|
|
1790
2372
|
const inputRef = (0, react.useRef)(null);
|
|
1791
2373
|
/**
|
|
1792
2374
|
* Search-field ref callback: focus the field the moment it mounts. The
|
|
@@ -1983,6 +2565,9 @@ window.__ModuleLoader__.load({
|
|
|
1983
2565
|
if (remote !== void 0) return remote;
|
|
1984
2566
|
return null;
|
|
1985
2567
|
};
|
|
2568
|
+
const browsingRow = selected === null ? null : findRow(selected);
|
|
2569
|
+
const browsingBranch = browsingRow?.kind === "remote" ? grouped.remoteNameMap.get(browsingRow.name) ?? browsingRow.name : browsingRow?.name ?? currentBranch;
|
|
2570
|
+
const browsingRef = browsingRow?.kind === "remote" ? `refs/remotes/${browsingBranch}` : browsingBranch && browsingBranch !== "HEAD" ? `refs/heads/${browsingBranch}` : "HEAD";
|
|
1986
2571
|
/** Every folder key that renders a header — the expand/collapse-all
|
|
1987
2572
|
* button's scope (group-prefixed, see groupKey). */
|
|
1988
2573
|
const folderPaths = (0, react.useMemo)(() => [...collectFolderPaths(localTree).map((p) => groupKey("local", p)), ...collectFolderPaths(remoteTree).map((p) => groupKey("remote", p))], [localTree, remoteTree]);
|
|
@@ -2026,8 +2611,12 @@ window.__ModuleLoader__.load({
|
|
|
2026
2611
|
setExpanded(many ? new Set([...chainExpanded(currentBranchRef.current)].map((p) => groupKey("local", p))) : /* @__PURE__ */ new Set([...localPaths, ...remotePaths]));
|
|
2027
2612
|
}, [open]);
|
|
2028
2613
|
(0, react.useEffect)(() => {
|
|
2029
|
-
if (selected !== null && !rows.some((r) => r.name === selected)) setSelected(null);
|
|
2030
|
-
}, [
|
|
2614
|
+
if (selected !== null && !rows.some((r) => r.name === selected) && !grouped.remoteNameMap.has(selected)) setSelected(null);
|
|
2615
|
+
}, [
|
|
2616
|
+
rows,
|
|
2617
|
+
selected,
|
|
2618
|
+
grouped.remoteNameMap
|
|
2619
|
+
]);
|
|
2031
2620
|
/** Toggle one folder header. */
|
|
2032
2621
|
const toggle = (path) => {
|
|
2033
2622
|
setExpanded((prev) => {
|
|
@@ -2043,26 +2632,89 @@ window.__ModuleLoader__.load({
|
|
|
2043
2632
|
setCtx(null);
|
|
2044
2633
|
return;
|
|
2045
2634
|
}
|
|
2635
|
+
let previousBounds = "";
|
|
2046
2636
|
const place = () => {
|
|
2047
2637
|
const anchor = anchorRef.current;
|
|
2048
2638
|
if (anchor === null) return;
|
|
2049
2639
|
const rect = anchor.getBoundingClientRect();
|
|
2050
2640
|
const vw = window.innerWidth;
|
|
2051
2641
|
const vh = window.innerHeight;
|
|
2052
|
-
const
|
|
2642
|
+
const bounds = anchor.closest("[data-composer-card]")?.getBoundingClientRect() ?? rect;
|
|
2643
|
+
const lowerEdge = Math.min(vh - MARGIN, rect.top - GAP);
|
|
2644
|
+
const nextBounds = [
|
|
2645
|
+
vw,
|
|
2646
|
+
vh,
|
|
2647
|
+
rect.left,
|
|
2648
|
+
rect.top,
|
|
2649
|
+
bounds.left,
|
|
2650
|
+
bounds.width
|
|
2651
|
+
].join(":");
|
|
2652
|
+
if (nextBounds !== previousBounds) {
|
|
2653
|
+
graphAnimationRef.current?.cancel();
|
|
2654
|
+
graphAnimationRef.current = null;
|
|
2655
|
+
previousBounds = nextBounds;
|
|
2656
|
+
}
|
|
2657
|
+
if (graphOpen) {
|
|
2658
|
+
const width = Math.max(0, Math.min(1060, bounds.width, vw - 24));
|
|
2659
|
+
const height = Math.max(0, Math.min(700, lowerEdge - MARGIN));
|
|
2660
|
+
const left = Math.min(Math.max(bounds.left + (bounds.width - width) / 2, MARGIN), Math.max(MARGIN, vw - width - MARGIN));
|
|
2661
|
+
setPos({
|
|
2662
|
+
left,
|
|
2663
|
+
width,
|
|
2664
|
+
height,
|
|
2665
|
+
bottom: vh - lowerEdge
|
|
2666
|
+
});
|
|
2667
|
+
return;
|
|
2668
|
+
}
|
|
2669
|
+
const width = CARD_WIDTH;
|
|
2670
|
+
const left = Math.min(Math.max(rect.left, MARGIN), Math.max(MARGIN, vw - width - MARGIN));
|
|
2053
2671
|
setPos({
|
|
2054
2672
|
left,
|
|
2055
|
-
bottom: vh -
|
|
2673
|
+
bottom: vh - lowerEdge
|
|
2056
2674
|
});
|
|
2057
2675
|
};
|
|
2058
2676
|
place();
|
|
2677
|
+
const observer = new ResizeObserver(place);
|
|
2678
|
+
const composer = anchorRef.current?.closest("[data-composer-card]");
|
|
2679
|
+
const conversation = anchorRef.current?.closest("[data-conversation-content]");
|
|
2680
|
+
if (composer) observer.observe(composer);
|
|
2681
|
+
if (conversation) observer.observe(conversation);
|
|
2059
2682
|
window.addEventListener("resize", place);
|
|
2060
2683
|
window.addEventListener("scroll", place, true);
|
|
2061
2684
|
return () => {
|
|
2685
|
+
observer.disconnect();
|
|
2062
2686
|
window.removeEventListener("resize", place);
|
|
2063
2687
|
window.removeEventListener("scroll", place, true);
|
|
2064
2688
|
};
|
|
2065
|
-
}, [
|
|
2689
|
+
}, [
|
|
2690
|
+
open,
|
|
2691
|
+
anchorRef,
|
|
2692
|
+
graphOpen
|
|
2693
|
+
]);
|
|
2694
|
+
(0, react.useLayoutEffect)(() => {
|
|
2695
|
+
const from = graphStartRectRef.current;
|
|
2696
|
+
graphStartRectRef.current = null;
|
|
2697
|
+
const card = cardRef.current;
|
|
2698
|
+
if (!open || !from || !card || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
2699
|
+
const to = card.getBoundingClientRect();
|
|
2700
|
+
const frame = (rect) => ({
|
|
2701
|
+
left: `${rect.left}px`,
|
|
2702
|
+
width: `${rect.width}px`,
|
|
2703
|
+
bottom: `${window.innerHeight - rect.bottom}px`,
|
|
2704
|
+
height: `${rect.height}px`,
|
|
2705
|
+
maxHeight: `${rect.height}px`
|
|
2706
|
+
});
|
|
2707
|
+
graphAnimationRef.current = card.animate([frame(from), frame(to)], {
|
|
2708
|
+
id: "dsh-branch-graph",
|
|
2709
|
+
duration: 220,
|
|
2710
|
+
easing: "ease"
|
|
2711
|
+
});
|
|
2712
|
+
}, [pos, open]);
|
|
2713
|
+
(0, react.useLayoutEffect)(() => () => {
|
|
2714
|
+
graphAnimationRef.current?.cancel();
|
|
2715
|
+
graphAnimationRef.current = null;
|
|
2716
|
+
graphStartRectRef.current = null;
|
|
2717
|
+
}, [open]);
|
|
2066
2718
|
const rowsRef = (0, react.useRef)(null);
|
|
2067
2719
|
const centerCurrentRow = (0, react.useCallback)((viewport) => {
|
|
2068
2720
|
const row = [...viewport.querySelectorAll("button[role=\"menuitem\"][data-branch]")].find((b) => (b.dataset.branch ?? "") === currentBranch);
|
|
@@ -2190,6 +2842,11 @@ window.__ModuleLoader__.load({
|
|
|
2190
2842
|
setRenaming(null);
|
|
2191
2843
|
return;
|
|
2192
2844
|
}
|
|
2845
|
+
if (graphOpenRef.current && graphEscapeRef.current?.()) {
|
|
2846
|
+
event.preventDefault();
|
|
2847
|
+
event.stopPropagation();
|
|
2848
|
+
return;
|
|
2849
|
+
}
|
|
2193
2850
|
if (queryRef.current.trim() !== "") {
|
|
2194
2851
|
setQuery("");
|
|
2195
2852
|
return;
|
|
@@ -2204,6 +2861,7 @@ window.__ModuleLoader__.load({
|
|
|
2204
2861
|
const card = cardRef.current;
|
|
2205
2862
|
const active = document.activeElement;
|
|
2206
2863
|
if (card === null || active === null || !card.contains(active)) return;
|
|
2864
|
+
if (active.closest("[data-commit-history]") !== null || active.closest("[role=\"toolbar\"]") !== null) return;
|
|
2207
2865
|
if (ctxStateRef.current !== null) return;
|
|
2208
2866
|
const leaves = [...card.querySelectorAll("button[role=\"menuitem\"][data-branch]")];
|
|
2209
2867
|
const isSearchInput = inputRef.current !== null && active === inputRef.current;
|
|
@@ -2246,7 +2904,8 @@ window.__ModuleLoader__.load({
|
|
|
2246
2904
|
},
|
|
2247
2905
|
onPick: (branch) => {
|
|
2248
2906
|
const el = leaves.find((b) => (b.dataset.branch ?? "") === branch) ?? buttonOf(branch);
|
|
2249
|
-
|
|
2907
|
+
if (graphOpenRef.current) setSelected(branch);
|
|
2908
|
+
else pickRef.current(el, branch);
|
|
2250
2909
|
},
|
|
2251
2910
|
onSelect: (branch) => {
|
|
2252
2911
|
setSelected(branch);
|
|
@@ -2412,7 +3071,10 @@ window.__ModuleLoader__.load({
|
|
|
2412
3071
|
* `el` is nullable like {@link pick}'s anchor: a row whose button is
|
|
2413
3072
|
* already unmounted still selects/picks, it just re-anchors nothing. */
|
|
2414
3073
|
const rowClick = (el, name) => {
|
|
2415
|
-
if (
|
|
3074
|
+
if (graphOpen) {
|
|
3075
|
+
confirmRef.current?.onCancel();
|
|
3076
|
+
setSelected(name);
|
|
3077
|
+
} else if (confirmOpen) pick(el, name);
|
|
2416
3078
|
else setSelected(name);
|
|
2417
3079
|
};
|
|
2418
3080
|
/** Shared row pointer wiring — the three render shapes (tree leaf, flat
|
|
@@ -2976,108 +3638,164 @@ window.__ModuleLoader__.load({
|
|
|
2976
3638
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
2977
3639
|
(0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2978
3640
|
ref: cardRef,
|
|
2979
|
-
className: BranchChip_module_default.menuCard
|
|
3641
|
+
className: `${BranchChip_module_default.menuCard} ${graphOpen ? BranchChip_module_default.menuCardGraph : ""}`,
|
|
2980
3642
|
style: {
|
|
2981
3643
|
left: pos.left,
|
|
2982
|
-
bottom: pos.bottom
|
|
3644
|
+
bottom: pos.bottom,
|
|
3645
|
+
width: graphOpen ? pos.width : void 0,
|
|
3646
|
+
height: graphOpen ? pos.height : void 0,
|
|
3647
|
+
maxHeight: graphOpen ? pos.height : `max(0px, min(420px, 60vh, calc(100dvh - ${pos.bottom + MARGIN}px)))`
|
|
2983
3648
|
},
|
|
2984
|
-
role: "menu",
|
|
3649
|
+
role: graphOpen ? "dialog" : "menu",
|
|
2985
3650
|
"aria-label": t("menuBranches"),
|
|
2986
|
-
children: [
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
disabled: busy || fetchBusy,
|
|
3005
|
-
onClick: () => {
|
|
3006
|
-
confirmRef.current?.onCancel();
|
|
3007
|
-
onUpdate();
|
|
3008
|
-
},
|
|
3009
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FetchGlyph, { dashed: false })
|
|
3010
|
-
}),
|
|
3011
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3012
|
-
type: "button",
|
|
3013
|
-
className: fetchBusy ? `${BranchChip_module_default.menuToolButton} ${BranchChip_module_default.menuToolButtonRunning}` : BranchChip_module_default.menuToolButton,
|
|
3014
|
-
title: t("menuFetch"),
|
|
3015
|
-
"aria-label": t("menuFetch"),
|
|
3016
|
-
disabled: busy || updateBusy,
|
|
3017
|
-
onClick: () => {
|
|
3018
|
-
confirmRef.current?.onCancel();
|
|
3019
|
-
onFetch();
|
|
3020
|
-
},
|
|
3021
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FetchGlyph, {})
|
|
3022
|
-
}),
|
|
3023
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3024
|
-
type: "button",
|
|
3025
|
-
className: BranchChip_module_default.menuToolButton,
|
|
3026
|
-
title: allExpanded ? t("menuCollapseAll") : t("menuExpandAll"),
|
|
3027
|
-
"aria-label": allExpanded ? t("menuCollapseAll") : t("menuExpandAll"),
|
|
3028
|
-
disabled: rows.length === 0 || needle !== "",
|
|
3029
|
-
onClick: toggleAll,
|
|
3030
|
-
children: allExpanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronUpOutlineRegular, { size: 14 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { size: 14 })
|
|
3031
|
-
})
|
|
3032
|
-
]
|
|
3033
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3034
|
-
className: BranchChip_module_default.menuMain,
|
|
3035
|
-
children: [
|
|
3036
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3037
|
-
className: BranchChip_module_default.menuHeading,
|
|
3038
|
-
children: t("menuBranches")
|
|
3039
|
-
}),
|
|
3040
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3041
|
-
className: BranchChip_module_default.menuRows,
|
|
3042
|
-
role: "presentation",
|
|
3043
|
-
ref: holdRowsCenter,
|
|
3044
|
-
children: [needle === "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3045
|
-
grouped.localRows.length > 0 && renderGroupHeader(t("menuLocalBranches"), grouped.localRows.length, localGroupOpen, () => setLocalGroupOpen((value) => !value)),
|
|
3046
|
-
localGroupOpen && renderTree(localTree, 1, "local:"),
|
|
3047
|
-
pickableWorktreeRows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderGroupHeader(t("menuWorktrees"), pickableWorktreeRows.length, worktreeGroupOpen, () => setWorktreeGroupOpen((value) => !value)), worktreeGroupOpen && pickableWorktreeRows.map((row) => renderFlatLeaf(row, "worktree:"))] }),
|
|
3048
|
-
grouped.remoteDisplayRows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderGroupHeader(t("menuRemoteBranches"), grouped.remoteDisplayRows.length, remoteGroupOpen, () => setRemoteGroupOpen((value) => !value)), remoteGroupOpen && renderTree(remoteTree, 1, "remote:")] })
|
|
3049
|
-
] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3050
|
-
grouped.localRows.some((row) => row.name.toLowerCase().includes(needle)) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderGroupHeader(t("menuLocalBranches"), searchLeafCount(localTree), true), renderSearch(localTree, 1, "local:")] }),
|
|
3051
|
-
pickableWorktreeRows.some((row) => row.name.toLowerCase().includes(needle)) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderGroupHeader(t("menuWorktrees"), pickableWorktreeRows.filter((row) => row.name.toLowerCase().includes(needle)).length, true), pickableWorktreeRows.filter((row) => row.name.toLowerCase().includes(needle)).map((row) => renderFlatLeaf(row, "worktree:"))] }),
|
|
3052
|
-
grouped.remoteDisplayRows.some((row) => row.name.toLowerCase().includes(needle)) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderGroupHeader(t("menuRemoteBranches"), searchLeafCount(remoteTree), true), renderSearch(remoteTree, 1, "remote:")] })
|
|
3053
|
-
] }), visible.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3054
|
-
className: BranchChip_module_default.menuEmpty,
|
|
3055
|
-
children: rows.length === 0 ? t("menuNoBranches") : t("menuNoMatches")
|
|
3056
|
-
})]
|
|
3057
|
-
}),
|
|
3058
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3059
|
-
className: BranchChip_module_default.menuSearchWrap,
|
|
3060
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3061
|
-
ref: holdSearchFocus,
|
|
3062
|
-
className: BranchChip_module_default.menuSearch,
|
|
3063
|
-
type: "text",
|
|
3064
|
-
value: query,
|
|
3065
|
-
placeholder: t("menuSearchPlaceholder"),
|
|
3066
|
-
"aria-label": t("menuSearchPlaceholder"),
|
|
3067
|
-
spellCheck: false,
|
|
3068
|
-
onChange: (event) => {
|
|
3069
|
-
setQuery(event.target.value);
|
|
3651
|
+
children: [
|
|
3652
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3653
|
+
className: BranchChip_module_default.menuToolbar,
|
|
3654
|
+
role: "toolbar",
|
|
3655
|
+
"aria-label": t("menuBranches"),
|
|
3656
|
+
children: [
|
|
3657
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3658
|
+
type: "button",
|
|
3659
|
+
className: `${BranchChip_module_default.menuToolButton} ${graphOpen ? BranchChip_module_default.menuToolActive : ""}`,
|
|
3660
|
+
title: t(graphOpen ? "graphToggleClose" : "graphToggleOpen"),
|
|
3661
|
+
"aria-label": t(graphOpen ? "graphToggleClose" : "graphToggleOpen"),
|
|
3662
|
+
"aria-pressed": graphOpen,
|
|
3663
|
+
onClick: () => {
|
|
3664
|
+
confirmRef.current?.onCancel();
|
|
3665
|
+
setCreating(false);
|
|
3666
|
+
setRenaming(null);
|
|
3667
|
+
setCtx(null);
|
|
3668
|
+
changeGraphOpen(!graphOpen);
|
|
3070
3669
|
},
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3670
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
3671
|
+
width: "16",
|
|
3672
|
+
height: "16",
|
|
3673
|
+
viewBox: "0 0 16 16",
|
|
3674
|
+
fill: "none",
|
|
3675
|
+
stroke: "currentColor",
|
|
3676
|
+
strokeWidth: "1.4",
|
|
3677
|
+
"aria-hidden": "true",
|
|
3678
|
+
children: [
|
|
3679
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 4v8M12 4v2c0 3-8 1-8 5" }),
|
|
3680
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
3681
|
+
cx: "4",
|
|
3682
|
+
cy: "3",
|
|
3683
|
+
r: "1.8"
|
|
3684
|
+
}),
|
|
3685
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
3686
|
+
cx: "4",
|
|
3687
|
+
cy: "13",
|
|
3688
|
+
r: "1.8"
|
|
3689
|
+
}),
|
|
3690
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
3691
|
+
cx: "12",
|
|
3692
|
+
cy: "3",
|
|
3693
|
+
r: "1.8"
|
|
3694
|
+
})
|
|
3695
|
+
]
|
|
3696
|
+
})
|
|
3697
|
+
}),
|
|
3698
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3699
|
+
type: "button",
|
|
3700
|
+
className: BranchChip_module_default.menuToolButton,
|
|
3701
|
+
title: t("menuLocate"),
|
|
3702
|
+
"aria-label": t("menuLocate"),
|
|
3703
|
+
onClick: locateCurrent,
|
|
3704
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconGoalOutlineRegular, { size: 16 })
|
|
3705
|
+
}),
|
|
3706
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3707
|
+
type: "button",
|
|
3708
|
+
className: updateBusy ? `${BranchChip_module_default.menuToolButton} ${BranchChip_module_default.menuToolButtonRunning}` : BranchChip_module_default.menuToolButton,
|
|
3709
|
+
title: t("menuUpdate"),
|
|
3710
|
+
"aria-label": t("menuUpdate"),
|
|
3711
|
+
disabled: busy || fetchBusy,
|
|
3712
|
+
onClick: () => {
|
|
3713
|
+
confirmRef.current?.onCancel();
|
|
3714
|
+
onUpdate();
|
|
3715
|
+
},
|
|
3716
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FetchGlyph, { dashed: false })
|
|
3717
|
+
}),
|
|
3718
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3719
|
+
type: "button",
|
|
3720
|
+
className: fetchBusy ? `${BranchChip_module_default.menuToolButton} ${BranchChip_module_default.menuToolButtonRunning}` : BranchChip_module_default.menuToolButton,
|
|
3721
|
+
title: t("menuFetch"),
|
|
3722
|
+
"aria-label": t("menuFetch"),
|
|
3723
|
+
disabled: busy || updateBusy,
|
|
3724
|
+
onClick: () => {
|
|
3725
|
+
confirmRef.current?.onCancel();
|
|
3726
|
+
onFetch();
|
|
3727
|
+
},
|
|
3728
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FetchGlyph, {})
|
|
3729
|
+
}),
|
|
3730
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3731
|
+
type: "button",
|
|
3732
|
+
className: BranchChip_module_default.menuToolButton,
|
|
3733
|
+
title: allExpanded ? t("menuCollapseAll") : t("menuExpandAll"),
|
|
3734
|
+
"aria-label": allExpanded ? t("menuCollapseAll") : t("menuExpandAll"),
|
|
3735
|
+
disabled: rows.length === 0 || needle !== "",
|
|
3736
|
+
onClick: toggleAll,
|
|
3737
|
+
children: allExpanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronUpOutlineRegular, { size: 14 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { size: 14 })
|
|
3738
|
+
})
|
|
3739
|
+
]
|
|
3740
|
+
}),
|
|
3741
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3742
|
+
className: BranchChip_module_default.menuMain,
|
|
3743
|
+
children: [
|
|
3744
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3745
|
+
className: BranchChip_module_default.menuHeading,
|
|
3746
|
+
children: t("menuBranches")
|
|
3747
|
+
}),
|
|
3748
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3749
|
+
className: BranchChip_module_default.menuRows,
|
|
3750
|
+
role: "presentation",
|
|
3751
|
+
ref: holdRowsCenter,
|
|
3752
|
+
children: [needle === "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3753
|
+
grouped.localRows.length > 0 && renderGroupHeader(t("menuLocalBranches"), grouped.localRows.length, localGroupOpen, () => setLocalGroupOpen((value) => !value)),
|
|
3754
|
+
localGroupOpen && renderTree(localTree, 1, "local:"),
|
|
3755
|
+
pickableWorktreeRows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderGroupHeader(t("menuWorktrees"), pickableWorktreeRows.length, worktreeGroupOpen, () => setWorktreeGroupOpen((value) => !value)), worktreeGroupOpen && pickableWorktreeRows.map((row) => renderFlatLeaf(row, "worktree:"))] }),
|
|
3756
|
+
grouped.remoteDisplayRows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderGroupHeader(t("menuRemoteBranches"), grouped.remoteDisplayRows.length, remoteGroupOpen, () => setRemoteGroupOpen((value) => !value)), remoteGroupOpen && renderTree(remoteTree, 1, "remote:")] })
|
|
3757
|
+
] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
3758
|
+
grouped.localRows.some((row) => row.name.toLowerCase().includes(needle)) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderGroupHeader(t("menuLocalBranches"), searchLeafCount(localTree), true), renderSearch(localTree, 1, "local:")] }),
|
|
3759
|
+
pickableWorktreeRows.some((row) => row.name.toLowerCase().includes(needle)) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderGroupHeader(t("menuWorktrees"), pickableWorktreeRows.filter((row) => row.name.toLowerCase().includes(needle)).length, true), pickableWorktreeRows.filter((row) => row.name.toLowerCase().includes(needle)).map((row) => renderFlatLeaf(row, "worktree:"))] }),
|
|
3760
|
+
grouped.remoteDisplayRows.some((row) => row.name.toLowerCase().includes(needle)) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [renderGroupHeader(t("menuRemoteBranches"), searchLeafCount(remoteTree), true), renderSearch(remoteTree, 1, "remote:")] })
|
|
3761
|
+
] }), visible.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3762
|
+
className: BranchChip_module_default.menuEmpty,
|
|
3763
|
+
children: rows.length === 0 ? t("menuNoBranches") : t("menuNoMatches")
|
|
3764
|
+
})]
|
|
3765
|
+
}),
|
|
3766
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3767
|
+
className: BranchChip_module_default.menuSearchWrap,
|
|
3768
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3769
|
+
ref: holdSearchFocus,
|
|
3770
|
+
className: BranchChip_module_default.menuSearch,
|
|
3771
|
+
type: "text",
|
|
3772
|
+
value: query,
|
|
3773
|
+
placeholder: t("menuSearchPlaceholder"),
|
|
3774
|
+
"aria-label": t("menuSearchPlaceholder"),
|
|
3775
|
+
spellCheck: false,
|
|
3776
|
+
onChange: (event) => {
|
|
3777
|
+
setQuery(event.target.value);
|
|
3778
|
+
},
|
|
3779
|
+
onKeyDown: (event) => {
|
|
3780
|
+
if (event.key === "Enter" && !event.altKey) {
|
|
3781
|
+
event.preventDefault();
|
|
3782
|
+
if (graphOpen) setSelected(visible[0]?.name ?? null);
|
|
3783
|
+
else commitFirst();
|
|
3784
|
+
}
|
|
3075
3785
|
}
|
|
3076
|
-
}
|
|
3786
|
+
})
|
|
3077
3787
|
})
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3788
|
+
]
|
|
3789
|
+
}),
|
|
3790
|
+
graphOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommitGraph, {
|
|
3791
|
+
repoPath,
|
|
3792
|
+
branchRef: browsingRef,
|
|
3793
|
+
branch: browsingBranch || "HEAD",
|
|
3794
|
+
escapeRef: graphEscapeRef,
|
|
3795
|
+
t,
|
|
3796
|
+
onClose
|
|
3797
|
+
}, `${repoPath}:${browsingRef}`)
|
|
3798
|
+
]
|
|
3081
3799
|
}), document.body),
|
|
3082
3800
|
confirm !== null && (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3083
3801
|
ref: flyRef,
|
|
@@ -4389,6 +5107,7 @@ window.__ModuleLoader__.load({
|
|
|
4389
5107
|
}),
|
|
4390
5108
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BranchMenu, {
|
|
4391
5109
|
open: menuOpen,
|
|
5110
|
+
repoPath: cwd ?? facts.repoRoot,
|
|
4392
5111
|
anchorRef: chipRef,
|
|
4393
5112
|
rows,
|
|
4394
5113
|
currentBranch: facts.currentBranch,
|
|
@@ -5736,6 +6455,33 @@ window.__ModuleLoader__.load({
|
|
|
5736
6455
|
//#region src/client/locales.ts
|
|
5737
6456
|
/** English dictionary — complete by construction. */
|
|
5738
6457
|
const en = {
|
|
6458
|
+
graphTitle: "Commit graph",
|
|
6459
|
+
graphDetail: "Commit details",
|
|
6460
|
+
graphNoBody: "This commit has no body",
|
|
6461
|
+
graphExpandBody: "Expand body",
|
|
6462
|
+
graphCollapseBody: "Collapse body",
|
|
6463
|
+
graphNoFiles: "No file changes",
|
|
6464
|
+
graphFiles: "{count} files",
|
|
6465
|
+
graphBinary: "{count} binary files",
|
|
6466
|
+
graphRefresh: "Refresh history",
|
|
6467
|
+
graphCloseWindow: "Close popup",
|
|
6468
|
+
graphToggleOpen: "Open graph",
|
|
6469
|
+
graphToggleClose: "Close graph",
|
|
6470
|
+
graphSearch: "Search",
|
|
6471
|
+
graphSearchPlaceholder: "Text or hash",
|
|
6472
|
+
graphAuthorFilter: "Filter by author",
|
|
6473
|
+
graphAllAuthors: "All authors",
|
|
6474
|
+
graphColumn: "Graph",
|
|
6475
|
+
graphCommit: "Commit",
|
|
6476
|
+
graphAuthor: "Author",
|
|
6477
|
+
graphDate: "Date",
|
|
6478
|
+
graphCommits: "Commit history",
|
|
6479
|
+
graphNoMatches: "No matching commits",
|
|
6480
|
+
graphEmpty: "No commits on this branch",
|
|
6481
|
+
graphLoading: "Loading commits…",
|
|
6482
|
+
graphLoaded: "{count} commits loaded",
|
|
6483
|
+
graphRetry: "Retry",
|
|
6484
|
+
graphMore: "Load more",
|
|
5739
6485
|
menuBranches: "Branches",
|
|
5740
6486
|
menuLocalBranches: "Local branches",
|
|
5741
6487
|
menuWorktrees: "Worktrees",
|
|
@@ -5913,6 +6659,33 @@ window.__ModuleLoader__.load({
|
|
|
5913
6659
|
};
|
|
5914
6660
|
/** 中文词典。 */
|
|
5915
6661
|
const zh = {
|
|
6662
|
+
graphTitle: "提交图谱",
|
|
6663
|
+
graphDetail: "提交详情",
|
|
6664
|
+
graphNoBody: "此提交没有正文",
|
|
6665
|
+
graphExpandBody: "展开正文",
|
|
6666
|
+
graphCollapseBody: "收起正文",
|
|
6667
|
+
graphNoFiles: "无文件变更",
|
|
6668
|
+
graphFiles: "{count} 个文件",
|
|
6669
|
+
graphBinary: "{count} 个二进制文件",
|
|
6670
|
+
graphRefresh: "刷新提交历史",
|
|
6671
|
+
graphCloseWindow: "关闭弹出的窗",
|
|
6672
|
+
graphToggleOpen: "打开图谱",
|
|
6673
|
+
graphToggleClose: "关闭图谱",
|
|
6674
|
+
graphSearch: "搜索",
|
|
6675
|
+
graphSearchPlaceholder: "文本或哈希",
|
|
6676
|
+
graphAuthorFilter: "作者筛选",
|
|
6677
|
+
graphAllAuthors: "全部作者",
|
|
6678
|
+
graphColumn: "图谱",
|
|
6679
|
+
graphCommit: "提交",
|
|
6680
|
+
graphAuthor: "作者",
|
|
6681
|
+
graphDate: "日期",
|
|
6682
|
+
graphCommits: "提交历史",
|
|
6683
|
+
graphNoMatches: "没有匹配的提交",
|
|
6684
|
+
graphEmpty: "此分支暂无提交",
|
|
6685
|
+
graphLoading: "正在读取提交…",
|
|
6686
|
+
graphLoaded: "已加载 {count} 条提交",
|
|
6687
|
+
graphRetry: "重试",
|
|
6688
|
+
graphMore: "加载更多",
|
|
5916
6689
|
menuBranches: "分支",
|
|
5917
6690
|
menuLocalBranches: "本地分支",
|
|
5918
6691
|
menuWorktrees: "工作树",
|