dsh-linked-workspace 0.20.0 → 0.20.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  English · [简体中文](CHANGELOG.zh.md)
4
4
 
5
+ ## 0.20.2 — 2026-11-19
6
+
7
+ - **The sheet stays readable under a translucent theme.** Some themes (a mica / frosted preset, for example) make the panel background semi-transparent, and since the overlay moved into the top layer the host's own blur no longer applies to it — the page behind showed through as mirrored text. The sheet now blurs whatever sits behind it, and the top-layer backdrop paints its own dim layer instead of relying on a theme scrim.
8
+
9
+ ## 0.20.1 — 2026-11-19
10
+
11
+ - **Overlays now live in the browser top layer.** The add-workspace dialog, every confirm/prompt dialog and the welcome card render into a `<dialog>` element with `showModal()`, so no neighbouring column (the right pane or the chat composer) can cover them. The old `z-index` values only worked inside one stacking context, which is why the same dialog was sometimes clipped.
12
+ - Esc still closes these overlays, and it now hangs off the top-layer host itself: cancelling goes through React, so the overlay is removed from the DOM instead of leaving a closed dialog behind.
13
+
5
14
  ## 0.20.0 — 2026-11-19
6
15
 
7
16
  - **Host key policy**: new `hostKeyPolicy` setting — `tofu` (default: trust and remember the first key) or `strict` (refuse any key we have never seen, which also covers a man-in-the-middle on the very first connection).
package/docs/VERIFY.md CHANGED
@@ -315,6 +315,8 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
315
315
  16. 触发一次错误提示后,再打开一个文件或点「刷新目录」:之前那条红色提示自动消失。
316
316
  17. 传一个较大的目录到远端,观察队列对话框的进行中行:进度后面会跟上吞吐,形如 `已传 3 个 · 12.0 MB · 4.1 MB/s`。
317
317
  18. 右键工作区根节点:菜单里**没有**「更改权限」(也没有「重命名」「删除」「移动到…」)。绕过界面直接请求 `fs.chmod` 并把 `path` 指向工作区远端根:返回 400「不能修改工作区根目录的权限」,随后 `fs.stat` 的权限保持不变。
318
+ 19. **覆盖层置顶(0.20.1)**:打开「添加工作区」弹窗时,右侧目录树与对话输入框都应变暗且完全在弹窗之下(在输入框位置 `document.elementFromPoint` 应命中遮罩);弹窗宿主是 `document.body` 下 `showModal()` 打开的 `<dialog class="rw-top-layer">`。按 Esc:弹窗消失且 `.rw-top-layer` 数量归 0(不能留下已关闭的 dialog),随后再点「添加工作区」仍能重新打开。
319
+ 20. **其它覆盖层(0.20.1)**:右键「移动到…」等确认对话框与首次运行欢迎卡片同样走 `.rw-top-layer`;Esc、点遮罩、点关闭按钮三种方式都能把宿主一起移除。
318
320
  ## 旧 Host 自检(0.15.0)
319
321
 
320
322
  1. **正常时不打扰**:插件已重启过后打开任意目录树,顶部**不应**出现任何黄色提示条。
package/lib/client.js CHANGED
@@ -26,6 +26,10 @@ window.__ModuleLoader__.load({
26
26
  'use strict';
27
27
 
28
28
  var React = require('react');
29
+ // react-dom is optional: some hosts expose it, some do not. It is only needed
30
+ // to portal overlays out of the plugin's slot subtree (see PortalBackdrop).
31
+ var reactDom = null;
32
+ try { reactDom = require('react-dom'); } catch (error) { reactDom = null; }
29
33
  var h = React.createElement;
30
34
  var useState = React.useState;
31
35
  var useEffect = React.useEffect;
@@ -3747,6 +3751,13 @@ function attributeViolation(name, value, tagName) {
3747
3751
  '.rw-tabs{display:flex;gap:4px;padding:3px;border-radius:9px;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1)}',
3748
3752
  '.rw-tab{flex:1 1 auto;height:28px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;border-radius:7px;background:transparent;font:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer}',
3749
3753
  '.rw-tab.is-on{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font-weight:600;box-shadow:0 0 0 1px var(--dsw-alias-border-l1)}',
3754
+ '.rw-top-layer{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;overflow:visible;color:inherit}',
3755
+ '.rw-top-layer::backdrop{background:rgba(0,0,0,.42);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}',
3756
+ // A theme can make the sheet translucent (the mica / floating-card look),
3757
+ // and because the sheet now lives in the top layer the host's own blur no
3758
+ // longer applies to it — the page behind would show through as readable
3759
+ // mirrored text. Blur whatever sits behind the sheet so only colour leaks.
3760
+ '.rw-top-layer .rw-modal,.rw-top-layer .rw-dialog,.rw-top-layer .rw-welcome{backdrop-filter:blur(18px) saturate(140%);-webkit-backdrop-filter:blur(18px) saturate(140%)}',
3750
3761
  '.rw-modal-backdrop{position:fixed;inset:0;z-index:1200;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.34)}',
3751
3762
  '.rw-modal{display:flex;flex-direction:column;width:min(620px,100%);max-height:min(760px,88vh);border:1px solid var(--dsw-alias-border-l2);border-radius:16px;background:var(--dsw-alias-bg-overlay);box-shadow:0 18px 60px rgba(0,0,0,.35);overflow:hidden}',
3752
3763
  '.rw-modal-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--dsw-alias-border-l1)}',
@@ -6501,7 +6512,7 @@ function rememberShowHidden(value) {
6501
6512
  { main: t('welcomeTools'), where: t('welcomeToolsWhere') },
6502
6513
  { main: t('welcomePassword'), where: t('welcomePasswordWhere') },
6503
6514
  ];
6504
- return h('div', {
6515
+ return h(PortalBackdrop, {
6505
6516
  className: 'rw-welcome-backdrop',
6506
6517
  onMouseDown: function (event) { if (event.target === event.currentTarget) close(); },
6507
6518
  }, h('div', {
@@ -6532,6 +6543,80 @@ function rememberShowHidden(value) {
6532
6543
  h('button', { type: 'button', className: 'rw-btn', onClick: close }, t('welcomeDone')))));
6533
6544
  }
6534
6545
 
6546
+ /**
6547
+ * Host for every overlay this plugin draws.
6548
+ *
6549
+ * DSH renders plugin slots inside its own layout tree, and the session column
6550
+ * (composer included) paints above neighbouring columns. A `position: fixed`
6551
+ * overlay that stays in the slot subtree is therefore still trapped by the
6552
+ * stacking context of its ancestor chain: raising z-index only wins against
6553
+ * some panes, never against a later top-layer or a higher ancestor context.
6554
+ *
6555
+ * So the overlay is portalled into a native <dialog> opened with showModal(),
6556
+ * which lives in the browser's top layer and paints above every column and
6557
+ * every future overlay regardless of z-index. When react-dom is missing (or the
6558
+ * browser has no <dialog>), it falls back to the in-place node, which still
6559
+ * works as before.
6560
+ */
6561
+ function PortalBackdrop(props) {
6562
+ var hostState = useState(null);
6563
+ var host = hostState[0];
6564
+ var setHost = hostState[1];
6565
+ var hostRef = useRef(null);
6566
+ var canPortal = Boolean(
6567
+ reactDom
6568
+ && typeof reactDom.createPortal === 'function'
6569
+ && typeof document !== 'undefined'
6570
+ && typeof document.createElement === 'function',
6571
+ );
6572
+
6573
+ useEffect(function () {
6574
+ if (!canPortal) return undefined;
6575
+ var element = document.createElement('dialog');
6576
+ element.className = 'rw-top-layer';
6577
+ element.setAttribute('data-lw-top-layer', '1');
6578
+ // Esc has to leave through React: the overlay owns its own cleanup, so if
6579
+ // the browser closed the <dialog> on its own the component would keep
6580
+ // rendering into a closed host. Every close path is funnelled to
6581
+ // props.onEscape instead.
6582
+ var onCancel = function (event) {
6583
+ if (event && typeof event.preventDefault === 'function') event.preventDefault();
6584
+ if (props.onEscape) props.onEscape();
6585
+ };
6586
+ var onNativeClose = function () {
6587
+ if (props.onEscape) props.onEscape();
6588
+ };
6589
+ element.addEventListener('cancel', onCancel);
6590
+ element.addEventListener('close', onNativeClose);
6591
+ document.body.appendChild(element);
6592
+ try {
6593
+ if (typeof element.showModal === 'function') element.showModal();
6594
+ else element.setAttribute('open', '');
6595
+ } catch (error) {
6596
+ element.setAttribute('open', '');
6597
+ }
6598
+ hostRef.current = element;
6599
+ setHost(element);
6600
+ return function () {
6601
+ hostRef.current = null;
6602
+ element.removeEventListener('cancel', onCancel);
6603
+ element.removeEventListener('close', onNativeClose);
6604
+ try { if (typeof element.close === 'function') element.close(); } catch (error) { /* already closed */ }
6605
+ if (element.parentNode) element.parentNode.removeChild(element);
6606
+ };
6607
+ }, [canPortal]);
6608
+
6609
+ var node = h('div', {
6610
+ className: props.className,
6611
+ role: props.role,
6612
+ onMouseDown: props.onMouseDown,
6613
+ }, props.children);
6614
+
6615
+ if (!canPortal) return node;
6616
+ if (!host) return null;
6617
+ return reactDom.createPortal(node, host);
6618
+ }
6619
+
6535
6620
  function DialogShell(props) {
6536
6621
  var boxRef = useRef(null);
6537
6622
  var restoreRef = useRef(null);
@@ -6573,7 +6658,7 @@ function rememberShowHidden(value) {
6573
6658
  window.addEventListener('keydown', onKey, true);
6574
6659
  return function () { window.removeEventListener('keydown', onKey, true); };
6575
6660
  }, [props.onClose]);
6576
- return h('div', {
6661
+ return h(PortalBackdrop, {
6577
6662
  className: 'rw-dialog-backdrop',
6578
6663
  onMouseDown: function (event) { if (event.target === event.currentTarget) props.onClose(); },
6579
6664
  }, h('div', {
@@ -10186,6 +10271,21 @@ function rememberShowHidden(value) {
10186
10271
  return function () { window.removeEventListener('wheel', onWheel, { capture: true }); };
10187
10272
  }, [props.open]);
10188
10273
 
10274
+ // Esc has to be caught on the window: the overlay now lives in a top-layer
10275
+ // <dialog>, so key events start at that element and never reach the modal
10276
+ // div's own handler.
10277
+ useEffect(function () {
10278
+ if (!props.open) return undefined;
10279
+ function onKey(event) {
10280
+ if (event.key !== 'Escape') return;
10281
+ event.preventDefault();
10282
+ event.stopPropagation();
10283
+ if (props.onCancel) props.onCancel();
10284
+ }
10285
+ window.addEventListener('keydown', onKey, true);
10286
+ return function () { window.removeEventListener('keydown', onKey, true); };
10287
+ }, [props.open, props.onCancel]);
10288
+
10189
10289
  function onModalKeyDown(event) {
10190
10290
  if (event.key === 'Escape') {
10191
10291
  event.preventDefault();
@@ -10211,7 +10311,11 @@ function rememberShowHidden(value) {
10211
10311
 
10212
10312
  if (!props.open) return null;
10213
10313
 
10214
- return h('div', { className: 'rw-modal-backdrop', role: 'presentation' },
10314
+ return h(PortalBackdrop, {
10315
+ className: 'rw-modal-backdrop',
10316
+ role: 'presentation',
10317
+ onEscape: function () { if (props.onCancel) props.onCancel(); },
10318
+ },
10215
10319
  h('div', {
10216
10320
  ref: modalRef,
10217
10321
  className: 'rw-modal',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-linked-workspace",
3
- "version": "0.20.0",
3
+ "version": "0.20.2",
4
4
  "description": "Linked local ⇄ remote workspaces and remote workspaces for DeepSeek Harness: theme-aware split editor, file-type icons, and agent tools that edit remote files directly.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",