@restregular/dsh-powerup 0.19.11 → 0.19.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 +328 -32
  2. package/package.json +2 -2
package/client.js CHANGED
@@ -98,7 +98,7 @@
98
98
  const requirementCreateDraft = { workspaceId: null, title: '', text: '', scope: 'current' };
99
99
  /** Fallback bucket when the hero cannot resolve an owning workspace yet. */
100
100
  const UNSCOPED_WORKSPACE = '__unscoped__';
101
- const VERSION = '0.19.11';
101
+ const VERSION = '0.19.13';
102
102
  const MENU_GAP = 8;
103
103
  const MENU_WIDTH = 248;
104
104
  /** Reference scheme understood by the Host's `powerup_step_read` tool. */
@@ -118,6 +118,24 @@
118
118
  'page.featureDesc': '在轨迹页面右键任意记录,快速复制、引用、查看详情、复制步骤引用,或从该记录 Fork 出一个新会话。',
119
119
  'page.enabled': '已启用',
120
120
  'page.disabled': '已停用',
121
+ 'page.details': '详情',
122
+ 'page.more': '更多',
123
+ 'page.collapse': '收起',
124
+ 'page.featureBrief': '右键轨迹记录,快速复制、引用、查看、Fork。',
125
+ 'page.launcherBrief': '把侧边栏面板按钮变成可拖拽排序的图标网格。',
126
+ 'page.sessionSwitchBrief': '点击会话标题,在运行中的会话间切换。',
127
+ 'page.locateBrief': '一键在工作区列表中定位当前会话。',
128
+ 'page.scrollToTopBrief': '在侧边栏加一个「回到顶部」按钮。',
129
+ 'page.renderingBrief': '按正则把回复中的指定片段替换成占位符。',
130
+ 'page.dualSendBrief': '在输入框加「等待/插话」两个发送按钮。',
131
+ 'page.quickRepliesBrief': '让 Agent 回复后提供可点的快捷选项。',
132
+ 'page.taskProgressBrief': '会话顶部一键生成结构化任务进度。',
133
+ 'page.directAskBrief': '输入区加轻量问答按钮,不启动 Agent。',
134
+ 'page.promptsBrief': '为每个工作区保存可复用的提示词。',
135
+ 'page.jobStopBrief': '停止后台任务时顺手填写停止原因。',
136
+ 'page.updateBrief': '为第三方插件提供安装入口。',
137
+ 'theme.toLight': '切换到亮色模式',
138
+ 'theme.toDark': '切换到暗色模式',
121
139
  'page.actions': '可用操作',
122
140
  'page.howTitle': '怎么用',
123
141
  'page.how1': '打开任意会话,切到顶部的「轨迹」视图。',
@@ -527,6 +545,24 @@
527
545
  'page.featureDesc': 'Right-click any trajectory record to copy it, quote it, open its inspector, copy a step reference, or fork the session at that point.',
528
546
  'page.enabled': 'Enabled',
529
547
  'page.disabled': 'Disabled',
548
+ 'page.details': 'Details',
549
+ 'page.more': 'More',
550
+ 'page.collapse': 'Hide',
551
+ 'page.featureBrief': 'Right-click a trajectory record to copy, quote, inspect, or fork it.',
552
+ 'page.launcherBrief': 'Turn sidebar panel buttons into a draggable, sortable icon grid.',
553
+ 'page.sessionSwitchBrief': 'Click the session title to switch between running sessions.',
554
+ 'page.locateBrief': 'Locate the current session in the workspace list.',
555
+ 'page.scrollToTopBrief': 'Add a back-to-top button to the sidebar.',
556
+ 'page.renderingBrief': 'Replace matching reply text with a placeholder via regex.',
557
+ 'page.dualSendBrief': 'Add wait/interrupt send buttons to the composer.',
558
+ 'page.quickRepliesBrief': 'Let the Agent offer tappable reply options.',
559
+ 'page.taskProgressBrief': 'Generate a structured progress panel from the header.',
560
+ 'page.directAskBrief': 'Add a quick, Agent-free Q&A button to the composer.',
561
+ 'page.promptsBrief': 'Save reusable prompts per workspace.',
562
+ 'page.jobStopBrief': 'Leave a reason when stopping a background job.',
563
+ 'page.updateBrief': 'Add an install entry to third-party plugins.',
564
+ 'theme.toLight': 'Switch to light mode',
565
+ 'theme.toDark': 'Switch to dark mode',
530
566
  'page.actions': 'What you can do',
531
567
  'page.howTitle': 'How to use it',
532
568
  'page.how1': 'Open a session and switch to the Trajectory view.',
@@ -4200,9 +4236,25 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
4200
4236
  .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}
4201
4237
  .dsh-powerup-card.is-off .dsh-powerup-card-icon,.dsh-powerup-card.is-off .dsh-powerup-card-copy{opacity:.55}
4202
4238
  .dsh-powerup-card-head{display:flex;align-items:flex-start;gap:12px}
4203
- .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}
4239
+ .dsh-powerup-card-body{margin-top:12px}
4240
+ .dsh-powerup-card-how{margin:0 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}
4204
4241
  .dsh-powerup-card-detail{margin-top:12px;padding-top:4px}
4242
+ .dsh-powerup-card-foot{display:flex;align-items:center;gap:8px;margin-top:12px}
4205
4243
  .dsh-powerup-how-card .dsh-powerup-section-title{margin-bottom:10px}
4244
+ .dsh-powerup-detail-btn{flex:none;padding:3px 9px;border:.5px solid var(--dsw-alias-border-l2);border-radius:7px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;line-height:18px;cursor:pointer;white-space:nowrap}
4245
+ .dsh-powerup-detail-btn:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-primary)}
4246
+ .dsh-powerup-detail-btn:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}
4247
+ .dsh-powerup-fold-btn{flex:none;display:inline-flex;align-items:center;gap:5px;padding:3px 9px 3px 7px;border:.5px solid var(--dsw-alias-border-l2);border-radius:7px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;line-height:18px;cursor:pointer;white-space:nowrap}
4248
+ .dsh-powerup-fold-btn:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-primary)}
4249
+ .dsh-powerup-fold-btn.on{color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}
4250
+ .dsh-powerup-fold-btn:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}
4251
+ .dsh-powerup-fold-chevron{display:inline-block;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4.5px solid currentColor;transition:transform .14s ease}
4252
+ .dsh-powerup-fold-btn.on .dsh-powerup-fold-chevron{transform:rotate(180deg)}
4253
+ .dsh-powerup-detail-modal{box-sizing:border-box;display:flex;flex-direction:column;width:min(460px,100%);max-height:min(680px,calc(100dvh - 48px));border-radius:var(--dsw-radius-panel,14px);background:var(--dsw-alias-bg-layer-2);box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;overflow:hidden;animation:dsh-powerup-prompt-rise .18s cubic-bezier(.2,.8,.3,1)}
4254
+ .dsh-powerup-detail-modal.is-closing{animation:dsh-powerup-prompt-sink .14s ease-in forwards}
4255
+ .dsh-powerup-detail-modal-title{display:flex;align-items:center;gap:10px;font-size:16px;line-height:24px;font-weight:500;min-width:0}
4256
+ .dsh-powerup-detail-modal-icon{flex:none;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary)}
4257
+ .dsh-powerup-detail-modal-desc{margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px;overflow-wrap:anywhere}
4206
4258
  .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)}
4207
4259
  .dsh-powerup-card-copy{min-width:0;flex:1 1 auto}
4208
4260
  .dsh-powerup-card-copy h2{margin:0;font-size:14px;line-height:1.35;font-weight:650}
@@ -4399,7 +4451,7 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
4399
4451
  .dsh-powerup-update-quick-note-title{display:flex;align-items:center;gap:6px;color:var(--dsw-alias-state-warn-label);font-size:12px;line-height:17px;font-weight:500}
4400
4452
  .dsh-powerup-update-quick-note .dsh-powerup-update-note{color:var(--dsw-alias-label-secondary)}
4401
4453
  .dsh-powerup-update-close:focus-visible,.dsh-powerup-update-toggle:focus-visible,.dsh-powerup-update-version:focus-visible,.dsh-powerup-update-select-trigger:focus-visible,.dsh-powerup-update-option:focus-visible,.dsh-powerup-update-primary:focus-visible,.dsh-powerup-update-ghost:focus-visible,.dsh-powerup-update-quick:focus-visible,.dsh-powerup-update-button:focus-visible,.dsh-powerup-restart-action:focus-visible,.dsh-powerup-update-default:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}
4402
- @media (max-width:680px){.dsh-powerup-page{padding:20px 16px 42px}.dsh-powerup-actions{grid-template-columns:minmax(0,1fr)}.dsh-powerup-hero-art{width:54px;height:54px}.dsh-powerup-hero h1{font-size:19px}.dsh-powerup-card-head{flex-wrap:wrap}.dsh-powerup-switch{margin-left:auto}.dsh-powerup-update-mask{padding:12px}.dsh-powerup-update-dialog{max-height:calc(100dvh - 24px)}.dsh-powerup-update-head{padding:18px 12px 10px 18px}.dsh-powerup-update-body{padding:0 18px 4px}.dsh-powerup-update-foot{padding:14px 18px 18px}}
4454
+ @media (max-width:680px){.dsh-powerup-page{padding:20px 16px 42px}.dsh-powerup-actions{grid-template-columns:minmax(0,1fr)}.dsh-powerup-hero-art{width:54px;height:54px}.dsh-powerup-hero h1{font-size:19px}.dsh-powerup-card-head{flex-wrap:wrap}.dsh-powerup-detail-btn{margin-left:auto}.dsh-powerup-update-mask{padding:12px}.dsh-powerup-update-dialog{max-height:calc(100dvh - 24px)}.dsh-powerup-update-head{padding:18px 12px 10px 18px}.dsh-powerup-update-body{padding:0 18px 4px}.dsh-powerup-update-foot{padding:14px 18px 18px}}
4403
4455
  `;
4404
4456
 
4405
4457
  const SESSION_SWITCH_CSS = `
@@ -4445,6 +4497,17 @@ default; shown only while the sidebar workspace list is scrolled down. */
4445
4497
  html[data-platform="darwin"] .dsh-powerup-scrolltop{background:var(--dsw-specific-sidebar-glass-fill)}
4446
4498
  html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-specific-sidebar-glass-hover)}
4447
4499
  @media (prefers-reduced-motion:reduce){.dsh-powerup-scrolltop{transition:none}}
4500
+ `;
4501
+
4502
+ const THEME_TOGGLE_CSS = `
4503
+ /* Theme toggle injected into the sidebar brand row (logoRow). Sits after the
4504
+ logo/brand name, before the rail's collapse toggle. */
4505
+ [class*="logoRow"]{position:relative}
4506
+ .dsh-powerup-theme-toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;margin-left:auto;border:0;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;transition:background .12s ease,color .12s ease}
4507
+ .dsh-powerup-theme-toggle:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
4508
+ .dsh-powerup-theme-toggle:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}
4509
+ .dsh-powerup-theme-toggle svg{width:16px;height:16px}
4510
+ @media (prefers-reduced-motion:reduce){.dsh-powerup-theme-toggle{transition:none}}
4448
4511
  `;
4449
4512
 
4450
4513
  const RENDERING_CSS = `
@@ -5890,6 +5953,136 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
5890
5953
  return core;
5891
5954
  }
5892
5955
 
5956
+ /**
5957
+ * DOM controller for a theme toggle button in the sidebar brand row (the
5958
+ * logoRow that also holds the collapsed-rail toggle). It reads the theme
5959
+ * service through ctx and flips the preference between `light` and `dark`,
5960
+ * showing a sun glyph in dark mode (click to go light) and a moon glyph in
5961
+ * light mode (click to go dark). Falls back to `prefers-color-scheme` via
5962
+ * the active theme's colorScheme when the preference is `system`.
5963
+ * @param {{getTheme?: Function, setTheme?: Function, t?: Function}} deps
5964
+ */
5965
+ function createThemeToggleCore(deps) {
5966
+ const options = deps ?? {};
5967
+ const getTheme = typeof options.getTheme === 'function' ? options.getTheme : () => undefined;
5968
+ const setTheme = typeof options.setTheme === 'function' ? options.setTheme : () => {};
5969
+ const t = typeof options.t === 'function' ? options.t : (key) => key;
5970
+
5971
+ let button = null;
5972
+ let observer = null;
5973
+ let started = false;
5974
+
5975
+ const SUN_ICON = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><circle cx="8" cy="8" r="3" stroke="currentColor" stroke-width="1.3"/><path d="M8 1.2v1.6M8 13.2v1.6M1.2 8h1.6M13.2 8h1.6M3.2 3.2l1.1 1.1M11.7 11.7l1.1 1.1M12.8 3.2l-1.1 1.1M4.3 11.7l-1.1 1.1" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/></svg>';
5976
+ const MOON_ICON = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><path d="M13.5 9.5A6 6 0 0 1 6.5 2.5a6 6 0 1 0 7 7Z" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round"/></svg>';
5977
+
5978
+ function hasDocument() {
5979
+ return typeof document !== 'undefined' && document !== null
5980
+ && typeof document.querySelector === 'function' && document.body !== null;
5981
+ }
5982
+
5983
+ /** The sidebar brand row that holds the logo and the rail toggle. */
5984
+ function brandRow() {
5985
+ if (!hasDocument()) return null;
5986
+ return document.querySelector('[class*="logoRow"]');
5987
+ }
5988
+
5989
+ function isDark() {
5990
+ const snap = getTheme();
5991
+ const active = snap && typeof snap === 'object' ? snap.active : null;
5992
+ const scheme = active && typeof active === 'object' ? active.colorScheme : null;
5993
+ if (scheme === 'dark') return true;
5994
+ if (scheme === 'light') return false;
5995
+ try {
5996
+ if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
5997
+ return window.matchMedia('(prefers-color-scheme: dark)').matches;
5998
+ }
5999
+ } catch { /* ignore */ }
6000
+ return false;
6001
+ }
6002
+
6003
+ function refresh() {
6004
+ if (button === null) return;
6005
+ const dark = isDark();
6006
+ button.innerHTML = dark ? SUN_ICON : MOON_ICON;
6007
+ button.setAttribute('aria-label', dark ? t('theme.toLight') : t('theme.toDark'));
6008
+ button.setAttribute('title', dark ? t('theme.toLight') : t('theme.toDark'));
6009
+ }
6010
+
6011
+ function ensureButton() {
6012
+ const host = brandRow();
6013
+ if (host === null) {
6014
+ if (button !== null) { button.remove(); button = null; }
6015
+ return;
6016
+ }
6017
+ if (button !== null && button.isConnected === true) { refresh(); return; }
6018
+ button = document.createElement('button');
6019
+ button.type = 'button';
6020
+ button.className = 'dsh-powerup-theme-toggle';
6021
+ button.setAttribute('data-powerup-theme-toggle', '');
6022
+ button.addEventListener('click', (event) => {
6023
+ event.preventDefault();
6024
+ event.stopPropagation();
6025
+ setTheme(isDark() ? 'light' : 'dark');
6026
+ refresh();
6027
+ });
6028
+ refresh();
6029
+ host.appendChild(button);
6030
+ }
6031
+
6032
+ function sync() {
6033
+ if (!started) return;
6034
+ ensureButton();
6035
+ }
6036
+
6037
+ function start() {
6038
+ if (started || !hasDocument()) return;
6039
+ started = true;
6040
+ ensureButton();
6041
+ if (typeof MutationObserver === 'function') {
6042
+ observer = new MutationObserver(() => sync());
6043
+ observer.observe(document.body, { childList: true, subtree: true });
6044
+ }
6045
+ }
6046
+
6047
+ function stop() {
6048
+ started = false;
6049
+ if (observer !== null) observer.disconnect();
6050
+ observer = null;
6051
+ if (button !== null) button.remove();
6052
+ button = null;
6053
+ }
6054
+
6055
+ return { start, stop, sync, isDark };
6056
+ }
6057
+
6058
+ /**
6059
+ * Install the sidebar theme toggle button.
6060
+ * @param {object} ctx client plugin context
6061
+ */
6062
+ function installThemeToggle(ctx) {
6063
+ const theme = (() => {
6064
+ try { return ctx.get('theme'); } catch { return undefined; }
6065
+ })();
6066
+ const core = createThemeToggleCore({
6067
+ t: (key, params) => translateCurrent(key, params),
6068
+ getTheme: () => {
6069
+ try { return theme && typeof theme.getTheme === 'function' ? theme.getTheme() : undefined; } catch { return undefined; }
6070
+ },
6071
+ setTheme: (id) => {
6072
+ try { if (theme && typeof theme.setTheme === 'function') theme.setTheme(id); } catch { /* ignore */ }
6073
+ },
6074
+ });
6075
+ ctx.effect(() => {
6076
+ core.start();
6077
+ const off = typeof ctx?.on === 'function' ? ctx.on('theme/change', () => core.sync()) : null;
6078
+ return () => {
6079
+ if (typeof off === 'function') off();
6080
+ core.stop();
6081
+ };
6082
+ }, 'dsh-powerup: theme toggle');
6083
+ return core;
6084
+ }
6085
+
5893
6086
  /**
5894
6087
  * DOM-based masking for assistant reply prose. We observe the Chat view's
5895
6088
  * assistant reply rows and replace matching text fragments in place. The
@@ -6021,7 +6214,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
6021
6214
  try {
6022
6215
  const style = document.createElement('style');
6023
6216
  style.setAttribute('data-dsh-powerup', '');
6024
- style.textContent = CSS + '\n' + LAUNCHER_CSS + '\n' + SESSION_SWITCH_CSS + '\n' + LOCATE_CSS + '\n' + SCROLL_TOP_CSS + '\n' + RENDERING_CSS + '\n' + QUICK_REPLIES_CSS + '\n' + PROMPTS_CSS + '\n' + PROGRESS_CSS;
6217
+ style.textContent = CSS + '\n' + LAUNCHER_CSS + '\n' + SESSION_SWITCH_CSS + '\n' + LOCATE_CSS + '\n' + SCROLL_TOP_CSS + '\n' + THEME_TOGGLE_CSS + '\n' + RENDERING_CSS + '\n' + QUICK_REPLIES_CSS + '\n' + PROMPTS_CSS + '\n' + PROGRESS_CSS;
6025
6218
  document.head.appendChild(style);
6026
6219
  ctx.effect(() => () => style.remove(), 'dsh-powerup: styles');
6027
6220
  } catch (error) {
@@ -10807,10 +11000,70 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10807
11000
  // ------------------------------------------------------------------
10808
11001
  // Sidebar page
10809
11002
  // ------------------------------------------------------------------
11003
+ /**
11004
+ * A feature card's full detail modal: icon + title + full description,
11005
+ * the "how to use" text, and any sub-options (settings) the card carries.
11006
+ */
11007
+ function FeatureDetailModal({ card, t, onClose }) {
11008
+ const [closing, setClosing] = useState(false);
11009
+ const requestClose = () => {
11010
+ if (closing) return;
11011
+ setClosing(true);
11012
+ setTimeout(() => {
11013
+ try { onClose(); } catch { /* parent owns unmount */ }
11014
+ }, 140);
11015
+ };
11016
+ useEffect(() => {
11017
+ const onKey = (event) => {
11018
+ if (event.key === 'Escape') {
11019
+ event.preventDefault();
11020
+ requestClose();
11021
+ }
11022
+ };
11023
+ document.addEventListener('keydown', onKey, true);
11024
+ return () => document.removeEventListener('keydown', onKey, true);
11025
+ }, [closing]);
11026
+ const Icon = card.iconComp;
11027
+ return renderInBody(h('div', {
11028
+ className: 'dsh-powerup-prompt-modal-mask' + (closing ? ' is-closing' : ''),
11029
+ role: 'presentation',
11030
+ onPointerDown: (event) => {
11031
+ if (event.target === event.currentTarget) requestClose();
11032
+ },
11033
+ },
11034
+ h('div', {
11035
+ className: 'dsh-powerup-detail-modal' + (closing ? ' is-closing' : ''),
11036
+ role: 'dialog',
11037
+ 'aria-modal': 'true',
11038
+ 'aria-label': t(card.titleKey),
11039
+ },
11040
+ h('div', { className: 'dsh-powerup-prompt-modal-head' },
11041
+ h('div', { className: 'dsh-powerup-detail-modal-title' },
11042
+ h('span', { className: 'dsh-powerup-detail-modal-icon' }, h(Icon, { size: 18 })),
11043
+ h('span', null, t(card.titleKey)),
11044
+ ),
11045
+ h('button', {
11046
+ type: 'button',
11047
+ className: 'dsh-powerup-prompt-modal-close',
11048
+ 'aria-label': t('prompts.cancel'),
11049
+ onClick: requestClose,
11050
+ }, '\u00d7'),
11051
+ ),
11052
+ h('div', { className: 'dsh-powerup-prompt-modal-body' },
11053
+ card.descKey !== undefined ? h('p', { className: 'dsh-powerup-detail-modal-desc' }, t(card.descKey)) : null,
11054
+ card.howKey !== undefined ? h('p', { className: 'dsh-powerup-card-how' }, t(card.howKey)) : null,
11055
+ card.detail ?? null,
11056
+ ),
11057
+ ),
11058
+ ));
11059
+ }
11060
+
10810
11061
  function PowerUpPage({ ctx }) {
10811
11062
  const settings = useSettings();
10812
11063
  const [, forceLocale] = useState(0);
10813
11064
  const [tab, setTab] = useState('features');
11065
+ const [expandedCards, setExpandedCards] = useState(() => new Set());
11066
+ const [detailCard, setDetailCard] = useState(null);
10814
11067
  useEffect(() => {
10815
11068
  const locale = ctx.get('locale');
10816
11069
  if (locale === undefined || typeof locale.subscribe !== 'function') return undefined;
@@ -10853,22 +11106,52 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10853
11106
  );
10854
11107
  };
10855
11108
 
10856
- /** One uniform feature card: icon + title + description + toggle, with optional detail rows. */
10857
- const featureCard = (key, iconComp, titleKey, descKey, howKey, detail) => h('section', {
10858
- key,
10859
- className: 'dsh-powerup-card' + (settings[key] === false ? ' is-off' : ''),
10860
- },
10861
- h('div', { className: 'dsh-powerup-card-head' },
10862
- h('div', { className: 'dsh-powerup-card-icon' }, h(iconComp, { size: 18 })),
10863
- h('div', { className: 'dsh-powerup-card-copy' },
10864
- h('h2', null, t(titleKey)),
10865
- h('p', null, t(descKey)),
11109
+ /** One uniform feature card: icon + title + one-line brief, an enable switch, a fold/unfold button for sub-options, and a Details button that opens a modal. */
11110
+ const featureCard = (key, iconComp, titleKey, briefKey, howKey, detail, descKey) => {
11111
+ const hasSub = detail !== undefined && detail !== null;
11112
+ const hasHow = howKey !== undefined;
11113
+ const expanded = expandedCards.has(key);
11114
+ const toggleExpanded = () => {
11115
+ const next = new Set(expandedCards);
11116
+ if (next.has(key)) next.delete(key);
11117
+ else next.add(key);
11118
+ setExpandedCards(next);
11119
+ };
11120
+ const openDetail = () => setDetailCard({ key, iconComp, titleKey, descKey, howKey, detail });
11121
+ return h('section', {
11122
+ key,
11123
+ className: 'dsh-powerup-card' + (settings[key] === false ? ' is-off' : ''),
11124
+ },
11125
+ h('div', { className: 'dsh-powerup-card-head' },
11126
+ h('div', { className: 'dsh-powerup-card-icon' }, h(iconComp, { size: 18 })),
11127
+ h('div', { className: 'dsh-powerup-card-copy' },
11128
+ h('h2', null, t(titleKey)),
11129
+ h('p', null, t(briefKey)),
11130
+ ),
11131
+ toggle(key, t(titleKey)),
10866
11132
  ),
10867
- toggle(key, t(titleKey)),
10868
- ),
10869
- howKey !== undefined ? h('p', { className: 'dsh-powerup-card-how' }, t(howKey)) : null,
10870
- detail ?? null,
10871
- );
11133
+ hasSub
11134
+ ? h('div', { className: 'dsh-powerup-card-foot' },
11135
+ hasHow ? h('button', {
11136
+ type: 'button',
11137
+ className: 'dsh-powerup-detail-btn',
11138
+ onClick: openDetail,
11139
+ }, t('page.details')) : null,
11140
+ h('button', {
11141
+ type: 'button',
11142
+ className: 'dsh-powerup-fold-btn' + (expanded ? ' on' : ''),
11143
+ 'aria-expanded': expanded ? 'true' : 'false',
11144
+ onClick: toggleExpanded,
11145
+ },
11146
+ h('span', { className: 'dsh-powerup-fold-chevron', 'aria-hidden': 'true' }),
11147
+ h('span', null, t(expanded ? 'page.collapse' : 'page.more'))),
11148
+ )
11149
+ : null,
11150
+ hasSub && expanded
11151
+ ? h('div', { className: 'dsh-powerup-card-body' }, detail)
11152
+ : null,
11153
+ );
11154
+ };
10872
11155
 
10873
11156
  /** A label/hint sub-row inside a card (for secondary options). */
10874
11157
  const settingRow = (key, checked, label, hint) => h('div', { key, className: 'dsh-powerup-setting' },
@@ -10955,32 +11238,34 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10955
11238
  );
10956
11239
 
10957
11240
  const featuresContent = h('div', null,
10958
- featureCard('contextMenu', PowerUpLineIcon, 'page.featureTitle', 'page.featureDesc', undefined, actionsDetail),
10959
- featureCard('launcher', LauncherIcon, 'page.launcherTitle', 'page.launcherDesc', undefined,
11241
+ featureCard('contextMenu', PowerUpLineIcon, 'page.featureTitle', 'page.featureBrief', undefined, actionsDetail),
11242
+ featureCard('launcher', LauncherIcon, 'page.launcherTitle', 'page.launcherBrief', undefined,
10960
11243
  h('div', { className: 'dsh-powerup-card-detail' },
10961
11244
  settingRow('launcher', settings.launcher !== false, t('page.launcherToggle'), t('page.launcherToggleHint')),
10962
11245
  ),
10963
11246
  ),
10964
- featureCard('sessionSwitch', QuickIcon, 'page.sessionSwitchTitle', 'page.sessionSwitchDesc', 'page.sessionSwitchHow'),
10965
- featureCard('locateSession', LocateIcon, 'page.locateTitle', 'page.locateDesc', 'page.locateHow'),
10966
- featureCard('scrollToTop', ScrollTopIcon, 'page.scrollToTopTitle', 'page.scrollToTopDesc', 'page.scrollToTopHow'),
10967
- featureCard('contentRendering', PowerUpLineIcon, 'page.renderingTitle', 'page.renderingDesc', 'page.renderingHow'),
10968
- featureCard('dualSend', LauncherIcon, 'page.dualSendTitle', 'page.dualSendDesc', 'page.dualSendHow'),
10969
- featureCard('quickReplies', TagIcon, 'page.quickRepliesTitle', 'page.quickRepliesDesc', 'page.quickRepliesHow'),
10970
- featureCard('taskProgress', ProgressIcon, 'page.taskProgressTitle', 'page.taskProgressDesc', 'page.taskProgressHow',
11247
+ featureCard('sessionSwitch', QuickIcon, 'page.sessionSwitchTitle', 'page.sessionSwitchBrief', 'page.sessionSwitchHow', undefined, 'page.sessionSwitchDesc'),
11248
+ featureCard('locateSession', LocateIcon, 'page.locateTitle', 'page.locateBrief', 'page.locateHow', undefined, 'page.locateDesc'),
11249
+ featureCard('scrollToTop', ScrollTopIcon, 'page.scrollToTopTitle', 'page.scrollToTopBrief', 'page.scrollToTopHow', undefined, 'page.scrollToTopDesc'),
11250
+ featureCard('contentRendering', PowerUpLineIcon, 'page.renderingTitle', 'page.renderingBrief', 'page.renderingHow', undefined, 'page.renderingDesc'),
11251
+ featureCard('dualSend', LauncherIcon, 'page.dualSendTitle', 'page.dualSendBrief', 'page.dualSendHow', undefined, 'page.dualSendDesc'),
11252
+ featureCard('quickReplies', TagIcon, 'page.quickRepliesTitle', 'page.quickRepliesBrief', 'page.quickRepliesHow', undefined, 'page.quickRepliesDesc'),
11253
+ featureCard('taskProgress', ProgressIcon, 'page.taskProgressTitle', 'page.taskProgressBrief', 'page.taskProgressHow',
10971
11254
  h('div', { className: 'dsh-powerup-card-detail' },
10972
11255
  numberRow('taskProgressCooldown', settings.taskProgressCooldown, t('page.taskProgressCooldown'), t('page.taskProgressCooldownHint')),
10973
11256
  ),
11257
+ 'page.taskProgressDesc',
10974
11258
  ),
10975
- featureCard('directAsk', TagIcon, 'page.directAskTitle', 'page.directAskDesc', 'page.directAskHow',
11259
+ featureCard('directAsk', TagIcon, 'page.directAskTitle', 'page.directAskBrief', 'page.directAskHow',
10976
11260
  h('div', { className: 'dsh-powerup-card-detail' },
10977
11261
  settingRow('directAsk', settings.directAsk !== false, t('page.directAskToggle'), t('page.directAskToggleHint')),
10978
11262
  settingRow('directAskAutoTitle', settings.directAskAutoTitle === true, t('page.directAskAutoTitle'), t('page.directAskAutoTitleHint')),
10979
11263
  ),
11264
+ 'page.directAskDesc',
10980
11265
  ),
10981
- featureCard('workspacePrompts', TagIcon, 'page.promptsTitle', 'page.promptsDesc', 'page.promptsHow'),
10982
- featureCard('jobStop', StopIcon, 'page.jobStopTitle', 'page.jobStopDesc', 'page.jobStopHow'),
10983
- featureCard('update', UpdateIcon, 'page.updateTitle', 'page.updateDesc', 'page.updateHow', oneClickDetail),
11266
+ featureCard('workspacePrompts', TagIcon, 'page.promptsTitle', 'page.promptsBrief', 'page.promptsHow', undefined, 'page.promptsDesc'),
11267
+ featureCard('jobStop', StopIcon, 'page.jobStopTitle', 'page.jobStopBrief', 'page.jobStopHow', undefined, 'page.jobStopDesc'),
11268
+ featureCard('update', UpdateIcon, 'page.updateTitle', 'page.updateBrief', 'page.updateHow', oneClickDetail, 'page.updateDesc'),
10984
11269
  );
10985
11270
 
10986
11271
  return h('div', { className: 'dsh-powerup-page' },
@@ -11006,6 +11291,13 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
11006
11291
  h('span', null, t('page.localOnly')),
11007
11292
  ),
11008
11293
  ),
11294
+ detailCard !== null
11295
+ ? h(FeatureDetailModal, {
11296
+ card: detailCard,
11297
+ t,
11298
+ onClose: () => setDetailCard(null),
11299
+ })
11300
+ : null,
11009
11301
  );
11010
11302
  }
11011
11303
 
@@ -12121,6 +12413,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
12121
12413
  installSessionSwitcher(ctx);
12122
12414
  installLocateSession(ctx);
12123
12415
  installScrollToTop(ctx);
12416
+ installThemeToggle(ctx);
12124
12417
  installReplyMask(ctx);
12125
12418
 
12126
12419
  const slots = ctx.get('slots');
@@ -12287,6 +12580,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
12287
12580
  SESSION_SWITCH_CSS,
12288
12581
  LOCATE_CSS,
12289
12582
  SCROLL_TOP_CSS,
12583
+ THEME_TOGGLE_CSS,
12290
12584
  RENDERING_CSS,
12291
12585
  PROMPTS_CSS,
12292
12586
  PROGRESS_CSS,
@@ -12332,6 +12626,8 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
12332
12626
  createSessionSwitcherCore,
12333
12627
  createLocateSessionCore,
12334
12628
  createScrollToTopCore,
12629
+ createThemeToggleCore,
12630
+ installThemeToggle,
12335
12631
  LocateIcon,
12336
12632
  ScrollTopIcon,
12337
12633
  LAUNCHER_CSS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restregular/dsh-powerup",
3
- "version": "0.19.11",
3
+ "version": "0.19.13",
4
4
  "description": "为 DeepSeek Harness 提供一组可选的小型增强:轨迹右键菜单与步骤引用、后台任务停止原因、插件一键安装、侧边栏图标网格、会话切换、定位当前会话、工作区提示词、旁路模型生成的结构化任务进度;所有功能均可在 Power-Up 页面独立开关。 · Opt-in upgrades for DeepSeek Harness: Trajectory context menu and step references, job stop reasons, one-click plugin install, an adaptive sidebar launcher, session switching, locating the current session, workspace prompts, and non-blocking model-generated structured task progress — each toggled independently on the Power-Up page.",
5
5
  "icon": "./icon.svg",
6
6
  "type": "module",
@@ -104,4 +104,4 @@
104
104
  "license": "MIT",
105
105
  "author": "RestRegular"
106
106
  }
107
-
107
+