dsh-linked-workspace 0.20.0 → 0.20.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/CHANGELOG.md +5 -0
- package/docs/VERIFY.md +2 -0
- package/lib/client.js +102 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
English · [简体中文](CHANGELOG.zh.md)
|
|
4
4
|
|
|
5
|
+
## 0.20.1 — 2026-11-19
|
|
6
|
+
|
|
7
|
+
- **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.
|
|
8
|
+
- 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.
|
|
9
|
+
|
|
5
10
|
## 0.20.0 — 2026-11-19
|
|
6
11
|
|
|
7
12
|
- **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,8 @@ 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:transparent}',
|
|
3750
3756
|
'.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
3757
|
'.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
3758
|
'.rw-modal-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--dsw-alias-border-l1)}',
|
|
@@ -6501,7 +6507,7 @@ function rememberShowHidden(value) {
|
|
|
6501
6507
|
{ main: t('welcomeTools'), where: t('welcomeToolsWhere') },
|
|
6502
6508
|
{ main: t('welcomePassword'), where: t('welcomePasswordWhere') },
|
|
6503
6509
|
];
|
|
6504
|
-
return h(
|
|
6510
|
+
return h(PortalBackdrop, {
|
|
6505
6511
|
className: 'rw-welcome-backdrop',
|
|
6506
6512
|
onMouseDown: function (event) { if (event.target === event.currentTarget) close(); },
|
|
6507
6513
|
}, h('div', {
|
|
@@ -6532,6 +6538,80 @@ function rememberShowHidden(value) {
|
|
|
6532
6538
|
h('button', { type: 'button', className: 'rw-btn', onClick: close }, t('welcomeDone')))));
|
|
6533
6539
|
}
|
|
6534
6540
|
|
|
6541
|
+
/**
|
|
6542
|
+
* Host for every overlay this plugin draws.
|
|
6543
|
+
*
|
|
6544
|
+
* DSH renders plugin slots inside its own layout tree, and the session column
|
|
6545
|
+
* (composer included) paints above neighbouring columns. A `position: fixed`
|
|
6546
|
+
* overlay that stays in the slot subtree is therefore still trapped by the
|
|
6547
|
+
* stacking context of its ancestor chain: raising z-index only wins against
|
|
6548
|
+
* some panes, never against a later top-layer or a higher ancestor context.
|
|
6549
|
+
*
|
|
6550
|
+
* So the overlay is portalled into a native <dialog> opened with showModal(),
|
|
6551
|
+
* which lives in the browser's top layer and paints above every column and
|
|
6552
|
+
* every future overlay regardless of z-index. When react-dom is missing (or the
|
|
6553
|
+
* browser has no <dialog>), it falls back to the in-place node, which still
|
|
6554
|
+
* works as before.
|
|
6555
|
+
*/
|
|
6556
|
+
function PortalBackdrop(props) {
|
|
6557
|
+
var hostState = useState(null);
|
|
6558
|
+
var host = hostState[0];
|
|
6559
|
+
var setHost = hostState[1];
|
|
6560
|
+
var hostRef = useRef(null);
|
|
6561
|
+
var canPortal = Boolean(
|
|
6562
|
+
reactDom
|
|
6563
|
+
&& typeof reactDom.createPortal === 'function'
|
|
6564
|
+
&& typeof document !== 'undefined'
|
|
6565
|
+
&& typeof document.createElement === 'function',
|
|
6566
|
+
);
|
|
6567
|
+
|
|
6568
|
+
useEffect(function () {
|
|
6569
|
+
if (!canPortal) return undefined;
|
|
6570
|
+
var element = document.createElement('dialog');
|
|
6571
|
+
element.className = 'rw-top-layer';
|
|
6572
|
+
element.setAttribute('data-lw-top-layer', '1');
|
|
6573
|
+
// Esc has to leave through React: the overlay owns its own cleanup, so if
|
|
6574
|
+
// the browser closed the <dialog> on its own the component would keep
|
|
6575
|
+
// rendering into a closed host. Every close path is funnelled to
|
|
6576
|
+
// props.onEscape instead.
|
|
6577
|
+
var onCancel = function (event) {
|
|
6578
|
+
if (event && typeof event.preventDefault === 'function') event.preventDefault();
|
|
6579
|
+
if (props.onEscape) props.onEscape();
|
|
6580
|
+
};
|
|
6581
|
+
var onNativeClose = function () {
|
|
6582
|
+
if (props.onEscape) props.onEscape();
|
|
6583
|
+
};
|
|
6584
|
+
element.addEventListener('cancel', onCancel);
|
|
6585
|
+
element.addEventListener('close', onNativeClose);
|
|
6586
|
+
document.body.appendChild(element);
|
|
6587
|
+
try {
|
|
6588
|
+
if (typeof element.showModal === 'function') element.showModal();
|
|
6589
|
+
else element.setAttribute('open', '');
|
|
6590
|
+
} catch (error) {
|
|
6591
|
+
element.setAttribute('open', '');
|
|
6592
|
+
}
|
|
6593
|
+
hostRef.current = element;
|
|
6594
|
+
setHost(element);
|
|
6595
|
+
return function () {
|
|
6596
|
+
hostRef.current = null;
|
|
6597
|
+
element.removeEventListener('cancel', onCancel);
|
|
6598
|
+
element.removeEventListener('close', onNativeClose);
|
|
6599
|
+
try { if (typeof element.close === 'function') element.close(); } catch (error) { /* already closed */ }
|
|
6600
|
+
if (element.parentNode) element.parentNode.removeChild(element);
|
|
6601
|
+
};
|
|
6602
|
+
}, [canPortal]);
|
|
6603
|
+
|
|
6604
|
+
var node = h('div', {
|
|
6605
|
+
className: props.className,
|
|
6606
|
+
role: props.role,
|
|
6607
|
+
onMouseDown: props.onMouseDown,
|
|
6608
|
+
}, props.children);
|
|
6609
|
+
|
|
6610
|
+
if (!canPortal) return node;
|
|
6611
|
+
if (!host) return null;
|
|
6612
|
+
return reactDom.createPortal(node, host);
|
|
6613
|
+
}
|
|
6614
|
+
|
|
6535
6615
|
function DialogShell(props) {
|
|
6536
6616
|
var boxRef = useRef(null);
|
|
6537
6617
|
var restoreRef = useRef(null);
|
|
@@ -6573,7 +6653,7 @@ function rememberShowHidden(value) {
|
|
|
6573
6653
|
window.addEventListener('keydown', onKey, true);
|
|
6574
6654
|
return function () { window.removeEventListener('keydown', onKey, true); };
|
|
6575
6655
|
}, [props.onClose]);
|
|
6576
|
-
return h(
|
|
6656
|
+
return h(PortalBackdrop, {
|
|
6577
6657
|
className: 'rw-dialog-backdrop',
|
|
6578
6658
|
onMouseDown: function (event) { if (event.target === event.currentTarget) props.onClose(); },
|
|
6579
6659
|
}, h('div', {
|
|
@@ -10186,6 +10266,21 @@ function rememberShowHidden(value) {
|
|
|
10186
10266
|
return function () { window.removeEventListener('wheel', onWheel, { capture: true }); };
|
|
10187
10267
|
}, [props.open]);
|
|
10188
10268
|
|
|
10269
|
+
// Esc has to be caught on the window: the overlay now lives in a top-layer
|
|
10270
|
+
// <dialog>, so key events start at that element and never reach the modal
|
|
10271
|
+
// div's own handler.
|
|
10272
|
+
useEffect(function () {
|
|
10273
|
+
if (!props.open) return undefined;
|
|
10274
|
+
function onKey(event) {
|
|
10275
|
+
if (event.key !== 'Escape') return;
|
|
10276
|
+
event.preventDefault();
|
|
10277
|
+
event.stopPropagation();
|
|
10278
|
+
if (props.onCancel) props.onCancel();
|
|
10279
|
+
}
|
|
10280
|
+
window.addEventListener('keydown', onKey, true);
|
|
10281
|
+
return function () { window.removeEventListener('keydown', onKey, true); };
|
|
10282
|
+
}, [props.open, props.onCancel]);
|
|
10283
|
+
|
|
10189
10284
|
function onModalKeyDown(event) {
|
|
10190
10285
|
if (event.key === 'Escape') {
|
|
10191
10286
|
event.preventDefault();
|
|
@@ -10211,7 +10306,11 @@ function rememberShowHidden(value) {
|
|
|
10211
10306
|
|
|
10212
10307
|
if (!props.open) return null;
|
|
10213
10308
|
|
|
10214
|
-
return h(
|
|
10309
|
+
return h(PortalBackdrop, {
|
|
10310
|
+
className: 'rw-modal-backdrop',
|
|
10311
|
+
role: 'presentation',
|
|
10312
|
+
onEscape: function () { if (props.onCancel) props.onCancel(); },
|
|
10313
|
+
},
|
|
10215
10314
|
h('div', {
|
|
10216
10315
|
ref: modalRef,
|
|
10217
10316
|
className: 'rw-modal',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-linked-workspace",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.1",
|
|
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",
|