@laoyuehanni/dsh-git-worktree 0.4.11 → 0.4.12
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 -1
- package/README.zh.md +1 -1
- package/lib/client.js +373 -16
- package/lib/git.d.ts +0 -8
- package/lib/git.js +45 -21
- package/lib/history.d.ts +15 -2
- package/lib/history.js +113 -27
- package/lib/index.d.ts +4 -0
- package/lib/index.js +11 -3
- package/lib/routes.d.ts +3 -2
- package/lib/routes.js +17 -2
- package/lib/wire.d.ts +17 -1
- package/lib/wire.js +2 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -59,8 +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. */
|
|
62
|
+
/** Read-only POSTs: bounded history, every author on that history, and one commit's full message/summary. */
|
|
63
63
|
const ROUTE_HISTORY = `${ROUTE_PREFIX}/history`;
|
|
64
|
+
const ROUTE_AUTHORS = `${ROUTE_PREFIX}/authors`;
|
|
64
65
|
const ROUTE_COMMIT = `${ROUTE_PREFIX}/commit`;
|
|
65
66
|
/** POST ROUTE_PREFIX/worktree — create-or-reuse a worktree for a branch. */
|
|
66
67
|
const ROUTE_WORKTREE = `${ROUTE_PREFIX}/worktree`;
|
|
@@ -122,6 +123,7 @@ window.__ModuleLoader__.load({
|
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
const fetchHistory = (body, signal) => graphRead(ROUTE_HISTORY, body, signal);
|
|
126
|
+
const fetchAuthors = (body, signal) => graphRead(ROUTE_AUTHORS, body, signal);
|
|
125
127
|
const fetchCommit = (repoPath, oid, signal) => graphRead(ROUTE_COMMIT, {
|
|
126
128
|
repoPath,
|
|
127
129
|
oid
|
|
@@ -1271,6 +1273,46 @@ window.__ModuleLoader__.load({
|
|
|
1271
1273
|
});
|
|
1272
1274
|
}
|
|
1273
1275
|
//#endregion
|
|
1276
|
+
//#region src/client/author-cache.ts
|
|
1277
|
+
/** Author lists remembered in the page, keyed by repository path and tip.
|
|
1278
|
+
* A tip identifies one history. Branch updates, fetch, and an explicit reload
|
|
1279
|
+
* drop every list for that repository; a response that started earlier cannot
|
|
1280
|
+
* write itself back. */
|
|
1281
|
+
const LIMIT = 32;
|
|
1282
|
+
const memory = /* @__PURE__ */ new Map();
|
|
1283
|
+
const epochs = /* @__PURE__ */ new Map();
|
|
1284
|
+
const keyOf = (repoPath, tip) => `${repoPath}\0${tip}`;
|
|
1285
|
+
function authorEpoch(repoPath) {
|
|
1286
|
+
return epochs.get(repoPath) ?? 0;
|
|
1287
|
+
}
|
|
1288
|
+
function cachedAuthors(repoPath, tip) {
|
|
1289
|
+
const key = keyOf(repoPath, tip);
|
|
1290
|
+
const hit = memory.get(key);
|
|
1291
|
+
if (!hit) return void 0;
|
|
1292
|
+
memory.delete(key);
|
|
1293
|
+
memory.set(key, hit);
|
|
1294
|
+
return hit;
|
|
1295
|
+
}
|
|
1296
|
+
/** `epoch` is the value of {@link authorEpoch} when the request started.
|
|
1297
|
+
* A bump since then means the list is stale and is discarded. */
|
|
1298
|
+
function rememberAuthors(repoPath, tip, authors, epoch) {
|
|
1299
|
+
if (epoch !== void 0 && epoch !== authorEpoch(repoPath)) return;
|
|
1300
|
+
const key = keyOf(repoPath, tip);
|
|
1301
|
+
memory.delete(key);
|
|
1302
|
+
memory.set(key, authors);
|
|
1303
|
+
while (memory.size > LIMIT) {
|
|
1304
|
+
const oldest = memory.keys().next().value;
|
|
1305
|
+
if (oldest === void 0) break;
|
|
1306
|
+
memory.delete(oldest);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
/** Drop every remembered list for one repository. */
|
|
1310
|
+
function forgetAuthors(repoPath) {
|
|
1311
|
+
const prefix = `${repoPath}\0`;
|
|
1312
|
+
for (const key of memory.keys()) if (key.startsWith(prefix)) memory.delete(key);
|
|
1313
|
+
epochs.set(repoPath, authorEpoch(repoPath) + 1);
|
|
1314
|
+
}
|
|
1315
|
+
//#endregion
|
|
1274
1316
|
//#region src/client/branch-tree.ts
|
|
1275
1317
|
/** Segment order: natural (so `v2` precedes `v10`) and case-blind. */
|
|
1276
1318
|
const segCmp = (a, b) => a.localeCompare(b, void 0, {
|
|
@@ -1421,6 +1463,20 @@ window.__ModuleLoader__.load({
|
|
|
1421
1463
|
function repoHasRemotes(branches) {
|
|
1422
1464
|
return branches.some((branch) => branch.kind === "remote" || branch.upstream !== void 0);
|
|
1423
1465
|
}
|
|
1466
|
+
/** Identity of the branch list the chip last showed. Ahead/behind, upstream,
|
|
1467
|
+
* and the checked-out name moving means some ref's history may have changed. */
|
|
1468
|
+
function branchFactsStamp(currentBranch, branches) {
|
|
1469
|
+
const rows = branches.map((branch) => [
|
|
1470
|
+
branch.kind,
|
|
1471
|
+
branch.name,
|
|
1472
|
+
branch.ahead ?? "",
|
|
1473
|
+
branch.behind ?? "",
|
|
1474
|
+
branch.upstream ?? "",
|
|
1475
|
+
branch.upstreamGone ? 1 : 0
|
|
1476
|
+
].join("\0"));
|
|
1477
|
+
rows.sort();
|
|
1478
|
+
return `${currentBranch}\n${rows.join("\n")}`;
|
|
1479
|
+
}
|
|
1424
1480
|
/**
|
|
1425
1481
|
* The remote-facing verbs a branch row's context menu offers. Where each one
|
|
1426
1482
|
* sits in the menu is the menu's call (Update directly above Push, both ahead
|
|
@@ -1501,8 +1557,13 @@ window.__ModuleLoader__.load({
|
|
|
1501
1557
|
}
|
|
1502
1558
|
return "ignored";
|
|
1503
1559
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1560
|
+
/** Next page loads when the user scrolls an overflowing list to its end.
|
|
1561
|
+
* A short list has no end to reach, and a failed page must not retry itself. */
|
|
1562
|
+
function shouldAutoLoadHistory(metrics, state) {
|
|
1563
|
+
if (state.loading || state.failed || !state.hasNext) return false;
|
|
1564
|
+
if (metrics.scrollHeight <= metrics.clientHeight) return false;
|
|
1565
|
+
return metrics.scrollHeight - metrics.scrollTop - metrics.clientHeight <= 8;
|
|
1566
|
+
}
|
|
1506
1567
|
/** Keep the selection inside the filtered rows, without scanning per row. */
|
|
1507
1568
|
function filterCommits(commits, query, author, selected) {
|
|
1508
1569
|
const needle = query.trim().toLocaleLowerCase();
|
|
@@ -1728,7 +1789,7 @@ window.__ModuleLoader__.load({
|
|
|
1728
1789
|
}
|
|
1729
1790
|
/** One branch browser. The owner keys by repository + ref: old async responses
|
|
1730
1791
|
* can never replace a different branch's history or selected commit. */
|
|
1731
|
-
function CommitGraph({ repoPath, branchRef, branch, onClose, escapeRef, t }) {
|
|
1792
|
+
function CommitGraph({ repoPath, branchRef, branch, branchEpoch = 0, onClose, escapeRef, t }) {
|
|
1732
1793
|
const [history, setHistory] = (0, react.useState)(null);
|
|
1733
1794
|
const [error, setError] = (0, react.useState)("");
|
|
1734
1795
|
const [loading, setLoading] = (0, react.useState)(true);
|
|
@@ -1739,7 +1800,18 @@ window.__ModuleLoader__.load({
|
|
|
1739
1800
|
const [detail, setDetail] = (0, react.useState)(null);
|
|
1740
1801
|
const [detailError, setDetailError] = (0, react.useState)("");
|
|
1741
1802
|
const [detailRevision, setDetailRevision] = (0, react.useState)(0);
|
|
1803
|
+
const [allAuthors, setAllAuthors] = (0, react.useState)(null);
|
|
1742
1804
|
const moreRequest = (0, react.useRef)(null);
|
|
1805
|
+
const freshAuthors = (0, react.useRef)(false);
|
|
1806
|
+
const seenEpoch = (0, react.useRef)(branchEpoch);
|
|
1807
|
+
const historyGen = (0, react.useRef)(0);
|
|
1808
|
+
const historyApplied = (0, react.useRef)(0);
|
|
1809
|
+
if (seenEpoch.current !== branchEpoch) {
|
|
1810
|
+
seenEpoch.current = branchEpoch;
|
|
1811
|
+
freshAuthors.current = true;
|
|
1812
|
+
forgetAuthors(repoPath);
|
|
1813
|
+
}
|
|
1814
|
+
const pagingOffset = (0, react.useRef)(null);
|
|
1743
1815
|
const listRef = (0, react.useRef)(null);
|
|
1744
1816
|
const detailHost = (0, react.useRef)(null);
|
|
1745
1817
|
const commits = history?.commits ?? [];
|
|
@@ -1750,12 +1822,22 @@ window.__ModuleLoader__.load({
|
|
|
1750
1822
|
author,
|
|
1751
1823
|
selected
|
|
1752
1824
|
]);
|
|
1753
|
-
const authors =
|
|
1825
|
+
const authors = (0, react.useMemo)(() => {
|
|
1826
|
+
const names = new Set(allAuthors ?? []);
|
|
1827
|
+
if (!allAuthors) {
|
|
1828
|
+
for (const item of commits) if (item.author) names.add(item.author);
|
|
1829
|
+
}
|
|
1830
|
+
return [...names].sort((a, b) => a.localeCompare(b));
|
|
1831
|
+
}, [allAuthors, commits]);
|
|
1754
1832
|
const filtered = !!query.trim() || !!author;
|
|
1755
1833
|
const graphWidth = filtered ? 30 : Math.max(42, graph.lanes * 12 + 14);
|
|
1756
1834
|
(0, react.useEffect)(() => {
|
|
1757
1835
|
const controller = new AbortController();
|
|
1836
|
+
const gen = ++historyGen.current;
|
|
1837
|
+
const reloadAuthors = freshAuthors.current;
|
|
1838
|
+
freshAuthors.current = false;
|
|
1758
1839
|
moreRequest.current?.abort();
|
|
1840
|
+
pagingOffset.current = null;
|
|
1759
1841
|
setHistory(null);
|
|
1760
1842
|
setError("");
|
|
1761
1843
|
setLoading(true);
|
|
@@ -1763,9 +1845,11 @@ window.__ModuleLoader__.load({
|
|
|
1763
1845
|
setDetail(null);
|
|
1764
1846
|
fetchHistory({
|
|
1765
1847
|
repoPath,
|
|
1766
|
-
ref: branchRef
|
|
1848
|
+
ref: branchRef,
|
|
1849
|
+
...reloadAuthors ? { freshAuthors: true } : {}
|
|
1767
1850
|
}, controller.signal).then((result) => {
|
|
1768
|
-
if (controller.signal.aborted) return;
|
|
1851
|
+
if (controller.signal.aborted || historyGen.current !== gen) return;
|
|
1852
|
+
historyApplied.current = gen;
|
|
1769
1853
|
setLoading(false);
|
|
1770
1854
|
if (result.ok) {
|
|
1771
1855
|
setHistory(result);
|
|
@@ -1779,7 +1863,43 @@ window.__ModuleLoader__.load({
|
|
|
1779
1863
|
}, [
|
|
1780
1864
|
repoPath,
|
|
1781
1865
|
branchRef,
|
|
1782
|
-
revision
|
|
1866
|
+
revision,
|
|
1867
|
+
branchEpoch
|
|
1868
|
+
]);
|
|
1869
|
+
(0, react.useEffect)(() => {
|
|
1870
|
+
if (historyApplied.current !== historyGen.current) {
|
|
1871
|
+
if (!history?.tip) setAllAuthors(null);
|
|
1872
|
+
return;
|
|
1873
|
+
}
|
|
1874
|
+
const tip = history?.tip;
|
|
1875
|
+
if (!tip) {
|
|
1876
|
+
setAllAuthors(null);
|
|
1877
|
+
return;
|
|
1878
|
+
}
|
|
1879
|
+
const hit = cachedAuthors(repoPath, tip);
|
|
1880
|
+
if (hit) {
|
|
1881
|
+
setAllAuthors(hit);
|
|
1882
|
+
return;
|
|
1883
|
+
}
|
|
1884
|
+
setAllAuthors(null);
|
|
1885
|
+
const epoch = authorEpoch(repoPath);
|
|
1886
|
+
const gen = historyGen.current;
|
|
1887
|
+
const controller = new AbortController();
|
|
1888
|
+
fetchAuthors({
|
|
1889
|
+
repoPath,
|
|
1890
|
+
ref: branchRef,
|
|
1891
|
+
tip
|
|
1892
|
+
}, controller.signal).then((result) => {
|
|
1893
|
+
if (controller.signal.aborted || !result.ok || result.tip !== tip) return;
|
|
1894
|
+
if (authorEpoch(repoPath) !== epoch || historyGen.current !== gen) return;
|
|
1895
|
+
rememberAuthors(repoPath, tip, result.authors, epoch);
|
|
1896
|
+
setAllAuthors(result.authors);
|
|
1897
|
+
});
|
|
1898
|
+
return () => controller.abort();
|
|
1899
|
+
}, [
|
|
1900
|
+
repoPath,
|
|
1901
|
+
branchRef,
|
|
1902
|
+
history
|
|
1783
1903
|
]);
|
|
1784
1904
|
(0, react.useEffect)(() => {
|
|
1785
1905
|
const controller = new AbortController();
|
|
@@ -1824,6 +1944,9 @@ window.__ModuleLoader__.load({
|
|
|
1824
1944
|
]);
|
|
1825
1945
|
const loadMore = async () => {
|
|
1826
1946
|
if (loading || history?.next == null || !history.tip) return;
|
|
1947
|
+
if (pagingOffset.current === history.next) return;
|
|
1948
|
+
const offset = history.next;
|
|
1949
|
+
pagingOffset.current = offset;
|
|
1827
1950
|
moreRequest.current?.abort();
|
|
1828
1951
|
const controller = new AbortController();
|
|
1829
1952
|
moreRequest.current = controller;
|
|
@@ -1833,7 +1956,7 @@ window.__ModuleLoader__.load({
|
|
|
1833
1956
|
repoPath,
|
|
1834
1957
|
ref: branchRef,
|
|
1835
1958
|
tip: history.tip,
|
|
1836
|
-
offset: String(
|
|
1959
|
+
offset: String(offset)
|
|
1837
1960
|
}, controller.signal);
|
|
1838
1961
|
if (controller.signal.aborted) return;
|
|
1839
1962
|
setLoading(false);
|
|
@@ -1843,6 +1966,16 @@ window.__ModuleLoader__.load({
|
|
|
1843
1966
|
});
|
|
1844
1967
|
else setError(result.error);
|
|
1845
1968
|
};
|
|
1969
|
+
const reloadHistory = () => {
|
|
1970
|
+
freshAuthors.current = true;
|
|
1971
|
+
forgetAuthors(repoPath);
|
|
1972
|
+
setRevision((value) => value + 1);
|
|
1973
|
+
};
|
|
1974
|
+
const retryHistory = () => {
|
|
1975
|
+
pagingOffset.current = null;
|
|
1976
|
+
if (history) loadMore();
|
|
1977
|
+
else reloadHistory();
|
|
1978
|
+
};
|
|
1846
1979
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1847
1980
|
className: CommitGraph_module_default.panel,
|
|
1848
1981
|
"data-commit-history": "",
|
|
@@ -1889,7 +2022,7 @@ window.__ModuleLoader__.load({
|
|
|
1889
2022
|
title: t("graphRefresh"),
|
|
1890
2023
|
"aria-label": t("graphRefresh"),
|
|
1891
2024
|
disabled: loading,
|
|
1892
|
-
onClick:
|
|
2025
|
+
onClick: reloadHistory,
|
|
1893
2026
|
children: "↻"
|
|
1894
2027
|
}),
|
|
1895
2028
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -1924,6 +2057,15 @@ window.__ModuleLoader__.load({
|
|
|
1924
2057
|
role: "listbox",
|
|
1925
2058
|
"aria-label": t("graphCommits"),
|
|
1926
2059
|
"aria-busy": loading,
|
|
2060
|
+
onScroll: (event) => {
|
|
2061
|
+
const el = event.currentTarget;
|
|
2062
|
+
if (!shouldAutoLoadHistory(el, {
|
|
2063
|
+
loading,
|
|
2064
|
+
hasNext: history?.next != null,
|
|
2065
|
+
failed: error !== ""
|
|
2066
|
+
})) return;
|
|
2067
|
+
loadMore();
|
|
2068
|
+
},
|
|
1927
2069
|
onKeyDown: (event) => {
|
|
1928
2070
|
if (![
|
|
1929
2071
|
"ArrowDown",
|
|
@@ -2011,7 +2153,7 @@ window.__ModuleLoader__.load({
|
|
|
2011
2153
|
type: "button",
|
|
2012
2154
|
className: CommitGraph_module_default.textButton,
|
|
2013
2155
|
disabled: loading,
|
|
2014
|
-
onClick:
|
|
2156
|
+
onClick: retryHistory,
|
|
2015
2157
|
children: t("graphRetry")
|
|
2016
2158
|
}),
|
|
2017
2159
|
history?.next != null && !error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -2044,6 +2186,31 @@ window.__ModuleLoader__.load({
|
|
|
2044
2186
|
});
|
|
2045
2187
|
}
|
|
2046
2188
|
//#endregion
|
|
2189
|
+
//#region src/client/frame-top.ts
|
|
2190
|
+
/** Host window chrome above the page, in pixels.
|
|
2191
|
+
* `--dsh-frame-chrome-top` is the live height, including an explicit 0 when
|
|
2192
|
+
* fullscreen hides the bar. `--dsh-frame-top-clearance` is only the fallback
|
|
2193
|
+
* for hosts that publish a static inset (the mac traffic-light band) and no
|
|
2194
|
+
* live value. An unset or non-numeric custom property means there is no chrome. */
|
|
2195
|
+
function hostFrameTop(chrome, clearance) {
|
|
2196
|
+
const px = (value) => {
|
|
2197
|
+
const n = Number.parseFloat(value);
|
|
2198
|
+
if (!Number.isFinite(n)) return null;
|
|
2199
|
+
return n > 0 ? n : 0;
|
|
2200
|
+
};
|
|
2201
|
+
return px(chrome) ?? px(clearance) ?? 0;
|
|
2202
|
+
}
|
|
2203
|
+
//#endregion
|
|
2204
|
+
//#region src/client/graph-open.ts
|
|
2205
|
+
/** Graph mode across a branch-menu open transition.
|
|
2206
|
+
* Turning the setting on makes the click that opens the menu start in the
|
|
2207
|
+
* graph. While the setting is off, a mode the user already chose survives
|
|
2208
|
+
* closing the popup. An already-open menu is left alone. */
|
|
2209
|
+
function graphOpenAfter(wasOpen, open, defaultGraph, graphOpen) {
|
|
2210
|
+
if (open && !wasOpen && defaultGraph) return true;
|
|
2211
|
+
return graphOpen;
|
|
2212
|
+
}
|
|
2213
|
+
//#endregion
|
|
2047
2214
|
//#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\BranchChip.module.css?inline
|
|
2048
2215
|
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";
|
|
2049
2216
|
const tagId$3 = "@laoyuehanni/dsh-git-worktree/BranchChip.module.css";
|
|
@@ -2354,9 +2521,15 @@ window.__ModuleLoader__.load({
|
|
|
2354
2521
|
* @param props - anchor, rows, confirm bundle, callbacks, and the class sheet.
|
|
2355
2522
|
* @returns null while closed or unplaced; otherwise the portaled card (+flyout).
|
|
2356
2523
|
*/
|
|
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 }) {
|
|
2524
|
+
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, defaultGraph = false, branchEpoch = 0, t }) {
|
|
2358
2525
|
const cardRef = (0, react.useRef)(null);
|
|
2359
2526
|
const [graphOpen, setGraphOpen] = (0, react.useState)(false);
|
|
2527
|
+
const [menuWasOpen, setMenuWasOpen] = (0, react.useState)(open);
|
|
2528
|
+
if (open !== menuWasOpen) {
|
|
2529
|
+
setMenuWasOpen(open);
|
|
2530
|
+
const next = graphOpenAfter(menuWasOpen, open, defaultGraph, graphOpen);
|
|
2531
|
+
if (next !== graphOpen) setGraphOpen(next);
|
|
2532
|
+
}
|
|
2360
2533
|
const graphOpenRef = (0, react.useRef)(graphOpen);
|
|
2361
2534
|
graphOpenRef.current = graphOpen;
|
|
2362
2535
|
const graphEscapeRef = (0, react.useRef)(null);
|
|
@@ -2641,13 +2814,16 @@ window.__ModuleLoader__.load({
|
|
|
2641
2814
|
const vh = window.innerHeight;
|
|
2642
2815
|
const bounds = anchor.closest("[data-composer-card]")?.getBoundingClientRect() ?? rect;
|
|
2643
2816
|
const lowerEdge = Math.min(vh - MARGIN, rect.top - GAP);
|
|
2817
|
+
const frame = getComputedStyle(document.documentElement);
|
|
2818
|
+
const chromeTop = hostFrameTop(frame.getPropertyValue("--dsh-frame-chrome-top"), frame.getPropertyValue("--dsh-frame-top-clearance"));
|
|
2644
2819
|
const nextBounds = [
|
|
2645
2820
|
vw,
|
|
2646
2821
|
vh,
|
|
2647
2822
|
rect.left,
|
|
2648
2823
|
rect.top,
|
|
2649
2824
|
bounds.left,
|
|
2650
|
-
bounds.width
|
|
2825
|
+
bounds.width,
|
|
2826
|
+
chromeTop
|
|
2651
2827
|
].join(":");
|
|
2652
2828
|
if (nextBounds !== previousBounds) {
|
|
2653
2829
|
graphAnimationRef.current?.cancel();
|
|
@@ -2656,7 +2832,8 @@ window.__ModuleLoader__.load({
|
|
|
2656
2832
|
}
|
|
2657
2833
|
if (graphOpen) {
|
|
2658
2834
|
const width = Math.max(0, Math.min(1060, bounds.width, vw - 24));
|
|
2659
|
-
const
|
|
2835
|
+
const ceiling = chromeTop + MARGIN;
|
|
2836
|
+
const height = Math.max(0, Math.min(700, lowerEdge - ceiling));
|
|
2660
2837
|
const left = Math.min(Math.max(bounds.left + (bounds.width - width) / 2, MARGIN), Math.max(MARGIN, vw - width - MARGIN));
|
|
2661
2838
|
setPos({
|
|
2662
2839
|
left,
|
|
@@ -3790,6 +3967,7 @@ window.__ModuleLoader__.load({
|
|
|
3790
3967
|
graphOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommitGraph, {
|
|
3791
3968
|
repoPath,
|
|
3792
3969
|
branchRef: browsingRef,
|
|
3970
|
+
branchEpoch,
|
|
3793
3971
|
branch: browsingBranch || "HEAD",
|
|
3794
3972
|
escapeRef: graphEscapeRef,
|
|
3795
3973
|
t,
|
|
@@ -4154,6 +4332,67 @@ window.__ModuleLoader__.load({
|
|
|
4154
4332
|
return kept.length === 0 ? text : kept.join("\n");
|
|
4155
4333
|
}
|
|
4156
4334
|
//#endregion
|
|
4335
|
+
//#region src/client/fetch-error.ts
|
|
4336
|
+
/**
|
|
4337
|
+
* The head the live fetch puts in front of git's own words: which remote
|
|
4338
|
+
* failed and what address it points at. A plain `git fetch --all` cannot say
|
|
4339
|
+
* this, so the head may be missing — the facts git printed still can.
|
|
4340
|
+
*/
|
|
4341
|
+
const REMOTE_HEAD = /^remote "([^"]+)" \(url: (.*)\)\s*$/m;
|
|
4342
|
+
/** The address git quotes back when the address itself is the problem. */
|
|
4343
|
+
const QUOTED = /'([^']+)'/;
|
|
4344
|
+
/**
|
|
4345
|
+
* Recognise a fetch failure.
|
|
4346
|
+
* @param raw - the error text the route returned.
|
|
4347
|
+
* @returns the failure the toast should describe, or null when git's own
|
|
4348
|
+
* words are the best thing the user can read.
|
|
4349
|
+
*/
|
|
4350
|
+
function explainFetchFailure(raw) {
|
|
4351
|
+
const text = stripCommand(raw);
|
|
4352
|
+
const head = REMOTE_HEAD.exec(text);
|
|
4353
|
+
const remote = head?.[1] ?? null;
|
|
4354
|
+
const url = head?.[2]?.trim() || null;
|
|
4355
|
+
const kind = classify(text);
|
|
4356
|
+
if (kind === null) return null;
|
|
4357
|
+
if (kind === "remoteNotFound" || kind === "remoteUnreachable") {
|
|
4358
|
+
if (url === null) return {
|
|
4359
|
+
kind: "remoteUnknown",
|
|
4360
|
+
remote,
|
|
4361
|
+
url,
|
|
4362
|
+
path: null
|
|
4363
|
+
};
|
|
4364
|
+
}
|
|
4365
|
+
return {
|
|
4366
|
+
kind,
|
|
4367
|
+
remote,
|
|
4368
|
+
url,
|
|
4369
|
+
path: kind === "remotePathMissing" ? QUOTED.exec(text)?.[1] ?? url : null
|
|
4370
|
+
};
|
|
4371
|
+
}
|
|
4372
|
+
/**
|
|
4373
|
+
* The cause of a fetch failure, most specific first: git's closing sentence
|
|
4374
|
+
* ("Could not read from remote repository") follows every remote failure, so
|
|
4375
|
+
* it can only be the last resort.
|
|
4376
|
+
* @param text - the failure text without the command preamble.
|
|
4377
|
+
* @returns the cause, or null when nothing matches.
|
|
4378
|
+
*/
|
|
4379
|
+
function classify(text) {
|
|
4380
|
+
if (/does not appear to be a git repository/i.test(text)) return "remotePathMissing";
|
|
4381
|
+
if (/permission denied \(publickey\)|too many authentication failures|authentication failed|could not read from remote repository\. please make sure you have the correct access rights/i.test(text)) return "remoteAuthFailed";
|
|
4382
|
+
if (/repository not found|not found\.\s*$/im.test(text)) return "remoteNotFound";
|
|
4383
|
+
if (/could not resolve hostname|name or service not known|connection (?:timed out|refused|reset)|network is unreachable|failed to connect|temporary failure in name resolution/i.test(text)) return "remoteUnreachable";
|
|
4384
|
+
if (/could not read from remote repository/i.test(text)) return "remoteUnknown";
|
|
4385
|
+
return null;
|
|
4386
|
+
}
|
|
4387
|
+
/**
|
|
4388
|
+
* Drop the `git <args> failed (exit N):` preamble the route wraps errors in.
|
|
4389
|
+
* @param raw - the error text the route returned.
|
|
4390
|
+
* @returns the text git itself printed.
|
|
4391
|
+
*/
|
|
4392
|
+
function stripCommand(raw) {
|
|
4393
|
+
return /^git [\s\S]*?failed \(exit \d+\):\s*([\s\S]*)$/.exec(raw)?.[1] ?? raw;
|
|
4394
|
+
}
|
|
4395
|
+
//#endregion
|
|
4157
4396
|
//#region \0git-worktree-css:D:\Code\dsh-worktree\src\client\SyncProgress.module.css?inline
|
|
4158
4397
|
const css$2 = "/* The floating progress card of a running fetch/update.\n *\n * Fixed to the viewport and portalled out of the composer, so it can never\n * push or clip the layout it floats over. Only the card itself takes the\n * pointer; everything around it keeps working, which is the point — a\n * transfer that takes a minute must not hold the app hostage.\n *\n * Chrome is the branch menu card's recipe (r16 here: it is a small notice,\n * not a menu), so it reads as part of the same plugin in both themes. */\n.card_2133289399 {\n box-sizing: border-box;\n position: fixed;\n right: 20px;\n bottom: 84px;\n z-index: 1000;\n /* Wide enough for git's longest ordinary counter line on one row\n * (`Receiving objects: 66% (1340/2030), 120.80 MiB | 10.24 MiB/s`), which a\n * 300px card cut to `… | 1024.0…` from the tens of MiB on. */\n width: 380px;\n max-width: calc(100vw - 40px);\n padding: 10px 12px 12px;\n border-radius: 16px;\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 color: var(--dsw-alias-label-primary, inherit);\n animation: syncCardIn 160ms ease-out;\n}\n\n.head_2133289399 {\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: 22px;\n}\n\n.title_2133289399 {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.cancel_2133289399 {\n flex: none;\n display: grid;\n place-items: center;\n width: 22px;\n height: 22px;\n margin: 0 -4px 0 0;\n padding: 0;\n border: 0;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-tertiary, #81858c);\n cursor: pointer;\n}\n\n.cancel_2133289399:hover {\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 8%, transparent));\n color: var(--dsw-alias-label-primary, inherit);\n}\n\n.cancel_2133289399:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary, #4186f0);\n outline-offset: 1px;\n}\n\n/* The bar: a determinate fill follows git's own percentage; with none to\n * show (connecting, a phase git cannot size, the fast-forward) a short\n * segment sweeps instead of a bar frozen at some stale number. */\n.track_2133289399 {\n position: relative;\n height: 4px;\n margin: 8px 0 8px;\n overflow: hidden;\n border-radius: 2px;\n background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 10%, transparent));\n}\n\n.fill_2133289399 {\n height: 100%;\n border-radius: 2px;\n background: var(--dsw-alias-brand-primary, #4186f0);\n transition: width 150ms linear;\n}\n\n.indeterminate_2133289399 {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 40%;\n border-radius: 2px;\n background: var(--dsw-alias-brand-primary, #4186f0);\n animation: syncSweep 1.1s ease-in-out infinite;\n}\n\n/* git's line, verbatim: stage, counts and transfer speed in one row, the\n * way IDEA's task popup prints it. Tabular figures keep it from jittering. */\n.detail_2133289399 {\n overflow: hidden;\n font-size: 12px;\n line-height: 18px;\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: var(--dsw-alias-label-secondary, #81858c);\n}\n\n@keyframes syncSweep {\n from { transform: translateX(-100%); }\n to { transform: translateX(250%); }\n}\n\n@keyframes syncCardIn {\n from { opacity: 0; transform: translateY(6px); }\n to { opacity: 1; transform: translateY(0); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .card_2133289399 { animation: none; }\n .fill_2133289399 { transition: none; }\n .indeterminate_2133289399 { width: 100%; opacity: 0.35; animation: none; }\n}\n";
|
|
4159
4398
|
const tagId$2 = "@laoyuehanni/dsh-git-worktree/SyncProgress.module.css";
|
|
@@ -4325,6 +4564,15 @@ window.__ModuleLoader__.load({
|
|
|
4325
4564
|
dirty: "updateFailDirty",
|
|
4326
4565
|
noUpstream: "updateFailNoUpstream"
|
|
4327
4566
|
};
|
|
4567
|
+
/** The toast for a fetch failure the plugin can name: which remote failed
|
|
4568
|
+
* and what to do about it. Git's own words name neither. */
|
|
4569
|
+
const FETCH_FAIL = {
|
|
4570
|
+
remotePathMissing: "fetchFailRemotePathMissing",
|
|
4571
|
+
remoteNotFound: "fetchFailRemoteNotFound",
|
|
4572
|
+
remoteAuthFailed: "fetchFailRemoteAuthFailed",
|
|
4573
|
+
remoteUnreachable: "fetchFailRemoteUnreachable",
|
|
4574
|
+
remoteUnknown: "fetchFailRemoteUnknown"
|
|
4575
|
+
};
|
|
4328
4576
|
/**
|
|
4329
4577
|
* Read the repository status for a directory; refetch on demand.
|
|
4330
4578
|
* @param cwd - absolute session directory.
|
|
@@ -4614,7 +4862,7 @@ window.__ModuleLoader__.load({
|
|
|
4614
4862
|
}), document.body);
|
|
4615
4863
|
}
|
|
4616
4864
|
/** The tool-row entry registered into conversation.input.left. */
|
|
4617
|
-
function BranchChipDock({ sessionId, useSessions, useSession, adoptWorktree, describeWorktreeRemoval, removeWorktree, pruneWorktrees, t }) {
|
|
4865
|
+
function BranchChipDock({ sessionId, useSessions, useSession, adoptWorktree, describeWorktreeRemoval, removeWorktree, pruneWorktrees, openGraphByDefault, t }) {
|
|
4618
4866
|
const summary = useSessions((state) => state.byId[sessionId]);
|
|
4619
4867
|
const session = useSession((s) => s);
|
|
4620
4868
|
const cwd = summary?.cwd;
|
|
@@ -4658,6 +4906,28 @@ window.__ModuleLoader__.load({
|
|
|
4658
4906
|
* not refetch while it is still empty (the mount fetch owns that). */
|
|
4659
4907
|
const shownBranchRef = (0, react.useRef)(void 0);
|
|
4660
4908
|
shownBranchRef.current = repo.facts?.currentBranch;
|
|
4909
|
+
const [branchEpoch, setBranchEpoch] = (0, react.useState)(0);
|
|
4910
|
+
const [syncMark, setSyncMark] = (0, react.useState)(0);
|
|
4911
|
+
const authorRepo = cwd ?? repo.facts?.repoRoot ?? "";
|
|
4912
|
+
const factsStamp = repo.facts === null ? "" : `${branchFactsStamp(repo.facts.currentBranch, repo.facts.branches)}\n${syncMark}`;
|
|
4913
|
+
const seenFacts = (0, react.useRef)(null);
|
|
4914
|
+
(0, react.useEffect)(() => {
|
|
4915
|
+
seenFacts.current = null;
|
|
4916
|
+
}, [authorRepo]);
|
|
4917
|
+
(0, react.useEffect)(() => {
|
|
4918
|
+
if (factsStamp === "" || authorRepo === "") return;
|
|
4919
|
+
if (seenFacts.current === null) {
|
|
4920
|
+
seenFacts.current = factsStamp;
|
|
4921
|
+
return;
|
|
4922
|
+
}
|
|
4923
|
+
if (seenFacts.current === factsStamp) return;
|
|
4924
|
+
seenFacts.current = factsStamp;
|
|
4925
|
+
forgetAuthors(authorRepo);
|
|
4926
|
+
setBranchEpoch((epoch) => epoch + 1);
|
|
4927
|
+
}, [factsStamp, authorRepo]);
|
|
4928
|
+
const noteBranchSync = (0, react.useCallback)(() => {
|
|
4929
|
+
setSyncMark((mark) => mark + 1);
|
|
4930
|
+
}, []);
|
|
4661
4931
|
/** One poll-triggered status fetch at a time. Focus and menu opens do not
|
|
4662
4932
|
* take this flag; the generation in useRepoStatus orders those bodies. */
|
|
4663
4933
|
const pollRefreshRef = (0, react.useRef)(false);
|
|
@@ -4714,9 +4984,32 @@ window.__ModuleLoader__.load({
|
|
|
4714
4984
|
refresh,
|
|
4715
4985
|
watchingBranch
|
|
4716
4986
|
]);
|
|
4987
|
+
/**
|
|
4988
|
+
* The plain sentence for a failed fetch. Git's own words name a path and
|
|
4989
|
+
* say nothing about the next step; `git fetch --all` does not even name the
|
|
4990
|
+
* remote that failed. The plugin does, so the toast can.
|
|
4991
|
+
* @param raw - the error text the route returned.
|
|
4992
|
+
* @returns true when the failure was a fetch failure, now said in words of
|
|
4993
|
+
* its own instead of git's.
|
|
4994
|
+
*/
|
|
4995
|
+
const showFetchError = (0, react.useCallback)((raw) => {
|
|
4996
|
+
const failure = explainFetchFailure(raw);
|
|
4997
|
+
if (failure === null) return false;
|
|
4998
|
+
pushToast(t(FETCH_FAIL[failure.kind], {
|
|
4999
|
+
remote: failure.remote ?? t("fetchFailRemoteUnnamed"),
|
|
5000
|
+
path: failure.path ?? "",
|
|
5001
|
+
url: failure.url ?? ""
|
|
5002
|
+
}));
|
|
5003
|
+
return true;
|
|
5004
|
+
}, [pushToast, t]);
|
|
4717
5005
|
const showError = (0, react.useCallback)((message) => {
|
|
5006
|
+
if (showFetchError(message)) return;
|
|
4718
5007
|
pushToast(t("errorGeneric", { message }));
|
|
4719
|
-
}, [
|
|
5008
|
+
}, [
|
|
5009
|
+
pushToast,
|
|
5010
|
+
showFetchError,
|
|
5011
|
+
t
|
|
5012
|
+
]);
|
|
4720
5013
|
/** Run one guarded confirm action: single-flight, toast on failure. On
|
|
4721
5014
|
* success the confirm clears; the MENU closes unless `keepOpen` (the row
|
|
4722
5015
|
* menu's rule: 原地动作 leave the picker up), and `onSettled` — the
|
|
@@ -4850,6 +5143,7 @@ window.__ModuleLoader__.load({
|
|
|
4850
5143
|
const { result, cancelled } = outcome;
|
|
4851
5144
|
if (cancelled && !result.ok) {
|
|
4852
5145
|
await refresh();
|
|
5146
|
+
noteBranchSync();
|
|
4853
5147
|
pushToast(t("fetchCancelled"));
|
|
4854
5148
|
return;
|
|
4855
5149
|
}
|
|
@@ -4858,10 +5152,12 @@ window.__ModuleLoader__.load({
|
|
|
4858
5152
|
return;
|
|
4859
5153
|
}
|
|
4860
5154
|
await refresh();
|
|
5155
|
+
noteBranchSync();
|
|
4861
5156
|
pushToast(t("fetchDone"));
|
|
4862
5157
|
}, [
|
|
4863
5158
|
blocked,
|
|
4864
5159
|
cwd,
|
|
5160
|
+
noteBranchSync,
|
|
4865
5161
|
pushToast,
|
|
4866
5162
|
refresh,
|
|
4867
5163
|
showError,
|
|
@@ -4883,6 +5179,7 @@ window.__ModuleLoader__.load({
|
|
|
4883
5179
|
const { result, cancelled } = outcome;
|
|
4884
5180
|
if (cancelled && !result.ok) {
|
|
4885
5181
|
await refresh();
|
|
5182
|
+
noteBranchSync();
|
|
4886
5183
|
pushToast(t("updateCancelled"));
|
|
4887
5184
|
return;
|
|
4888
5185
|
}
|
|
@@ -4893,10 +5190,12 @@ window.__ModuleLoader__.load({
|
|
|
4893
5190
|
return;
|
|
4894
5191
|
}
|
|
4895
5192
|
await refresh();
|
|
5193
|
+
noteBranchSync();
|
|
4896
5194
|
pushToast(result.updated ? t("updateDone", { branch: result.branch }) : t("updateUpToDate"));
|
|
4897
5195
|
}, [
|
|
4898
5196
|
blocked,
|
|
4899
5197
|
cwd,
|
|
5198
|
+
noteBranchSync,
|
|
4900
5199
|
pushToast,
|
|
4901
5200
|
refresh,
|
|
4902
5201
|
showError,
|
|
@@ -4942,6 +5241,7 @@ window.__ModuleLoader__.load({
|
|
|
4942
5241
|
if (!result.ok && !stopped) recordPushFailure(cwd, failure(result.error));
|
|
4943
5242
|
if (currentCwdRef.current !== cwd) return;
|
|
4944
5243
|
await refresh();
|
|
5244
|
+
noteBranchSync();
|
|
4945
5245
|
if (currentCwdRef.current !== cwd) return;
|
|
4946
5246
|
if (stopped) pushToast(t("pushCancelled"));
|
|
4947
5247
|
else if (result.ok) pushToast(t("pushDone", {
|
|
@@ -4954,6 +5254,7 @@ window.__ModuleLoader__.load({
|
|
|
4954
5254
|
}, [
|
|
4955
5255
|
blocked,
|
|
4956
5256
|
cwd,
|
|
5257
|
+
noteBranchSync,
|
|
4957
5258
|
pushToast,
|
|
4958
5259
|
refresh,
|
|
4959
5260
|
t
|
|
@@ -5107,6 +5408,8 @@ window.__ModuleLoader__.load({
|
|
|
5107
5408
|
}),
|
|
5108
5409
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BranchMenu, {
|
|
5109
5410
|
open: menuOpen,
|
|
5411
|
+
defaultGraph: openGraphByDefault(),
|
|
5412
|
+
branchEpoch,
|
|
5110
5413
|
repoPath: cwd ?? facts.repoRoot,
|
|
5111
5414
|
anchorRef: chipRef,
|
|
5112
5415
|
rows,
|
|
@@ -5284,6 +5587,7 @@ window.__ModuleLoader__.load({
|
|
|
5284
5587
|
this.publish();
|
|
5285
5588
|
},
|
|
5286
5589
|
setFetchBeforeCreate: (value) => this.setSimpleFlag("fetchBeforeCreate", value),
|
|
5590
|
+
setOpenGraphByDefault: (value) => this.setSimpleFlag("openGraphByDefault", value),
|
|
5287
5591
|
setAutoPruneWorktrees: (value) => this.setSimpleFlag("autoPruneWorktrees", value),
|
|
5288
5592
|
editKeepWorktrees: (text) => {
|
|
5289
5593
|
this.keepDraft = text;
|
|
@@ -5410,6 +5714,7 @@ window.__ModuleLoader__.load({
|
|
|
5410
5714
|
saving: this.saving,
|
|
5411
5715
|
failed: this.failed,
|
|
5412
5716
|
fetchBeforeCreate: this.scope.getSnapshot().value?.fetchBeforeCreate ?? false,
|
|
5717
|
+
openGraphByDefault: this.scope.getSnapshot().value?.openGraphByDefault ?? false,
|
|
5413
5718
|
autoPruneWorktrees: this.scope.getSnapshot().value?.autoPruneWorktrees ?? false,
|
|
5414
5719
|
keepWorktreesText: keepText,
|
|
5415
5720
|
keepWorktreesValid: keepParsed !== void 0 && keepParsed >= 1,
|
|
@@ -6223,6 +6528,38 @@ window.__ModuleLoader__.load({
|
|
|
6223
6528
|
className: GitWorktreeCard_module_default.hint,
|
|
6224
6529
|
children: [t("cardRootDirHint"), state.overridden ? ` ${t("cardOverridden")}` : ""]
|
|
6225
6530
|
}),
|
|
6531
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6532
|
+
className: `${GitWorktreeCard_module_default.field} ${GitWorktreeCard_module_default.toggleRow}`,
|
|
6533
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6534
|
+
className: GitWorktreeCard_module_default.toggleText,
|
|
6535
|
+
children: [
|
|
6536
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6537
|
+
className: GitWorktreeCard_module_default.toggleLabel,
|
|
6538
|
+
children: t("cardOpenGraphLabel")
|
|
6539
|
+
}),
|
|
6540
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6541
|
+
className: GitWorktreeCard_module_default.toggleHint,
|
|
6542
|
+
children: t("cardOpenGraphHint")
|
|
6543
|
+
}),
|
|
6544
|
+
state.switchFailed === "openGraphByDefault" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6545
|
+
className: GitWorktreeCard_module_default.switchBad,
|
|
6546
|
+
role: "alert",
|
|
6547
|
+
children: t("cardSwitchFailed")
|
|
6548
|
+
})
|
|
6549
|
+
]
|
|
6550
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6551
|
+
className: GitWorktreeCard_module_default.toggleControl,
|
|
6552
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6553
|
+
className: GitWorktreeCard_module_default.toggle,
|
|
6554
|
+
type: "checkbox",
|
|
6555
|
+
disabled: lockInput,
|
|
6556
|
+
checked: state.openGraphByDefault,
|
|
6557
|
+
onChange: (event) => {
|
|
6558
|
+
props.setOpenGraphByDefault(event.target.checked);
|
|
6559
|
+
}
|
|
6560
|
+
})
|
|
6561
|
+
})]
|
|
6562
|
+
}),
|
|
6226
6563
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6227
6564
|
className: `${GitWorktreeCard_module_default.field} ${GitWorktreeCard_module_default.manageRow}`,
|
|
6228
6565
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -6521,6 +6858,12 @@ window.__ModuleLoader__.load({
|
|
|
6521
6858
|
updateFailDiverged: "The branch has diverged. Merge or rebase its upstream first.",
|
|
6522
6859
|
updateFailDirty: "Uncommitted changes would be overwritten by the fast-forward. Commit or stash them, then update again.",
|
|
6523
6860
|
updateFailNoUpstream: "This branch has no upstream to update from. Push it and set an upstream first.",
|
|
6861
|
+
fetchFailRemotePathMissing: "Remote {remote} points at a folder that is gone or is not a Git repository: {path}. Point it at a valid address (git remote set-url {remote} <url>), or leave it out of bulk fetches (git config remote.{remote}.skipFetchAll true).",
|
|
6862
|
+
fetchFailRemoteNotFound: "Remote {remote} was not found at {url}. Check the address, or that you still have access.",
|
|
6863
|
+
fetchFailRemoteAuthFailed: "Remote {remote} refused the connection: authentication failed. Check your credentials or SSH key.",
|
|
6864
|
+
fetchFailRemoteUnreachable: "Remote {remote} could not be reached: {url}. Check the network and the address.",
|
|
6865
|
+
fetchFailRemoteUnknown: "Remote {remote} could not be fetched.",
|
|
6866
|
+
fetchFailRemoteUnnamed: "repository",
|
|
6524
6867
|
syncTitleFetch: "Fetching remote branches",
|
|
6525
6868
|
syncTitleUpdate: "Updating {branch}",
|
|
6526
6869
|
syncTitlePush: "Pushing {branch}",
|
|
@@ -6590,6 +6933,8 @@ window.__ModuleLoader__.load({
|
|
|
6590
6933
|
cardSave: "Save",
|
|
6591
6934
|
cardSaving: "Saving…",
|
|
6592
6935
|
cardSwitchFailed: "This switch did not save. Try again.",
|
|
6936
|
+
cardOpenGraphLabel: "Open the commit graph by default",
|
|
6937
|
+
cardOpenGraphHint: "Clicking the branch button in the composer opens the graph.",
|
|
6593
6938
|
cardManageWorktrees: "Manage worktrees…",
|
|
6594
6939
|
cardManageHint: "Browse and remove worktrees across repositories — including directories never registered as workspaces.",
|
|
6595
6940
|
cardFetchBeforeCreateLabel: "Fetch upstream before creating",
|
|
@@ -6725,6 +7070,12 @@ window.__ModuleLoader__.load({
|
|
|
6725
7070
|
updateFailDiverged: "分支已分叉,请先合并或变基上游。",
|
|
6726
7071
|
updateFailDirty: "工作区有未提交的改动,快进会覆盖它们。请先提交或暂存这些改动,再更新。",
|
|
6727
7072
|
updateFailNoUpstream: "当前分支没有可用的上游,无法更新。请先推送并设置上游。",
|
|
7073
|
+
fetchFailRemotePathMissing: "远程仓库{remote}的地址指向的目录已不存在或不是 Git 仓库:{path}。请把它指向有效地址(git remote set-url {remote} <地址>),或让它不再参与批量抓取(git config remote.{remote}.skipFetchAll true)。",
|
|
7074
|
+
fetchFailRemoteNotFound: "远程仓库{remote}在 {url} 上不存在。请检查地址,或确认你仍有访问权限。",
|
|
7075
|
+
fetchFailRemoteAuthFailed: "远程仓库{remote}拒绝了连接:认证失败。请检查凭据或 SSH 私钥。",
|
|
7076
|
+
fetchFailRemoteUnreachable: "远程仓库{remote}无法访问:{url}。请检查网络与地址。",
|
|
7077
|
+
fetchFailRemoteUnknown: "远程仓库{remote}抓取失败。",
|
|
7078
|
+
fetchFailRemoteUnnamed: "",
|
|
6728
7079
|
syncTitleFetch: "正在提取远程分支",
|
|
6729
7080
|
syncTitleUpdate: "正在更新 {branch}",
|
|
6730
7081
|
syncTitlePush: "正在推送 {branch}",
|
|
@@ -6794,6 +7145,8 @@ window.__ModuleLoader__.load({
|
|
|
6794
7145
|
cardSave: "保存",
|
|
6795
7146
|
cardSaving: "保存中…",
|
|
6796
7147
|
cardSwitchFailed: "该开关未保存,请重试。",
|
|
7148
|
+
cardOpenGraphLabel: "默认展开 Git 图谱",
|
|
7149
|
+
cardOpenGraphHint: "点击对话框里的分支图标时直接打开提交图谱。",
|
|
6797
7150
|
cardManageWorktrees: "管理工作树…",
|
|
6798
7151
|
cardManageHint: "跨仓库查看并删除全部工作树,包含从未注册为工作区的目录。",
|
|
6799
7152
|
cardFetchBeforeCreateLabel: "创建工作树前同步上游",
|
|
@@ -6957,6 +7310,10 @@ window.__ModuleLoader__.load({
|
|
|
6957
7310
|
archiveSessionIds: facts.archiveIds
|
|
6958
7311
|
});
|
|
6959
7312
|
},
|
|
7313
|
+
openGraphByDefault: () => {
|
|
7314
|
+
const section = groupingForm.getSnapshot();
|
|
7315
|
+
return section.status === "ready" && section.value?.openGraphByDefault === true;
|
|
7316
|
+
},
|
|
6960
7317
|
pruneWorktrees: async (createdPath) => {
|
|
6961
7318
|
const section = groupingForm.getSnapshot();
|
|
6962
7319
|
if (section.status !== "ready") return void 0;
|