@restregular/dsh-powerup 0.8.11 → 0.8.13

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.
Files changed (2) hide show
  1. package/client.js +455 -110
  2. package/package.json +6 -3
package/client.js CHANGED
@@ -69,7 +69,7 @@
69
69
 
70
70
  const NS = 'dsh-powerup';
71
71
  const SETTINGS_KEY = 'dsh-powerup:settings:v1';
72
- const VERSION = '0.8.11';
72
+ const VERSION = '0.8.12';
73
73
  const MENU_GAP = 8;
74
74
  const MENU_WIDTH = 248;
75
75
  /** Reference scheme understood by the Host's `powerup_step_read` tool. */
@@ -110,6 +110,12 @@
110
110
  'page.launcherDesc': '把左侧边栏的面板按钮变成自适应图标网格:列数跟着侧边栏宽度走,图标在上、文字在下;拖动图标可以排序,把一个图标拖到另一个图标的中间就会合成一个分组(像 Windows 开始菜单的文件夹),点分组会以浮层弹出里面的图标。网格里自带「返回会话」「重启 DSH」「关闭 DSH」三个按钮,它们和「更多」一样也能拖进分组。',
111
111
  'page.launcherToggle': '启用图标网格',
112
112
  'page.launcherToggleHint': '关闭后侧边栏恢复宿主原本的列表样式;排序与分组仍会保留。',
113
+ 'page.sessionSwitchTitle': '会话标题切换',
114
+ 'page.sessionSwitchDesc': '把会话标题变成可点击的下拉列表,列出正在运行的会话(带工作区名称前缀),点击即可切换。',
115
+ 'page.sessionSwitchHow': '打开任意会话,点击顶部的会话标题,在运行中的会话列表中选择目标会话。',
116
+ 'page.locateTitle': '定位当前会话',
117
+ 'page.locateDesc': '在工作区侧边栏的按钮栏加一个定位按钮,把当前会话在工作区列表中展开、居中显示,自动展开折叠的工作区。',
118
+ 'page.locateHow': '在工作区列表顶部点击「定位当前会话」图标按钮,当前会话所在的工作区会自动展开并滚动到视图中央。',
113
119
  'launcher.groupDefault': '分组',
114
120
  'launcher.count': '{count} 个面板',
115
121
  'launcher.renameHint': '点击重命名',
@@ -123,6 +129,9 @@
123
129
  'sessionSwitch.title': '切换会话',
124
130
  'sessionSwitch.empty': '没有正在运行的会话',
125
131
  'sessionSwitch.hint': '点击会话标题切换',
132
+ 'sessionSwitch.defaultWorkspace': '默认工作区',
133
+ 'locate.label': '定位当前会话',
134
+ 'locate.hint': '在工作区列表中定位并居中显示当前会话',
126
135
  'close.title': '关闭 DSH?',
127
136
  'close.desc': '关闭会退出 DSH,正在运行的任务会中断。',
128
137
  'close.cancel': '取消',
@@ -311,6 +320,12 @@
311
320
  'page.launcherDesc': 'Turns the left sidebar panel buttons into an adaptive icon grid: the column count follows the sidebar width, icons sit above their labels, icons can be dragged to reorder, dropping one icon onto the middle of another forms a folder (like a Windows Start menu folder), and clicking a folder opens its contents in a flyout. The grid also carries three built-in buttons — back to conversation, restart DSH and close DSH — and they, like the host\'s "more" entry, can be dragged into a folder too.',
312
321
  'page.launcherToggle': 'Enable the icon grid',
313
322
  'page.launcherToggleHint': 'When off, the sidebar keeps the host list; order and folders are remembered.',
323
+ 'page.sessionSwitchTitle': 'Session title switcher',
324
+ 'page.sessionSwitchDesc': 'Makes the session title a clickable dropdown listing running sessions (prefixed with their workspace name); pick one to switch to it.',
325
+ 'page.sessionSwitchHow': 'Open any session, click its title in the header, and choose a target from the running-sessions list.',
326
+ 'page.locateTitle': 'Locate current session',
327
+ 'page.locateDesc': 'Adds a button to the workspace sidebar header that expands, reveals and centers the current session in the workspace list, auto-expanding collapsed workspaces.',
328
+ 'page.locateHow': 'Click the locate button in the workspace header; the workspace containing the current session expands and scrolls to the center of the view.',
314
329
  'launcher.groupDefault': 'Group',
315
330
  'launcher.count': '{count} panels',
316
331
  'launcher.renameHint': 'Click to rename',
@@ -324,6 +339,9 @@
324
339
  'sessionSwitch.title': 'Switch session',
325
340
  'sessionSwitch.empty': 'No running sessions',
326
341
  'sessionSwitch.hint': 'Click the session title to switch',
342
+ 'sessionSwitch.defaultWorkspace': 'Default workspace',
343
+ 'locate.label': 'Locate current session',
344
+ 'locate.hint': 'Find and center the current session in the workspace list',
327
345
  'close.title': 'Close DSH?',
328
346
  'close.desc': 'Closing quits DSH; running tasks are interrupted.',
329
347
  'close.cancel': 'Cancel',
@@ -511,18 +529,34 @@
511
529
  // ------------------------------------------------------------------
512
530
  // Settings store (localStorage, per browser)
513
531
  // ------------------------------------------------------------------
514
- /** One-click update defaults: enable and restart unless the user turned one off. */
515
- const DEFAULT_SETTINGS = { enabled: true, oneClickEnable: true, oneClickRestart: true, launcher: true };
532
+ /** Per-feature enable flags and one-click defaults. All default on. */
533
+ const DEFAULT_SETTINGS = {
534
+ contextMenu: true,
535
+ launcher: true,
536
+ sessionSwitch: true,
537
+ jobStop: true,
538
+ update: true,
539
+ locateSession: true,
540
+ oneClickEnable: true,
541
+ oneClickRestart: true,
542
+ };
516
543
 
517
544
  function readSettings() {
518
545
  try {
519
546
  const parsed = JSON.parse(localStorage.getItem(SETTINGS_KEY) || 'null');
520
547
  if (parsed !== null && typeof parsed === 'object') {
548
+ const contextMenu = parsed.contextMenu !== undefined
549
+ ? parsed.contextMenu !== false
550
+ : parsed.enabled !== false;
521
551
  return {
522
- enabled: parsed.enabled !== false,
552
+ contextMenu,
553
+ launcher: parsed.launcher !== false,
554
+ sessionSwitch: parsed.sessionSwitch !== false,
555
+ jobStop: parsed.jobStop !== false,
556
+ update: parsed.update !== false,
557
+ locateSession: parsed.locateSession !== false,
523
558
  oneClickEnable: parsed.oneClickEnable !== false,
524
559
  oneClickRestart: parsed.oneClickRestart !== false,
525
- launcher: parsed.launcher !== false,
526
560
  };
527
561
  }
528
562
  } catch {
@@ -2314,6 +2348,17 @@
2314
2348
  );
2315
2349
  }
2316
2350
 
2351
+ function LocateIcon({ size = 16 }) {
2352
+ return h(Icon, { size },
2353
+ h('circle', { cx: '8', cy: '8', r: '4.6', stroke: 'currentColor', strokeWidth: '1.3' }),
2354
+ h('circle', { cx: '8', cy: '8', r: '1.4', fill: 'currentColor' }),
2355
+ h('path', {
2356
+ d: 'M8 1.2v2.2M8 12.6v2.2M1.2 8h2.2M12.6 8h2.2',
2357
+ stroke: 'currentColor', strokeWidth: '1.3', strokeLinecap: 'round',
2358
+ }),
2359
+ );
2360
+ }
2361
+
2317
2362
  function PowerUpLineIcon({ size = 16 }) {
2318
2363
  return h(Icon, { size },
2319
2364
  h('path', {
@@ -2591,7 +2636,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
2591
2636
  .dsh-powerup-drag-ghost [class*="panelUnpin"]{display:none!important}
2592
2637
  .dsh-powerup-drag-ghost [class*="panelGlyph"] svg{width:20px;height:20px}
2593
2638
  .dsh-powerup-drag-ghost [class*="panelTitle"]{display:block;width:100%;max-width:100%;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:14px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
2594
- .dsh-powerup-folder-pop{position:fixed;z-index:1800;box-sizing:border-box;display:flex;flex-direction:column;gap:6px;width:max-content;min-width:196px;max-width:min(440px,calc(100vw - 24px));max-height:min(72vh,440px);padding:8px;border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-lg,10px);background:var(--dsw-alias-bg-layer-2);box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);font-size:12px;line-height:16px;opacity:0;transform:scale(.92);transition:opacity .13s ease,transform .17s cubic-bezier(.22,.9,.3,1.06)}
2639
+ .dsh-powerup-folder-pop{position:fixed;z-index:1800;box-sizing:border-box;display:flex;flex-direction:column;gap:6px;width:max-content;min-width:196px;max-width:min(440px,calc(100vw - 24px));max-height:min(72vh,440px);padding:8px;border:0;border-radius:var(--dsw-radius-panel,14px);background:var(--dsw-alias-bg-layer-2);box-shadow:var(--dsw-elevation-prominent);--dsw-elevation-stroke-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);font-size:12px;line-height:16px;opacity:0;transform:scale(.92);transition:opacity .13s ease,transform .17s cubic-bezier(.22,.9,.3,1.06)}
2595
2640
  .dsh-powerup-folder-pop.is-open{opacity:1;transform:scale(1)}
2596
2641
  .dsh-powerup-folder-pop-head{display:flex;align-items:center;gap:6px;min-width:0;padding:0 2px}
2597
2642
  .dsh-powerup-folder-pop-title{flex:1 1 auto;min-width:0;padding:2px 5px;border:0;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;line-height:16px;font-weight:500;text-align:left;cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -2633,8 +2678,12 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
2633
2678
  .dsh-powerup-hero-copy{min-width:0}
2634
2679
  .dsh-powerup-hero h1{margin:0;font-size:22px;line-height:1.25;font-weight:650;letter-spacing:-.01em}
2635
2680
  .dsh-powerup-hero p{margin:5px 0 0;color:var(--dsw-alias-label-secondary);font-size:12.5px;line-height:1.5}
2636
- .dsh-powerup-card{margin:0 0 14px;padding:16px;border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-1)}
2681
+ .dsh-powerup-card{margin:0 0 14px;padding:16px;border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-1);transition:opacity .14s ease}
2682
+ .dsh-powerup-card.is-off .dsh-powerup-card-icon,.dsh-powerup-card.is-off .dsh-powerup-card-copy{opacity:.55}
2637
2683
  .dsh-powerup-card-head{display:flex;align-items:flex-start;gap:12px}
2684
+ .dsh-powerup-card-how{margin:12px 0 0;padding:10px 12px;border-radius:var(--dsw-radius-md,8px);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.55;overflow-wrap:anywhere}
2685
+ .dsh-powerup-card-detail{margin-top:12px;padding-top:4px}
2686
+ .dsh-powerup-how-card .dsh-powerup-section-title{margin-bottom:10px}
2638
2687
  .dsh-powerup-card-icon{flex:none;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:9px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary)}
2639
2688
  .dsh-powerup-card-copy{min-width:0;flex:1 1 auto}
2640
2689
  .dsh-powerup-card-copy h2{margin:0;font-size:14px;line-height:1.35;font-weight:650}
@@ -2666,7 +2715,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
2666
2715
  .dsh-powerup-step-num{flex:none;display:inline-flex;align-items:center;justify-content:center;width:19px;height:19px;margin-top:1px;border-radius:50%;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);font-size:10px;font-weight:700;font-variant-numeric:tabular-nums}
2667
2716
  .dsh-powerup-foot{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:2px 2px 0;color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:1.5}
2668
2717
  .dsh-powerup-dot{width:3px;height:3px;border-radius:50%;background:var(--dsw-alias-label-caption);opacity:.6}
2669
- .dsh-powerup-menu{position:fixed;z-index:1000;min-width:232px;max-width:300px;max-height:min(70vh,430px);overflow-y:auto;padding:4px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-overlay,var(--dsw-alias-bg-layer-1));box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgba(15,23,42,.24),0 2px 8px rgba(15,23,42,.1));color:var(--dsw-alias-label-primary);font-size:12.5px;line-height:1.4;pointer-events:auto;outline:none;--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2)}
2718
+ .dsh-powerup-menu{position:fixed;z-index:1000;min-width:232px;max-width:300px;max-height:min(70vh,430px);overflow-y:auto;padding:4px;border:0;border-radius:var(--dsw-radius-panel,14px);background:var(--dsw-alias-bg-layer-2);box-shadow:var(--dsw-elevation-prominent);--dsw-elevation-stroke-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);font-size:12.5px;line-height:1.4;pointer-events:auto;outline:none;--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2)}
2670
2719
  .dsh-powerup-menu-head{display:flex;align-items:center;gap:6px;padding:5px 7px 6px;color:var(--dsw-alias-label-tertiary);font-size:10.5px;font-weight:600;letter-spacing:.03em}
2671
2720
  .dsh-powerup-menu-head-icon{display:flex;align-items:center;color:var(--dsw-alias-label-tertiary)}
2672
2721
  .dsh-powerup-menu-kind{margin-left:auto;max-width:112px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 5px;border-radius:4px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);font-weight:500;line-height:16px}
@@ -2824,13 +2873,15 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
2824
2873
  const SESSION_SWITCH_CSS = `
2825
2874
  [data-powerup-session-title]{cursor:pointer!important}
2826
2875
  [data-powerup-session-title]:hover{color:var(--dsw-alias-brand-primary)}
2827
- .dsh-powerup-session-pop{position:fixed;z-index:1500;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-lg,10px);background:var(--dsw-alias-bg-overlay);box-shadow:var(--dsw-elevation-prominent,0 12px 32px rgba(15,23,42,.28));color:var(--dsw-alias-label-primary);font-size:12.5px;line-height:1.5;opacity:0;transform:translateY(-4px);transition:opacity .12s ease,transform .12s ease;pointer-events:auto}
2876
+ .dsh-powerup-session-pop{position:fixed;z-index:1500;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;border:0;border-radius:var(--dsw-radius-panel,14px);background:var(--dsw-alias-bg-layer-2);box-shadow:var(--dsw-elevation-prominent);--dsw-elevation-stroke-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);font-size:12.5px;line-height:1.5;opacity:0;transform:translateY(-4px);transition:opacity .12s ease,transform .12s ease;pointer-events:auto}
2828
2877
  .dsh-powerup-session-pop.is-open{opacity:1;transform:none}
2829
2878
  .dsh-powerup-session-pop-head{flex:none;padding:10px 12px 8px;border-bottom:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}
2830
- .dsh-powerup-session-pop-list{flex:1;min-height:0;overflow-y:auto;padding:5px}
2831
- .dsh-powerup-session-pop-item{display:flex;align-items:center;gap:8px;width:100%;box-sizing:border-box;padding:7px 9px;border:0;border-radius:var(--dsw-radius-md,7px);background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:12.5px;text-align:left;cursor:pointer}
2832
- .dsh-powerup-session-pop-item:hover{background:var(--dsw-alias-bg-layer-2)}
2879
+ .dsh-powerup-session-pop-list{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:4px;padding:6px}
2880
+ .dsh-powerup-session-pop-item{display:flex;align-items:center;gap:8px;width:100%;box-sizing:border-box;padding:7px 9px;border:0;border-radius:var(--dsw-radius-md,7px);background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:12.5px;text-align:left;cursor:pointer;transition:background .12s ease,color .12s ease}
2881
+ .dsh-powerup-session-pop-item:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-3));color:var(--dsw-alias-label-primary)}
2833
2882
  .dsh-powerup-session-pop-item[data-current]{background:var(--dsw-alias-bg-layer-2)}
2883
+ .dsh-powerup-session-pop-item[data-current]:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-3))}
2884
+ .dsh-powerup-session-pop-item:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-1px}
2834
2885
  .dsh-powerup-session-pop-dot{flex:none;width:7px;height:7px;border-radius:50%;background:var(--dsw-alias-state-success-primary)}
2835
2886
  .dsh-powerup-session-pop-item[data-current] .dsh-powerup-session-pop-dot{background:var(--dsw-alias-brand-primary)}
2836
2887
  .dsh-powerup-session-pop-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -2838,18 +2889,68 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
2838
2889
  @media (prefers-reduced-motion:reduce){.dsh-powerup-session-pop{transition:none}}
2839
2890
  `;
2840
2891
 
2892
+ const LOCATE_CSS = `
2893
+ /* The host caps the toolbar's action row at 60px (two 28px buttons plus the
2894
+ 4px gap) and clips the overflow, so a third button would be invisible. The
2895
+ marker is only present while our button is mounted, and the host's
2896
+ "search expanded" class still collapses the row. */
2897
+ [data-sidebar-workspace-header] [data-powerup-locate-actions]:not([class*="headerActionsHidden"]){max-width:none}
2898
+ [data-sidebar-workspace-header] .dsh-powerup-locate{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-caption);cursor:pointer;transition:background .12s ease,color .12s ease}
2899
+ [data-sidebar-workspace-header] .dsh-powerup-locate:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
2900
+ [data-sidebar-workspace-header] .dsh-powerup-locate:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}
2901
+ [data-sidebar-workspace-header] .dsh-powerup-locate svg{width:16px;height:16px}
2902
+ `;
2903
+
2904
+ /** Max display length of a session option, in Unicode code points. */
2905
+ const SESSION_SWITCH_LABEL_MAX = 40;
2906
+ /** Separator between the workspace name and the session title. */
2907
+ const SESSION_SWITCH_LABEL_SEP = ' · ';
2908
+
2909
+ /**
2910
+ * Truncate a string to a maximum number of Unicode code points, appending
2911
+ * an ellipsis when anything was cut. Code-point based so an astral emoji
2912
+ * is never split into a lone surrogate.
2913
+ * @param {string} value
2914
+ * @param {number} max
2915
+ * @returns {string}
2916
+ */
2917
+ function truncateLabel(value, max) {
2918
+ const text = typeof value === 'string' ? value : '';
2919
+ const points = [...text];
2920
+ if (points.length <= max) return text;
2921
+ const keep = Math.max(0, max - 1);
2922
+ return points.slice(0, keep).join('') + '\u2026';
2923
+ }
2924
+
2925
+ /**
2926
+ * Compose the option label: `<workspace> · <session title>`, truncated as
2927
+ * a whole so the workspace prefix stays visible even for long titles.
2928
+ * @param {string} workspace workspace display name (may be empty)
2929
+ * @param {string} title session title
2930
+ * @returns {string}
2931
+ */
2932
+ function sessionOptionLabel(workspace, title) {
2933
+ const ws = typeof workspace === 'string' ? workspace : '';
2934
+ const base = typeof title === 'string' ? title : '';
2935
+ if (ws === '') return truncateLabel(base, SESSION_SWITCH_LABEL_MAX);
2936
+ return truncateLabel(ws + SESSION_SWITCH_LABEL_SEP + base, SESSION_SWITCH_LABEL_MAX);
2937
+ }
2938
+
2841
2939
  /**
2842
2940
  * Project the live session list into the rows shown by the switcher.
2843
2941
  * Only sessions the host currently reports as running are listed; the
2844
- * host's own list order (most recent first) is preserved.
2942
+ * host's own list order (most recent first) is preserved. Each label is
2943
+ * prefixed with its workspace name when known.
2845
2944
  * @param {unknown} snapshot value of `sessions.list.getSnapshot()`
2846
2945
  * @param {string | undefined} currentId id of the open session
2946
+ * @param {(sessionId: string, cwd?: string) => string} [workspaceOf] resolve a workspace name
2847
2947
  * @returns {Array<{id:string,title:string,current:boolean}>}
2848
2948
  */
2849
- function runningSessionRows(snapshot, currentId) {
2949
+ function runningSessionRows(snapshot, currentId, workspaceOf) {
2850
2950
  const state = snapshot !== null && typeof snapshot === 'object' ? snapshot : {};
2851
2951
  const byId = state.byId !== null && typeof state.byId === 'object' ? state.byId : {};
2852
2952
  const ids = Array.isArray(state.ids) ? state.ids : Object.keys(byId);
2953
+ const resolveWorkspace = typeof workspaceOf === 'function' ? workspaceOf : () => '';
2853
2954
  const rows = [];
2854
2955
  const seen = new Set();
2855
2956
  for (const id of ids) {
@@ -2860,7 +2961,15 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
2860
2961
  const title = typeof item.displayTitle === 'string' && item.displayTitle !== ''
2861
2962
  ? item.displayTitle
2862
2963
  : typeof item.title === 'string' && item.title !== '' ? item.title : id;
2863
- rows.push({ id, title, current: id === currentId });
2964
+ const cwd = typeof item.cwd === 'string' ? item.cwd : undefined;
2965
+ let workspace = '';
2966
+ try {
2967
+ workspace = resolveWorkspace(id, cwd);
2968
+ } catch {
2969
+ workspace = '';
2970
+ }
2971
+ const label = sessionOptionLabel(workspace, title);
2972
+ rows.push({ id, title: label, current: id === currentId });
2864
2973
  }
2865
2974
  return rows;
2866
2975
  }
@@ -3147,6 +3256,38 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
3147
3256
  };
3148
3257
  }
3149
3258
 
3259
+ /**
3260
+ * Index workspace titles by session id and by normalized path leaf. Used
3261
+ * to prefix session options with their workspace name.
3262
+ * @param {unknown} snapshot value of `workspaces.list.getSnapshot()`
3263
+ * @param {(title: string) => string} [displayTitle] optional default-name mapping
3264
+ * @returns {{bySession: Record<string,string>, byPath: Record<string,string>}}
3265
+ */
3266
+ function buildWorkspaceIndex(snapshot, displayTitle) {
3267
+ const state = snapshot !== null && typeof snapshot === 'object' ? snapshot : {};
3268
+ const items = Array.isArray(state.items) ? state.items : [];
3269
+ const mapTitle = typeof displayTitle === 'function' ? displayTitle : (value) => value;
3270
+ const bySession = {};
3271
+ const byPath = {};
3272
+ const normalizePath = (value) => {
3273
+ const text = typeof value === 'string' ? value.replace(/[\\/]+$/u, '') : '';
3274
+ const parts = text.split(/[\\/]/u).filter(Boolean);
3275
+ const leaf = parts.length > 0 ? parts[parts.length - 1] : '';
3276
+ return leaf.toLowerCase();
3277
+ };
3278
+ for (const item of items) {
3279
+ if (item === null || typeof item !== 'object') continue;
3280
+ const title = mapTitle(typeof item.title === 'string' ? item.title : '');
3281
+ const sessionIds = Array.isArray(item.sessionIds) ? item.sessionIds : [];
3282
+ for (const id of sessionIds) {
3283
+ if (typeof id === 'string' && id !== '') bySession[id] = title;
3284
+ }
3285
+ const leaf = normalizePath(item.path);
3286
+ if (leaf !== '') byPath[leaf] = title;
3287
+ }
3288
+ return { bySession, byPath };
3289
+ }
3290
+
3150
3291
  /**
3151
3292
  * Wire the session title switcher to the live Client services. Services
3152
3293
  * are read lazily at click time so late-provided ones still work.
@@ -3179,7 +3320,22 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
3179
3320
  const sessions = ctx.get('sessions');
3180
3321
  const list = sessions?.list;
3181
3322
  if (list === undefined || typeof list.getSnapshot !== 'function') return [];
3182
- return runningSessionRows(list.getSnapshot(), currentSessionId());
3323
+ const workspaces = ctx.get('workspaces');
3324
+ let index = { bySession: {}, byPath: {} };
3325
+ if (workspaces?.list !== undefined && typeof workspaces.list.getSnapshot === 'function') {
3326
+ index = buildWorkspaceIndex(workspaces.list.getSnapshot(), (title) =>
3327
+ title === 'default-workspace' ? translateCurrent('sessionSwitch.defaultWorkspace') : title);
3328
+ }
3329
+ const workspaceOf = (id, cwd) => {
3330
+ if (Object.prototype.hasOwnProperty.call(index.bySession, id)) return index.bySession[id];
3331
+ if (typeof cwd === 'string') {
3332
+ const parts = cwd.replace(/[\\/]+$/u, '').split(/[\\/]/u).filter(Boolean);
3333
+ const leaf = parts.length > 0 ? parts[parts.length - 1].toLowerCase() : '';
3334
+ if (leaf !== '' && Object.prototype.hasOwnProperty.call(index.byPath, leaf)) return index.byPath[leaf];
3335
+ }
3336
+ return '';
3337
+ };
3338
+ return runningSessionRows(list.getSnapshot(), currentSessionId(), workspaceOf);
3183
3339
  } catch {
3184
3340
  return [];
3185
3341
  }
@@ -3204,17 +3360,220 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
3204
3360
  }
3205
3361
  }
3206
3362
  ctx.effect(() => {
3207
- core.start();
3208
- return () => core.stop();
3363
+ if (getSettings().sessionSwitch) core.start();
3364
+ const off = subscribeSettings(() => {
3365
+ if (getSettings().sessionSwitch) core.start();
3366
+ else core.stop();
3367
+ });
3368
+ return () => {
3369
+ off();
3370
+ core.stop();
3371
+ };
3209
3372
  }, 'dsh-powerup: session title switcher');
3210
3373
  return core;
3211
3374
  }
3212
3375
 
3376
+ /** 16-grid locate glyph: a target reticle with a center dot. */
3377
+ const LOCATE_ICON = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="4.6" stroke="currentColor" stroke-width="1.3"/><circle cx="8" cy="8" r="1.4" fill="currentColor"/><path d="M8 1.2v2.2M8 12.6v2.2M1.2 8h2.2M12.6 8h2.2" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/></svg>';
3378
+
3379
+ /**
3380
+ * DOM controller for the "locate current session" button in the workspace
3381
+ * section header. It expands collapsed workspace groups until the current
3382
+ * session row is present, then centers that row in its scroll container.
3383
+ * @param {{t?: Function, currentSessionId?: Function, isEnabled?: Function}} deps
3384
+ */
3385
+ function createLocateSessionCore(deps) {
3386
+ const options = deps ?? {};
3387
+ const t = typeof options.t === 'function' ? options.t : (key) => key;
3388
+ const currentSessionId = typeof options.currentSessionId === 'function' ? options.currentSessionId : () => undefined;
3389
+ const isEnabled = typeof options.isEnabled === 'function' ? options.isEnabled : () => true;
3390
+
3391
+ let button = null;
3392
+ let observer = null;
3393
+ let started = false;
3394
+ let expandAttempts = 0;
3395
+
3396
+ function hasDocument() {
3397
+ return typeof document !== 'undefined' && document !== null
3398
+ && typeof document.querySelector === 'function' && document.body !== null;
3399
+ }
3400
+
3401
+ function header() {
3402
+ if (!hasDocument()) return null;
3403
+ return document.querySelector('[data-sidebar-workspace-header]');
3404
+ }
3405
+
3406
+ function sessionRow(id) {
3407
+ if (!hasDocument() || typeof id !== 'string' || id === '') return null;
3408
+ const rows = document.querySelectorAll('[data-row-key^="session:"]');
3409
+ for (const el of rows) {
3410
+ if (el.getAttribute('data-row-key') === 'session:' + id) return el;
3411
+ }
3412
+ return null;
3413
+ }
3414
+
3415
+ function collapsedWorkspaces() {
3416
+ if (!hasDocument()) return [];
3417
+ const rows = document.querySelectorAll('[data-row-key^="workspace:"]');
3418
+ const out = [];
3419
+ for (const el of rows) {
3420
+ if (el.getAttribute('aria-expanded') === 'false') out.push(el);
3421
+ }
3422
+ return out;
3423
+ }
3424
+
3425
+ function locate() {
3426
+ if (!hasDocument()) return;
3427
+ const id = currentSessionId();
3428
+ if (typeof id !== 'string' || id === '') return;
3429
+ expandAttempts = 0;
3430
+ const reveal = () => {
3431
+ const row = sessionRow(id);
3432
+ if (row === null) {
3433
+ // Expand one collapsed workspace at a time, then retry after the
3434
+ // host re-renders. Bound the loop so a missing row cannot spin.
3435
+ if (expandAttempts >= 24) return;
3436
+ const collapsed = collapsedWorkspaces();
3437
+ if (collapsed.length === 0) return;
3438
+ expandAttempts += 1;
3439
+ const target = collapsed[collapsed.length - 1];
3440
+ target.click();
3441
+ if (typeof requestAnimationFrame === 'function') requestAnimationFrame(reveal);
3442
+ else setTimeout(reveal, 16);
3443
+ return;
3444
+ }
3445
+ try {
3446
+ row.scrollIntoView({ block: 'center', inline: 'nearest', behavior: 'smooth' });
3447
+ } catch {
3448
+ row.scrollIntoView();
3449
+ }
3450
+ };
3451
+ reveal();
3452
+ }
3453
+
3454
+ /** The action row the button lives in, marked so CSS can widen it. */
3455
+ let actions = null;
3456
+
3457
+ function clearActions() {
3458
+ if (actions !== null) {
3459
+ try {
3460
+ actions.removeAttribute('data-powerup-locate-actions');
3461
+ } catch {
3462
+ /* A detached node is already clean. */
3463
+ }
3464
+ }
3465
+ actions = null;
3466
+ }
3467
+
3468
+ function ensureButton() {
3469
+ const host = header();
3470
+ if (host === null || !isEnabled()) {
3471
+ if (button !== null) {
3472
+ button.remove();
3473
+ button = null;
3474
+ }
3475
+ clearActions();
3476
+ return;
3477
+ }
3478
+ if (button !== null && button.isConnected === true) {
3479
+ // React can replace the row without dropping our button; re-mark it.
3480
+ const parent = button.parentElement;
3481
+ if (parent !== null && parent !== undefined
3482
+ && typeof parent.setAttribute === 'function'
3483
+ && typeof parent.hasAttribute === 'function'
3484
+ && !parent.hasAttribute('data-powerup-locate-actions')) {
3485
+ parent.setAttribute('data-powerup-locate-actions', '');
3486
+ actions = parent;
3487
+ }
3488
+ return;
3489
+ }
3490
+ button = document.createElement('button');
3491
+ button.type = 'button';
3492
+ button.className = 'dsh-powerup-locate';
3493
+ button.setAttribute('data-powerup-locate', '');
3494
+ button.setAttribute('aria-label', t('locate.label'));
3495
+ button.setAttribute('title', t('locate.hint'));
3496
+ button.innerHTML = LOCATE_ICON;
3497
+ button.addEventListener('click', (event) => {
3498
+ event.preventDefault();
3499
+ event.stopPropagation();
3500
+ locate();
3501
+ });
3502
+ const row = host.querySelector('[class*="headerActions"]') ?? host;
3503
+ // The host clips this row at 60px; the marker lets LOCATE_CSS widen it
3504
+ // so the third button is actually reachable.
3505
+ if (typeof row.setAttribute === 'function') {
3506
+ row.setAttribute('data-powerup-locate-actions', '');
3507
+ actions = row;
3508
+ }
3509
+ row.appendChild(button);
3510
+ }
3511
+
3512
+ function sync() {
3513
+ if (!started) return;
3514
+ ensureButton();
3515
+ }
3516
+
3517
+ function start() {
3518
+ if (started || !hasDocument()) return;
3519
+ started = true;
3520
+ ensureButton();
3521
+ if (typeof MutationObserver === 'function') {
3522
+ observer = new MutationObserver(() => sync());
3523
+ observer.observe(document.body, { childList: true, subtree: true });
3524
+ }
3525
+ }
3526
+
3527
+ function stop() {
3528
+ started = false;
3529
+ if (observer !== null) observer.disconnect();
3530
+ observer = null;
3531
+ if (button !== null) button.remove();
3532
+ button = null;
3533
+ clearActions();
3534
+ }
3535
+
3536
+ return { start, stop, sync, locate, sessionRow, collapsedWorkspaces };
3537
+ }
3538
+
3539
+ /**
3540
+ * Install the workspace "locate current session" button.
3541
+ * @param {object} ctx client plugin context
3542
+ */
3543
+ function installLocateSession(ctx) {
3544
+ const currentSessionId = () => {
3545
+ try {
3546
+ const el = document.querySelector('[data-conversation-session]');
3547
+ const id = el === null ? null : el.getAttribute('data-conversation-session');
3548
+ return typeof id === 'string' && id !== '' ? id : undefined;
3549
+ } catch {
3550
+ return undefined;
3551
+ }
3552
+ };
3553
+ const core = createLocateSessionCore({
3554
+ t: (key, params) => translateCurrent(key, params),
3555
+ currentSessionId,
3556
+ isEnabled: () => getSettings().locateSession,
3557
+ });
3558
+ ctx.effect(() => {
3559
+ if (getSettings().locateSession) core.start();
3560
+ const off = subscribeSettings(() => {
3561
+ if (getSettings().locateSession) core.start();
3562
+ else core.stop();
3563
+ });
3564
+ return () => {
3565
+ off();
3566
+ core.stop();
3567
+ };
3568
+ }, 'dsh-powerup: locate session');
3569
+ return core;
3570
+ }
3571
+
3213
3572
  function installStyles(ctx) {
3214
3573
  try {
3215
3574
  const style = document.createElement('style');
3216
3575
  style.setAttribute('data-dsh-powerup', '');
3217
- style.textContent = CSS + '\n' + LAUNCHER_CSS + '\n' + SESSION_SWITCH_CSS;
3576
+ style.textContent = CSS + '\n' + LAUNCHER_CSS + '\n' + SESSION_SWITCH_CSS + '\n' + LOCATE_CSS;
3218
3577
  document.head.appendChild(style);
3219
3578
  ctx.effect(() => () => style.remove(), 'dsh-powerup: styles');
3220
3579
  } catch (error) {
@@ -3491,7 +3850,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
3491
3850
  }, [notify, t]);
3492
3851
 
3493
3852
  useEffect(() => {
3494
- if (!settings.enabled) {
3853
+ if (!settings.contextMenu) {
3495
3854
  close();
3496
3855
  return undefined;
3497
3856
  }
@@ -3551,7 +3910,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
3551
3910
  window.removeEventListener('resize', onResize);
3552
3911
  window.removeEventListener('blur', onResize);
3553
3912
  };
3554
- }, [settings.enabled, close, t, ctx, notify]);
3913
+ }, [settings.contextMenu, close, t, ctx, notify]);
3555
3914
 
3556
3915
  useLayoutEffect(() => {
3557
3916
  if (menu === null || menuRef.current === null) return;
@@ -4460,6 +4819,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
4460
4819
  * host's original stop flow runs unchanged.
4461
4820
  */
4462
4821
  function JobStopOverlay({ jobs, ctx }) {
4822
+ const settings = useSettings();
4463
4823
  const [target, setTarget] = useState(null);
4464
4824
  const [reason, setReason] = useState('');
4465
4825
  const [pending, setPending] = useState(false);
@@ -4477,6 +4837,10 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
4477
4837
  }, []);
4478
4838
 
4479
4839
  useEffect(() => {
4840
+ if (!settings.jobStop) {
4841
+ setTarget(null);
4842
+ return undefined;
4843
+ }
4480
4844
  const onClick = (event) => {
4481
4845
  if (event.defaultPrevented) return;
4482
4846
  const node = event.target;
@@ -4495,7 +4859,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
4495
4859
  };
4496
4860
  document.addEventListener('click', onClick, true);
4497
4861
  return () => document.removeEventListener('click', onClick, true);
4498
- }, [jobs]);
4862
+ }, [jobs, settings.jobStop]);
4499
4863
 
4500
4864
  useEffect(() => {
4501
4865
  if (target === null) return undefined;
@@ -4667,6 +5031,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
4667
5031
  * asks about enabling, and offers to restart DSH.
4668
5032
  */
4669
5033
  function PluginUpdateOverlay({ manager, remote, ctx }) {
5034
+ const settings = useSettings();
4670
5035
  const [view, setView] = useState(null);
4671
5036
  const [localeTick, forceLocale] = useState(0);
4672
5037
  const [pending, setPending] = useState(() => readPendingRestarts());
@@ -4967,6 +5332,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
4967
5332
  const openRef = useRef(openFor);
4968
5333
  openRef.current = openFor;
4969
5334
  useEffect(() => {
5335
+ if (!settings.update) return undefined;
4970
5336
  const buttons = buttonsRef.current;
4971
5337
  let scheduled = false;
4972
5338
  let stopped = false;
@@ -4998,7 +5364,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
4998
5364
  }
4999
5365
  buttons.clear();
5000
5366
  };
5001
- }, [localeTick, pending]);
5367
+ }, [localeTick, pending, settings.update]);
5002
5368
 
5003
5369
  // Keep the selected version input focused when the chooser opens.
5004
5370
  useEffect(() => {
@@ -6128,13 +6494,11 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
6128
6494
  { id: 'stepref', icon: TagIcon, name: t('action.stepRef'), hint: t('action.stepRefHint') },
6129
6495
  { id: 'export', icon: ExportIcon, name: t('action.export'), hint: t('action.exportHint') },
6130
6496
  ];
6131
- /** One label/description row with a host-styled switch. */
6132
- const settingRow = (key, checked, label, hint) => h('div', { key, className: 'dsh-powerup-setting' },
6133
- h('div', { className: 'dsh-powerup-setting-copy' },
6134
- h('span', { className: 'dsh-powerup-setting-label' }, label),
6135
- h('span', { className: 'dsh-powerup-setting-hint' }, hint),
6136
- ),
6137
- h('button', {
6497
+
6498
+ /** A host-styled toggle button shared by every feature card. */
6499
+ const toggle = (key, label) => {
6500
+ const checked = settings[key] !== false;
6501
+ return h('button', {
6138
6502
  type: 'button',
6139
6503
  role: 'switch',
6140
6504
  'aria-checked': checked ? 'true' : 'false',
@@ -6142,12 +6506,57 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
6142
6506
  className: 'dsh-powerup-switch',
6143
6507
  onClick: () => setSettings({ [key]: !checked }),
6144
6508
  },
6145
- h('span', { className: 'dsh-powerup-switch-track' },
6146
- h('span', { className: 'dsh-powerup-switch-thumb' }),
6509
+ h('span', { className: 'dsh-powerup-switch-track' },
6510
+ h('span', { className: 'dsh-powerup-switch-thumb' }),
6511
+ ),
6512
+ h('span', null, checked ? t('page.enabled') : t('page.disabled')),
6513
+ );
6514
+ };
6515
+
6516
+ /** One uniform feature card: icon + title + description + toggle, with optional detail rows. */
6517
+ const featureCard = (key, iconComp, titleKey, descKey, howKey, detail) => h('section', {
6518
+ key,
6519
+ className: 'dsh-powerup-card' + (settings[key] === false ? ' is-off' : ''),
6520
+ },
6521
+ h('div', { className: 'dsh-powerup-card-head' },
6522
+ h('div', { className: 'dsh-powerup-card-icon' }, h(iconComp, { size: 18 })),
6523
+ h('div', { className: 'dsh-powerup-card-copy' },
6524
+ h('h2', null, t(titleKey)),
6525
+ h('p', null, t(descKey)),
6526
+ ),
6527
+ toggle(key, t(titleKey)),
6147
6528
  ),
6148
- h('span', null, checked ? t('page.enabled') : t('page.disabled')),
6529
+ howKey !== undefined ? h('p', { className: 'dsh-powerup-card-how' }, t(howKey)) : null,
6530
+ detail ?? null,
6531
+ );
6532
+
6533
+ /** A label/hint sub-row inside a card (for secondary options). */
6534
+ const settingRow = (key, checked, label, hint) => h('div', { key, className: 'dsh-powerup-setting' },
6535
+ h('div', { className: 'dsh-powerup-setting-copy' },
6536
+ h('span', { className: 'dsh-powerup-setting-label' }, label),
6537
+ h('span', { className: 'dsh-powerup-setting-hint' }, hint),
6149
6538
  ),
6539
+ toggle(key, label),
6150
6540
  );
6541
+
6542
+ const actionsDetail = h('div', { className: 'dsh-powerup-card-detail' },
6543
+ h('h3', { className: 'dsh-powerup-section-title' }, t('page.actions')),
6544
+ h('ul', { className: 'dsh-powerup-actions' },
6545
+ actions.map((action) => h('li', { key: action.id, className: 'dsh-powerup-action' },
6546
+ h('span', { className: 'dsh-powerup-action-icon' }, h(action.icon, { size: 15 })),
6547
+ h('span', { className: 'dsh-powerup-action-copy' },
6548
+ h('span', { className: 'dsh-powerup-action-name' }, action.name),
6549
+ h('span', { className: 'dsh-powerup-action-hint' }, action.hint),
6550
+ ),
6551
+ )),
6552
+ ),
6553
+ );
6554
+
6555
+ const oneClickDetail = h('div', { className: 'dsh-powerup-card-detail' },
6556
+ settingRow('oneClickEnable', settings.oneClickEnable !== false, t('page.oneClickEnable'), t('page.oneClickEnableHint')),
6557
+ settingRow('oneClickRestart', settings.oneClickRestart !== false, t('page.oneClickRestart'), t('page.oneClickRestartHint')),
6558
+ );
6559
+
6151
6560
  return h('div', { className: 'dsh-powerup-page' },
6152
6561
  h('div', { className: 'dsh-powerup-shell' },
6153
6562
  h('header', { className: 'dsh-powerup-hero' },
@@ -6157,86 +6566,17 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
6157
6566
  h('p', null, t('page.subtitle')),
6158
6567
  ),
6159
6568
  ),
6160
- h('section', { className: 'dsh-powerup-card' },
6161
- h('div', { className: 'dsh-powerup-card-head' },
6162
- h('div', { className: 'dsh-powerup-card-icon' }, h(PowerUpLineIcon, { size: 18 })),
6163
- h('div', { className: 'dsh-powerup-card-copy' },
6164
- h('h2', null, t('page.featureTitle')),
6165
- h('p', null, t('page.featureDesc')),
6166
- ),
6167
- h('button', {
6168
- type: 'button',
6169
- role: 'switch',
6170
- 'aria-checked': settings.enabled ? 'true' : 'false',
6171
- 'aria-label': t('page.featureTitle'),
6172
- className: 'dsh-powerup-switch',
6173
- onClick: () => setSettings({ enabled: !settings.enabled }),
6174
- },
6175
- h('span', { className: 'dsh-powerup-switch-track' },
6176
- h('span', { className: 'dsh-powerup-switch-thumb' }),
6177
- ),
6178
- h('span', null, settings.enabled ? t('page.enabled') : t('page.disabled')),
6179
- ),
6180
- ),
6181
- h('div', { style: { marginTop: '14px' } },
6182
- h('h3', { className: 'dsh-powerup-section-title' }, t('page.actions')),
6183
- h('ul', { className: 'dsh-powerup-actions' },
6184
- actions.map((action) => h('li', { key: action.id, className: 'dsh-powerup-action' },
6185
- h('span', { className: 'dsh-powerup-action-icon' }, h(action.icon, { size: 15 })),
6186
- h('span', { className: 'dsh-powerup-action-copy' },
6187
- h('span', { className: 'dsh-powerup-action-name' }, action.name),
6188
- h('span', { className: 'dsh-powerup-action-hint' }, action.hint),
6189
- ),
6190
- )),
6191
- ),
6192
- ),
6193
- ),
6194
- h('section', { className: 'dsh-powerup-card' },
6195
- h('div', { className: 'dsh-powerup-card-head' },
6196
- h('div', { className: 'dsh-powerup-card-icon' }, h(LauncherIcon, { size: 18 })),
6197
- h('div', { className: 'dsh-powerup-card-copy' },
6198
- h('h2', null, t('page.launcherTitle')),
6199
- h('p', null, t('page.launcherDesc')),
6200
- ),
6201
- ),
6202
- h('div', { className: 'dsh-powerup-settings' },
6569
+ featureCard('contextMenu', PowerUpLineIcon, 'page.featureTitle', 'page.featureDesc', undefined, actionsDetail),
6570
+ featureCard('launcher', LauncherIcon, 'page.launcherTitle', 'page.launcherDesc', undefined,
6571
+ h('div', { className: 'dsh-powerup-card-detail' },
6203
6572
  settingRow('launcher', settings.launcher !== false, t('page.launcherToggle'), t('page.launcherToggleHint')),
6204
6573
  ),
6205
6574
  ),
6206
- h('section', { className: 'dsh-powerup-card' },
6207
- h('div', { className: 'dsh-powerup-card-head' },
6208
- h('div', { className: 'dsh-powerup-card-icon' }, h(QuickIcon, { size: 18 })),
6209
- h('div', { className: 'dsh-powerup-card-copy' },
6210
- h('h2', null, t('page.oneClickTitle')),
6211
- h('p', null, t('page.oneClickDesc')),
6212
- ),
6213
- ),
6214
- h('div', { className: 'dsh-powerup-settings' },
6215
- settingRow('oneClickEnable', settings.oneClickEnable !== false, t('page.oneClickEnable'), t('page.oneClickEnableHint')),
6216
- settingRow('oneClickRestart', settings.oneClickRestart !== false, t('page.oneClickRestart'), t('page.oneClickRestartHint')),
6217
- ),
6218
- ),
6219
- h('section', { className: 'dsh-powerup-card' },
6220
- h('div', { className: 'dsh-powerup-card-head' },
6221
- h('div', { className: 'dsh-powerup-card-icon' }, h(UpdateIcon, { size: 18 })),
6222
- h('div', { className: 'dsh-powerup-card-copy' },
6223
- h('h2', null, t('page.updateTitle')),
6224
- h('p', null, t('page.updateDesc')),
6225
- ),
6226
- ),
6227
- h('p', { className: 'dsh-powerup-update-note', style: { marginTop: '12px' } }, t('page.updateHow')),
6228
- ),
6229
- h('section', { className: 'dsh-powerup-card' },
6230
- h('div', { className: 'dsh-powerup-card-head' },
6231
- h('div', { className: 'dsh-powerup-card-icon' }, h(StopIcon, { size: 18 })),
6232
- h('div', { className: 'dsh-powerup-card-copy' },
6233
- h('h2', null, t('page.jobStopTitle')),
6234
- h('p', null, t('page.jobStopDesc')),
6235
- ),
6236
- ),
6237
- h('p', { className: 'dsh-powerup-update-note', style: { marginTop: '12px' } }, t('page.jobStopHow')),
6238
- ),
6239
- h('section', { className: 'dsh-powerup-card' },
6575
+ featureCard('sessionSwitch', QuickIcon, 'page.sessionSwitchTitle', 'page.sessionSwitchDesc', 'page.sessionSwitchHow'),
6576
+ featureCard('locateSession', LocateIcon, 'page.locateTitle', 'page.locateDesc', 'page.locateHow'),
6577
+ featureCard('jobStop', StopIcon, 'page.jobStopTitle', 'page.jobStopDesc', 'page.jobStopHow'),
6578
+ featureCard('update', UpdateIcon, 'page.updateTitle', 'page.updateDesc', 'page.updateHow', oneClickDetail),
6579
+ h('section', { className: 'dsh-powerup-card dsh-powerup-how-card' },
6240
6580
  h('h2', { className: 'dsh-powerup-section-title', style: { marginBottom: '10px' } }, t('page.howTitle')),
6241
6581
  h('ol', { className: 'dsh-powerup-steps' },
6242
6582
  h('li', { className: 'dsh-powerup-step' },
@@ -6294,6 +6634,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
6294
6634
  installStyles(ctx);
6295
6635
  installLauncher(ctx);
6296
6636
  installSessionSwitcher(ctx);
6637
+ installLocateSession(ctx);
6297
6638
 
6298
6639
  const slots = ctx.get('slots');
6299
6640
  if (slots === undefined || typeof slots.inject !== 'function' || typeof slots.register !== 'function') {
@@ -6386,8 +6727,12 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
6386
6727
  DICT,
6387
6728
  CSS,
6388
6729
  SESSION_SWITCH_CSS,
6730
+ LOCATE_CSS,
6389
6731
  runningSessionRows,
6732
+ buildWorkspaceIndex,
6390
6733
  createSessionSwitcherCore,
6734
+ createLocateSessionCore,
6735
+ LocateIcon,
6391
6736
  LAUNCHER_CSS,
6392
6737
  LAUNCHER_STORAGE_KEY,
6393
6738
  LAUNCHER_CHAT_KEY,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@restregular/dsh-powerup",
3
- "version": "0.8.11",
4
- "description": "Power-Up — small, opt-in upgrades for DeepSeek Harness. Adds a right-click action menu to the Trajectory ledger, an optional stop reason in the session header's background jobs panel (appended to the injected completion notice), and an install control for third-party plugins from the Plugins page: read versions from the configured registries, install the version in the input through the Add plugin path (removing the old copy first), mark restart-needed installs, hand Power-Up's own install to the background, and optionally restart DSH. One-click install skips the enable and restart questions and can apply those actions automatically with configurable defaults. The ledger menu also copies a step reference (session id + step id) that the read-only powerup_step_read tool resolves back into the raw session data. · 为 DeepSeek Harness 提供小型增强:在轨迹页面右键记录即可复制、引用、查看详情或从该记录 Fork;右键「复制步骤引用」得到「会话 ID + 步骤 ID」,Agent 用只读工具 powerup_step_read 即可取回该步骤的完整原始数据;在会话顶部的后台任务面板手动停止任务时可填写停止原因,原因会附加到任务结束后的会话提示;并在插件页为第三方已安装插件提供安装按钮,从安装源读取版本,按输入框中的版本沿用「添加插件」流程安装(先卸载旧版),支持待重启标记、Power-Up 自身后台安装与可选重启;安装面板提供「一键安装」,按输入框版本安装并跳过启用/重启询问,默认自动启用并重启,可在 Power-Up 页面调整默认行为。 · 侧边栏启动器:把左侧边栏的面板按钮变成随宽度自适应的图标网格(图标在上、文字在下),支持拖拽排序与分组(拖到另一个图标中间即合并为分组,点击分组弹出浮层展示内部图标),可随时整体关闭;网格里自带「返回会话」「重启 DSH」「关闭 DSH」三个按钮,它们和「更多」一样可以拖进分组,重启/关闭沿用插件安装流程的确认对话框。 · 会话切换:把会话标题变成可点击,点击后弹出下拉列表,列出正在运行中的会话标题,点击即可切换到对应会话。",
3
+ "version": "0.8.13",
4
+ "description": "Power-Up — small, opt-in upgrades for DeepSeek Harness. Adds a right-click action menu to the Trajectory ledger, an optional stop reason in the session header's background jobs panel (appended to the injected completion notice), and an install control for third-party plugins from the Plugins page: read versions from the configured registries, install the version in the input through the Add plugin path (removing the old copy first), mark restart-needed installs, hand Power-Up's own install to the background, and optionally restart DSH. One-click install skips the enable and restart questions and can apply those actions automatically with configurable defaults. The ledger menu also copies a step reference (session id + step id) that the read-only powerup_step_read tool resolves back into the raw session data. · 为 DeepSeek Harness 提供小型增强:在轨迹页面右键记录即可复制、引用、查看详情或从该记录 Fork;右键「复制步骤引用」得到「会话 ID + 步骤 ID」,Agent 用只读工具 powerup_step_read 即可取回该步骤的完整原始数据;在会话顶部的后台任务面板手动停止任务时可填写停止原因,原因会附加到任务结束后的会话提示;并在插件页为第三方已安装插件提供安装按钮,从安装源读取版本,按输入框中的版本沿用「添加插件」流程安装(先卸载旧版),支持待重启标记、Power-Up 自身后台安装与可选重启;安装面板提供「一键安装」,按输入框版本安装并跳过启用/重启询问,默认自动启用并重启,可在 Power-Up 页面调整默认行为。 · 侧边栏启动器:把左侧边栏的面板按钮变成随宽度自适应的图标网格(图标在上、文字在下),支持拖拽排序与分组(拖到另一个图标中间即合并为分组,点击分组弹出浮层展示内部图标),可随时整体关闭;网格里自带「返回会话」「重启 DSH」「关闭 DSH」三个按钮,它们和「更多」一样可以拖进分组,重启/关闭沿用插件安装流程的确认对话框。 · 会话切换:把会话标题变成可点击,点击后弹出下拉列表,列出正在运行中的会话标题(带工作区名称前缀),点击即可切换到对应会话。 · 定位当前会话:工作区按钮栏新增按钮,把当前会话在工作区列表中展开并居中显示,自动展开折叠的工作区。 · 所有功能均可在 Power-Up 页面独立启用/禁用,弹窗统一为宿主原生样式。",
5
5
  "icon": "./icon.svg",
6
6
  "type": "module",
7
7
  "main": "index.js",
@@ -78,7 +78,10 @@
78
78
  "drag-sort",
79
79
  "folder",
80
80
  "restart",
81
- "close"
81
+ "close",
82
+ "session-switch",
83
+ "workspace",
84
+ "locate"
82
85
  ],
83
86
  "publishConfig": {
84
87
  "access": "public",