@banzhe/dsh-workbench 0.2.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/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,206 +1822,77 @@ window.__ModuleLoader__.load({
1810
1822
  }
1811
1823
  //#endregion
1812
1824
  //#region src/client/attention/model.ts
1813
- /** The running sort is stable, so equal timestamps keep Host list order. */
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
- function childIndexOf(byId) {
1825
- const byParent = /* @__PURE__ */ new Map();
1826
- for (const id of idsOf(byId)) {
1827
- const row = byId[id];
1828
- if (row?.parentId === void 0) continue;
1829
- const siblings = byParent.get(row.parentId);
1830
- if (siblings === void 0) byParent.set(row.parentId, [row]);
1831
- else siblings.push(row);
1832
- }
1833
- return {
1834
- byId,
1835
- byParent
1836
- };
1837
- }
1838
- /**
1839
- * The direct subagent children of one node: the node's own `subagentCatalog`
1840
- * projection order first, then indexed `byId` rows the catalog has not caught up
1841
- * with. A catalog entry with no row here, another `parentId`, or a non-subagent
1842
- * origin is ignored, exactly like a foreign row in the index.
1843
- */
1844
- function directChildrenOf(parent, ctx) {
1845
- const seen = /* @__PURE__ */ new Set();
1846
- const ordered = [];
1847
- for (const entry of ctx.list.projectionsBySession[parent]?.values.subagentCatalog ?? []) {
1848
- const row = ctx.index.byId[entry.id];
1849
- if (row === void 0 || row.parentId !== parent || seen.has(entry.id)) continue;
1850
- seen.add(entry.id);
1851
- ordered.push(row);
1852
- }
1853
- for (const row of ctx.index.byParent.get(parent) ?? []) {
1854
- if (seen.has(row.id)) continue;
1855
- seen.add(row.id);
1856
- ordered.push(row);
1857
- }
1858
- return ordered.filter((row) => row.origin === "subagent");
1859
- }
1860
- /**
1861
- * The node one row contributes, from its own run and its already-assembled
1862
- * children: a running row keeps its title and children, an idle row over running
1863
- * work becomes a container, and a row with neither is not part of the subtree.
1864
- */
1865
- function subtreeNode(row, running, children) {
1866
- if (!running) return children.length === 0 ? void 0 : {
1867
- id: row.id,
1868
- title: row.displayTitle,
1869
- container: true,
1870
- children
1871
- };
1872
- return {
1873
- id: row.id,
1874
- title: row.displayTitle,
1875
- ...children.length === 0 ? {} : { children }
1876
- };
1877
- }
1878
- /**
1879
- * The mounted subtree of one listed Session: every descendant running, or
1880
- * carrying running work below it, nested one level per delegation hop.
1881
- *
1882
- * Two lineage facts make this walk terminate without a visited set. A row carries
1883
- * at most one `parentId`, so the child edges — built once in `byParent` for the
1884
- * whole fold — form a functional graph; and only a row whose `origin` is
1885
- * `subagent` is ever a child. Every node of a cycle would therefore have to be
1886
- * `subagent` (each one is somebody's child) while taking its parent from inside
1887
- * the cycle, so no listed root — which is non-subagent by construction — can be
1888
- * an ancestor of one. An endless dataset would have to break the unique-parent
1889
- * rule to reach this fold.
1890
- *
1891
- * The walk is an explicit stack rather than recursion for the reason
1892
- * `runningDescendantCounts` in tree.ts is: a delegation chain of a few thousand
1893
- * hops is legal input, and the JavaScript call stack is not that deep. Frames are
1894
- * assembled post-order, so a parent is built only after every child below it,
1895
- * and children keep `directChildrenOf` order.
1896
- * @param root - the listed Session whose subtree to expand.
1897
- * @param ctx - this fold's list, child index and status map.
1898
- * @returns the nested node, or `undefined` when neither `root` nor anything below it runs.
1899
- */
1900
- function runningSubtreeOf(root, ctx) {
1901
- const built = /* @__PURE__ */ new Map();
1902
- const frames = [{
1903
- row: root,
1904
- kids: directChildrenOf(root.id, ctx),
1905
- next: 0
1906
- }];
1907
- while (frames.length > 0) {
1908
- const frame = frames[frames.length - 1];
1909
- if (frame.next < frame.kids.length) {
1910
- const kid = frame.kids[frame.next];
1911
- frame.next += 1;
1912
- frames.push({
1913
- row: kid,
1914
- kids: directChildrenOf(kid.id, ctx),
1915
- next: 0
1916
- });
1917
- continue;
1918
- }
1919
- frames.pop();
1920
- const children = [];
1921
- for (const kid of frame.kids) {
1922
- const node = built.get(kid.id);
1923
- if (node !== void 0) children.push(node);
1924
- }
1925
- built.set(frame.row.id, subtreeNode(frame.row, sessionIsRunning(ctx.list, ctx.status, frame.row.id), children));
1926
- }
1927
- return built.get(root.id);
1928
- }
1929
- function idsOf(byId) {
1930
- return Object.keys(byId);
1931
- }
1932
1829
  /**
1933
1830
  * Fold one list snapshot, one status snapshot, and the archive and pin sets into
1934
1831
  * the region's content.
1935
1832
  * @param list - Session list snapshot, in Host list order.
1936
1833
  * @param status - per-Session status map.
1937
1834
  * @param archived - archived Session ids, which never list.
1938
- * @param pinned - pinned Session ids, which lead the unread group at rest.
1835
+ * @param pinned - pinned Session ids, which list only under `pinned`.
1939
1836
  * @returns the model the region renders.
1940
1837
  */
1941
1838
  function deriveAttention(list, status, archived, pinned) {
1942
- const running = [];
1943
1839
  const unread = [];
1840
+ const pinnedRows = [];
1841
+ const running = [];
1944
1842
  const blocked = /* @__PURE__ */ new Set();
1945
- const ctx = {
1946
- list,
1947
- index: childIndexOf(list.byId),
1948
- status
1949
- };
1843
+ const descendants = runningDescendantCounts(list, status);
1950
1844
  list.ids.forEach((id) => {
1951
1845
  const row = list.byId[id];
1952
1846
  if (row === void 0) return;
1953
1847
  if (row.origin === "subagent" || row.blank || archived.has(id)) return;
1954
- const entry = status.get(id);
1955
- const isPinned = pinned.has(id);
1956
- const node = runningSubtreeOf(row, ctx);
1957
- if (node !== void 0) {
1958
- running.push({
1959
- updatedAt: row.updatedAt,
1960
- row: isPinned ? {
1961
- ...node,
1962
- pinned: true
1963
- } : node
1964
- });
1965
- 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);
1966
1856
  return;
1967
1857
  }
1968
- if (entry?.completionUnread === true) {
1969
- unread.push({
1970
- updatedAt: row.updatedAt,
1971
- row: {
1972
- id,
1973
- title: row.displayTitle,
1974
- ...isPinned ? { pinned: true } : {}
1975
- }
1976
- });
1977
- if (entry.pendingInteraction !== void 0) blocked.add(id);
1858
+ if (node.running || node.runningSubagentCount > 0) {
1859
+ running.push(candidate);
1978
1860
  return;
1979
1861
  }
1980
- if (isPinned) {
1981
- unread.push({
1982
- updatedAt: row.updatedAt,
1983
- row: {
1984
- id,
1985
- title: row.displayTitle,
1986
- container: true,
1987
- pinned: true
1988
- }
1989
- });
1990
- if (entry?.pendingInteraction !== void 0) blocked.add(id);
1991
- }
1862
+ if (node.completed) unread.push(candidate);
1992
1863
  });
1864
+ const unreadRows = unread.sort(byRecency).map((candidate) => candidate.row);
1865
+ const pinnedRowsSorted = pinnedRows.sort(byRecency).map((candidate) => candidate.row);
1993
1866
  const runningRows = running.sort(byRecency).map((candidate) => candidate.row);
1994
- const unreadRows = unread.sort(byUnreadPriority).map((candidate) => candidate.row);
1995
1867
  return {
1996
- running: runningRows,
1997
1868
  unread: unreadRows,
1998
- waiting: [...runningRows, ...unreadRows].filter((row) => blocked.has(row.id))
1869
+ pinned: pinnedRowsSorted,
1870
+ running: runningRows,
1871
+ waiting: [
1872
+ ...unreadRows,
1873
+ ...pinnedRowsSorted,
1874
+ ...runningRows
1875
+ ].filter((row) => blocked.has(row.id))
1999
1876
  };
2000
1877
  }
2001
1878
  /**
2002
- * One row's comparable identity: everything the row renders plus its subtree, in
2003
- * order. Two models with equal keys draw the same pixels, which is what lets the
2004
- * store publish a fold only when something visible changed.
1879
+ * One row's comparable identity: everything the row renders. Two models with equal
1880
+ * keys draw the same pixels, which is what lets the store publish a fold only when
1881
+ * something visible changed.
2005
1882
  */
2006
1883
  function rowKey(row) {
2007
1884
  return [
2008
1885
  row.id,
2009
1886
  row.title,
2010
- row.container ? "c" : "",
1887
+ row.blank ? "b" : "",
1888
+ row.running ? "r" : "",
1889
+ String(row.runningSubagentCount),
1890
+ row.completed ? "c" : "",
2011
1891
  row.pinned ? "p" : "",
2012
- row.children === void 0 ? "" : row.children.map(rowKey).join("")
1892
+ row.archived ? "a" : "",
1893
+ row.pendingInteraction ?? "",
1894
+ String(row.updatedAt),
1895
+ row.cwd ?? ""
2013
1896
  ].join("");
2014
1897
  }
2015
1898
  function rowsKey(rows) {
@@ -2017,7 +1900,7 @@ window.__ModuleLoader__.load({
2017
1900
  }
2018
1901
  /** Whether two models would render identically. */
2019
1902
  function sameModel(left, right) {
2020
- return rowsKey(left.running) === rowsKey(right.running) && rowsKey(left.unread) === rowsKey(right.unread) && rowsKey(left.waiting) === rowsKey(right.waiting);
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);
2021
1904
  }
2022
1905
  /**
2023
1906
  * Keep the model in step with the four sources it folds: the Session list, the
@@ -2067,6 +1950,98 @@ window.__ModuleLoader__.load({
2067
1950
  };
2068
1951
  }
2069
1952
  //#endregion
1953
+ //#region src/client/attention/taskbar.ts
1954
+ /** Progress value Electron treats as the Windows indeterminate pulse. */
1955
+ const PULSE = 2;
1956
+ /** Progress value that removes the taskbar indicator. */
1957
+ const CLEAR = -1;
1958
+ /**
1959
+ * Read the shell's taskbar-progress write, or undefined when this page cannot use
1960
+ * it. Absence is the version probe, so the plugin never compares protocol
1961
+ * versions; the caller swallows the rejection a refused IPC produces.
1962
+ * @returns the bridge's write, or undefined when this page has none.
1963
+ */
1964
+ function desktopWindowProgress() {
1965
+ const setProgressBar = globalThis.dshDesktop?.window?.setProgressBar;
1966
+ return typeof setProgressBar === "function" ? setProgressBar : void 0;
1967
+ }
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
+ /**
1988
+ * Whether the current content earns the taskbar pulse: work is in flight, and
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.
1993
+ * @param model - the current In work content.
1994
+ * @returns true when the Windows progress bar should run indeterminate.
1995
+ */
1996
+ function shouldPulseTaskbar(model) {
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);
2005
+ }
2006
+ /**
2007
+ * One write per pulse/clear transition. A repeated state is a no-op, so an
2008
+ * unrelated list update does not re-issue the same platform call.
2009
+ */
2010
+ var TaskbarProgressPresenter = class {
2011
+ write;
2012
+ pulsing;
2013
+ constructor() {
2014
+ this.write = desktopWindowProgress();
2015
+ }
2016
+ /** The page can reach the shell's taskbar-progress write. */
2017
+ get viable() {
2018
+ return this.write !== void 0;
2019
+ }
2020
+ /**
2021
+ * Project one model onto the taskbar, writing only when the state changes.
2022
+ * @param model - the current In work content.
2023
+ */
2024
+ project(model) {
2025
+ const next = shouldPulseTaskbar(model);
2026
+ if (this.pulsing === next) return;
2027
+ this.pulsing = next;
2028
+ this.apply(next ? PULSE : CLEAR);
2029
+ }
2030
+ /** Retract the pulse so a disposed plugin leaves no stale indicator. */
2031
+ clear() {
2032
+ const wasPulsing = this.pulsing === true;
2033
+ this.pulsing = void 0;
2034
+ if (wasPulsing) this.apply(CLEAR);
2035
+ }
2036
+ apply(progress) {
2037
+ const write = this.write;
2038
+ if (write === void 0) return;
2039
+ write(progress).catch((error) => {
2040
+ console.warn("ui-workspace: the shell refused the taskbar progress", error);
2041
+ });
2042
+ }
2043
+ };
2044
+ //#endregion
2070
2045
  //#region ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
2071
2046
  function r(e) {
2072
2047
  var t, f, n = "";
@@ -2093,51 +2068,51 @@ window.__ModuleLoader__.load({
2093
2068
  document.head.appendChild(tag);
2094
2069
  }
2095
2070
  var WorkspaceBrowser_module_css_default = {
2096
- "listArea": "hlvKNa_listArea",
2097
- "treeBody": "hlvKNa_treeBody",
2098
- "flatList": "hlvKNa_flatList",
2071
+ "iconButton": "hlvKNa_iconButton",
2099
2072
  "searchButton": "hlvKNa_searchButton",
2100
- "searchTree": "hlvKNa_searchTree",
2101
- "wide-in": "hlvKNa_wide-in",
2102
- "skeletonBar": "hlvKNa_skeletonBar",
2103
- "searchExpanded": "hlvKNa_searchExpanded",
2104
- "searchSlotExpanded": "hlvKNa_searchSlotExpanded",
2105
- "listTopDropActive": "hlvKNa_listTopDropActive",
2106
- "headerActionsHidden": "hlvKNa_headerActionsHidden",
2107
- "searchInput": "hlvKNa_searchInput",
2108
2073
  "wide": "hlvKNa_wide",
2109
- "deleteStatus": "hlvKNa_deleteStatus",
2110
- "viewOptionsMenu": "hlvKNa_viewOptionsMenu",
2111
- "groupSection": "hlvKNa_groupSection",
2112
- "skeletonDot": "hlvKNa_skeletonDot",
2074
+ "listTopDropIndicator": "hlvKNa_listTopDropIndicator",
2075
+ "sectionLabelHidden": "hlvKNa_sectionLabelHidden",
2076
+ "workspaceDropAfter": "hlvKNa_workspaceDropAfter",
2077
+ "listTopDropActive": "hlvKNa_listTopDropActive",
2078
+ "searchTree": "hlvKNa_searchTree",
2113
2079
  "root": "hlvKNa_root",
2080
+ "sectionLabel": "hlvKNa_sectionLabel",
2081
+ "viewOptionsMenu": "hlvKNa_viewOptionsMenu",
2082
+ "searchStatus": "hlvKNa_searchStatus",
2114
2083
  "skeletonBars": "hlvKNa_skeletonBars",
2115
2084
  "archiveActivity": "hlvKNa_archiveActivity",
2116
- "renameError": "hlvKNa_renameError",
2117
2085
  "sectionHeader": "hlvKNa_sectionHeader",
2118
- "searchSpacingMotion": "hlvKNa_searchSpacingMotion",
2119
- "headerActions": "hlvKNa_headerActions",
2120
- "clearButton": "hlvKNa_clearButton",
2121
- "list": "hlvKNa_list",
2122
- "searchStatus": "hlvKNa_searchStatus",
2123
- "search": "hlvKNa_search",
2124
- "sectionLabelHidden": "hlvKNa_sectionLabelHidden",
2125
- "skeletonBarWide": "hlvKNa_skeletonBarWide",
2126
- "emptyState": "hlvKNa_emptyState",
2127
- "emptyAction": "hlvKNa_emptyAction",
2128
- "renameInput": "hlvKNa_renameInput",
2129
- "deleteAction": "hlvKNa_deleteAction",
2130
- "sectionLabel": "hlvKNa_sectionLabel",
2131
- "search-skeleton": "hlvKNa_search-skeleton",
2132
2086
  "skeletonRow": "hlvKNa_skeletonRow",
2133
- "rail": "hlvKNa_rail",
2134
2087
  "workspaceDropBefore": "hlvKNa_workspaceDropBefore",
2135
- "listTopDropIndicator": "hlvKNa_listTopDropIndicator",
2136
- "empty": "hlvKNa_empty",
2137
- "iconButton": "hlvKNa_iconButton",
2088
+ "renameInput": "hlvKNa_renameInput",
2089
+ "wide-in": "hlvKNa_wide-in",
2090
+ "rail": "hlvKNa_rail",
2091
+ "headerActionsHidden": "hlvKNa_headerActionsHidden",
2138
2092
  "searchSlot": "hlvKNa_searchSlot",
2093
+ "listArea": "hlvKNa_listArea",
2094
+ "deleteAction": "hlvKNa_deleteAction",
2095
+ "empty": "hlvKNa_empty",
2096
+ "skeletonBar": "hlvKNa_skeletonBar",
2097
+ "renameError": "hlvKNa_renameError",
2098
+ "list": "hlvKNa_list",
2099
+ "groupSection": "hlvKNa_groupSection",
2100
+ "skeletonBarWide": "hlvKNa_skeletonBarWide",
2101
+ "searchSpacingMotion": "hlvKNa_searchSpacingMotion",
2102
+ "deleteStatus": "hlvKNa_deleteStatus",
2103
+ "skeletonDot": "hlvKNa_skeletonDot",
2139
2104
  "sessionOverflowButton": "hlvKNa_sessionOverflowButton",
2140
- "workspaceDropAfter": "hlvKNa_workspaceDropAfter"
2105
+ "emptyState": "hlvKNa_emptyState",
2106
+ "clearButton": "hlvKNa_clearButton",
2107
+ "search-skeleton": "hlvKNa_search-skeleton",
2108
+ "emptyAction": "hlvKNa_emptyAction",
2109
+ "searchSlotExpanded": "hlvKNa_searchSlotExpanded",
2110
+ "search": "hlvKNa_search",
2111
+ "flatList": "hlvKNa_flatList",
2112
+ "treeBody": "hlvKNa_treeBody",
2113
+ "headerActions": "hlvKNa_headerActions",
2114
+ "searchInput": "hlvKNa_searchInput",
2115
+ "searchExpanded": "hlvKNa_searchExpanded"
2141
2116
  };
2142
2117
  //#endregion
2143
2118
  //#region src/client/rows/WorkspaceDialogs.tsx
@@ -2309,47 +2284,47 @@ window.__ModuleLoader__.load({
2309
2284
  document.head.appendChild(tag);
2310
2285
  }
2311
2286
  var Rows_module_css_default = {
2312
- "searchResultWorkspace": "Nlsn7q_searchResultWorkspace",
2313
- "archived": "Nlsn7q_archived",
2314
- "arrowOpen": "Nlsn7q_arrowOpen",
2315
- "hoverStatus": "Nlsn7q_hoverStatus",
2287
+ "slot": "Nlsn7q_slot",
2288
+ "searchResultMeta": "Nlsn7q_searchResultMeta",
2289
+ "renameInput": "Nlsn7q_renameInput",
2290
+ "projectRow": "Nlsn7q_projectRow",
2291
+ "rowResting": "Nlsn7q_rowResting",
2292
+ "searchResultHeading": "Nlsn7q_searchResultHeading",
2293
+ "dot": "Nlsn7q_dot",
2294
+ "hoverTitle": "Nlsn7q_hoverTitle",
2295
+ "searchResultRow": "Nlsn7q_searchResultRow",
2316
2296
  "rowQuickActions": "Nlsn7q_rowQuickActions",
2317
2297
  "rowActions": "Nlsn7q_rowActions",
2318
- "dragPreview": "Nlsn7q_dragPreview",
2319
- "rowResting": "Nlsn7q_rowResting",
2320
2298
  "pinnedAction": "Nlsn7q_pinnedAction",
2321
- "renameInput": "Nlsn7q_renameInput",
2322
- "hoverArchived": "Nlsn7q_hoverArchived",
2323
- "searchResultHeading": "Nlsn7q_searchResultHeading",
2324
- "arrow": "Nlsn7q_arrow",
2299
+ "hoverStatus": "Nlsn7q_hoverStatus",
2300
+ "searchResultWorkspace": "Nlsn7q_searchResultWorkspace",
2301
+ "hoverPath": "Nlsn7q_hoverPath",
2302
+ "archived": "Nlsn7q_archived",
2303
+ "sessionRow": "Nlsn7q_sessionRow",
2304
+ "searchResultTitle": "Nlsn7q_searchResultTitle",
2305
+ "chevron": "Nlsn7q_chevron",
2306
+ "menuOpen": "Nlsn7q_menuOpen",
2307
+ "folderActivity": "Nlsn7q_folderActivity",
2308
+ "meta": "Nlsn7q_meta",
2325
2309
  "timestamp": "Nlsn7q_timestamp",
2310
+ "hoverArchived": "Nlsn7q_hoverArchived",
2311
+ "dropBefore": "Nlsn7q_dropBefore",
2312
+ "iconButton": "Nlsn7q_iconButton",
2326
2313
  "searchResultSnippet": "Nlsn7q_searchResultSnippet",
2327
- "pinIndicator": "Nlsn7q_pinIndicator",
2314
+ "hoverContent": "Nlsn7q_hoverContent",
2315
+ "selected": "Nlsn7q_selected",
2316
+ "arrowOpen": "Nlsn7q_arrowOpen",
2317
+ "time": "Nlsn7q_time",
2318
+ "dropAfter": "Nlsn7q_dropAfter",
2328
2319
  "visuallyHidden": "Nlsn7q_visuallyHidden",
2329
- "searchResultRow": "Nlsn7q_searchResultRow",
2330
- "projectRow": "Nlsn7q_projectRow",
2331
2320
  "title": "Nlsn7q_title",
2332
- "chevron": "Nlsn7q_chevron",
2333
- "folderActive": "Nlsn7q_folderActive",
2334
- "searchResultMeta": "Nlsn7q_searchResultMeta",
2335
2321
  "hoverTime": "Nlsn7q_hoverTime",
2336
- "dropBefore": "Nlsn7q_dropBefore",
2337
- "searchResultTitle": "Nlsn7q_searchResultTitle",
2338
- "selected": "Nlsn7q_selected",
2322
+ "folderActive": "Nlsn7q_folderActive",
2323
+ "pinIndicator": "Nlsn7q_pinIndicator",
2324
+ "arrow": "Nlsn7q_arrow",
2339
2325
  "folder": "Nlsn7q_folder",
2340
- "sessionRow": "Nlsn7q_sessionRow",
2341
- "dot": "Nlsn7q_dot",
2342
- "slot": "Nlsn7q_slot",
2343
- "menuOpen": "Nlsn7q_menuOpen",
2344
- "hoverTitle": "Nlsn7q_hoverTitle",
2345
- "dropAfter": "Nlsn7q_dropAfter",
2346
- "time": "Nlsn7q_time",
2347
- "hoverPath": "Nlsn7q_hoverPath",
2348
- "hoverContent": "Nlsn7q_hoverContent",
2349
2326
  "projectText": "Nlsn7q_projectText",
2350
- "folderActivity": "Nlsn7q_folderActivity",
2351
- "meta": "Nlsn7q_meta",
2352
- "iconButton": "Nlsn7q_iconButton"
2327
+ "dragPreview": "Nlsn7q_dragPreview"
2353
2328
  };
2354
2329
  //#endregion
2355
2330
  //#region src/client/rows/Rows.tsx
@@ -2886,7 +2861,7 @@ window.__ModuleLoader__.load({
2886
2861
  * @param props.t - the browser root's locale seat.
2887
2862
  * @returns the session row.
2888
2863
  */
2889
- 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 }) {
2890
2865
  const { getTriggerProps } = useContextMenu();
2891
2866
  const row = node;
2892
2867
  const title = displayTitle(node, t);
@@ -2917,7 +2892,7 @@ window.__ModuleLoader__.load({
2917
2892
  }, [onReveal]);
2918
2893
  const ownRow = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2919
2894
  ref: rowRef,
2920
- "data-row-key": `session:${node.id}`,
2895
+ "data-row-key": rowKey ?? `session:${node.id}`,
2921
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),
2922
2897
  role: "treeitem",
2923
2898
  "aria-selected": selected,
@@ -3077,12 +3052,12 @@ window.__ModuleLoader__.load({
3077
3052
  document.head.appendChild(tag);
3078
3053
  }
3079
3054
  var WorkspacePicker_module_css_default = {
3080
- "menuStatus": "_i1QeG_menuStatus",
3081
3055
  "disambiguated": "_i1QeG_disambiguated",
3056
+ "menuStatus": "_i1QeG_menuStatus",
3082
3057
  "modalError": "_i1QeG_modalError",
3083
- "modalAction": "_i1QeG_modalAction",
3084
3058
  "pathSuffix": "_i1QeG_pathSuffix",
3085
- "title": "_i1QeG_title"
3059
+ "title": "_i1QeG_title",
3060
+ "modalAction": "_i1QeG_modalAction"
3086
3061
  };
3087
3062
  //#endregion
3088
3063
  //#region src/client/WorkspacePicker.tsx
@@ -3275,7 +3250,7 @@ window.__ModuleLoader__.load({
3275
3250
  }
3276
3251
  //#endregion
3277
3252
  //#region \0dsh-css-module:/home/runner/work/dsh-plugins/dsh-plugins/plugins/workbench/src/client/attention/AttentionSection.module.css.mjs
3278
- const css = ".iFQc1W_section{border-bottom:.5px solid var(--dsw-alias-border-l4);flex-direction:column;gap:2px;margin-bottom:4px;padding:2px 0 6px;display:flex}.iFQc1W_groupHeader:focus-visible,.iFQc1W_row:focus-visible,.iFQc1W_unpin:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}.iFQc1W_group{flex-direction:column;display:flex}.iFQc1W_groupHeader{border-radius:var(--dsw-radius-sm);width:100%;height:24px;color:var(--dsw-alias-label-tertiary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:4px;padding:0 6px;font-size:11px;font-weight:500;display:flex}.iFQc1W_groupHeader:hover{background:var(--dsw-alias-interactive-bg-hover)}.iFQc1W_chevron{color:var(--dsw-alias-label-tertiary);align-items:center;display:inline-flex}.iFQc1W_groupLabel{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.iFQc1W_groupCount{min-width:14px;color:var(--dsw-alias-label-tertiary);text-align:center;flex:none;font-size:10px}.iFQc1W_groupBody{flex-direction:column;gap:1px;display:flex}.iFQc1W_list{flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;display:flex}.iFQc1W_item{flex-direction:column;display:flex}.iFQc1W_rowWrap{align-items:center;gap:2px;display:flex}.iFQc1W_row{border-radius:var(--dsw-radius-sm);min-width:0;height:26px;color:var(--dsw-alias-label-primary);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;flex:1;align-items:center;gap:6px;padding:0 6px 0 24px;font-size:12px;display:flex}.iFQc1W_row:hover{background:var(--dsw-alias-interactive-bg-hover)}.iFQc1W_dot{flex:none;align-items:center;display:inline-flex}.iFQc1W_title{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.iFQc1W_unpin{border-radius:var(--dsw-radius-sm);width:20px;height:20px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;margin-right:4px;padding:0;display:inline-flex}.iFQc1W_unpin:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}";
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}";
3279
3254
  const tagId = "@banzhe/dsh-workbench/AttentionSection.module.css";
3280
3255
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
3281
3256
  const tag = document.createElement("style");
@@ -3285,197 +3260,202 @@ window.__ModuleLoader__.load({
3285
3260
  document.head.appendChild(tag);
3286
3261
  }
3287
3262
  var AttentionSection_module_css_default = {
3288
- "list": "iFQc1W_list",
3289
- "item": "iFQc1W_item",
3290
- "rowWrap": "iFQc1W_rowWrap",
3291
- "group": "iFQc1W_group",
3292
- "groupLabel": "iFQc1W_groupLabel",
3293
- "groupBody": "iFQc1W_groupBody",
3294
3263
  "section": "iFQc1W_section",
3295
- "dot": "iFQc1W_dot",
3296
- "title": "iFQc1W_title",
3297
- "chevron": "iFQc1W_chevron",
3264
+ "groupBody": "iFQc1W_groupBody",
3298
3265
  "groupHeader": "iFQc1W_groupHeader",
3299
- "row": "iFQc1W_row",
3300
- "unpin": "iFQc1W_unpin",
3301
- "groupCount": "iFQc1W_groupCount"
3266
+ "group": "iFQc1W_group",
3267
+ "list": "iFQc1W_list"
3302
3268
  };
3303
3269
  //#endregion
3304
3270
  //#region src/client/attention/AttentionSection.tsx
3305
3271
  /**
3306
- * The In work region at the top of the browsing list: two independent, collapsible
3307
- * groups — running Sessions and unread or pinned-idle Sessions — folded from state
3308
- * other plugins already own. Each group header carries its own count; the region
3309
- * draws no header of its own and renders nothing while both groups are empty.
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.
3310
3276
  *
3311
- * The region renders no state of its own beyond the two fold choices: opening a row
3312
- * goes through the Workspace owner's guarded open (the same call the tree rows
3313
- * make), which selects the Session as the main view and lets ui-session clear its
3314
- * unread flag; releasing a pin is the same Host call the sidebar's row action
3315
- * issues, behind the same access gate.
3316
- */
3317
- /**
3318
- * The dot one row draws, or none. A container row stands for work below it, so it
3319
- * carries no state of its own; a turn blocked on the user outranks the group's own
3320
- * state; a running row spins and an unread row is done.
3321
- */
3322
- function dotStateOf(group, row, waiting) {
3323
- if (row.container === true) return void 0;
3324
- if (waiting.has(row.id)) return "warning";
3325
- return group === "running" ? "ongoing" : "done";
3326
- }
3327
- /**
3328
- * The release control for one pinned row, rendered only where the Session's
3329
- * access snapshot allows the toggle — the same gate the row's pin button uses, so
3330
- * a refused Session never shows a button that can only fail.
3331
- * @param props - the Session, the Host action, the label, and the access Hook.
3332
- * @returns the button, or null when the toggle is not allowed here.
3333
- */
3334
- function UnpinControl({ sessionId, unpin, label, useSessionAccess }) {
3335
- if (!useSessionAccess(sessionId, "workspace/unpinSession")) return null;
3336
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3337
- type: "button",
3338
- className: AttentionSection_module_css_default.unpin,
3339
- title: label,
3340
- "aria-label": label,
3341
- onClick: () => {
3342
- unpin(sessionId);
3343
- },
3344
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPinOutlineRegular, { size: 12 })
3345
- });
3346
- }
3347
- /**
3348
- * Rows of one group, nested one level per delegation hop.
3349
- * @param props - the rows, the group they belong to, and the callbacks they need.
3350
- * @returns the group's list.
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.
3284
+ *
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.
3351
3297
  */
3352
- function Rows({ rows, group, waiting, open, unpin, label, unpinLabel, useSessionAccess }) {
3353
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
3354
- className: AttentionSection_module_css_default.list,
3355
- children: rows.map((row) => {
3356
- const dot = dotStateOf(group, row, waiting);
3357
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
3358
- className: AttentionSection_module_css_default.item,
3359
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3360
- className: AttentionSection_module_css_default.rowWrap,
3361
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
3362
- type: "button",
3363
- className: AttentionSection_module_css_default.row,
3364
- "aria-label": label(row.title, row.pinned === true),
3365
- onClick: () => {
3366
- open(row.id);
3367
- },
3368
- children: [dot !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3369
- className: AttentionSection_module_css_default.dot,
3370
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
3371
- state: dot,
3372
- size: 10
3373
- })
3374
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3375
- className: AttentionSection_module_css_default.title,
3376
- children: row.title
3377
- })]
3378
- }), row.pinned === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UnpinControl, {
3379
- sessionId: row.id,
3380
- unpin,
3381
- label: unpinLabel,
3382
- useSessionAccess
3383
- })]
3384
- }), row.children !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3385
- className: AttentionSection_module_css_default.children,
3386
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Rows, {
3387
- rows: row.children,
3388
- group,
3389
- waiting,
3390
- open,
3391
- unpin,
3392
- label,
3393
- unpinLabel,
3394
- useSessionAccess
3395
- })
3396
- })]
3397
- }, row.id);
3398
- })
3399
- });
3400
- }
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
+ ];
3401
3313
  /**
3402
- * One independent fold: a group header with its visible count, and its rows when
3403
- * expanded. The count is part of the button's visible text, so it also names the
3404
- * count to a screen reader.
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.
3405
3333
  */
3406
- function GroupCollapse({ title, count, children }) {
3334
+ function Fold({ fold, title, count, keepMounted = false, children }) {
3407
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;
3408
3340
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
3409
3341
  className: AttentionSection_module_css_default.group,
3342
+ "data-browser-fold": fold,
3343
+ "aria-labelledby": headerId,
3410
3344
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
3345
+ id: headerId,
3411
3346
  type: "button",
3412
- className: AttentionSection_module_css_default.groupHeader,
3347
+ className: clsx(Rows_module_css_default.sessionRow, AttentionSection_module_css_default.groupHeader),
3413
3348
  "aria-expanded": expanded,
3349
+ "aria-controls": controls,
3414
3350
  onClick: () => {
3415
3351
  setExpanded((current) => !current);
3416
3352
  },
3417
3353
  children: [
3418
3354
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3419
- className: AttentionSection_module_css_default.chevron,
3355
+ className: clsx(Rows_module_css_default.slot, Rows_module_css_default.chevron),
3420
3356
  "aria-hidden": "true",
3421
- children: expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { size: 12 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutlineRegular, { size: 12 })
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
+ })
3422
3361
  }),
3423
3362
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3424
- className: AttentionSection_module_css_default.groupLabel,
3363
+ className: Rows_module_css_default.title,
3425
3364
  children: title
3426
3365
  }),
3427
- " ",
3428
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3429
- className: AttentionSection_module_css_default.groupCount,
3366
+ count !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [" ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3367
+ className: Rows_module_css_default.time,
3430
3368
  children: count
3431
- })
3369
+ })] })
3432
3370
  ]
3433
- }), expanded && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3371
+ }), mounted && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3372
+ id: bodyId,
3434
3373
  className: AttentionSection_module_css_default.groupBody,
3374
+ "data-browser-fold-body": "",
3375
+ hidden: !expanded,
3435
3376
  children
3436
3377
  })]
3437
3378
  });
3438
3379
  }
3439
3380
  /**
3440
- * The In work region: the two group folds that have entries, and nothing at all
3441
- * while both are empty.
3442
- * @param props - the model hook, the access hook, the two Host actions, and the locale seat.
3443
- * @returns the region's folds, or null when neither group lists a Session.
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.
3444
3420
  */
3445
- function AttentionSection({ useAttention, useSessionAccess, open, unpin, t }) {
3421
+ function AttentionSection({ useAttention, useSessionAccess, open, onSessionRenameRequest, currentId, home, workspacesTitle, renderSlot, renderFactorySlot, useContextMenuTarget, useContextMenu, t, children }) {
3446
3422
  const model = useAttention((current) => current);
3447
- const waiting = (0, react.useMemo)(() => new Set(model.waiting.map((row) => row.id)), [model]);
3448
- const label = (title, pinned) => pinned ? t("attention.row.openPinned", { title }) : t("attention.row.open", { title });
3449
- if (model.running.length === 0 && model.unread.length === 0) return null;
3450
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
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", {
3451
3437
  className: AttentionSection_module_css_default.section,
3452
- "data-attention-section": "",
3453
- children: [model.running.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupCollapse, {
3454
- title: t("attention.section.running"),
3455
- count: model.running.length,
3456
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Rows, {
3457
- rows: model.running,
3458
- group: "running",
3459
- waiting,
3460
- open,
3461
- unpin,
3462
- label,
3463
- unpinLabel: t("attention.row.unpin"),
3464
- useSessionAccess
3465
- })
3466
- }), model.unread.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupCollapse, {
3467
- title: t("attention.section.unread"),
3468
- count: model.unread.length,
3469
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Rows, {
3470
- rows: model.unread,
3471
- group: "unread",
3472
- waiting,
3473
- open,
3474
- unpin,
3475
- label,
3476
- unpinLabel: t("attention.row.unpin"),
3477
- useSessionAccess
3478
- })
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
3479
3459
  })]
3480
3460
  });
3481
3461
  }
@@ -3484,13 +3464,14 @@ window.__ModuleLoader__.load({
3484
3464
  /**
3485
3465
  * The workspace/session browsing region filling the sidebar shell's
3486
3466
  * `sidebar.workspaces` hole: section header (title + view options + add
3487
- * workspace), search, the grouped tree or flat list, and the workspace
3488
- * dialogs. Wide state renders the full browser; rail state renders the two
3489
- * region icons (search / add workspace) as 36px controls on the shell's shared
3490
- * rail entry path, each requesting expansion through the owner share. Adding
3491
- * is the header button's one action, so it raises the directory flow with no
3492
- * menu in between; the flow and its error dialog live in WorkspacePicker
3493
- * (same package — direct composition, no slot between them). A Session row's
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
3494
3475
  * "..." menu and hover buttons are the `sidebar.workspaces.session.menu.item`
3495
3476
  * and `sidebar.workspaces.session.row.action` lists rendered through this
3496
3477
  * entry's `renderSlot`; the actions in them, this package's own included,
@@ -4214,7 +4195,7 @@ window.__ModuleLoader__.load({
4214
4195
  * @param props - composed slot props (shell owner share + store + injected actions).
4215
4196
  * @returns the region element tree.
4216
4197
  */
4217
- function WorkspaceBrowser({ wide, usePanelInfo, expandSidebar, useSectionScroller, useSessions, useSessionStatus, useSessionAccess, useWorkspaceAccess, useWorkspaces, useStore, actions, startSession, open, requestSessionRename, notifyArchivedNotOpenable, renameWorkspace, useWorkspaceActionRequest, settleWorkspaceAction, deleteWorkspace, insertWorkspaceBefore, unarchiveSession, unpinSession, createWorkspace, searchSessions, searchResultLimit, useDirectoryFlow, useHostInfo, useAttention, useShortcuts, useWorkspaceShortcuts, requestSearch, requestAddWorkspace, closeAddWorkspace, setDirectoryBusy, renderSlot, renderFactorySlot, useContextMenuTarget, useContextMenu, t }) {
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 }) {
4218
4199
  const home = useHostInfo((info) => info.home);
4219
4200
  const shortcuts = useShortcuts((rows) => rows);
4220
4201
  const searchShortcut = shortcuts.find((row) => row.id === "session.search");
@@ -4249,6 +4230,7 @@ window.__ModuleLoader__.load({
4249
4230
  };
4250
4231
  const workspaceReady = workspacePhase === "ready" && workspaceStreamState !== "loading";
4251
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;
4252
4234
  const currentBlank = mainSessionId !== void 0 && list.byId[mainSessionId]?.blank === true ? mainSessionId : void 0;
4253
4235
  const ungroupedMemberIds = (0, react.useMemo)(() => {
4254
4236
  const accounted = new Set(workspaces.flatMap((workspace) => workspace.sessionIds));
@@ -4643,17 +4625,11 @@ window.__ModuleLoader__.load({
4643
4625
  })
4644
4626
  })
4645
4627
  }),
4646
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4628
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4647
4629
  ref: wide ? bindScrollerRef : void 0,
4648
4630
  className: WorkspaceBrowser_module_css_default.listArea,
4649
4631
  "data-sidebar-list-area": "",
4650
- children: [wide && normalizedQuery === "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AttentionSection, {
4651
- useAttention,
4652
- useSessionAccess,
4653
- open: guardedOpen,
4654
- unpin: unpinSession,
4655
- t
4656
- }), wide && (normalizedQuery !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchResults, {
4632
+ children: wide && (normalizedQuery !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchResults, {
4657
4633
  usePanelInfo,
4658
4634
  useSessionAccess,
4659
4635
  useSessions,
@@ -4667,57 +4643,71 @@ window.__ModuleLoader__.load({
4667
4643
  remote: remoteSearch,
4668
4644
  resultLimit: searchResultLimit,
4669
4645
  t
4670
- }) : groupBy === "flat" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FlatList, {
4646
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AttentionSection, {
4647
+ useAttention,
4671
4648
  useSessionAccess,
4672
- usePanelInfo,
4673
- list,
4674
- sessionIds: orderedFlatSessionIds,
4675
- rowState,
4676
- onLeaveArchivedOnly: leaveArchivedOnly,
4677
- workspaceReady,
4678
- animationResetKey: `${groupBy}/${orderBy}/${archivedFilter}`,
4679
- useSessionStatus,
4680
4649
  open: guardedOpen,
4681
4650
  onSessionRenameRequest: requestSessionRename,
4682
- renderSlot,
4683
- renderFactorySlot,
4684
- useContextMenu,
4685
- useContextMenuTarget,
4686
- setSessionOrder: saveSessionOrder,
4687
- revealSessionId,
4688
- onSessionRevealed: acknowledgeSessionReveal,
4651
+ currentId: highlightedSessionId,
4689
4652
  home,
4690
- t
4691
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionTree, {
4692
- useSessionAccess,
4693
- useWorkspaceAccess,
4694
- usePanelInfo,
4695
- list,
4696
- shortcuts,
4697
- useSessionStatus,
4698
- onSessionRenameRequest: requestSessionRename,
4653
+ workspacesTitle: groupBy === "flat" ? t("attention.section.allSessions") : t("attention.section.allWorkspaces"),
4699
4654
  renderSlot,
4700
4655
  renderFactorySlot,
4701
4656
  useContextMenu,
4702
4657
  useContextMenuTarget,
4703
- workspaces: orderedWorkspaces,
4704
- ungroupedSessionIds: orderedUngroupedSessionIds,
4705
- workspaceReady,
4706
- nestWorkspaces: groupBy === "workspace-tree",
4707
- animationResetKey: `${groupBy}/${orderBy}/${archivedFilter}`,
4708
- groupExpansion,
4709
- setGroupExpanded: actions.setGroupExpanded,
4710
- setSessionOrder: saveSessionOrder,
4711
- rowState,
4712
- onLeaveArchivedOnly: leaveArchivedOnly,
4713
- startSession,
4714
- open: guardedOpen,
4715
- insertWorkspaceBefore,
4716
- revealSessionId,
4717
- onSessionRevealed: acknowledgeSessionReveal,
4718
- home,
4719
- t
4720
- }))]
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
+ }))
4721
4711
  }),
4722
4712
  workspaceActionRequest !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorkspaceDialogs, {
4723
4713
  request: workspaceActionRequest,
@@ -5426,11 +5416,11 @@ window.__ModuleLoader__.load({
5426
5416
  "time.months": "{n}个月",
5427
5417
  "time.years": "{n}年",
5428
5418
  "time.ago": "{t}前",
5419
+ "attention.section.allSessions": "全部会话",
5420
+ "attention.section.allWorkspaces": "全部工作区",
5421
+ "attention.section.pinned": "置顶",
5429
5422
  "attention.section.running": "运行中",
5430
- "attention.section.unread": "未读",
5431
- "attention.row.open": "打开会话 {title}",
5432
- "attention.row.openPinned": "打开置顶会话 {title}",
5433
- "attention.row.unpin": "取消置顶"
5423
+ "attention.section.unread": "未读"
5434
5424
  };
5435
5425
  /** English dictionary, checked complete against the zh key set. */
5436
5426
  const en = {
@@ -5555,11 +5545,11 @@ window.__ModuleLoader__.load({
5555
5545
  "time.months": "{n}mo",
5556
5546
  "time.years": "{n}y",
5557
5547
  "time.ago": "{t} ago",
5548
+ "attention.section.allSessions": "All sessions",
5549
+ "attention.section.allWorkspaces": "All workspaces",
5550
+ "attention.section.pinned": "Pinned",
5558
5551
  "attention.section.running": "Running",
5559
- "attention.section.unread": "Unread",
5560
- "attention.row.open": "Open session {title}",
5561
- "attention.row.openPinned": "Open pinned session {title}",
5562
- "attention.row.unpin": "Unpin session"
5552
+ "attention.section.unread": "Unread"
5563
5553
  };
5564
5554
  /** Japanese copy, checked against the English keys. */
5565
5555
  const ja = {
@@ -5684,11 +5674,11 @@ window.__ModuleLoader__.load({
5684
5674
  "time.months": "{n}か月",
5685
5675
  "time.years": "{n}年",
5686
5676
  "time.ago": "{t}前",
5677
+ "attention.section.allSessions": "すべてのセッション",
5678
+ "attention.section.allWorkspaces": "すべてのワークスペース",
5679
+ "attention.section.pinned": "ピン留め",
5687
5680
  "attention.section.running": "実行中",
5688
- "attention.section.unread": "未読",
5689
- "attention.row.open": "セッション {title} を開く",
5690
- "attention.row.openPinned": "ピン留めしたセッション {title} を開く",
5691
- "attention.row.unpin": "ピン留めを解除"
5681
+ "attention.section.unread": "未読"
5692
5682
  };
5693
5683
  /** Spanish dictionary, checked against the English keys. */
5694
5684
  const es = {
@@ -5813,11 +5803,11 @@ window.__ModuleLoader__.load({
5813
5803
  "time.months": "{n}mo",
5814
5804
  "time.years": "{n}y",
5815
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",
5816
5809
  "attention.section.running": "En ejecución",
5817
- "attention.section.unread": "Sin leer",
5818
- "attention.row.open": "Abrir la sesión {title}",
5819
- "attention.row.openPinned": "Abrir la sesión fijada {title}",
5820
- "attention.row.unpin": "Desfijar la sesión"
5810
+ "attention.section.unread": "Sin leer"
5821
5811
  };
5822
5812
  /** French dictionary, checked against the English keys. */
5823
5813
  const fr = {
@@ -5942,11 +5932,11 @@ window.__ModuleLoader__.load({
5942
5932
  "time.months": "{n}mo",
5943
5933
  "time.years": "{n}y",
5944
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",
5945
5938
  "attention.section.running": "En cours",
5946
- "attention.section.unread": "Non lues",
5947
- "attention.row.open": "Ouvrir la session {title}",
5948
- "attention.row.openPinned": "Ouvrir la session épinglée {title}",
5949
- "attention.row.unpin": "Désépingler la session"
5939
+ "attention.section.unread": "Non lues"
5950
5940
  };
5951
5941
  /** German dictionary, checked against the English keys. */
5952
5942
  const de = {
@@ -6071,11 +6061,11 @@ window.__ModuleLoader__.load({
6071
6061
  "time.months": "{n}mo",
6072
6062
  "time.years": "{n}y",
6073
6063
  "time.ago": "Vor {t}",
6064
+ "attention.section.allSessions": "Alle Sitzungen",
6065
+ "attention.section.allWorkspaces": "Alle Arbeitsbereiche",
6066
+ "attention.section.pinned": "Angeheftet",
6074
6067
  "attention.section.running": "Läuft",
6075
- "attention.section.unread": "Ungelesen",
6076
- "attention.row.open": "Sitzung {title} öffnen",
6077
- "attention.row.openPinned": "Angeheftete Sitzung {title} öffnen",
6078
- "attention.row.unpin": "Anheftung der Sitzung lösen"
6068
+ "attention.section.unread": "Ungelesen"
6079
6069
  };
6080
6070
  /** Russian dictionary, checked against the English keys. */
6081
6071
  const ru = {
@@ -6200,11 +6190,11 @@ window.__ModuleLoader__.load({
6200
6190
  "time.months": "{n}mo",
6201
6191
  "time.years": "{n}y",
6202
6192
  "time.ago": "{t} назад",
6193
+ "attention.section.allSessions": "Все сеансы",
6194
+ "attention.section.allWorkspaces": "Все рабочие области",
6195
+ "attention.section.pinned": "Закреплённые",
6203
6196
  "attention.section.running": "Выполняется",
6204
- "attention.section.unread": "Непрочитанные",
6205
- "attention.row.open": "Открыть сеанс {title}",
6206
- "attention.row.openPinned": "Открыть закреплённый сеанс {title}",
6207
- "attention.row.unpin": "Открепить сеанс"
6197
+ "attention.section.unread": "Непрочитанные"
6208
6198
  };
6209
6199
  /** Portuguese dictionary, checked against the English keys. */
6210
6200
  const pt = {
@@ -6329,11 +6319,11 @@ window.__ModuleLoader__.load({
6329
6319
  "time.months": "{n} mês",
6330
6320
  "time.years": "{n}s",
6331
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",
6332
6325
  "attention.section.running": "Em execução",
6333
- "attention.section.unread": "Não lidas",
6334
- "attention.row.open": "Abrir a sessão {title}",
6335
- "attention.row.openPinned": "Abrir a sessão fixada {title}",
6336
- "attention.row.unpin": "Desafixar a sessão"
6326
+ "attention.section.unread": "Não lidas"
6337
6327
  };
6338
6328
  //#endregion
6339
6329
  //#region src/client/index.ts
@@ -6423,6 +6413,19 @@ window.__ModuleLoader__.load({
6423
6413
  ctx.effect(() => () => {
6424
6414
  attention.dispose();
6425
6415
  }, "ui-workspace: attention model");
6416
+ ctx.effect(() => {
6417
+ const presenter = new TaskbarProgressPresenter();
6418
+ if (!presenter.viable) return () => {};
6419
+ const sync = () => {
6420
+ presenter.project(attention.getSnapshot());
6421
+ };
6422
+ sync();
6423
+ const unsubscribe = attention.subscribe(sync);
6424
+ return () => {
6425
+ unsubscribe();
6426
+ presenter.clear();
6427
+ };
6428
+ }, "ui-workspace: windows taskbar progress");
6426
6429
  const renameRequest = derive(shortcutControls.state, (state) => state.renameTarget);
6427
6430
  const archiveRequest = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(null);
6428
6431
  const requestSessionRename = shortcutControls.rename;
@@ -6640,7 +6643,6 @@ window.__ModuleLoader__.load({
6640
6643
  unarchiveSession: async (sessionId) => {
6641
6644
  await uiWorkspace.unarchiveSession(sessionId);
6642
6645
  },
6643
- unpinSession,
6644
6646
  createWorkspace: (input) => workspaces.create(input),
6645
6647
  requestSearch: shortcutControls.search,
6646
6648
  requestAddWorkspace: shortcutControls.add,