dsh-shortcut-extensions 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -62,6 +62,10 @@ dsh-shortcut-extensions/
62
62
  └── icon.svg
63
63
  ```
64
64
 
65
+ ## Icons / 图标
66
+
67
+ - Icons: [Lucide](https://lucide.dev) — `keyboard`, `cpu`, `messages-square`, `arrow-left`, `arrow-right`, `search-check`, `text-cursor-input`, `shield`, `shield-half`, `panel-left`, `message-circle`, `layout-grid`, `message-square-plus` (ISC License).
68
+
65
69
  ## License
66
70
 
67
71
  [MIT](LICENSE)
package/README.zh.md CHANGED
@@ -62,6 +62,10 @@ dsh-shortcut-extensions/
62
62
  └── icon.svg
63
63
  ```
64
64
 
65
+ ## 图标 / Icons
66
+
67
+ - 图标:[Lucide](https://lucide.dev)(`keyboard`、`cpu`、`messages-square`、`arrow-left`、`arrow-right`、`search-check`、`text-cursor-input`、`shield`、`shield-half`、`panel-left`、`message-circle`、`layout-grid`、`message-square-plus`,ISC 许可证)。
68
+
65
69
  ## 许可证
66
70
 
67
71
  [MIT](LICENSE)
package/client.js CHANGED
@@ -375,8 +375,8 @@ window.__ModuleLoader__.load({
375
375
  labelKey: 'action.newSession',
376
376
  impl: 'uiWorkspace.startSession()',
377
377
  run: (d) => { try { d.ctx.uiWorkspace.startSession(); } catch (error) { console.error('[shortcut-ext] startSession failed', error); } }
378
- }
379
- ];
378
+ },
379
+ ];
380
380
 
381
381
  const ACTION_BY_ID = new Map(ACTIONS.map((action) => [action.id, action]));
382
382
 
@@ -497,7 +497,7 @@ window.__ModuleLoader__.load({
497
497
  },
498
498
  {}
499
499
  ]
500
- }
500
+ },
501
501
  ];
502
502
 
503
503
  const COMMAND_IDS = COMMANDS.map((command) => command.id);
@@ -507,12 +507,13 @@ window.__ModuleLoader__.load({
507
507
  /* ------------------------------------------------------------------ */
508
508
 
509
509
  const CSS = [
510
- /* Palettes: same material as the host's native popup (menu surface, centered) */
510
+ /* Palettes: menu-toned surface over an opaque base (no see-through) */
511
511
  '.dqs-backdrop{position:fixed;inset:0;z-index:1200;display:flex;align-items:center;justify-content:center;',
512
512
  'background:rgba(0,0,0,.32);}',
513
513
  '.dqs-palette{width:min(720px,calc(100vw - 48px));max-height:min(70vh,660px);display:flex;flex-direction:column;',
514
- 'overflow:hidden;background:var(--dsw-specific-menu,var(--dsw-alias-bg-overlay,var(--dsw-alias-bg-layer-1)));',
515
- 'backdrop-filter:var(--dsw-menu-backdrop-filter,blur(20px));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(20px));',
514
+ 'overflow:hidden;background-color:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-overlay));',
515
+ 'background-image:linear-gradient(var(--dsw-specific-menu,var(--dsw-alias-bg-overlay)),',
516
+ 'var(--dsw-specific-menu,var(--dsw-alias-bg-overlay)));',
516
517
  'border:.5px solid var(--dsw-alias-border-l1);border-radius:var(--dsw-radius-lg,14px);',
517
518
  'box-shadow:var(--dsw-elevation-prominent,0 12px 32px rgba(0,0,0,.28));color:var(--dsw-alias-label-primary);}',
518
519
  '.dqs-paletteHead{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px 10px;}',
@@ -522,18 +523,25 @@ window.__ModuleLoader__.load({
522
523
  '.dqs-closeBtn:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2));',
523
524
  'color:var(--dsw-alias-label-primary);}',
524
525
  '.dqs-input{width:100%;box-sizing:border-box;height:40px;padding:0 12px 0 34px;',
525
- 'border:none;border-radius:10px;background:var(--dsw-alias-bg-layer-2);',
526
- 'color:var(--dsw-alias-label-primary);font-size:13px;outline:none;}',
526
+ 'border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--dsw-alias-bg-layer-2);',
527
+ 'color:var(--dsw-alias-label-primary);font-size:13px;outline:none;transition:border-color .12s;}',
527
528
  '.dqs-input::placeholder{color:var(--dsw-alias-label-secondary);opacity:.8;}',
528
- '.dqs-input:focus{box-shadow:0 0 0 2px var(--dsw-focus-ring-color,var(--dsw-alias-brand-primary));}',
529
+ '.dqs-input:hover:not(:focus){border-color:var(--dsw-alias-border-l2,var(--dsw-alias-border-l1));}',
530
+ '.dqs-input:focus{border-color:var(--dsw-alias-state-business-primary);}',
529
531
  '.dqs-searchWrap{position:relative;margin:0 14px 10px;}',
530
532
  '.dqs-searchIcon{position:absolute;left:11px;top:50%;transform:translateY(-50%);',
531
533
  'color:var(--dsw-alias-label-secondary);display:flex;pointer-events:none;}',
532
- '.dqs-list{height:340px;overflow-y:auto;padding:2px 8px 8px;}',
533
- '.dqs-columns{display:flex;height:340px;min-height:0;}',
534
- '.dqs-columns .dqs-list{flex:1 1 auto;height:100%;min-width:0;}',
534
+ '.dqs-list{height:360px;overflow-y:auto;padding:2px 8px 6px;}',
535
+ '.dqs-list::-webkit-scrollbar{width:8px;height:8px;}',
536
+ '.dqs-list::-webkit-scrollbar-track{background:transparent;}',
537
+ '.dqs-list::-webkit-scrollbar-thumb{background:var(--dsw-alias-scrollbar-bg-l2,var(--dsw-alias-border-l2));',
538
+ 'border-radius:999px;}',
539
+ '.dqs-list::-webkit-scrollbar-thumb:hover{background:var(--dsw-alias-scrollbar-hover-l2,var(--dsw-alias-border-l1));}',
540
+ '.dqs-columns{display:flex;height:360px;min-height:0;}',
541
+ '.dqs-columns .dqs-list{flex:1 1 auto;height:100%;min-width:0;border-right:none;}',
535
542
  '.dqs-paletteWide{width:min(880px,calc(100vw - 48px));}',
536
- '.dqs-row{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;cursor:pointer;font-size:14px;}',
543
+ '.dqs-row{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;cursor:pointer;',
544
+ 'font-size:14px;min-height:36px;box-sizing:border-box;}',
537
545
  '.dqs-row[data-active="true"]{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2));}',
538
546
  '.dqs-rowName{flex:0 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}',
539
547
  '.dqs-rowProvider{flex:1 1 auto;min-width:0;color:var(--dsw-alias-label-secondary);font-size:12px;',
@@ -561,10 +569,13 @@ window.__ModuleLoader__.load({
561
569
  '.dqs-pinBtn[data-pinned="true"]{color:var(--dsw-alias-brand-primary);}',
562
570
  '.dqs-status{padding:10px 16px;font-size:12px;color:var(--dsw-alias-label-secondary);}',
563
571
  '.dqs-statusError{color:var(--dsw-alias-state-error-primary);}',
564
- '.dqs-footer{padding:8px 16px;font-size:11px;color:var(--dsw-alias-label-secondary);',
565
- 'border-top:.5px solid var(--dsw-alias-border-l1);display:flex;gap:14px;flex-wrap:wrap;}',
566
- '.dqs-kbd{border:none;background:var(--dsw-alias-bg-layer-2);border-radius:4px;',
567
- 'padding:1px 5px;font-size:10px;margin-right:4px;color:var(--dsw-alias-label-secondary);}',
572
+ '.dqs-footer{padding:12px 18px 13px;font-size:12px;color:var(--dsw-alias-label-secondary);',
573
+ 'border-top:.5px solid var(--dsw-alias-border-l1);display:flex;align-items:center;gap:8px 22px;flex-wrap:wrap;}',
574
+ '.dqs-hintItem{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;}',
575
+ '.dqs-kbd{border:.5px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1));',
576
+ 'background:var(--dsw-alias-bg-layer-1);border-radius:5px;',
577
+ 'min-width:22px;height:20px;padding:0 7px;box-sizing:border-box;text-align:center;font-size:11px;',
578
+ 'color:var(--dsw-alias-label-secondary);display:inline-flex;align-items:center;justify-content:center;}',
568
579
  '.dqs-rowDot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--dsw-alias-state-idle-primary);opacity:.45;}',
569
580
  '.dqs-rowDot[data-running="true"]{background:var(--dsw-alias-state-success-primary);opacity:1;}',
570
581
  '.dqs-rowPin{flex:none;color:var(--dsw-alias-brand-primary);display:flex;}',
@@ -574,7 +585,7 @@ window.__ModuleLoader__.load({
574
585
  'flex-direction:column;align-items:center;gap:26px;padding:0 clamp(24px,4vw,48px) 48px;overflow:auto;}',
575
586
  '.dqs-page>*{width:100%;max-width:960px;}',
576
587
  '.dqs-pageHead{padding-top:36px;margin-bottom:-6px;}',
577
- '.dqs-pageTitle{font-size:26px;font-weight:600;margin:0 0 6px;}',
588
+ '.dqs-pageTitle{font-size:20px;font-weight:500;line-height:28px;margin:0 0 6px;}',
578
589
  '.dqs-pageSub{font-size:13px;color:var(--dsw-alias-label-secondary);margin:0;}',
579
590
  '.dqs-toolbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;}',
580
591
  '.dqs-tabs{display:flex;gap:2px;padding:3px;border-radius:9px;background:var(--dsw-alias-bg-layer-2);}',
@@ -589,9 +600,10 @@ window.__ModuleLoader__.load({
589
600
  '.dqs-linkBtn:hover{text-decoration:underline;}',
590
601
  '.dqs-search{width:220px;height:32px;padding:0 12px;box-sizing:border-box;border-radius:8px;',
591
602
  'border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);',
592
- 'color:var(--dsw-alias-label-primary);font-size:13px;outline:none;}',
603
+ 'color:var(--dsw-alias-label-primary);font-size:13px;outline:none;transition:border-color .12s;}',
593
604
  '.dqs-search::placeholder{color:var(--dsw-alias-label-secondary);opacity:.7;}',
594
- '.dqs-search:focus{border-color:var(--dsw-alias-brand-primary);}',
605
+ '.dqs-search:hover:not(:focus){border-color:var(--dsw-alias-border-l2,var(--dsw-alias-border-l1));}',
606
+ '.dqs-search:focus{border-color:var(--dsw-alias-state-business-primary);}',
595
607
  '.dqs-rows{display:flex;flex-direction:column;}',
596
608
  '.dqs-cmdRow{display:flex;align-items:center;gap:16px;padding:14px 2px;',
597
609
  'border-bottom:.5px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1));transition:opacity .15s;}',
@@ -599,13 +611,13 @@ window.__ModuleLoader__.load({
599
611
  '.dqs-tile{flex:none;width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;',
600
612
  'background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-brand-primary);border:1px solid var(--dsw-alias-border-l1);}',
601
613
  '.dqs-cmdInfo{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px;}',
602
- '.dqs-cmdName{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}',
603
- '.dqs-cmdImpl{font-size:11.5px;color:var(--dsw-alias-label-secondary);',
614
+ '.dqs-cmdName{font-size:14px;font-weight:400;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}',
615
+ '.dqs-cmdImpl{font-size:11px;color:var(--dsw-alias-label-secondary);',
604
616
  'font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}',
605
617
  '.dqs-cmdRight{flex:none;display:flex;align-items:center;gap:14px;}',
606
618
  '.dqs-cmdKeys{display:flex;align-items:center;gap:3px;}',
607
619
  '.dqs-keycap{min-width:20px;height:20px;padding:0 5px;box-sizing:border-box;display:inline-flex;align-items:center;',
608
- 'justify-content:center;border:1px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1));border-radius:5px;',
620
+ 'justify-content:center;border:.5px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1));border-radius:5px;',
609
621
  'font-size:11px;line-height:1;color:var(--dsw-alias-label-secondary);',
610
622
  'background:var(--dsw-alias-bg-layer-2);white-space:nowrap;}',
611
623
  '.dqs-keycapNone{border:none;background:none;font-size:11px;color:var(--dsw-alias-label-secondary);opacity:.7;}',
@@ -664,7 +676,7 @@ window.__ModuleLoader__.load({
664
676
  '.dqs-permCard{border:1px solid var(--dsw-alias-border-l1);border-radius:12px;',
665
677
  'background:var(--dsw-alias-bg-layer-1);padding:16px 18px;}',
666
678
  '.dqs-sectionHead{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:10px;}',
667
- '.dqs-sectionTitle{font-size:13px;font-weight:600;}',
679
+ '.dqs-sectionTitle{font-size:14px;font-weight:500;line-height:20px;}',
668
680
  '.dqs-chips{display:flex;gap:8px;flex-wrap:wrap;}',
669
681
  '.dqs-permChip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1));',
670
682
  'border-radius:999px;padding:5px 14px;font-size:12px;cursor:pointer;background:transparent;color:var(--dsw-alias-label-secondary);}',
@@ -679,7 +691,17 @@ window.__ModuleLoader__.load({
679
691
  '.dqs-expand{padding:2px 2px 18px 64px;}',
680
692
  '.dqs-sysRow{display:flex;align-items:center;gap:12px;padding:12px 2px;',
681
693
  'border-bottom:.5px solid var(--dsw-alias-border-l2,var(--dsw-alias-border-l1));}',
682
- '.dqs-sysLabel{flex:1 1 auto;min-width:0;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}',
694
+ '.dqs-sysLabel{flex:1 1 auto;min-width:0;font-size:14px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}',
695
+ '.dqs-tip{position:relative;}',
696
+ '.dqs-tip:hover::after{content:attr(data-tip);position:absolute;bottom:calc(100% + 6px);left:50%;',
697
+ 'transform:translateX(-50%);background:var(--dsw-alias-bg-overlay,var(--dsw-alias-bg-layer-1));',
698
+ 'border:.5px solid var(--dsw-alias-border-l1);border-radius:6px;padding:3px 8px;font-size:11px;',
699
+ 'line-height:16px;color:var(--dsw-alias-label-primary);white-space:nowrap;z-index:20;',
700
+ 'box-shadow:var(--dsw-elevation-prominent,0 6px 16px rgba(0,0,0,.18));pointer-events:none;}',
701
+ '.dqs-iconBtn{flex:none;border:none;background:none;cursor:pointer;display:flex;padding:4px;',
702
+ 'border-radius:6px;color:var(--dsw-alias-label-secondary);}',
703
+ '.dqs-iconBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2));}',
704
+ '.dqs-iconBtn[data-hidden="true"]{visibility:hidden;pointer-events:none;}',
683
705
  '.dqs-sysFixed{flex:none;font-size:11px;color:var(--dsw-alias-label-secondary);',
684
706
  'border:1px solid var(--dsw-alias-border-l1);border-radius:999px;padding:1px 8px;}'
685
707
  ].join('');
@@ -1216,16 +1238,44 @@ window.__ModuleLoader__.load({
1216
1238
  }));
1217
1239
  }
1218
1240
 
1241
+
1242
+ /** Sidebar glyph: Lucide `keyboard` (ISC) - https://lucide.dev/icons/keyboard */
1219
1243
  function PanelIcon({ size, active }) {
1220
1244
  const px = size ?? 16;
1221
- const bar = (y, width) => h('rect', { x: 2, y, width, height: 2.4, rx: 1.2, fill: 'currentColor' });
1245
+ const dot = (d) => h('path', { key: d, d });
1246
+ return h('svg', {
1247
+ width: px,
1248
+ height: px,
1249
+ viewBox: '0 0 24 24',
1250
+ fill: 'none',
1251
+ stroke: 'currentColor',
1252
+ strokeWidth: 2,
1253
+ strokeLinecap: 'round',
1254
+ strokeLinejoin: 'round',
1255
+ 'aria-hidden': true,
1256
+ style: { display: 'block', color: active ? 'var(--dsw-alias-state-business-primary)' : undefined }
1257
+ },
1258
+ h('rect', { key: 'frame', x: 2, y: 4, width: 20, height: 16, rx: 2 }),
1259
+ dot('M6 8h.01'),
1260
+ dot('M10 8h.01'),
1261
+ dot('M14 8h.01'),
1262
+ dot('M18 8h.01'),
1263
+ dot('M8 12h.01'),
1264
+ dot('M12 12h.01'),
1265
+ dot('M16 12h.01'),
1266
+ dot('M7 16h10'));
1267
+ }
1268
+
1269
+
1270
+ /** Lucide `rotate-ccw` (ISC) - restore a command's default binding. */
1271
+ function ResetIcon() {
1222
1272
  return h('svg', {
1223
- width: px, height: px, viewBox: '0 0 16 16', 'aria-hidden': true,
1224
- style: { display: 'block', color: active ? 'var(--dsw-alias-brand-primary)' : undefined }
1273
+ width: 14, height: 14, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor',
1274
+ strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': true,
1275
+ style: { display: 'block' }
1225
1276
  },
1226
- bar(2.6, 12),
1227
- bar(6.8, 8),
1228
- bar(11, 10));
1277
+ h('path', { d: 'M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8' }),
1278
+ h('path', { d: 'M3 3v5h5' }));
1229
1279
  }
1230
1280
 
1231
1281
  /* ------------------------------------------------------------------ */
@@ -1407,11 +1457,11 @@ window.__ModuleLoader__.load({
1407
1457
  ? h('div', { className: 'dqs-status' }, t('palette.providerFailures'))
1408
1458
  : null,
1409
1459
  h('div', { className: 'dqs-footer' },
1410
- h('span', null, h('span', { className: 'dqs-kbd' }, '\u2191\u2193'), t('palette.hint.nav')),
1411
- h('span', null, h('span', { className: 'dqs-kbd' }, 'Enter'), t('palette.hint.confirm')),
1412
- h('span', null, h('span', { className: 'dqs-kbd' }, 'Esc'), t('palette.hint.close')),
1413
- h('span', null, h('span', { className: 'dqs-kbd' }, '\u2605'), t('palette.hint.pin')),
1414
- h('span', null, t('palette.hint.tag')))
1460
+ h('span', { className: 'dqs-hintItem' }, h('span', { className: 'dqs-kbd' }, '\u2191\u2193'), t('palette.hint.nav')),
1461
+ h('span', { className: 'dqs-hintItem' }, h('span', { className: 'dqs-kbd' }, 'Enter'), t('palette.hint.confirm')),
1462
+ h('span', { className: 'dqs-hintItem' }, h('span', { className: 'dqs-kbd' }, 'Esc'), t('palette.hint.close')),
1463
+ h('span', { className: 'dqs-hintItem' }, h('span', { className: 'dqs-kbd' }, '\u2605'), t('palette.hint.pin')),
1464
+ h('span', { className: 'dqs-hintItem' }, t('palette.hint.tag')))
1415
1465
  ));
1416
1466
  }
1417
1467
 
@@ -1618,9 +1668,9 @@ window.__ModuleLoader__.load({
1618
1668
  })))),
1619
1669
  error ? h('div', { className: 'dqs-status dqs-statusError' }, error) : null,
1620
1670
  h('div', { className: 'dqs-footer' },
1621
- h('span', null, h('span', { className: 'dqs-kbd' }, '\u2191\u2193'), t('session.hint.nav')),
1622
- h('span', null, h('span', { className: 'dqs-kbd' }, 'Enter'), t('session.hint.open')),
1623
- h('span', null, h('span', { className: 'dqs-kbd' }, 'Esc'), t('session.hint.close')))));
1671
+ h('span', { className: 'dqs-hintItem' }, h('span', { className: 'dqs-kbd' }, '\u2191\u2193'), t('session.hint.nav')),
1672
+ h('span', { className: 'dqs-hintItem' }, h('span', { className: 'dqs-kbd' }, 'Enter'), t('session.hint.open')),
1673
+ h('span', { className: 'dqs-hintItem' }, h('span', { className: 'dqs-kbd' }, 'Esc'), t('session.hint.close')))));
1624
1674
  }
1625
1675
 
1626
1676
  /* ------------------------------------------------------------------ */
@@ -1648,63 +1698,40 @@ window.__ModuleLoader__.load({
1648
1698
  row.keys.map((cap, index) => h('span', { key: index, className: 'dqs-keycap' }, cap)));
1649
1699
  }
1650
1700
 
1701
+ /**
1702
+ * Command tile glyphs: Lucide icons (ISC, https://lucide.dev) rendered as
1703
+ * static trusted markup, stroked with the current text color.
1704
+ */
1705
+ const COMMAND_GLYPHS = {
1706
+ 'open-model-palette': '<rect width="16" height="16" x="4" y="4" rx="2" /> <rect width="6" height="6" x="9" y="9" rx="1" /> <path d="M15 2v2" /> <path d="M15 20v2" /> <path d="M2 15h2" /> <path d="M2 9h2" /> <path d="M20 15h2" /> <path d="M20 9h2" /> <path d="M9 2v2" /> <path d="M9 20v2" />',
1707
+ 'open-session-palette': '<path d="M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z" /> <path d="M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1" />',
1708
+ 'next-session': '<path d="M5 12h14" /> <path d="m12 5 7 7-7 7" />',
1709
+ 'prev-session': '<path d="m12 19-7-7 7-7" /> <path d="M19 12H5" />',
1710
+ 'jump-completed': '<path d="m8 11 2 2 4-4" /> <circle cx="11" cy="11" r="8" /> <path d="m21 21-4.3-4.3" />',
1711
+ 'focus-composer': '<path d="M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1" /> <path d="M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5" /> <path d="M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1" /> <path d="M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7" /> <path d="M9 7v10" />',
1712
+ 'toggle-permission': '<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />',
1713
+ 'set-permission': '<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /> <path d="M12 22V2" />',
1714
+ 'toggle-sidebar': '<rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M9 3v18" />',
1715
+ 'show-conversation': '<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z" />',
1716
+ 'show-deck': '<rect width="7" height="7" x="3" y="3" rx="1" /> <rect width="7" height="7" x="14" y="3" rx="1" /> <rect width="7" height="7" x="14" y="14" rx="1" /> <rect width="7" height="7" x="3" y="14" rx="1" />',
1717
+ 'new-session': '<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" /> <path d="M12 7v6" /> <path d="M9 10h6" />'
1718
+ };
1719
+
1651
1720
  function CommandGlyph({ id }) {
1652
- const common = {
1653
- width: 20, height: 20, viewBox: '0 0 16 16', 'aria-hidden': true, style: { display: 'block' }
1654
- };
1655
- switch (id) {
1656
- case 'open-model-palette':
1657
- return h('svg', common, h('path', {
1658
- d: 'M9.2 1.5 4 9.2h3L6.2 14.5 12 6.6H8.7l.5-5.1z', fill: 'currentColor'
1659
- }));
1660
- case 'open-session-palette':
1661
- return h('svg', common, h('path', {
1662
- d: 'M2.5 4h11M2.5 8h7M2.5 12h9', stroke: 'currentColor', strokeWidth: 1.6,
1663
- strokeLinecap: 'round', fill: 'none'
1664
- }));
1665
- case 'next-session':
1666
- return h('svg', common, h('path', {
1667
- d: 'M3 8h9M8.5 4 12.5 8l-4 4', stroke: 'currentColor', strokeWidth: 1.6,
1668
- strokeLinecap: 'round', strokeLinejoin: 'round', fill: 'none'
1669
- }));
1670
- case 'prev-session':
1671
- return h('svg', common, h('path', {
1672
- d: 'M13 8H4M7.5 4 3.5 8l4 4', stroke: 'currentColor', strokeWidth: 1.6,
1673
- strokeLinecap: 'round', strokeLinejoin: 'round', fill: 'none'
1674
- }));
1675
- case 'jump-completed':
1676
- return h('svg', common,
1677
- h('circle', { cx: 8, cy: 8, r: 5.2, fill: 'none', stroke: 'currentColor', strokeWidth: 1.5 }),
1678
- h('circle', { cx: 8, cy: 8, r: 1.8, fill: 'currentColor' }));
1679
- case 'focus-composer':
1680
- return h('svg', common, h('path', {
1681
- d: 'M5 2.5h6M8 2.5v11M5 13.5h6', stroke: 'currentColor', strokeWidth: 1.6,
1682
- strokeLinecap: 'round', fill: 'none'
1683
- }));
1684
- case 'toggle-sidebar':
1685
- return h('svg', common,
1686
- h('rect', { x: 2, y: 2.5, width: 12, height: 11, rx: 2, fill: 'none', stroke: 'currentColor', strokeWidth: 1.4 }),
1687
- h('path', { d: 'M6 2.5v11', stroke: 'currentColor', strokeWidth: 1.4 }));
1688
- case 'show-conversation':
1689
- return h('svg', common, h('path', {
1690
- d: 'M2.5 3.5h11v7h-6l-3 2.5v-2.5h-2z', fill: 'none', stroke: 'currentColor',
1691
- strokeWidth: 1.4, strokeLinejoin: 'round'
1692
- }));
1693
- case 'show-deck':
1694
- return h('svg', common, h('path', {
1695
- d: 'M2.5 4h11M2.5 8h11M2.5 12h11', stroke: 'currentColor', strokeWidth: 1.6,
1696
- strokeLinecap: 'round', fill: 'none'
1697
- }));
1698
- case 'new-session':
1699
- return h('svg', common, h('path', {
1700
- d: 'M8 3v10M3 8h10', stroke: 'currentColor', strokeWidth: 1.7, strokeLinecap: 'round', fill: 'none'
1701
- }));
1702
- default:
1703
- return h('svg', common, h('path', {
1704
- d: 'M8 1.6 12.6 3.4v4.2c0 3.2-2.2 5.2-4.6 6.8-2.4-1.6-4.6-3.6-4.6-6.8V3.4z',
1705
- fill: 'none', stroke: 'currentColor', strokeWidth: 1.5, strokeLinejoin: 'round'
1706
- }));
1707
- }
1721
+ const markup = COMMAND_GLYPHS[id] ?? COMMAND_GLYPHS['toggle-permission'];
1722
+ return h('svg', {
1723
+ width: 20,
1724
+ height: 20,
1725
+ viewBox: '0 0 24 24',
1726
+ fill: 'none',
1727
+ stroke: 'currentColor',
1728
+ strokeWidth: 2,
1729
+ strokeLinecap: 'round',
1730
+ strokeLinejoin: 'round',
1731
+ 'aria-hidden': true,
1732
+ style: { display: 'block' },
1733
+ dangerouslySetInnerHTML: { __html: markup }
1734
+ });
1708
1735
  }
1709
1736
 
1710
1737
  function SearchIcon() {
@@ -1917,6 +1944,16 @@ window.__ModuleLoader__.load({
1917
1944
  sysRows.map((row) => {
1918
1945
  return h('div', { key: row.id, className: 'dqs-sysRow' },
1919
1946
  h('span', { className: 'dqs-sysLabel' }, row.label),
1947
+ h('button', {
1948
+ type: 'button',
1949
+ className: 'dqs-iconBtn dqs-tip',
1950
+ 'data-tip': t('system.reset'),
1951
+ 'aria-label': t('system.reset'),
1952
+ 'data-hidden': overrides[row.id] === undefined ? 'true' : 'false',
1953
+ onClick: async () => {
1954
+ markResult(row.id, await applyEdit({ type: 'reset', id: row.id }));
1955
+ }
1956
+ }, h(ResetIcon)),
1920
1957
  h(KeyRecorder, {
1921
1958
  ctx,
1922
1959
  t,
@@ -1925,15 +1962,6 @@ window.__ModuleLoader__.load({
1925
1962
  markResult(row.id, await applyEdit({ type: 'set', id: row.id, binding }));
1926
1963
  }
1927
1964
  }),
1928
- overrides[row.id] !== undefined
1929
- ? h('button', {
1930
- type: 'button',
1931
- className: 'dqs-linkBtn',
1932
- onClick: async () => {
1933
- markResult(row.id, await applyEdit({ type: 'reset', id: row.id }));
1934
- }
1935
- }, t('system.reset'))
1936
- : null,
1937
1965
  sysIssues[row.id]
1938
1966
  ? h('span', { className: 'dqs-editorError' }, sysIssues[row.id])
1939
1967
  : null);
@@ -2278,12 +2306,14 @@ window.__ModuleLoader__.load({
2278
2306
 
2279
2307
  ctx.effect(() => {
2280
2308
  if (typeof document === 'undefined') return undefined;
2281
- if (document.querySelector('style[data-dqs="1"]')) return undefined;
2282
- const style = document.createElement('style');
2309
+ // Upgrade an existing tag in place: after a hot reload the old tag is
2310
+ // still attached, and skipping it would keep stale CSS alive.
2311
+ const existing = document.querySelector('style[data-dqs="1"]');
2312
+ const style = existing ?? document.createElement('style');
2283
2313
  style.setAttribute('data-dqs', '1');
2284
2314
  style.textContent = CSS;
2285
- document.head.appendChild(style);
2286
- return () => { style.remove(); };
2315
+ if (!existing) document.head.appendChild(style);
2316
+ return () => { if (style.isConnected) style.remove(); };
2287
2317
  }, 'shortcut-ext: styles');
2288
2318
 
2289
2319
  ctx.slots.inject('shell.overlay', () => ctx.slots.register({
package/icon.svg CHANGED
@@ -1,6 +1,9 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
2
- <rect x="4" y="4" width="56" height="56" rx="14" fill="#3559e0"/>
3
- <rect x="16" y="19" width="32" height="5" rx="2.5" fill="#ffffff"/>
4
- <rect x="16" y="29.5" width="21" height="5" rx="2.5" fill="#ffffff" opacity="0.85"/>
5
- <rect x="16" y="40" width="27" height="5" rx="2.5" fill="#ffffff" opacity="0.7"/>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
2
+ <rect width="32" height="32" rx="7" fill="#3559e0"/>
3
+ <g transform="translate(4 4)" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
4
+ <rect x="2" y="4" width="20" height="16" rx="2"/>
5
+ <path d="M6 8h.01"/><path d="M10 8h.01"/><path d="M14 8h.01"/><path d="M18 8h.01"/>
6
+ <path d="M8 12h.01"/><path d="M12 12h.01"/><path d="M16 12h.01"/>
7
+ <path d="M7 16h10"/>
8
+ </g>
6
9
  </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-shortcut-extensions",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "Shortcut Extensions: a toggleable registry of quick-switch shortcut commands (model palette with pins, session palette with prompt preview and archived restore, recency-ordered session cycling, find-next-answered jump, focus composer, configurable permission cycling) with a sidebar control panel and a custom command editor.",
6
6
  "keywords": [