@banzhe/dsh-workbench 0.3.0 → 0.3.1
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 +3 -3
- package/README.zh-CN.md +3 -3
- package/lib/client.js +403 -378
- package/lib/client.js.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1141,6 +1141,18 @@ window.__ModuleLoader__.load({
|
|
|
1141
1141
|
}
|
|
1142
1142
|
return counts;
|
|
1143
1143
|
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Project one Session's row from the current snapshots: the list's own label,
|
|
1146
|
+
* recency and directory, plus the pin, archive, live and completion bits every
|
|
1147
|
+
* browsing surface shows. The tree and the In work folds both read rows through
|
|
1148
|
+
* this one projection, so a Session carries identical state wherever it lists.
|
|
1149
|
+
* @param s - the Session's list row.
|
|
1150
|
+
* @param statuses - unified UI status by Session.
|
|
1151
|
+
* @param descendants - running subagent descendant counts by ancestor.
|
|
1152
|
+
* @param pinned - registry-global pin set.
|
|
1153
|
+
* @param archived - registry-global archive set.
|
|
1154
|
+
* @returns the row facts the browsing surfaces render.
|
|
1155
|
+
*/
|
|
1144
1156
|
function sessionNode(s, statuses, descendants, pinned, archived) {
|
|
1145
1157
|
const status = statuses.get(s.id);
|
|
1146
1158
|
const pendingInteraction = visiblePendingKind(status?.pendingInteraction?.kind);
|
|
@@ -1810,80 +1822,57 @@ window.__ModuleLoader__.load({
|
|
|
1810
1822
|
}
|
|
1811
1823
|
//#endregion
|
|
1812
1824
|
//#region src/client/attention/model.ts
|
|
1813
|
-
/**
|
|
1825
|
+
/** Every group lists newest first; the sort is stable, so equal timestamps keep Host list order. */
|
|
1814
1826
|
function byRecency(left, right) {
|
|
1815
1827
|
return right.updatedAt - left.updatedAt;
|
|
1816
1828
|
}
|
|
1817
|
-
/** Pinned rows lead the unread group; each side keeps the stable newest-first order. */
|
|
1818
|
-
function byUnreadPriority(left, right) {
|
|
1819
|
-
const leftPinned = left.row.pinned === true ? 0 : 1;
|
|
1820
|
-
const rightPinned = right.row.pinned === true ? 0 : 1;
|
|
1821
|
-
if (leftPinned !== rightPinned) return leftPinned - rightPinned;
|
|
1822
|
-
return right.updatedAt - left.updatedAt;
|
|
1823
|
-
}
|
|
1824
1829
|
/**
|
|
1825
1830
|
* Fold one list snapshot, one status snapshot, and the archive and pin sets into
|
|
1826
1831
|
* the region's content.
|
|
1827
1832
|
* @param list - Session list snapshot, in Host list order.
|
|
1828
1833
|
* @param status - per-Session status map.
|
|
1829
1834
|
* @param archived - archived Session ids, which never list.
|
|
1830
|
-
* @param pinned - pinned Session ids, which
|
|
1835
|
+
* @param pinned - pinned Session ids, which list only under `pinned`.
|
|
1831
1836
|
* @returns the model the region renders.
|
|
1832
1837
|
*/
|
|
1833
1838
|
function deriveAttention(list, status, archived, pinned) {
|
|
1834
|
-
const running = [];
|
|
1835
1839
|
const unread = [];
|
|
1840
|
+
const pinnedRows = [];
|
|
1841
|
+
const running = [];
|
|
1836
1842
|
const blocked = /* @__PURE__ */ new Set();
|
|
1837
1843
|
const descendants = runningDescendantCounts(list, status);
|
|
1838
1844
|
list.ids.forEach((id) => {
|
|
1839
1845
|
const row = list.byId[id];
|
|
1840
1846
|
if (row === void 0) return;
|
|
1841
1847
|
if (row.origin === "subagent" || row.blank || archived.has(id)) return;
|
|
1842
|
-
|
|
1843
|
-
const
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
...isPinned ? { pinned: true } : {}
|
|
1851
|
-
}
|
|
1852
|
-
});
|
|
1853
|
-
if (entry?.pendingInteraction !== void 0) blocked.add(id);
|
|
1848
|
+
if (status.get(id)?.pendingInteraction !== void 0) blocked.add(id);
|
|
1849
|
+
const node = sessionNode(row, status, descendants, pinned, archived);
|
|
1850
|
+
const candidate = {
|
|
1851
|
+
updatedAt: row.updatedAt,
|
|
1852
|
+
row: node
|
|
1853
|
+
};
|
|
1854
|
+
if (node.pinned) {
|
|
1855
|
+
pinnedRows.push(candidate);
|
|
1854
1856
|
return;
|
|
1855
1857
|
}
|
|
1856
|
-
if (
|
|
1857
|
-
|
|
1858
|
-
updatedAt: row.updatedAt,
|
|
1859
|
-
row: {
|
|
1860
|
-
id,
|
|
1861
|
-
title: row.displayTitle,
|
|
1862
|
-
...isPinned ? { pinned: true } : {}
|
|
1863
|
-
}
|
|
1864
|
-
});
|
|
1865
|
-
if (entry.pendingInteraction !== void 0) blocked.add(id);
|
|
1858
|
+
if (node.running || node.runningSubagentCount > 0) {
|
|
1859
|
+
running.push(candidate);
|
|
1866
1860
|
return;
|
|
1867
1861
|
}
|
|
1868
|
-
if (
|
|
1869
|
-
unread.push({
|
|
1870
|
-
updatedAt: row.updatedAt,
|
|
1871
|
-
row: {
|
|
1872
|
-
id,
|
|
1873
|
-
title: row.displayTitle,
|
|
1874
|
-
container: true,
|
|
1875
|
-
pinned: true
|
|
1876
|
-
}
|
|
1877
|
-
});
|
|
1878
|
-
if (entry?.pendingInteraction !== void 0) blocked.add(id);
|
|
1879
|
-
}
|
|
1862
|
+
if (node.completed) unread.push(candidate);
|
|
1880
1863
|
});
|
|
1864
|
+
const unreadRows = unread.sort(byRecency).map((candidate) => candidate.row);
|
|
1865
|
+
const pinnedRowsSorted = pinnedRows.sort(byRecency).map((candidate) => candidate.row);
|
|
1881
1866
|
const runningRows = running.sort(byRecency).map((candidate) => candidate.row);
|
|
1882
|
-
const unreadRows = unread.sort(byUnreadPriority).map((candidate) => candidate.row);
|
|
1883
1867
|
return {
|
|
1884
|
-
running: runningRows,
|
|
1885
1868
|
unread: unreadRows,
|
|
1886
|
-
|
|
1869
|
+
pinned: pinnedRowsSorted,
|
|
1870
|
+
running: runningRows,
|
|
1871
|
+
waiting: [
|
|
1872
|
+
...unreadRows,
|
|
1873
|
+
...pinnedRowsSorted,
|
|
1874
|
+
...runningRows
|
|
1875
|
+
].filter((row) => blocked.has(row.id))
|
|
1887
1876
|
};
|
|
1888
1877
|
}
|
|
1889
1878
|
/**
|
|
@@ -1895,8 +1884,15 @@ window.__ModuleLoader__.load({
|
|
|
1895
1884
|
return [
|
|
1896
1885
|
row.id,
|
|
1897
1886
|
row.title,
|
|
1898
|
-
row.
|
|
1899
|
-
row.
|
|
1887
|
+
row.blank ? "b" : "",
|
|
1888
|
+
row.running ? "r" : "",
|
|
1889
|
+
String(row.runningSubagentCount),
|
|
1890
|
+
row.completed ? "c" : "",
|
|
1891
|
+
row.pinned ? "p" : "",
|
|
1892
|
+
row.archived ? "a" : "",
|
|
1893
|
+
row.pendingInteraction ?? "",
|
|
1894
|
+
String(row.updatedAt),
|
|
1895
|
+
row.cwd ?? ""
|
|
1900
1896
|
].join("");
|
|
1901
1897
|
}
|
|
1902
1898
|
function rowsKey(rows) {
|
|
@@ -1904,7 +1900,7 @@ window.__ModuleLoader__.load({
|
|
|
1904
1900
|
}
|
|
1905
1901
|
/** Whether two models would render identically. */
|
|
1906
1902
|
function sameModel(left, right) {
|
|
1907
|
-
return rowsKey(left.
|
|
1903
|
+
return rowsKey(left.unread) === rowsKey(right.unread) && rowsKey(left.pinned) === rowsKey(right.pinned) && rowsKey(left.running) === rowsKey(right.running) && rowsKey(left.waiting) === rowsKey(right.waiting);
|
|
1908
1904
|
}
|
|
1909
1905
|
/**
|
|
1910
1906
|
* Keep the model in step with the four sources it folds: the Session list, the
|
|
@@ -1970,15 +1966,42 @@ window.__ModuleLoader__.load({
|
|
|
1970
1966
|
return typeof setProgressBar === "function" ? setProgressBar : void 0;
|
|
1971
1967
|
}
|
|
1972
1968
|
/**
|
|
1969
|
+
* Whether one listed Session finished while nobody looked: the reminder the pulse
|
|
1970
|
+
* must not talk over. A run in flight is not one, even with the flag still set on
|
|
1971
|
+
* it — the flag is cleared by opening the Session, not by a new turn.
|
|
1972
|
+
* @param row - one listed Session.
|
|
1973
|
+
* @returns true when the row reports finished and nothing about it is live.
|
|
1974
|
+
*/
|
|
1975
|
+
function finishedUnreadAtRest(row) {
|
|
1976
|
+
return row.completed && !isLive(row);
|
|
1977
|
+
}
|
|
1978
|
+
/**
|
|
1979
|
+
* Whether a listed Session has work in flight: its own run, or the subagent work
|
|
1980
|
+
* delegated below it.
|
|
1981
|
+
* @param row - one listed Session.
|
|
1982
|
+
* @returns true while the Session carries running work.
|
|
1983
|
+
*/
|
|
1984
|
+
function isLive(row) {
|
|
1985
|
+
return row.running || row.runningSubagentCount > 0;
|
|
1986
|
+
}
|
|
1987
|
+
/**
|
|
1973
1988
|
* Whether the current content earns the taskbar pulse: work is in flight, and
|
|
1974
|
-
* nothing is blocked on the user or finished-unread.
|
|
1975
|
-
*
|
|
1976
|
-
* its own
|
|
1989
|
+
* nothing is blocked on the user or finished-unread. Placement never decides this:
|
|
1990
|
+
* a pinned Session at rest is in view because the user asked, so it is not a new
|
|
1991
|
+
* notification and never pulses on its own, while a pinned Session that runs or
|
|
1992
|
+
* finished unread counts exactly like an unpinned one.
|
|
1977
1993
|
* @param model - the current In work content.
|
|
1978
1994
|
* @returns true when the Windows progress bar should run indeterminate.
|
|
1979
1995
|
*/
|
|
1980
1996
|
function shouldPulseTaskbar(model) {
|
|
1981
|
-
|
|
1997
|
+
const listed = [
|
|
1998
|
+
...model.unread,
|
|
1999
|
+
...model.pinned,
|
|
2000
|
+
...model.running
|
|
2001
|
+
];
|
|
2002
|
+
if (!listed.some(isLive)) return false;
|
|
2003
|
+
if (model.waiting.length > 0) return false;
|
|
2004
|
+
return !listed.some(finishedUnreadAtRest);
|
|
1982
2005
|
}
|
|
1983
2006
|
/**
|
|
1984
2007
|
* One write per pulse/clear transition. A repeated state is a no-op, so an
|
|
@@ -2045,51 +2068,51 @@ window.__ModuleLoader__.load({
|
|
|
2045
2068
|
document.head.appendChild(tag);
|
|
2046
2069
|
}
|
|
2047
2070
|
var WorkspaceBrowser_module_css_default = {
|
|
2048
|
-
"searchExpanded": "hlvKNa_searchExpanded",
|
|
2049
|
-
"root": "hlvKNa_root",
|
|
2050
|
-
"clearButton": "hlvKNa_clearButton",
|
|
2051
|
-
"searchSpacingMotion": "hlvKNa_searchSpacingMotion",
|
|
2052
|
-
"searchInput": "hlvKNa_searchInput",
|
|
2053
|
-
"workspaceDropBefore": "hlvKNa_workspaceDropBefore",
|
|
2054
|
-
"list": "hlvKNa_list",
|
|
2055
2071
|
"iconButton": "hlvKNa_iconButton",
|
|
2056
|
-
"
|
|
2072
|
+
"searchButton": "hlvKNa_searchButton",
|
|
2057
2073
|
"wide": "hlvKNa_wide",
|
|
2058
|
-
"
|
|
2059
|
-
"rail": "hlvKNa_rail",
|
|
2074
|
+
"listTopDropIndicator": "hlvKNa_listTopDropIndicator",
|
|
2060
2075
|
"sectionLabelHidden": "hlvKNa_sectionLabelHidden",
|
|
2076
|
+
"workspaceDropAfter": "hlvKNa_workspaceDropAfter",
|
|
2077
|
+
"listTopDropActive": "hlvKNa_listTopDropActive",
|
|
2078
|
+
"searchTree": "hlvKNa_searchTree",
|
|
2079
|
+
"root": "hlvKNa_root",
|
|
2080
|
+
"sectionLabel": "hlvKNa_sectionLabel",
|
|
2081
|
+
"viewOptionsMenu": "hlvKNa_viewOptionsMenu",
|
|
2082
|
+
"searchStatus": "hlvKNa_searchStatus",
|
|
2061
2083
|
"skeletonBars": "hlvKNa_skeletonBars",
|
|
2062
|
-
"
|
|
2063
|
-
"wide-in": "hlvKNa_wide-in",
|
|
2064
|
-
"search-skeleton": "hlvKNa_search-skeleton",
|
|
2065
|
-
"empty": "hlvKNa_empty",
|
|
2066
|
-
"searchButton": "hlvKNa_searchButton",
|
|
2084
|
+
"archiveActivity": "hlvKNa_archiveActivity",
|
|
2067
2085
|
"sectionHeader": "hlvKNa_sectionHeader",
|
|
2068
|
-
"
|
|
2069
|
-
"
|
|
2070
|
-
"emptyAction": "hlvKNa_emptyAction",
|
|
2071
|
-
"skeletonDot": "hlvKNa_skeletonDot",
|
|
2072
|
-
"deleteStatus": "hlvKNa_deleteStatus",
|
|
2073
|
-
"listTopDropIndicator": "hlvKNa_listTopDropIndicator",
|
|
2074
|
-
"searchStatus": "hlvKNa_searchStatus",
|
|
2086
|
+
"skeletonRow": "hlvKNa_skeletonRow",
|
|
2087
|
+
"workspaceDropBefore": "hlvKNa_workspaceDropBefore",
|
|
2075
2088
|
"renameInput": "hlvKNa_renameInput",
|
|
2076
|
-
"
|
|
2077
|
-
"
|
|
2078
|
-
"workspaceDropAfter": "hlvKNa_workspaceDropAfter",
|
|
2089
|
+
"wide-in": "hlvKNa_wide-in",
|
|
2090
|
+
"rail": "hlvKNa_rail",
|
|
2079
2091
|
"headerActionsHidden": "hlvKNa_headerActionsHidden",
|
|
2092
|
+
"searchSlot": "hlvKNa_searchSlot",
|
|
2093
|
+
"listArea": "hlvKNa_listArea",
|
|
2080
2094
|
"deleteAction": "hlvKNa_deleteAction",
|
|
2095
|
+
"empty": "hlvKNa_empty",
|
|
2096
|
+
"skeletonBar": "hlvKNa_skeletonBar",
|
|
2097
|
+
"renameError": "hlvKNa_renameError",
|
|
2098
|
+
"list": "hlvKNa_list",
|
|
2081
2099
|
"groupSection": "hlvKNa_groupSection",
|
|
2082
|
-
"
|
|
2100
|
+
"skeletonBarWide": "hlvKNa_skeletonBarWide",
|
|
2101
|
+
"searchSpacingMotion": "hlvKNa_searchSpacingMotion",
|
|
2102
|
+
"deleteStatus": "hlvKNa_deleteStatus",
|
|
2103
|
+
"skeletonDot": "hlvKNa_skeletonDot",
|
|
2083
2104
|
"sessionOverflowButton": "hlvKNa_sessionOverflowButton",
|
|
2105
|
+
"emptyState": "hlvKNa_emptyState",
|
|
2106
|
+
"clearButton": "hlvKNa_clearButton",
|
|
2107
|
+
"search-skeleton": "hlvKNa_search-skeleton",
|
|
2108
|
+
"emptyAction": "hlvKNa_emptyAction",
|
|
2084
2109
|
"searchSlotExpanded": "hlvKNa_searchSlotExpanded",
|
|
2085
|
-
"
|
|
2110
|
+
"search": "hlvKNa_search",
|
|
2111
|
+
"flatList": "hlvKNa_flatList",
|
|
2086
2112
|
"treeBody": "hlvKNa_treeBody",
|
|
2087
|
-
"renameError": "hlvKNa_renameError",
|
|
2088
|
-
"searchTree": "hlvKNa_searchTree",
|
|
2089
2113
|
"headerActions": "hlvKNa_headerActions",
|
|
2090
|
-
"
|
|
2091
|
-
"
|
|
2092
|
-
"emptyState": "hlvKNa_emptyState"
|
|
2114
|
+
"searchInput": "hlvKNa_searchInput",
|
|
2115
|
+
"searchExpanded": "hlvKNa_searchExpanded"
|
|
2093
2116
|
};
|
|
2094
2117
|
//#endregion
|
|
2095
2118
|
//#region src/client/rows/WorkspaceDialogs.tsx
|
|
@@ -2261,47 +2284,47 @@ window.__ModuleLoader__.load({
|
|
|
2261
2284
|
document.head.appendChild(tag);
|
|
2262
2285
|
}
|
|
2263
2286
|
var Rows_module_css_default = {
|
|
2264
|
-
"
|
|
2265
|
-
"
|
|
2266
|
-
"
|
|
2267
|
-
"hoverArchived": "Nlsn7q_hoverArchived",
|
|
2268
|
-
"rowQuickActions": "Nlsn7q_rowQuickActions",
|
|
2269
|
-
"dragPreview": "Nlsn7q_dragPreview",
|
|
2270
|
-
"arrow": "Nlsn7q_arrow",
|
|
2271
|
-
"dropBefore": "Nlsn7q_dropBefore",
|
|
2272
|
-
"searchResultHeading": "Nlsn7q_searchResultHeading",
|
|
2287
|
+
"slot": "Nlsn7q_slot",
|
|
2288
|
+
"searchResultMeta": "Nlsn7q_searchResultMeta",
|
|
2289
|
+
"renameInput": "Nlsn7q_renameInput",
|
|
2273
2290
|
"projectRow": "Nlsn7q_projectRow",
|
|
2274
|
-
"
|
|
2275
|
-
"
|
|
2276
|
-
"folderActive": "Nlsn7q_folderActive",
|
|
2291
|
+
"rowResting": "Nlsn7q_rowResting",
|
|
2292
|
+
"searchResultHeading": "Nlsn7q_searchResultHeading",
|
|
2277
2293
|
"dot": "Nlsn7q_dot",
|
|
2278
|
-
"
|
|
2294
|
+
"hoverTitle": "Nlsn7q_hoverTitle",
|
|
2295
|
+
"searchResultRow": "Nlsn7q_searchResultRow",
|
|
2296
|
+
"rowQuickActions": "Nlsn7q_rowQuickActions",
|
|
2297
|
+
"rowActions": "Nlsn7q_rowActions",
|
|
2298
|
+
"pinnedAction": "Nlsn7q_pinnedAction",
|
|
2279
2299
|
"hoverStatus": "Nlsn7q_hoverStatus",
|
|
2300
|
+
"searchResultWorkspace": "Nlsn7q_searchResultWorkspace",
|
|
2301
|
+
"hoverPath": "Nlsn7q_hoverPath",
|
|
2302
|
+
"archived": "Nlsn7q_archived",
|
|
2303
|
+
"sessionRow": "Nlsn7q_sessionRow",
|
|
2280
2304
|
"searchResultTitle": "Nlsn7q_searchResultTitle",
|
|
2281
|
-
"rowActions": "Nlsn7q_rowActions",
|
|
2282
2305
|
"chevron": "Nlsn7q_chevron",
|
|
2283
|
-
"
|
|
2284
|
-
"arrowOpen": "Nlsn7q_arrowOpen",
|
|
2285
|
-
"slot": "Nlsn7q_slot",
|
|
2286
|
-
"folder": "Nlsn7q_folder",
|
|
2287
|
-
"searchResultWorkspace": "Nlsn7q_searchResultWorkspace",
|
|
2288
|
-
"selected": "Nlsn7q_selected",
|
|
2289
|
-
"pinIndicator": "Nlsn7q_pinIndicator",
|
|
2290
|
-
"projectText": "Nlsn7q_projectText",
|
|
2306
|
+
"menuOpen": "Nlsn7q_menuOpen",
|
|
2291
2307
|
"folderActivity": "Nlsn7q_folderActivity",
|
|
2292
|
-
"
|
|
2308
|
+
"meta": "Nlsn7q_meta",
|
|
2309
|
+
"timestamp": "Nlsn7q_timestamp",
|
|
2310
|
+
"hoverArchived": "Nlsn7q_hoverArchived",
|
|
2311
|
+
"dropBefore": "Nlsn7q_dropBefore",
|
|
2312
|
+
"iconButton": "Nlsn7q_iconButton",
|
|
2293
2313
|
"searchResultSnippet": "Nlsn7q_searchResultSnippet",
|
|
2294
|
-
"
|
|
2295
|
-
"
|
|
2296
|
-
"
|
|
2314
|
+
"hoverContent": "Nlsn7q_hoverContent",
|
|
2315
|
+
"selected": "Nlsn7q_selected",
|
|
2316
|
+
"arrowOpen": "Nlsn7q_arrowOpen",
|
|
2297
2317
|
"time": "Nlsn7q_time",
|
|
2298
|
-
"
|
|
2299
|
-
"iconButton": "Nlsn7q_iconButton",
|
|
2318
|
+
"dropAfter": "Nlsn7q_dropAfter",
|
|
2300
2319
|
"visuallyHidden": "Nlsn7q_visuallyHidden",
|
|
2301
|
-
"
|
|
2302
|
-
"
|
|
2303
|
-
"
|
|
2304
|
-
"
|
|
2320
|
+
"title": "Nlsn7q_title",
|
|
2321
|
+
"hoverTime": "Nlsn7q_hoverTime",
|
|
2322
|
+
"folderActive": "Nlsn7q_folderActive",
|
|
2323
|
+
"pinIndicator": "Nlsn7q_pinIndicator",
|
|
2324
|
+
"arrow": "Nlsn7q_arrow",
|
|
2325
|
+
"folder": "Nlsn7q_folder",
|
|
2326
|
+
"projectText": "Nlsn7q_projectText",
|
|
2327
|
+
"dragPreview": "Nlsn7q_dragPreview"
|
|
2305
2328
|
};
|
|
2306
2329
|
//#endregion
|
|
2307
2330
|
//#region src/client/rows/Rows.tsx
|
|
@@ -2838,7 +2861,7 @@ window.__ModuleLoader__.load({
|
|
|
2838
2861
|
* @param props.t - the browser root's locale seat.
|
|
2839
2862
|
* @returns the session row.
|
|
2840
2863
|
*/
|
|
2841
|
-
function SessionNodeItem({ node, currentId, now, onOpen, onRenameRequest, renderSlot, renderFactorySlot, useContextMenuTarget, useContextMenu, onReveal, drag, home, useSessionAccess, t }) {
|
|
2864
|
+
function SessionNodeItem({ node, currentId, now, onOpen, onRenameRequest, renderSlot, renderFactorySlot, useContextMenuTarget, useContextMenu, onReveal, rowKey, drag, home, useSessionAccess, t }) {
|
|
2842
2865
|
const { getTriggerProps } = useContextMenu();
|
|
2843
2866
|
const row = node;
|
|
2844
2867
|
const title = displayTitle(node, t);
|
|
@@ -2869,7 +2892,7 @@ window.__ModuleLoader__.load({
|
|
|
2869
2892
|
}, [onReveal]);
|
|
2870
2893
|
const ownRow = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2871
2894
|
ref: rowRef,
|
|
2872
|
-
"data-row-key": `session:${node.id}`,
|
|
2895
|
+
"data-row-key": rowKey ?? `session:${node.id}`,
|
|
2873
2896
|
className: clsx(Rows_module_css_default.sessionRow, selected && Rows_module_css_default.selected, menuOpen && Rows_module_css_default.menuOpen, row.archived && Rows_module_css_default.archived, drag?.marker === "before" && Rows_module_css_default.dropBefore, drag?.marker === "after" && Rows_module_css_default.dropAfter),
|
|
2874
2897
|
role: "treeitem",
|
|
2875
2898
|
"aria-selected": selected,
|
|
@@ -3029,12 +3052,12 @@ window.__ModuleLoader__.load({
|
|
|
3029
3052
|
document.head.appendChild(tag);
|
|
3030
3053
|
}
|
|
3031
3054
|
var WorkspacePicker_module_css_default = {
|
|
3032
|
-
"menuStatus": "_i1QeG_menuStatus",
|
|
3033
|
-
"title": "_i1QeG_title",
|
|
3034
|
-
"modalAction": "_i1QeG_modalAction",
|
|
3035
3055
|
"disambiguated": "_i1QeG_disambiguated",
|
|
3056
|
+
"menuStatus": "_i1QeG_menuStatus",
|
|
3036
3057
|
"modalError": "_i1QeG_modalError",
|
|
3037
|
-
"pathSuffix": "_i1QeG_pathSuffix"
|
|
3058
|
+
"pathSuffix": "_i1QeG_pathSuffix",
|
|
3059
|
+
"title": "_i1QeG_title",
|
|
3060
|
+
"modalAction": "_i1QeG_modalAction"
|
|
3038
3061
|
};
|
|
3039
3062
|
//#endregion
|
|
3040
3063
|
//#region src/client/WorkspacePicker.tsx
|
|
@@ -3227,7 +3250,7 @@ window.__ModuleLoader__.load({
|
|
|
3227
3250
|
}
|
|
3228
3251
|
//#endregion
|
|
3229
3252
|
//#region \0dsh-css-module:/home/runner/work/dsh-plugins/dsh-plugins/plugins/workbench/src/client/attention/AttentionSection.module.css.mjs
|
|
3230
|
-
const css = ".iFQc1W_section{
|
|
3253
|
+
const css = ".iFQc1W_section{flex-direction:column;gap:2px;padding:2px 0 0;display:flex}.iFQc1W_group,.iFQc1W_groupBody{flex-direction:column;display:flex}.iFQc1W_groupBody[hidden]{display:none}.iFQc1W_list{flex-direction:column;gap:2px;display:flex}.iFQc1W_groupHeader{appearance:none;width:100%;font:inherit;text-align:left;background-color:#0000;border-block:0}.iFQc1W_groupHeader:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}";
|
|
3231
3254
|
const tagId = "@banzhe/dsh-workbench/AttentionSection.module.css";
|
|
3232
3255
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
3233
3256
|
const tag = document.createElement("style");
|
|
@@ -3237,142 +3260,93 @@ window.__ModuleLoader__.load({
|
|
|
3237
3260
|
document.head.appendChild(tag);
|
|
3238
3261
|
}
|
|
3239
3262
|
var AttentionSection_module_css_default = {
|
|
3240
|
-
"rowButton": "iFQc1W_rowButton",
|
|
3241
3263
|
"section": "iFQc1W_section",
|
|
3242
|
-
"group": "iFQc1W_group",
|
|
3243
3264
|
"groupBody": "iFQc1W_groupBody",
|
|
3244
|
-
"
|
|
3245
|
-
"
|
|
3265
|
+
"groupHeader": "iFQc1W_groupHeader",
|
|
3266
|
+
"group": "iFQc1W_group",
|
|
3267
|
+
"list": "iFQc1W_list"
|
|
3246
3268
|
};
|
|
3247
3269
|
//#endregion
|
|
3248
3270
|
//#region src/client/attention/AttentionSection.tsx
|
|
3249
3271
|
/**
|
|
3250
|
-
* The
|
|
3251
|
-
*
|
|
3252
|
-
*
|
|
3253
|
-
* draws no
|
|
3272
|
+
* The browsing region's four folds: the three quick groups the In work model lists
|
|
3273
|
+
* — unread, pinned, running — and the workspace tree itself. Each fold is an
|
|
3274
|
+
* independent, labelled section with its own header button and fold state; the
|
|
3275
|
+
* region draws no title or total above them.
|
|
3254
3276
|
*
|
|
3255
|
-
* The
|
|
3256
|
-
*
|
|
3257
|
-
*
|
|
3258
|
-
*
|
|
3259
|
-
*
|
|
3277
|
+
* The three quick groups render the browsing list's own Session rows
|
|
3278
|
+
* (rows/Rows.tsx), not a private row shape: focus, hover, the row menu trigger,
|
|
3279
|
+
* the hover card, the pin mark, the relative time and the row's action strip are
|
|
3280
|
+
* the same code the tree below runs. The menu and the hover actions are the shared
|
|
3281
|
+
* `contextMenu.button` factory and the `sidebar.workspaces.session.row.action`
|
|
3282
|
+
* list, so pin/unpin, archive, rename and fork behave here exactly as they do in
|
|
3283
|
+
* the tree — this region copies no menu, no Host write, no access gate and no copy.
|
|
3260
3284
|
*
|
|
3261
|
-
*
|
|
3262
|
-
*
|
|
3263
|
-
* the
|
|
3264
|
-
*
|
|
3265
|
-
*
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
*
|
|
3269
|
-
*
|
|
3270
|
-
*
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
if (row.container === true) return void 0;
|
|
3274
|
-
if (waiting.has(row.id)) return "warning";
|
|
3275
|
-
return group === "running" ? "ongoing" : "done";
|
|
3276
|
-
}
|
|
3277
|
-
/**
|
|
3278
|
-
* One row in a fold: the list's own row box, its click target, the resting mark a
|
|
3279
|
-
* pinned Session carries at rest, and the hover action strip that releases the
|
|
3280
|
-
* pin. The access gate is asked once per row — the same gate the list row's pin
|
|
3281
|
-
* button uses — so a refused Session keeps its resting mark and never renders an
|
|
3282
|
-
* empty action strip.
|
|
3283
|
-
* @param props - the Session, its group, the callbacks it needs, and the gate.
|
|
3284
|
-
* @returns the row item.
|
|
3285
|
-
*/
|
|
3286
|
-
function AttentionRowItem({ row, group, waiting, open, unpin, label, unpinLabel, unpinTitle, useSessionAccess }) {
|
|
3287
|
-
const canUnpin = useSessionAccess(row.id, "workspace/unpinSession");
|
|
3288
|
-
const pinned = row.pinned === true;
|
|
3289
|
-
const dot = dotStateOf(group, row, waiting);
|
|
3290
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3291
|
-
className: Rows_module_css_default.sessionRow,
|
|
3292
|
-
children: [
|
|
3293
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3294
|
-
type: "button",
|
|
3295
|
-
className: AttentionSection_module_css_default.rowButton,
|
|
3296
|
-
"aria-label": label(row.title, pinned),
|
|
3297
|
-
onClick: () => {
|
|
3298
|
-
open(row.id);
|
|
3299
|
-
},
|
|
3300
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3301
|
-
className: Rows_module_css_default.slot,
|
|
3302
|
-
children: dot !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
3303
|
-
state: dot,
|
|
3304
|
-
size: 7
|
|
3305
|
-
})
|
|
3306
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3307
|
-
className: Rows_module_css_default.title,
|
|
3308
|
-
children: row.title
|
|
3309
|
-
})]
|
|
3310
|
-
}),
|
|
3311
|
-
pinned && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3312
|
-
className: Rows_module_css_default.rowResting,
|
|
3313
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3314
|
-
className: Rows_module_css_default.pinIndicator,
|
|
3315
|
-
"aria-hidden": "true",
|
|
3316
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPinFillRegular, { size: 14 })
|
|
3317
|
-
})
|
|
3318
|
-
}),
|
|
3319
|
-
pinned && canUnpin && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3320
|
-
className: Rows_module_css_default.rowActions,
|
|
3321
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
3322
|
-
label: unpinTitle,
|
|
3323
|
-
side: "bottom",
|
|
3324
|
-
align: "end",
|
|
3325
|
-
delayMs: 500,
|
|
3326
|
-
portal: true,
|
|
3327
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3328
|
-
type: "button",
|
|
3329
|
-
className: clsx(Rows_module_css_default.iconButton, Rows_module_css_default.pinnedAction),
|
|
3330
|
-
"aria-label": unpinLabel,
|
|
3331
|
-
onClick: () => {
|
|
3332
|
-
unpin(row.id);
|
|
3333
|
-
},
|
|
3334
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPinFillRegular, { size: 14 })
|
|
3335
|
-
})
|
|
3336
|
-
})
|
|
3337
|
-
})
|
|
3338
|
-
]
|
|
3339
|
-
}) });
|
|
3340
|
-
}
|
|
3341
|
-
/**
|
|
3342
|
-
* One group's rows, each a Session the fold listed.
|
|
3343
|
-
* @param props - the rows, the group they belong to, and the callbacks they need.
|
|
3344
|
-
* @returns the group's list.
|
|
3285
|
+
* A Session can list here and in the tree at once, so each quick-group row takes
|
|
3286
|
+
* its own row key (`quick:<group>:<id>`) and the two occurrences stay distinct in
|
|
3287
|
+
* the DOM. Everything else follows the Session, not the occurrence: opening,
|
|
3288
|
+
* renaming and every row action are addressed by Session id, so either occurrence
|
|
3289
|
+
* raises the same navigation, the same dialog and the same Host call, and the
|
|
3290
|
+
* shared context-menu target reports the menu open on both — the same fact either
|
|
3291
|
+
* way. Row dragging is the one behaviour the quick groups leave out: reordering
|
|
3292
|
+
* belongs to the tree, which owns the account order.
|
|
3293
|
+
*
|
|
3294
|
+
* Opening a row goes through the Workspace owner's guarded open (the same call the
|
|
3295
|
+
* tree rows make), which selects the Session as the main view and lets ui-session
|
|
3296
|
+
* clear its unread flag. The region persists nothing and writes nothing.
|
|
3345
3297
|
*/
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
}
|
|
3298
|
+
/** The three quick groups, in display order, each with the dictionary key naming it. */
|
|
3299
|
+
const QUICK_GROUPS = [
|
|
3300
|
+
{
|
|
3301
|
+
fold: "unread",
|
|
3302
|
+
labelKey: "attention.section.unread"
|
|
3303
|
+
},
|
|
3304
|
+
{
|
|
3305
|
+
fold: "pinned",
|
|
3306
|
+
labelKey: "attention.section.pinned"
|
|
3307
|
+
},
|
|
3308
|
+
{
|
|
3309
|
+
fold: "running",
|
|
3310
|
+
labelKey: "attention.section.running"
|
|
3311
|
+
}
|
|
3312
|
+
];
|
|
3362
3313
|
/**
|
|
3363
|
-
* One
|
|
3364
|
-
*
|
|
3365
|
-
*
|
|
3366
|
-
*
|
|
3314
|
+
* One fold: a header button that owns the fold state, and its body. The header is
|
|
3315
|
+
* the session rows' own 32px box with the tree's filled triangle in the leading
|
|
3316
|
+
* cell, so a fold label starts on the same edge as the titles under it. The
|
|
3317
|
+
* header's text names the fold and, for a quick group, its count; the button's
|
|
3318
|
+
* `aria-expanded`/`aria-controls` pair is what makes the fold reachable and
|
|
3319
|
+
* operable from the keyboard and from a screen reader.
|
|
3320
|
+
*
|
|
3321
|
+
* A quick group's rows are cheap and stateless, so its body leaves the tree on
|
|
3322
|
+
* collapse. The browsing list's fold is the opposite: the list holds its own
|
|
3323
|
+
* view state — the "Show more" watermarks, group expansion, and the scroll
|
|
3324
|
+
* position of a revealed Session — so its body stays mounted and is hidden
|
|
3325
|
+
* instead, keeping that state and keeping `aria-controls` pointing at a real
|
|
3326
|
+
* element whether the fold is open or closed.
|
|
3327
|
+
* @param props.fold - the fold's stable key, also its id stem.
|
|
3328
|
+
* @param props.title - localized fold name.
|
|
3329
|
+
* @param props.count - entries in the fold, for a quick group; the list reports its own.
|
|
3330
|
+
* @param props.keepMounted - keep the body mounted while folded, hiding it instead.
|
|
3331
|
+
* @param props.children - the fold's body content.
|
|
3332
|
+
* @returns the fold section.
|
|
3367
3333
|
*/
|
|
3368
|
-
function
|
|
3334
|
+
function Fold({ fold, title, count, keepMounted = false, children }) {
|
|
3369
3335
|
const [expanded, setExpanded] = (0, react.useState)(true);
|
|
3336
|
+
const headerId = `workspace-fold-${fold}-header`;
|
|
3337
|
+
const bodyId = `workspace-fold-${fold}-body`;
|
|
3338
|
+
const mounted = keepMounted || expanded;
|
|
3339
|
+
const controls = mounted ? bodyId : void 0;
|
|
3370
3340
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3371
3341
|
className: AttentionSection_module_css_default.group,
|
|
3342
|
+
"data-browser-fold": fold,
|
|
3343
|
+
"aria-labelledby": headerId,
|
|
3372
3344
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
3345
|
+
id: headerId,
|
|
3373
3346
|
type: "button",
|
|
3374
3347
|
className: clsx(Rows_module_css_default.sessionRow, AttentionSection_module_css_default.groupHeader),
|
|
3375
3348
|
"aria-expanded": expanded,
|
|
3349
|
+
"aria-controls": controls,
|
|
3376
3350
|
onClick: () => {
|
|
3377
3351
|
setExpanded((current) => !current);
|
|
3378
3352
|
},
|
|
@@ -3380,66 +3354,108 @@ window.__ModuleLoader__.load({
|
|
|
3380
3354
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3381
3355
|
className: clsx(Rows_module_css_default.slot, Rows_module_css_default.chevron),
|
|
3382
3356
|
"aria-hidden": "true",
|
|
3383
|
-
children:
|
|
3357
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTriangleRightFillRegular, {
|
|
3358
|
+
size: 14,
|
|
3359
|
+
className: clsx(Rows_module_css_default.arrow, expanded && Rows_module_css_default.arrowOpen)
|
|
3360
|
+
})
|
|
3384
3361
|
}),
|
|
3385
3362
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3386
3363
|
className: Rows_module_css_default.title,
|
|
3387
3364
|
children: title
|
|
3388
3365
|
}),
|
|
3389
|
-
" ",
|
|
3390
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3366
|
+
count !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [" ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3391
3367
|
className: Rows_module_css_default.time,
|
|
3392
3368
|
children: count
|
|
3393
|
-
})
|
|
3369
|
+
})] })
|
|
3394
3370
|
]
|
|
3395
|
-
}),
|
|
3371
|
+
}), mounted && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3372
|
+
id: bodyId,
|
|
3396
3373
|
className: AttentionSection_module_css_default.groupBody,
|
|
3374
|
+
"data-browser-fold-body": "",
|
|
3375
|
+
hidden: !expanded,
|
|
3397
3376
|
children
|
|
3398
3377
|
})]
|
|
3399
3378
|
});
|
|
3400
3379
|
}
|
|
3401
3380
|
/**
|
|
3402
|
-
*
|
|
3403
|
-
*
|
|
3404
|
-
*
|
|
3405
|
-
*
|
|
3381
|
+
* One quick group's rows: the browsing list's own session rows, each carrying the
|
|
3382
|
+
* group's row key so it never collides with the same Session's tree row. The rows
|
|
3383
|
+
* sit in the shell's own hover-card group, so the group shares the tree's dwell
|
|
3384
|
+
* and one-card-at-a-time coordination instead of reimplementing it; the list
|
|
3385
|
+
* itself keeps the tree's role and label and the rows' 32px box.
|
|
3386
|
+
* @param props.rows - the group's Sessions, in the model's order.
|
|
3387
|
+
* @param props.fold - the group, which scopes the row keys.
|
|
3388
|
+
* @param props.label - the group's localized name, used as the tree label.
|
|
3389
|
+
* @param props.seats - the row seats plus the render clock.
|
|
3390
|
+
* @returns the group's rows, in a hover-card group of their own.
|
|
3391
|
+
*/
|
|
3392
|
+
function GroupRows({ rows, fold, label, seats }) {
|
|
3393
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.HoverCardGroup, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3394
|
+
className: AttentionSection_module_css_default.list,
|
|
3395
|
+
role: "tree",
|
|
3396
|
+
"aria-label": label,
|
|
3397
|
+
children: rows.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionNodeItem, {
|
|
3398
|
+
rowKey: `quick:${fold}:${row.id}`,
|
|
3399
|
+
node: row,
|
|
3400
|
+
currentId: seats.currentId,
|
|
3401
|
+
now: seats.now,
|
|
3402
|
+
onOpen: seats.open,
|
|
3403
|
+
onRenameRequest: seats.onSessionRenameRequest,
|
|
3404
|
+
renderSlot: seats.renderSlot,
|
|
3405
|
+
renderFactorySlot: seats.renderFactorySlot,
|
|
3406
|
+
useContextMenu: seats.useContextMenu,
|
|
3407
|
+
useContextMenuTarget: seats.useContextMenuTarget,
|
|
3408
|
+
home: seats.home,
|
|
3409
|
+
useSessionAccess: seats.useSessionAccess,
|
|
3410
|
+
t: seats.t
|
|
3411
|
+
}, row.id))
|
|
3412
|
+
}) });
|
|
3413
|
+
}
|
|
3414
|
+
/**
|
|
3415
|
+
* The four folds: the quick groups that have entries, then the browsing list's own
|
|
3416
|
+
* fold, which always renders, always starts open, and keeps its content mounted
|
|
3417
|
+
* while folded.
|
|
3418
|
+
* @param props - the model hook, the row seats, the fourth fold's title, and the browsing body.
|
|
3419
|
+
* @returns the region's folds.
|
|
3406
3420
|
*/
|
|
3407
|
-
function AttentionSection({ useAttention, useSessionAccess, open,
|
|
3421
|
+
function AttentionSection({ useAttention, useSessionAccess, open, onSessionRenameRequest, currentId, home, workspacesTitle, renderSlot, renderFactorySlot, useContextMenuTarget, useContextMenu, t, children }) {
|
|
3408
3422
|
const model = useAttention((current) => current);
|
|
3409
|
-
const
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3423
|
+
const seats = {
|
|
3424
|
+
currentId,
|
|
3425
|
+
home,
|
|
3426
|
+
open,
|
|
3427
|
+
onSessionRenameRequest,
|
|
3428
|
+
useSessionAccess,
|
|
3429
|
+
renderSlot,
|
|
3430
|
+
renderFactorySlot,
|
|
3431
|
+
useContextMenuTarget,
|
|
3432
|
+
useContextMenu,
|
|
3433
|
+
t,
|
|
3434
|
+
now: Date.now()
|
|
3435
|
+
};
|
|
3436
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3413
3437
|
className: AttentionSection_module_css_default.section,
|
|
3414
|
-
"data-
|
|
3415
|
-
children: [
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
waiting,
|
|
3436
|
-
open,
|
|
3437
|
-
unpin,
|
|
3438
|
-
label,
|
|
3439
|
-
unpinLabel: t("attention.row.unpin"),
|
|
3440
|
-
unpinTitle: t("actions.unpin"),
|
|
3441
|
-
useSessionAccess
|
|
3442
|
-
})
|
|
3438
|
+
"data-browser-folds": "",
|
|
3439
|
+
children: [QUICK_GROUPS.map(({ fold, labelKey }) => {
|
|
3440
|
+
const rows = model[fold];
|
|
3441
|
+
if (rows.length === 0) return null;
|
|
3442
|
+
const label = t(labelKey);
|
|
3443
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Fold, {
|
|
3444
|
+
fold,
|
|
3445
|
+
title: label,
|
|
3446
|
+
count: rows.length,
|
|
3447
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupRows, {
|
|
3448
|
+
rows,
|
|
3449
|
+
fold,
|
|
3450
|
+
label,
|
|
3451
|
+
seats
|
|
3452
|
+
})
|
|
3453
|
+
}, fold);
|
|
3454
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Fold, {
|
|
3455
|
+
fold: "workspaces",
|
|
3456
|
+
title: workspacesTitle,
|
|
3457
|
+
keepMounted: true,
|
|
3458
|
+
children
|
|
3443
3459
|
})]
|
|
3444
3460
|
});
|
|
3445
3461
|
}
|
|
@@ -3448,13 +3464,14 @@ window.__ModuleLoader__.load({
|
|
|
3448
3464
|
/**
|
|
3449
3465
|
* The workspace/session browsing region filling the sidebar shell's
|
|
3450
3466
|
* `sidebar.workspaces` hole: section header (title + view options + add
|
|
3451
|
-
* workspace), search, the
|
|
3452
|
-
*
|
|
3453
|
-
* region icons (search / add workspace) as
|
|
3454
|
-
* rail entry path, each requesting
|
|
3455
|
-
* is the header button's one action,
|
|
3456
|
-
* menu in between; the flow and its
|
|
3457
|
-
* (same package — direct composition, no
|
|
3467
|
+
* workspace), search, the four folds (unread, pinned, running, and the grouped
|
|
3468
|
+
* tree or flat list), and the workspace dialogs. Wide state renders the full
|
|
3469
|
+
* browser; rail state renders the two region icons (search / add workspace) as
|
|
3470
|
+
* 36px controls on the shell's shared rail entry path, each requesting
|
|
3471
|
+
* expansion through the owner share. Adding is the header button's one action,
|
|
3472
|
+
* so it raises the directory flow with no menu in between; the flow and its
|
|
3473
|
+
* error dialog live in WorkspacePicker (same package — direct composition, no
|
|
3474
|
+
* slot between them). A Session row's
|
|
3458
3475
|
* "..." menu and hover buttons are the `sidebar.workspaces.session.menu.item`
|
|
3459
3476
|
* and `sidebar.workspaces.session.row.action` lists rendered through this
|
|
3460
3477
|
* entry's `renderSlot`; the actions in them, this package's own included,
|
|
@@ -4178,7 +4195,7 @@ window.__ModuleLoader__.load({
|
|
|
4178
4195
|
* @param props - composed slot props (shell owner share + store + injected actions).
|
|
4179
4196
|
* @returns the region element tree.
|
|
4180
4197
|
*/
|
|
4181
|
-
function WorkspaceBrowser({ wide, usePanelInfo, expandSidebar, useSectionScroller, useSessions, useSessionStatus, useSessionAccess, useWorkspaceAccess, useWorkspaces, useStore, actions, startSession, open, requestSessionRename, notifyArchivedNotOpenable, renameWorkspace, useWorkspaceActionRequest, settleWorkspaceAction, deleteWorkspace, insertWorkspaceBefore, unarchiveSession,
|
|
4198
|
+
function WorkspaceBrowser({ wide, usePanelInfo, expandSidebar, useSectionScroller, useSessions, useSessionStatus, useSessionAccess, useWorkspaceAccess, useWorkspaces, useStore, actions, startSession, open, requestSessionRename, notifyArchivedNotOpenable, renameWorkspace, useWorkspaceActionRequest, settleWorkspaceAction, deleteWorkspace, insertWorkspaceBefore, unarchiveSession, createWorkspace, searchSessions, searchResultLimit, useDirectoryFlow, useHostInfo, useAttention, useShortcuts, useWorkspaceShortcuts, requestSearch, requestAddWorkspace, closeAddWorkspace, setDirectoryBusy, renderSlot, renderFactorySlot, useContextMenuTarget, useContextMenu, t }) {
|
|
4182
4199
|
const home = useHostInfo((info) => info.home);
|
|
4183
4200
|
const shortcuts = useShortcuts((rows) => rows);
|
|
4184
4201
|
const searchShortcut = shortcuts.find((row) => row.id === "session.search");
|
|
@@ -4213,6 +4230,7 @@ window.__ModuleLoader__.load({
|
|
|
4213
4230
|
};
|
|
4214
4231
|
const workspaceReady = workspacePhase === "ready" && workspaceStreamState !== "loading";
|
|
4215
4232
|
const mainSessionId = Object.values(list.byId).find((session) => (session.retainedBy.mainView ?? 0) > 0)?.id;
|
|
4233
|
+
const highlightedSessionId = usePanelInfo((info) => info.activePanelId !== null) ? void 0 : mainSessionId;
|
|
4216
4234
|
const currentBlank = mainSessionId !== void 0 && list.byId[mainSessionId]?.blank === true ? mainSessionId : void 0;
|
|
4217
4235
|
const ungroupedMemberIds = (0, react.useMemo)(() => {
|
|
4218
4236
|
const accounted = new Set(workspaces.flatMap((workspace) => workspace.sessionIds));
|
|
@@ -4607,17 +4625,11 @@ window.__ModuleLoader__.load({
|
|
|
4607
4625
|
})
|
|
4608
4626
|
})
|
|
4609
4627
|
}),
|
|
4610
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
4628
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4611
4629
|
ref: wide ? bindScrollerRef : void 0,
|
|
4612
4630
|
className: WorkspaceBrowser_module_css_default.listArea,
|
|
4613
4631
|
"data-sidebar-list-area": "",
|
|
4614
|
-
children:
|
|
4615
|
-
useAttention,
|
|
4616
|
-
useSessionAccess,
|
|
4617
|
-
open: guardedOpen,
|
|
4618
|
-
unpin: unpinSession,
|
|
4619
|
-
t
|
|
4620
|
-
}), wide && (normalizedQuery !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchResults, {
|
|
4632
|
+
children: wide && (normalizedQuery !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchResults, {
|
|
4621
4633
|
usePanelInfo,
|
|
4622
4634
|
useSessionAccess,
|
|
4623
4635
|
useSessions,
|
|
@@ -4631,57 +4643,71 @@ window.__ModuleLoader__.load({
|
|
|
4631
4643
|
remote: remoteSearch,
|
|
4632
4644
|
resultLimit: searchResultLimit,
|
|
4633
4645
|
t
|
|
4634
|
-
}) :
|
|
4646
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AttentionSection, {
|
|
4647
|
+
useAttention,
|
|
4635
4648
|
useSessionAccess,
|
|
4636
|
-
usePanelInfo,
|
|
4637
|
-
list,
|
|
4638
|
-
sessionIds: orderedFlatSessionIds,
|
|
4639
|
-
rowState,
|
|
4640
|
-
onLeaveArchivedOnly: leaveArchivedOnly,
|
|
4641
|
-
workspaceReady,
|
|
4642
|
-
animationResetKey: `${groupBy}/${orderBy}/${archivedFilter}`,
|
|
4643
|
-
useSessionStatus,
|
|
4644
4649
|
open: guardedOpen,
|
|
4645
4650
|
onSessionRenameRequest: requestSessionRename,
|
|
4646
|
-
|
|
4647
|
-
renderFactorySlot,
|
|
4648
|
-
useContextMenu,
|
|
4649
|
-
useContextMenuTarget,
|
|
4650
|
-
setSessionOrder: saveSessionOrder,
|
|
4651
|
-
revealSessionId,
|
|
4652
|
-
onSessionRevealed: acknowledgeSessionReveal,
|
|
4651
|
+
currentId: highlightedSessionId,
|
|
4653
4652
|
home,
|
|
4654
|
-
t
|
|
4655
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionTree, {
|
|
4656
|
-
useSessionAccess,
|
|
4657
|
-
useWorkspaceAccess,
|
|
4658
|
-
usePanelInfo,
|
|
4659
|
-
list,
|
|
4660
|
-
shortcuts,
|
|
4661
|
-
useSessionStatus,
|
|
4662
|
-
onSessionRenameRequest: requestSessionRename,
|
|
4653
|
+
workspacesTitle: groupBy === "flat" ? t("attention.section.allSessions") : t("attention.section.allWorkspaces"),
|
|
4663
4654
|
renderSlot,
|
|
4664
4655
|
renderFactorySlot,
|
|
4665
4656
|
useContextMenu,
|
|
4666
4657
|
useContextMenuTarget,
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4658
|
+
t,
|
|
4659
|
+
children: groupBy === "flat" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FlatList, {
|
|
4660
|
+
useSessionAccess,
|
|
4661
|
+
usePanelInfo,
|
|
4662
|
+
list,
|
|
4663
|
+
sessionIds: orderedFlatSessionIds,
|
|
4664
|
+
rowState,
|
|
4665
|
+
onLeaveArchivedOnly: leaveArchivedOnly,
|
|
4666
|
+
workspaceReady,
|
|
4667
|
+
animationResetKey: `${groupBy}/${orderBy}/${archivedFilter}`,
|
|
4668
|
+
useSessionStatus,
|
|
4669
|
+
open: guardedOpen,
|
|
4670
|
+
onSessionRenameRequest: requestSessionRename,
|
|
4671
|
+
renderSlot,
|
|
4672
|
+
renderFactorySlot,
|
|
4673
|
+
useContextMenu,
|
|
4674
|
+
useContextMenuTarget,
|
|
4675
|
+
setSessionOrder: saveSessionOrder,
|
|
4676
|
+
revealSessionId,
|
|
4677
|
+
onSessionRevealed: acknowledgeSessionReveal,
|
|
4678
|
+
home,
|
|
4679
|
+
t
|
|
4680
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionTree, {
|
|
4681
|
+
useSessionAccess,
|
|
4682
|
+
useWorkspaceAccess,
|
|
4683
|
+
usePanelInfo,
|
|
4684
|
+
list,
|
|
4685
|
+
shortcuts,
|
|
4686
|
+
useSessionStatus,
|
|
4687
|
+
onSessionRenameRequest: requestSessionRename,
|
|
4688
|
+
renderSlot,
|
|
4689
|
+
renderFactorySlot,
|
|
4690
|
+
useContextMenu,
|
|
4691
|
+
useContextMenuTarget,
|
|
4692
|
+
workspaces: orderedWorkspaces,
|
|
4693
|
+
ungroupedSessionIds: orderedUngroupedSessionIds,
|
|
4694
|
+
workspaceReady,
|
|
4695
|
+
nestWorkspaces: groupBy === "workspace-tree",
|
|
4696
|
+
animationResetKey: `${groupBy}/${orderBy}/${archivedFilter}`,
|
|
4697
|
+
groupExpansion,
|
|
4698
|
+
setGroupExpanded: actions.setGroupExpanded,
|
|
4699
|
+
setSessionOrder: saveSessionOrder,
|
|
4700
|
+
rowState,
|
|
4701
|
+
onLeaveArchivedOnly: leaveArchivedOnly,
|
|
4702
|
+
startSession,
|
|
4703
|
+
open: guardedOpen,
|
|
4704
|
+
insertWorkspaceBefore,
|
|
4705
|
+
revealSessionId,
|
|
4706
|
+
onSessionRevealed: acknowledgeSessionReveal,
|
|
4707
|
+
home,
|
|
4708
|
+
t
|
|
4709
|
+
})
|
|
4710
|
+
}))
|
|
4685
4711
|
}),
|
|
4686
4712
|
workspaceActionRequest !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorkspaceDialogs, {
|
|
4687
4713
|
request: workspaceActionRequest,
|
|
@@ -5390,11 +5416,11 @@ window.__ModuleLoader__.load({
|
|
|
5390
5416
|
"time.months": "{n}个月",
|
|
5391
5417
|
"time.years": "{n}年",
|
|
5392
5418
|
"time.ago": "{t}前",
|
|
5419
|
+
"attention.section.allSessions": "全部会话",
|
|
5420
|
+
"attention.section.allWorkspaces": "全部工作区",
|
|
5421
|
+
"attention.section.pinned": "置顶",
|
|
5393
5422
|
"attention.section.running": "运行中",
|
|
5394
|
-
"attention.section.unread": "未读"
|
|
5395
|
-
"attention.row.open": "打开会话 {title}",
|
|
5396
|
-
"attention.row.openPinned": "打开置顶会话 {title}",
|
|
5397
|
-
"attention.row.unpin": "取消置顶"
|
|
5423
|
+
"attention.section.unread": "未读"
|
|
5398
5424
|
};
|
|
5399
5425
|
/** English dictionary, checked complete against the zh key set. */
|
|
5400
5426
|
const en = {
|
|
@@ -5519,11 +5545,11 @@ window.__ModuleLoader__.load({
|
|
|
5519
5545
|
"time.months": "{n}mo",
|
|
5520
5546
|
"time.years": "{n}y",
|
|
5521
5547
|
"time.ago": "{t} ago",
|
|
5548
|
+
"attention.section.allSessions": "All sessions",
|
|
5549
|
+
"attention.section.allWorkspaces": "All workspaces",
|
|
5550
|
+
"attention.section.pinned": "Pinned",
|
|
5522
5551
|
"attention.section.running": "Running",
|
|
5523
|
-
"attention.section.unread": "Unread"
|
|
5524
|
-
"attention.row.open": "Open session {title}",
|
|
5525
|
-
"attention.row.openPinned": "Open pinned session {title}",
|
|
5526
|
-
"attention.row.unpin": "Unpin session"
|
|
5552
|
+
"attention.section.unread": "Unread"
|
|
5527
5553
|
};
|
|
5528
5554
|
/** Japanese copy, checked against the English keys. */
|
|
5529
5555
|
const ja = {
|
|
@@ -5648,11 +5674,11 @@ window.__ModuleLoader__.load({
|
|
|
5648
5674
|
"time.months": "{n}か月",
|
|
5649
5675
|
"time.years": "{n}年",
|
|
5650
5676
|
"time.ago": "{t}前",
|
|
5677
|
+
"attention.section.allSessions": "すべてのセッション",
|
|
5678
|
+
"attention.section.allWorkspaces": "すべてのワークスペース",
|
|
5679
|
+
"attention.section.pinned": "ピン留め",
|
|
5651
5680
|
"attention.section.running": "実行中",
|
|
5652
|
-
"attention.section.unread": "未読"
|
|
5653
|
-
"attention.row.open": "セッション {title} を開く",
|
|
5654
|
-
"attention.row.openPinned": "ピン留めしたセッション {title} を開く",
|
|
5655
|
-
"attention.row.unpin": "ピン留めを解除"
|
|
5681
|
+
"attention.section.unread": "未読"
|
|
5656
5682
|
};
|
|
5657
5683
|
/** Spanish dictionary, checked against the English keys. */
|
|
5658
5684
|
const es = {
|
|
@@ -5777,11 +5803,11 @@ window.__ModuleLoader__.load({
|
|
|
5777
5803
|
"time.months": "{n}mo",
|
|
5778
5804
|
"time.years": "{n}y",
|
|
5779
5805
|
"time.ago": "Hace {t}",
|
|
5806
|
+
"attention.section.allSessions": "Todas las sesiones",
|
|
5807
|
+
"attention.section.allWorkspaces": "Todos los espacios de trabajo",
|
|
5808
|
+
"attention.section.pinned": "Fijados",
|
|
5780
5809
|
"attention.section.running": "En ejecución",
|
|
5781
|
-
"attention.section.unread": "Sin leer"
|
|
5782
|
-
"attention.row.open": "Abrir la sesión {title}",
|
|
5783
|
-
"attention.row.openPinned": "Abrir la sesión fijada {title}",
|
|
5784
|
-
"attention.row.unpin": "Desfijar la sesión"
|
|
5810
|
+
"attention.section.unread": "Sin leer"
|
|
5785
5811
|
};
|
|
5786
5812
|
/** French dictionary, checked against the English keys. */
|
|
5787
5813
|
const fr = {
|
|
@@ -5906,11 +5932,11 @@ window.__ModuleLoader__.load({
|
|
|
5906
5932
|
"time.months": "{n}mo",
|
|
5907
5933
|
"time.years": "{n}y",
|
|
5908
5934
|
"time.ago": "Il y a {t}",
|
|
5935
|
+
"attention.section.allSessions": "Toutes les sessions",
|
|
5936
|
+
"attention.section.allWorkspaces": "Tous les espaces de travail",
|
|
5937
|
+
"attention.section.pinned": "Épinglés",
|
|
5909
5938
|
"attention.section.running": "En cours",
|
|
5910
|
-
"attention.section.unread": "Non lues"
|
|
5911
|
-
"attention.row.open": "Ouvrir la session {title}",
|
|
5912
|
-
"attention.row.openPinned": "Ouvrir la session épinglée {title}",
|
|
5913
|
-
"attention.row.unpin": "Désépingler la session"
|
|
5939
|
+
"attention.section.unread": "Non lues"
|
|
5914
5940
|
};
|
|
5915
5941
|
/** German dictionary, checked against the English keys. */
|
|
5916
5942
|
const de = {
|
|
@@ -6035,11 +6061,11 @@ window.__ModuleLoader__.load({
|
|
|
6035
6061
|
"time.months": "{n}mo",
|
|
6036
6062
|
"time.years": "{n}y",
|
|
6037
6063
|
"time.ago": "Vor {t}",
|
|
6064
|
+
"attention.section.allSessions": "Alle Sitzungen",
|
|
6065
|
+
"attention.section.allWorkspaces": "Alle Arbeitsbereiche",
|
|
6066
|
+
"attention.section.pinned": "Angeheftet",
|
|
6038
6067
|
"attention.section.running": "Läuft",
|
|
6039
|
-
"attention.section.unread": "Ungelesen"
|
|
6040
|
-
"attention.row.open": "Sitzung {title} öffnen",
|
|
6041
|
-
"attention.row.openPinned": "Angeheftete Sitzung {title} öffnen",
|
|
6042
|
-
"attention.row.unpin": "Anheftung der Sitzung lösen"
|
|
6068
|
+
"attention.section.unread": "Ungelesen"
|
|
6043
6069
|
};
|
|
6044
6070
|
/** Russian dictionary, checked against the English keys. */
|
|
6045
6071
|
const ru = {
|
|
@@ -6164,11 +6190,11 @@ window.__ModuleLoader__.load({
|
|
|
6164
6190
|
"time.months": "{n}mo",
|
|
6165
6191
|
"time.years": "{n}y",
|
|
6166
6192
|
"time.ago": "{t} назад",
|
|
6193
|
+
"attention.section.allSessions": "Все сеансы",
|
|
6194
|
+
"attention.section.allWorkspaces": "Все рабочие области",
|
|
6195
|
+
"attention.section.pinned": "Закреплённые",
|
|
6167
6196
|
"attention.section.running": "Выполняется",
|
|
6168
|
-
"attention.section.unread": "Непрочитанные"
|
|
6169
|
-
"attention.row.open": "Открыть сеанс {title}",
|
|
6170
|
-
"attention.row.openPinned": "Открыть закреплённый сеанс {title}",
|
|
6171
|
-
"attention.row.unpin": "Открепить сеанс"
|
|
6197
|
+
"attention.section.unread": "Непрочитанные"
|
|
6172
6198
|
};
|
|
6173
6199
|
/** Portuguese dictionary, checked against the English keys. */
|
|
6174
6200
|
const pt = {
|
|
@@ -6293,11 +6319,11 @@ window.__ModuleLoader__.load({
|
|
|
6293
6319
|
"time.months": "{n} mês",
|
|
6294
6320
|
"time.years": "{n}s",
|
|
6295
6321
|
"time.ago": "{t} atrás",
|
|
6322
|
+
"attention.section.allSessions": "Todas as sessões",
|
|
6323
|
+
"attention.section.allWorkspaces": "Todos os espaços de trabalho",
|
|
6324
|
+
"attention.section.pinned": "Fixados",
|
|
6296
6325
|
"attention.section.running": "Em execução",
|
|
6297
|
-
"attention.section.unread": "Não lidas"
|
|
6298
|
-
"attention.row.open": "Abrir a sessão {title}",
|
|
6299
|
-
"attention.row.openPinned": "Abrir a sessão fixada {title}",
|
|
6300
|
-
"attention.row.unpin": "Desafixar a sessão"
|
|
6326
|
+
"attention.section.unread": "Não lidas"
|
|
6301
6327
|
};
|
|
6302
6328
|
//#endregion
|
|
6303
6329
|
//#region src/client/index.ts
|
|
@@ -6617,7 +6643,6 @@ window.__ModuleLoader__.load({
|
|
|
6617
6643
|
unarchiveSession: async (sessionId) => {
|
|
6618
6644
|
await uiWorkspace.unarchiveSession(sessionId);
|
|
6619
6645
|
},
|
|
6620
|
-
unpinSession,
|
|
6621
6646
|
createWorkspace: (input) => workspaces.create(input),
|
|
6622
6647
|
requestSearch: shortcutControls.search,
|
|
6623
6648
|
requestAddWorkspace: shortcutControls.add,
|