@restregular/dsh-powerup 0.19.12 → 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 +295 -31
  2. package/package.json +1 -1
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.12';
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. */
@@ -119,7 +119,23 @@
119
119
  'page.enabled': '已启用',
120
120
  'page.disabled': '已停用',
121
121
  'page.details': '详情',
122
+ 'page.more': '更多',
122
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': '切换到暗色模式',
123
139
  'page.actions': '可用操作',
124
140
  'page.howTitle': '怎么用',
125
141
  'page.how1': '打开任意会话,切到顶部的「轨迹」视图。',
@@ -530,7 +546,23 @@
530
546
  'page.enabled': 'Enabled',
531
547
  'page.disabled': 'Disabled',
532
548
  'page.details': 'Details',
549
+ 'page.more': 'More',
533
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',
534
566
  'page.actions': 'What you can do',
535
567
  'page.howTitle': 'How to use it',
536
568
  'page.how1': 'Open a session and switch to the Trajectory view.',
@@ -4207,11 +4239,22 @@ nav.dsh-powerup-launcher.dsh-powerup-launcher-wide>[data-powerup-grid]:hover [cl
4207
4239
  .dsh-powerup-card-body{margin-top:12px}
4208
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}
4209
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}
4210
4243
  .dsh-powerup-how-card .dsh-powerup-section-title{margin-bottom:10px}
4211
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}
4212
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)}
4213
- .dsh-powerup-detail-btn.on{color:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary)}
4214
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}
4215
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)}
4216
4259
  .dsh-powerup-card-copy{min-width:0;flex:1 1 auto}
4217
4260
  .dsh-powerup-card-copy h2{margin:0;font-size:14px;line-height:1.35;font-weight:650}
@@ -4454,6 +4497,17 @@ default; shown only while the sidebar workspace list is scrolled down. */
4454
4497
  html[data-platform="darwin"] .dsh-powerup-scrolltop{background:var(--dsw-specific-sidebar-glass-fill)}
4455
4498
  html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-specific-sidebar-glass-hover)}
4456
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}}
4457
4511
  `;
4458
4512
 
4459
4513
  const RENDERING_CSS = `
@@ -5899,6 +5953,136 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
5899
5953
  return core;
5900
5954
  }
5901
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
+
5902
6086
  /**
5903
6087
  * DOM-based masking for assistant reply prose. We observe the Chat view's
5904
6088
  * assistant reply rows and replace matching text fragments in place. The
@@ -6030,7 +6214,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
6030
6214
  try {
6031
6215
  const style = document.createElement('style');
6032
6216
  style.setAttribute('data-dsh-powerup', '');
6033
- 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;
6034
6218
  document.head.appendChild(style);
6035
6219
  ctx.effect(() => () => style.remove(), 'dsh-powerup: styles');
6036
6220
  } catch (error) {
@@ -10816,11 +11000,70 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10816
11000
  // ------------------------------------------------------------------
10817
11001
  // Sidebar page
10818
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
+
10819
11061
  function PowerUpPage({ ctx }) {
10820
11062
  const settings = useSettings();
10821
11063
  const [, forceLocale] = useState(0);
10822
11064
  const [tab, setTab] = useState('features');
10823
11065
  const [expandedCards, setExpandedCards] = useState(() => new Set());
11066
+ const [detailCard, setDetailCard] = useState(null);
10824
11067
  useEffect(() => {
10825
11068
  const locale = ctx.get('locale');
10826
11069
  if (locale === undefined || typeof locale.subscribe !== 'function') return undefined;
@@ -10863,9 +11106,10 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10863
11106
  );
10864
11107
  };
10865
11108
 
10866
- /** One uniform feature card: icon + title + description, a details button that folds the body, and an enable/disable switch. */
10867
- const featureCard = (key, iconComp, titleKey, descKey, howKey, detail) => {
10868
- const hasDetail = howKey !== undefined || detail !== undefined;
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;
10869
11113
  const expanded = expandedCards.has(key);
10870
11114
  const toggleExpanded = () => {
10871
11115
  const next = new Set(expandedCards);
@@ -10873,6 +11117,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10873
11117
  else next.add(key);
10874
11118
  setExpandedCards(next);
10875
11119
  };
11120
+ const openDetail = () => setDetailCard({ key, iconComp, titleKey, descKey, howKey, detail });
10876
11121
  return h('section', {
10877
11122
  key,
10878
11123
  className: 'dsh-powerup-card' + (settings[key] === false ? ' is-off' : ''),
@@ -10881,24 +11126,30 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10881
11126
  h('div', { className: 'dsh-powerup-card-icon' }, h(iconComp, { size: 18 })),
10882
11127
  h('div', { className: 'dsh-powerup-card-copy' },
10883
11128
  h('h2', null, t(titleKey)),
10884
- h('p', null, t(descKey)),
11129
+ h('p', null, t(briefKey)),
10885
11130
  ),
10886
- hasDetail
10887
- ? h('button', {
11131
+ toggle(key, t(titleKey)),
11132
+ ),
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', {
10888
11141
  type: 'button',
10889
- className: 'dsh-powerup-detail-btn' + (expanded ? ' on' : ''),
11142
+ className: 'dsh-powerup-fold-btn' + (expanded ? ' on' : ''),
10890
11143
  'aria-expanded': expanded ? 'true' : 'false',
10891
11144
  onClick: toggleExpanded,
10892
- }, t(expanded ? 'page.collapse' : 'page.details'))
10893
- : null,
10894
- toggle(key, t(titleKey)),
10895
- ),
10896
- hasDetail && expanded
10897
- ? h('div', { className: 'dsh-powerup-card-body' },
10898
- howKey !== undefined ? h('p', { className: 'dsh-powerup-card-how' }, t(howKey)) : null,
10899
- detail ?? null,
11145
+ },
11146
+ h('span', { className: 'dsh-powerup-fold-chevron', 'aria-hidden': 'true' }),
11147
+ h('span', null, t(expanded ? 'page.collapse' : 'page.more'))),
10900
11148
  )
10901
11149
  : null,
11150
+ hasSub && expanded
11151
+ ? h('div', { className: 'dsh-powerup-card-body' }, detail)
11152
+ : null,
10902
11153
  );
10903
11154
  };
10904
11155
 
@@ -10987,32 +11238,34 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
10987
11238
  );
10988
11239
 
10989
11240
  const featuresContent = h('div', null,
10990
- featureCard('contextMenu', PowerUpLineIcon, 'page.featureTitle', 'page.featureDesc', undefined, actionsDetail),
10991
- 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,
10992
11243
  h('div', { className: 'dsh-powerup-card-detail' },
10993
11244
  settingRow('launcher', settings.launcher !== false, t('page.launcherToggle'), t('page.launcherToggleHint')),
10994
11245
  ),
10995
11246
  ),
10996
- featureCard('sessionSwitch', QuickIcon, 'page.sessionSwitchTitle', 'page.sessionSwitchDesc', 'page.sessionSwitchHow'),
10997
- featureCard('locateSession', LocateIcon, 'page.locateTitle', 'page.locateDesc', 'page.locateHow'),
10998
- featureCard('scrollToTop', ScrollTopIcon, 'page.scrollToTopTitle', 'page.scrollToTopDesc', 'page.scrollToTopHow'),
10999
- featureCard('contentRendering', PowerUpLineIcon, 'page.renderingTitle', 'page.renderingDesc', 'page.renderingHow'),
11000
- featureCard('dualSend', LauncherIcon, 'page.dualSendTitle', 'page.dualSendDesc', 'page.dualSendHow'),
11001
- featureCard('quickReplies', TagIcon, 'page.quickRepliesTitle', 'page.quickRepliesDesc', 'page.quickRepliesHow'),
11002
- 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',
11003
11254
  h('div', { className: 'dsh-powerup-card-detail' },
11004
11255
  numberRow('taskProgressCooldown', settings.taskProgressCooldown, t('page.taskProgressCooldown'), t('page.taskProgressCooldownHint')),
11005
11256
  ),
11257
+ 'page.taskProgressDesc',
11006
11258
  ),
11007
- featureCard('directAsk', TagIcon, 'page.directAskTitle', 'page.directAskDesc', 'page.directAskHow',
11259
+ featureCard('directAsk', TagIcon, 'page.directAskTitle', 'page.directAskBrief', 'page.directAskHow',
11008
11260
  h('div', { className: 'dsh-powerup-card-detail' },
11009
11261
  settingRow('directAsk', settings.directAsk !== false, t('page.directAskToggle'), t('page.directAskToggleHint')),
11010
11262
  settingRow('directAskAutoTitle', settings.directAskAutoTitle === true, t('page.directAskAutoTitle'), t('page.directAskAutoTitleHint')),
11011
11263
  ),
11264
+ 'page.directAskDesc',
11012
11265
  ),
11013
- featureCard('workspacePrompts', TagIcon, 'page.promptsTitle', 'page.promptsDesc', 'page.promptsHow'),
11014
- featureCard('jobStop', StopIcon, 'page.jobStopTitle', 'page.jobStopDesc', 'page.jobStopHow'),
11015
- 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'),
11016
11269
  );
11017
11270
 
11018
11271
  return h('div', { className: 'dsh-powerup-page' },
@@ -11038,6 +11291,13 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
11038
11291
  h('span', null, t('page.localOnly')),
11039
11292
  ),
11040
11293
  ),
11294
+ detailCard !== null
11295
+ ? h(FeatureDetailModal, {
11296
+ card: detailCard,
11297
+ t,
11298
+ onClose: () => setDetailCard(null),
11299
+ })
11300
+ : null,
11041
11301
  );
11042
11302
  }
11043
11303
 
@@ -12153,6 +12413,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
12153
12413
  installSessionSwitcher(ctx);
12154
12414
  installLocateSession(ctx);
12155
12415
  installScrollToTop(ctx);
12416
+ installThemeToggle(ctx);
12156
12417
  installReplyMask(ctx);
12157
12418
 
12158
12419
  const slots = ctx.get('slots');
@@ -12319,6 +12580,7 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
12319
12580
  SESSION_SWITCH_CSS,
12320
12581
  LOCATE_CSS,
12321
12582
  SCROLL_TOP_CSS,
12583
+ THEME_TOGGLE_CSS,
12322
12584
  RENDERING_CSS,
12323
12585
  PROMPTS_CSS,
12324
12586
  PROGRESS_CSS,
@@ -12364,6 +12626,8 @@ html[data-platform="darwin"] .dsh-powerup-scrolltop:hover{background:var(--dsw-s
12364
12626
  createSessionSwitcherCore,
12365
12627
  createLocateSessionCore,
12366
12628
  createScrollToTopCore,
12629
+ createThemeToggleCore,
12630
+ installThemeToggle,
12367
12631
  LocateIcon,
12368
12632
  ScrollTopIcon,
12369
12633
  LAUNCHER_CSS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restregular/dsh-powerup",
3
- "version": "0.19.12",
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",