dsh-linked-workspace 0.12.0 → 0.13.0
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 +6 -0
- package/README.en.md +3 -3
- package/README.md +3 -3
- package/docs/VERIFY.md +19 -2
- package/lib/client.js +313 -80
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
English · [简体中文](CHANGELOG.zh.md)
|
|
4
4
|
|
|
5
|
+
## 0.13.0 — 2026-11-14
|
|
6
|
+
|
|
7
|
+
- **Batch drag and move**: dragging inside one tree is now a move instead of a dead end — remote-to-remote in a linked or remote workspace, local-to-local in a linked workspace — and a multi-selection travels as one gesture in both directions (one request per entry, so a failure leaves the rest untouched and the notice reports how many landed). The row menu gained “Move selected (N)…” for the same job without dragging.
|
|
8
|
+
- **Hover card host line**: the host's workspace hover preview now shows the SSH host of the connection together with its live state, on one line right under the workspace name (`RTX-PRO-6000-1 · Connected` / `RTX-PRO-6000-1 · Connection lost`), for both linked and remote workspaces. The line is green while the connection is up and red once it drops; the previous standalone state line and the session counter are gone.
|
|
9
|
+
- **First-run welcome card**: the first time the plugin loads in a browser profile it shows one card that says what the plugin does, where to create a linked or remote workspace, where the two remote trees live, and that an SSH password can be kept on this machine — plus a “Star the repo” link. Dismissing it (button, `Esc`, or clicking the backdrop) is remembered in `localStorage`, so it never reopens; a fresh DSH profile shows it once again.
|
|
10
|
+
|
|
5
11
|
## 0.12.0 — 2026-11-14
|
|
6
12
|
|
|
7
13
|
- **Password diagnostics**: an SSH failure now shows the server's own reason next to the translated text (for example “SSH 认证失败:… All configured authentication methods failed.”), and the add-workspace dialog gained a **Check password** button that stores the secret and opens a probe connection, so a wrong password is caught before creating the workspace. Password logins also answer `keyboard-interactive` prompts with the same secret, which is what PAM-based servers often ask for.
|
package/README.en.md
CHANGED
|
@@ -30,7 +30,7 @@ Turn an existing SSH connection into a **linked workspace** or a **remote worksp
|
|
|
30
30
|
|
|
31
31
|
## Quick start
|
|
32
32
|
|
|
33
|
-
1. **Install** the plugin (see [Install](#install)) and restart the DSH client.
|
|
33
|
+
1. **Install** the plugin (see [Install](#install)) and restart the DSH client; the first time it loads, a welcome card explains what it does — press “Got it” to dismiss it for good.
|
|
34
34
|
2. **Add a workspace**: Settings → Linked workspaces → “Create linked workspace” or “Create remote workspace”, then pick an existing SSH host (add it to `~/.ssh/config` or the DSH SSH Manager, then press “Refresh”, if the list is empty).
|
|
35
35
|
3. **Pick directories**: a linked workspace needs a remote path plus a local folder (empty or new); a remote workspace needs only a remote path, and that directory must already exist — the plugin never creates it.
|
|
36
36
|
4. **Open the sidebar**: on the right sidebar start page choose “Linked Workspace Directory” or “Remote Workspace Directory”.
|
|
@@ -56,7 +56,7 @@ The plugin takes over the DSH sidebar/hero directory-selection hole; the dialog
|
|
|
56
56
|
2. **Linked workspace (local ⇄ remote)**: SSH host + remote directory + local directory + mirror toggle; the local directory becomes a DSH workspace.
|
|
57
57
|
3. **Remote workspace**: SSH host + remote directory + workspace name; the placeholder directory becomes a DSH workspace and sessions run on the server.
|
|
58
58
|
|
|
59
|
-
> Linked workspace rows no longer carry a `⇄` title prefix: a scoped stylesheet keyed on `data-row-key` swaps the host folder glyph for the workspace's own icon — two interlocking links for a linked workspace, a display with an outbound arrow for a remote workspace (normal local workspaces are untouched). When the SSH connection drops the row icon turns red, and the host's hover card gains
|
|
59
|
+
> Linked workspace rows no longer carry a `⇄` title prefix: a scoped stylesheet keyed on `data-row-key` swaps the host folder glyph for the workspace's own icon — two interlocking links for a linked workspace, a display with an outbound arrow for a remote workspace (normal local workspaces are untouched). When the SSH connection drops the row icon turns red, and the host's hover card gains one line under the name combining the SSH host with its live state (`RTX-PRO-6000-1 · Connected`, turning red with “Connection lost” once the link drops); a remote workspace shows the remote directory, a linked one shows both the remote and local directories. This is the only DOM-level adaptation of the host row; if DSH changes the row structure the selector stops matching and the original folder icon returns, with no other breakage.
|
|
60
60
|
|
|
61
61
|
### Sidebar: “Linked Workspace Directory”
|
|
62
62
|
|
|
@@ -94,7 +94,7 @@ Appears automatically for sessions that belong to a remote workspace (and can be
|
|
|
94
94
|
|
|
95
95
|
### Transfer, comparison and conflicts
|
|
96
96
|
|
|
97
|
-
- **Drag and drop**: drag rows between the local and remote trees, or
|
|
97
|
+
- **Drag and drop**: drag rows between the local and remote trees to transfer them, or drag inside one tree (remote-inside-remote, local-inside-local) to **move** them; with several rows selected the whole selection travels in one gesture. OS files can be dropped onto either tree (the web client cannot read dropped file paths and says to use the desktop app). Hovering a collapsed folder for 700 ms while dragging expands it; a multi-selection can also be moved at once with “Move selected (N)…”.
|
|
98
98
|
- **Overwrite confirmation**: dropping onto a folder that already has the name no longer overwrites silently — a dialog offers cancel / keep both / overwrite. “Keep both” produces `name copy.txt` or `name (2).txt`. The API and tools accept `conflict=error|overwrite|unique`.
|
|
99
99
|
- **Local ⇄ remote comparison**: right-click a remote folder → “Compare with local…” groups entries into only-local / only-remote / changed (size differs, or mtime differs by more than 2 s); up to 4000 files and depth 12 per side, 200 rows per group, with a truncation notice. Clicking a row opens the file; each row can push to remote or pull to local; a missing local folder is called out explicitly.
|
|
100
100
|
- **Transfer queue**: one job at a time with queued/running/done/failed states; failed items can be retried.
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
## 快速开始
|
|
32
32
|
|
|
33
|
-
1. **安装插件**(见[安装](#安装)),重启 DSH
|
|
33
|
+
1. **安装插件**(见[安装](#安装)),重启 DSH 客户端;首次打开时插件会弹出一张欢迎卡片,点「知道了」即可(之后不再出现)。
|
|
34
34
|
2. **添加工作区**:设置 → 联动工作区 →「创建联动工作区」或「创建远程工作区」,选择已有 SSH 主机;列表里没有就把主机写进 `~/.ssh/config`(或在 DSH 的 SSH Manager 里添加),然后点「刷新」。
|
|
35
35
|
3. **选目录**:联动工作区需选远端路径和本地目录;远程工作区只需选远端路径(该目录必须已存在,插件不会自动创建)。
|
|
36
36
|
4. **打开右侧栏**:会话右侧栏开始页点「联动工作区目录」(联动)或「远程工作区目录」(远程)。
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
2. **联动工作区(本地 ⇄ 远端)**:SSH 主机 + 远端目录 + 本地目录 + 镜像开关,创建后本地目录成为 DSH 工作区。
|
|
57
57
|
3. **远程工作区**:SSH 主机 + 远端目录 + 工作区名称,创建后占位目录成为 DSH 工作区,会话直接跑在远端。
|
|
58
58
|
|
|
59
|
-
> 左侧工作区行不再带 `⇄` 标题前缀:插件用一份按 `data-row-key` 定位的样式表,把宿主文件夹图标换成工作区自己的图标——联动工作区是**双链环**,远程工作区是**显示器 + 出链箭头**,普通本地工作区不受影响。SSH
|
|
59
|
+
> 左侧工作区行不再带 `⇄` 标题前缀:插件用一份按 `data-row-key` 定位的样式表,把宿主文件夹图标换成工作区自己的图标——联动工作区是**双链环**,远程工作区是**显示器 + 出链箭头**,普通本地工作区不受影响。SSH 连接断开时该行的图标会变红;把鼠标停在行上,宿主那张悬停信息卡里名字下面会多出一行「SSH 主机 · 连接状态」(形如 `RTX-PRO-6000-1 · 已连接`,掉线后变红并显示「连接已断开」);远程工作区显示远端目录、联动工作区同时显示远端与本地目录。这是对宿主行结构的唯一 DOM 级适配;如果 DSH 以后更改行结构,选择器会自然失配并回退到原来的文件夹图标,不破坏其他功能。
|
|
60
60
|
|
|
61
61
|
### 右侧栏「联动工作区目录」
|
|
62
62
|
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
|
|
95
95
|
### 传输、对比与冲突处理
|
|
96
96
|
|
|
97
|
-
-
|
|
97
|
+
- **拖拽**:在本地树与远端树之间拖动文件即可互传;同一棵树内拖动(远端内或本地内)则是**移动**,选中多项后拖动会一起移动/传输。也可以把系统文件拖进任一树(Web 端浏览器无法读取拖入文件路径时会提示改用桌面端)。拖动时悬停在折叠目录上 700 ms 会自动展开;多选后用右键「移动所选的 N 项…」也能批量移动。
|
|
98
98
|
- **覆盖确认**:目标目录已有同名文件时,不再静默覆盖,而是弹出「取消 / 保留两者 / 覆盖」;保留两者会自动生成 `name copy.txt` 或 `name (2).txt`。工具与 API 也可用 `conflict=error|overwrite|unique` 指定策略。
|
|
99
99
|
- **本地 ⇄ 远端对比**:右键远端目录 →「与本地对比…」,按「仅本地存在 / 仅远端存在 / 大小或时间不同」分组列出;单侧最多扫描 4000 个文件、深度 12、每组展示 200 行,超限会提示。点行直接打开文件;每行可「推送到远端」或「拉取到本地」;本地缺少对应目录时会明确说明。
|
|
100
100
|
- **传输队列**:一次执行一个任务,显示排队/传输中/完成/失败;失败项可重试。
|
package/docs/VERIFY.md
CHANGED
|
@@ -36,6 +36,14 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
36
36
|
7. **远端目录必须已存在**:填一个不存在的路径 → 报错 `FS_NOT_FOUND`(不会自动创建)。
|
|
37
37
|
8. **标签常驻**:当前会话属于联动工作区时,设置页仍能打开远程工作区目录树(不再依赖会话 scope 才注册标签)。
|
|
38
38
|
|
|
39
|
+
## 首次运行欢迎卡片(0.13.0)
|
|
40
|
+
|
|
41
|
+
1. **首次打开会弹出**:清掉 `localStorage` 里的 `dsh-linked-workspace:welcome`(或换一个全新 profile)后刷新页面——中央出现一张卡片:标签 `DSH-LINKED-WORKSPACE`、标题「欢迎使用联动工作区插件」、一段说明、四条「做什么 + 在哪」(创建工作区 / 浏览远端文件 / 让模型读写远端代码 / 不用 SSH Manager 也能连),底部「★ 点个 Star」与「知道了」。
|
|
42
|
+
2. **三种关闭方式**:点「知道了」、按 `Esc`、点卡片外的遮罩都能关闭;关闭后 `localStorage.dsh-linked-workspace:welcome === "1"`。
|
|
43
|
+
3. **不会重复弹**:刷新页面后不再出现;把该键删掉再刷新会重新出现。
|
|
44
|
+
4. **深浅两套主题都正常**:深色下卡片底色 `rgb(44,44,46)`、行内底色 `rgb(21,21,23)`、文字浅色;浅色下卡片白底、行内白底带边框、主按钮深底反白。
|
|
45
|
+
5. **Star 按钮**:链接指向 `https://github.com/jiahui-huang1/dsh-linked-workspace`(新标签打开)。
|
|
46
|
+
|
|
39
47
|
## 侧边栏入口与可选依赖(0.11.0)
|
|
40
48
|
|
|
41
49
|
1. **菜单按工作区类型给出入口**:分别在「默认工作区(普通本地)」「联动工作区」「远程工作区」三种会话里打开右侧栏「+」新标签页菜单——本地工作区两条都不出现;联动工作区只出现「联动工作区目录」;远程工作区只出现「远程工作区目录」。
|
|
@@ -58,7 +66,7 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
58
66
|
## 工作区图标与连接状态(0.11.0)
|
|
59
67
|
|
|
60
68
|
1. **图标区分**:左侧栏工作区行、侧栏「+」菜单、目录树工作区 chip 与分组头、设置页卡片与两个创建按钮、「添加工作区」弹窗三个页签——联动工作区统一是「双链环」,远程工作区统一是「显示器 + 出链箭头」,本地工作区仍是文件夹。
|
|
61
|
-
2. **悬停预览卡片**:把鼠标停在左侧栏工作区行上,弹出的信息卡里依次是「名称 / 连接状态 / 目录 /
|
|
69
|
+
2. **悬停预览卡片**:把鼠标停在左侧栏工作区行上,弹出的信息卡里依次是「名称 / SSH 主机 · 连接状态 / 目录 / 创建于」——第二行把主机名与状态合在一起(形如 `RTX-PRO-6000-1 · 已连接`),联动工作区与远程工作区都有;连接正常时该行是绿色,在服务器上 `pkill -u <user> sshd` 掉线后变红并显示「连接已断开」。卡片里**不再显示会话数**,也不再出现浏览器原生 `title` 提示。
|
|
62
70
|
3. **卡片里的目录**:远程工作区的卡片只显示**远端目录**绝对路径(例如 `/shared_data_ssd1/huangjh/code`,不显示本地占位目录);联动工作区的卡片显示两行——「远端 …」与「本地 …」两个绝对路径。
|
|
63
71
|
4. **断线变红**:让主机断开 SSH(例如在服务器上执行 `pkill -u <user> sshd`,或在网络中断开)→ 左侧栏该工作区行的图标变红(`#f85149`),悬停卡片里的状态行同样变成红色的「连接已断开」。
|
|
64
72
|
5. **自动恢复**:再次访问该工作区(打开目录树 / 刷新设置页)→ 连接重建后图标恢复常规颜色,悬停卡片里的状态回到「已连接」。
|
|
@@ -228,6 +236,15 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
228
236
|
6. **本地缺少对应目录**:对比一个本地没有的远程子目录:对话框应提示「本地没有对应目录,远端独有的文件无法对比」。
|
|
229
237
|
7. **队列重试**:制造一次传输失败(例如目标路径是文件而非目录),在队列中点「重试」:修好原因后应成功并刷新树。
|
|
230
238
|
8. **注册工作区**:联动记录的 `workspaceId` 为空时,设置页应显示「注册为工作区」,点击后变为正常的工作区信息。
|
|
231
|
-
9.
|
|
239
|
+
9. **拖拽提示**:拖本地目录到远端、拖远端目录到本地:应分别给出「暂不支持把本地目录拖拽到远端…」「暂不支持把远程目录拖拽到本地…」(同一棵树内拖拽是移动,见下一节)。
|
|
232
240
|
10. **悬停展开**:拖拽停在折叠目录行 700 ms:该目录应自动展开。
|
|
233
241
|
11. **host-api**:`node test/host-api.mjs` 应为 28 步全部通过。
|
|
242
|
+
|
|
243
|
+
## 批量拖拽与移动(0.13.0)
|
|
244
|
+
|
|
245
|
+
1. **远端内移动**:联动工作区或远程工作区里,把远端文件拖到另一个远端目录:应提示「已移动」,文件只在目标目录出现。
|
|
246
|
+
2. **本地内移动**:联动工作区里把本地文件拖到另一个本地目录:同上,提示「已移动」。
|
|
247
|
+
3. **多选拖拽**:Ctrl/Cmd 点选 3 个文件(或 Shift 连选)后拖动其中一行:应提示「已移动 3 项」,三条都落到目标目录。
|
|
248
|
+
4. **跨侧批量**:多选本地文件拖到远端目录(或反过来):应提示「已导入 N 个文件」,逐个文件各一次请求;其中一个目标同名时会先弹冲突对话框。
|
|
249
|
+
5. **批量右键移动**:多选后用右键「移动所选的 N 项…」,选目标目录:应提示「已移动 N 项」。
|
|
250
|
+
6. **同目录/自身保护**:把文件拖到它当前所在的目录、或把目录拖进自己的子目录:应被忽略,不产生报错或递归。
|
package/lib/client.js
CHANGED
|
@@ -2126,6 +2126,19 @@ function attributeViolation(name, value, tagName) {
|
|
|
2126
2126
|
var ZH = {
|
|
2127
2127
|
settingsNav: '联动工作区',
|
|
2128
2128
|
title: '联动&远程工作区',
|
|
2129
|
+
welcomeEyebrow: 'DSH-LINKED-WORKSPACE',
|
|
2130
|
+
welcomeTitle: '欢迎使用联动工作区插件',
|
|
2131
|
+
welcomeLead: '把 SSH 主机上的远端目录接进 DSH:既能和本地目录配对成联动工作区,也能让会话直接运行在远端目录。会话里的模型可以读写远端代码。',
|
|
2132
|
+
welcomeCreate: '创建联动或远程工作区',
|
|
2133
|
+
welcomeCreateWhere: '设置 →「联动工作区」,或左侧工作区栏的「添加工作区」',
|
|
2134
|
+
welcomeBrowse: '在右侧栏浏览远端文件',
|
|
2135
|
+
welcomeBrowseWhere: '标签栏「+」→「联动工作区目录」或「远程工作区目录」',
|
|
2136
|
+
welcomeTools: '让模型读写远端代码',
|
|
2137
|
+
welcomeToolsWhere: '直接在会话里提需求,模型会用 linked_workspace 工具',
|
|
2138
|
+
welcomePassword: '不用装 SSH Manager 也能连',
|
|
2139
|
+
welcomePasswordWhere: '添加工作区时直接填 SSH 密码,只保存在本机',
|
|
2140
|
+
welcomeStar: '★ 点个 Star',
|
|
2141
|
+
welcomeDone: '知道了',
|
|
2129
2142
|
intro: '把 SSH 连接变成工作区:联动工作区把本地目录与远端目录配对,远程工作区让会话直接运行在远端目录。会话都能读取、搜索和编辑远端文件。',
|
|
2130
2143
|
addWorkspace: '添加工作区',
|
|
2131
2144
|
addLinked: '添加联动工作区',
|
|
@@ -2195,11 +2208,14 @@ function attributeViolation(name, value, tagName) {
|
|
|
2195
2208
|
csvTruncated: '仅显示前 1000 行',
|
|
2196
2209
|
moveTitle: '移动到…',
|
|
2197
2210
|
moveMessage: '选择「{{name}}」要移动到的目录',
|
|
2211
|
+
moveMessageMany: '选择这 {{count}} 项要移动到的目录',
|
|
2198
2212
|
moveDone: '已移动',
|
|
2213
|
+
moveDoneCount: '已移动 {{count}} 项',
|
|
2199
2214
|
moveDirty: '该文件有未保存修改,请先保存或关闭后再移动',
|
|
2200
2215
|
moveFailed: '移动失败',
|
|
2201
2216
|
moveHint: '进入目标文件夹后点击「使用此目录」',
|
|
2202
2217
|
ctxMove: '移动到…',
|
|
2218
|
+
ctxMoveSelected: '移动所选的 {{count}} 项…',
|
|
2203
2219
|
noWorkspace: '远程工作区不存在,请重新添加。',
|
|
2204
2220
|
noTarget: '没有可浏览的工作区。先在设置 → 连接中创建,或点击左侧「添加工作区」。',
|
|
2205
2221
|
treeEmpty: '空目录',
|
|
@@ -2542,6 +2558,19 @@ function attributeViolation(name, value, tagName) {
|
|
|
2542
2558
|
var EN = {
|
|
2543
2559
|
settingsNav: 'Linked workspaces',
|
|
2544
2560
|
title: 'Linked & remote workspaces',
|
|
2561
|
+
welcomeEyebrow: 'DSH-LINKED-WORKSPACE',
|
|
2562
|
+
welcomeTitle: 'Welcome to the linked-workspaces plugin',
|
|
2563
|
+
welcomeLead: 'Bring a folder on an SSH host into DSH: pair it with a local folder as a linked workspace, or run sessions straight inside the remote folder. Sessions can read and edit the remote code.',
|
|
2564
|
+
welcomeCreate: 'Create a linked or remote workspace',
|
|
2565
|
+
welcomeCreateWhere: 'Settings → “Linked workspaces”, or “Add workspace” in the left column',
|
|
2566
|
+
welcomeBrowse: 'Browse remote files in the right sidebar',
|
|
2567
|
+
welcomeBrowseWhere: 'Tab bar “+” → “Linked workspace directory” or “Remote workspace directory”',
|
|
2568
|
+
welcomeTools: 'Let the model read and write remote code',
|
|
2569
|
+
welcomeToolsWhere: 'Just ask in a session; the model uses the linked_workspace tool',
|
|
2570
|
+
welcomePassword: 'No SSH Manager needed',
|
|
2571
|
+
welcomePasswordWhere: 'Type the SSH password when adding a workspace; it stays on this machine',
|
|
2572
|
+
welcomeStar: '★ Star the repo',
|
|
2573
|
+
welcomeDone: 'Got it',
|
|
2545
2574
|
intro: 'Turn an SSH connection into a workspace: a linked workspace pairs a local folder with a remote folder, and a remote workspace runs sessions directly inside the remote folder. Either way sessions can read, search and edit remote files.',
|
|
2546
2575
|
addWorkspace: 'Add workspace',
|
|
2547
2576
|
addRemoteDir: 'Add remote directory',
|
|
@@ -2612,11 +2641,14 @@ function attributeViolation(name, value, tagName) {
|
|
|
2612
2641
|
csvTruncated: 'Showing the first 1000 rows',
|
|
2613
2642
|
moveTitle: 'Move to…',
|
|
2614
2643
|
moveMessage: 'Choose the destination folder for "{{name}}"',
|
|
2644
|
+
moveMessageMany: 'Choose the destination folder for these {{count}} items',
|
|
2615
2645
|
moveDone: 'Moved',
|
|
2646
|
+
moveDoneCount: 'Moved {{count}} items',
|
|
2616
2647
|
moveDirty: 'This file has unsaved changes; save or close it before moving',
|
|
2617
2648
|
moveFailed: 'Move failed',
|
|
2618
2649
|
moveHint: 'Open the destination folder, then click “Use this directory”',
|
|
2619
2650
|
ctxMove: 'Move to…',
|
|
2651
|
+
ctxMoveSelected: 'Move selected ({{count}})…',
|
|
2620
2652
|
noWorkspace: 'This remote workspace no longer exists. Add it again.',
|
|
2621
2653
|
noTarget: 'No workspace to browse. Create one in Settings → Connections, or click “Add workspace” on the left.',
|
|
2622
2654
|
treeEmpty: 'Empty directory',
|
|
@@ -3344,9 +3376,9 @@ function attributeViolation(name, value, tagName) {
|
|
|
3344
3376
|
'.rw-path{font-family:ui-monospace,"Cascadia Code",Consolas,monospace;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary);word-break:break-all}',
|
|
3345
3377
|
// Injected into the host's workspace hover preview, which always paints on
|
|
3346
3378
|
// a fixed dark card, so these colours cannot follow the theme tokens.
|
|
3347
|
-
'.rw-hover-
|
|
3348
|
-
'.rw-hover-
|
|
3349
|
-
'.rw-hover-
|
|
3379
|
+
'.rw-hover-host{margin:1px 0 0;font-size:12px;line-height:18px;color:rgb(207,211,214)}',
|
|
3380
|
+
'.rw-hover-host.is-on{color:#3fb950}',
|
|
3381
|
+
'.rw-hover-host.is-off{color:#f85149}',
|
|
3350
3382
|
'.rw-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}',
|
|
3351
3383
|
'.rw-meta-text{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
3352
3384
|
'.rw-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}',
|
|
@@ -3619,6 +3651,21 @@ function attributeViolation(name, value, tagName) {
|
|
|
3619
3651
|
'.rw-dialog-input{width:100%;box-sizing:border-box;padding:6px 9px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;outline:none}',
|
|
3620
3652
|
'.rw-dialog-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:12px}',
|
|
3621
3653
|
'.rw-dialog-message{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}',
|
|
3654
|
+
// First-run welcome card: sits in shell.overlay, so the backdrop is its own.
|
|
3655
|
+
'.rw-welcome-backdrop{position:fixed;inset:0;z-index:2000;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.42)}',
|
|
3656
|
+
'.rw-welcome{position:relative;width:min(470px,100%);max-height:min(86vh,700px);overflow:auto;box-sizing:border-box;padding:22px 22px 18px;border:1px solid var(--dsw-alias-border-l2);border-radius:18px;background:var(--dsw-alias-bg-layer-2);box-shadow:0 26px 70px rgba(0,0,0,.42);color:var(--dsw-alias-label-primary)}',
|
|
3657
|
+
'.rw-welcome-x{position:absolute;top:12px;right:12px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer}',
|
|
3658
|
+
'.rw-welcome-x:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.14))}',
|
|
3659
|
+
'.rw-welcome-eyebrow{display:inline-flex;align-items:center;gap:6px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--dsw-alias-label-tertiary)}',
|
|
3660
|
+
'.rw-welcome-dot{width:6px;height:6px;border-radius:50%;background:var(--dsw-alias-brand-primary)}',
|
|
3661
|
+
'.rw-welcome-title{margin:8px 0 0;font-size:19px;line-height:26px;font-weight:650}',
|
|
3662
|
+
'.rw-welcome-lead{margin:8px 0 0;font-size:13px;line-height:20px;color:var(--dsw-alias-label-secondary)}',
|
|
3663
|
+
'.rw-welcome-rows{display:flex;flex-direction:column;gap:8px;margin:16px 0 0}',
|
|
3664
|
+
'.rw-welcome-row{padding:10px 12px;border:1px solid var(--dsw-alias-border-l1);border-radius:11px;background:var(--dsw-alias-bg-base)}',
|
|
3665
|
+
'.rw-welcome-row-main{font-size:13px;line-height:19px;font-weight:600}',
|
|
3666
|
+
'.rw-welcome-row-where{margin-top:2px;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}',
|
|
3667
|
+
'.rw-welcome-foot{display:flex;align-items:center;gap:10px;margin-top:18px}',
|
|
3668
|
+
'.rw-welcome-foot .rw-btn{height:32px;padding:0 16px;text-decoration:none}',
|
|
3622
3669
|
'.rw-props{display:grid;grid-template-columns:70px minmax(0,1fr);gap:5px 9px;font-size:12px;line-height:18px}',
|
|
3623
3670
|
'.rw-props-key{color:var(--dsw-alias-label-tertiary)}',
|
|
3624
3671
|
'.rw-props-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
@@ -3814,13 +3861,16 @@ function attributeViolation(name, value, tagName) {
|
|
|
3814
3861
|
var remote = record.remotePath;
|
|
3815
3862
|
var local = record.localPath || '';
|
|
3816
3863
|
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3864
|
+
// Second line: the SSH host that backs this workspace plus its live
|
|
3865
|
+
// connection state, e.g. "RTX-PRO-6000-1 · 已连接". Both pieces come from
|
|
3866
|
+
// the same record, so a host without a name still shows the state alone.
|
|
3867
|
+
var stateLine = document.createElement('div');
|
|
3868
|
+
stateLine.className = 'rw-hover-host' + (record.disconnected ? ' is-off' : record.connected ? ' is-on' : '');
|
|
3869
|
+
stateLine.setAttribute(HOVER_LINE_ATTR, '1');
|
|
3870
|
+
stateLine.textContent = record.host ? record.host + ' · ' + record.status : record.status;
|
|
3821
3871
|
var titleEl = card.querySelector('[class*="hoverTitle"]');
|
|
3822
3872
|
var anchor = titleEl || pathEl;
|
|
3823
|
-
anchor.parentNode.insertBefore(
|
|
3873
|
+
anchor.parentNode.insertBefore(stateLine, anchor.nextSibling);
|
|
3824
3874
|
|
|
3825
3875
|
if (record.kind === 'linked' && local !== '') {
|
|
3826
3876
|
pathEl.textContent = t('pathRemoteShort') + ' ' + remote;
|
|
@@ -3887,6 +3937,7 @@ function attributeViolation(name, value, tagName) {
|
|
|
3887
3937
|
records[key] = {
|
|
3888
3938
|
kind: entry.kind,
|
|
3889
3939
|
name: item.name,
|
|
3940
|
+
host: item.hostName || item.host || '',
|
|
3890
3941
|
remotePath: item.remotePath || '',
|
|
3891
3942
|
localPath: linked ? (item.localPath || '') : '',
|
|
3892
3943
|
status: statusLabel(t, item),
|
|
@@ -5822,6 +5873,90 @@ function attributeViolation(name, value, tagName) {
|
|
|
5822
5873
|
}, items.map(renderItem)));
|
|
5823
5874
|
}
|
|
5824
5875
|
|
|
5876
|
+
// ── first-run welcome card ──────────────────────────────────────────────
|
|
5877
|
+
|
|
5878
|
+
// Shown once per browser profile: the flag lives in localStorage so the
|
|
5879
|
+
// dialog never reopens on refresh, and a fresh DSH install opens it again.
|
|
5880
|
+
var WELCOME_KEY = 'dsh-linked-workspace:welcome';
|
|
5881
|
+
|
|
5882
|
+
function welcomeSeen() {
|
|
5883
|
+
try {
|
|
5884
|
+
if (typeof window === 'undefined' || !window.localStorage) return true;
|
|
5885
|
+
return window.localStorage.getItem(WELCOME_KEY) === '1';
|
|
5886
|
+
} catch (error) {
|
|
5887
|
+
return true;
|
|
5888
|
+
}
|
|
5889
|
+
}
|
|
5890
|
+
|
|
5891
|
+
function welcomeRemember() {
|
|
5892
|
+
try {
|
|
5893
|
+
if (typeof window !== 'undefined' && window.localStorage) window.localStorage.setItem(WELCOME_KEY, '1');
|
|
5894
|
+
} catch (error) { /* storage unavailable: the card simply shows again */ }
|
|
5895
|
+
}
|
|
5896
|
+
|
|
5897
|
+
function WelcomeRow(props) {
|
|
5898
|
+
return h('div', { className: 'rw-welcome-row' },
|
|
5899
|
+
h('div', { className: 'rw-welcome-row-main' }, props.main),
|
|
5900
|
+
h('div', { className: 'rw-welcome-row-where' }, props.where));
|
|
5901
|
+
}
|
|
5902
|
+
|
|
5903
|
+
function WelcomeCard(props) {
|
|
5904
|
+
var locale = useLocale(props.ctx);
|
|
5905
|
+
var t = useMemo(function () { return makeT(locale); }, [locale]);
|
|
5906
|
+
var state = useState(function () { return !welcomeSeen(); });
|
|
5907
|
+
var open = state[0];
|
|
5908
|
+
var setOpen = state[1];
|
|
5909
|
+
function close() { welcomeRemember(); setOpen(false); }
|
|
5910
|
+
useEffect(function () {
|
|
5911
|
+
if (!open) return undefined;
|
|
5912
|
+
function onKey(event) {
|
|
5913
|
+
if (event.key !== 'Escape') return;
|
|
5914
|
+
event.preventDefault();
|
|
5915
|
+
event.stopPropagation();
|
|
5916
|
+
welcomeRemember();
|
|
5917
|
+
setOpen(false);
|
|
5918
|
+
}
|
|
5919
|
+
window.addEventListener('keydown', onKey, true);
|
|
5920
|
+
return function () { window.removeEventListener('keydown', onKey, true); };
|
|
5921
|
+
}, [open]);
|
|
5922
|
+
if (!open) return null;
|
|
5923
|
+
var rows = [
|
|
5924
|
+
{ main: t('welcomeCreate'), where: t('welcomeCreateWhere') },
|
|
5925
|
+
{ main: t('welcomeBrowse'), where: t('welcomeBrowseWhere') },
|
|
5926
|
+
{ main: t('welcomeTools'), where: t('welcomeToolsWhere') },
|
|
5927
|
+
{ main: t('welcomePassword'), where: t('welcomePasswordWhere') },
|
|
5928
|
+
];
|
|
5929
|
+
return h('div', {
|
|
5930
|
+
className: 'rw-welcome-backdrop',
|
|
5931
|
+
onMouseDown: function (event) { if (event.target === event.currentTarget) close(); },
|
|
5932
|
+
}, h('div', {
|
|
5933
|
+
className: 'rw-welcome',
|
|
5934
|
+
role: 'dialog',
|
|
5935
|
+
'aria-modal': 'true',
|
|
5936
|
+
'aria-label': t('welcomeTitle'),
|
|
5937
|
+
},
|
|
5938
|
+
h('button', {
|
|
5939
|
+
type: 'button',
|
|
5940
|
+
className: 'rw-welcome-x',
|
|
5941
|
+
'aria-label': t('close'),
|
|
5942
|
+
onClick: close,
|
|
5943
|
+
}, IconClose(14)),
|
|
5944
|
+
h('div', { className: 'rw-welcome-eyebrow' }, h('span', { className: 'rw-welcome-dot' }), t('welcomeEyebrow')),
|
|
5945
|
+
h('div', { className: 'rw-welcome-title' }, t('welcomeTitle')),
|
|
5946
|
+
h('div', { className: 'rw-welcome-lead' }, t('welcomeLead')),
|
|
5947
|
+
h('div', { className: 'rw-welcome-rows' }, rows.map(function (row, index) {
|
|
5948
|
+
return h(WelcomeRow, { key: String(index), main: row.main, where: row.where });
|
|
5949
|
+
})),
|
|
5950
|
+
h('div', { className: 'rw-welcome-foot' },
|
|
5951
|
+
h('a', {
|
|
5952
|
+
className: 'rw-btn rw-btn-primary',
|
|
5953
|
+
href: 'https://github.com/jiahui-huang1/dsh-linked-workspace',
|
|
5954
|
+
target: '_blank',
|
|
5955
|
+
rel: 'noreferrer',
|
|
5956
|
+
}, t('welcomeStar')),
|
|
5957
|
+
h('button', { type: 'button', className: 'rw-btn', onClick: close }, t('welcomeDone')))));
|
|
5958
|
+
}
|
|
5959
|
+
|
|
5825
5960
|
function DialogShell(props) {
|
|
5826
5961
|
return h('div', {
|
|
5827
5962
|
className: 'rw-dialog-backdrop',
|
|
@@ -7011,11 +7146,21 @@ function attributeViolation(name, value, tagName) {
|
|
|
7011
7146
|
|
|
7012
7147
|
function beginDragRow(side, event, info) {
|
|
7013
7148
|
if (!event.dataTransfer || !info) return;
|
|
7149
|
+
// Dragging one row of a multi-selection carries the whole selection, so
|
|
7150
|
+
// a single gesture can move or copy several entries at once.
|
|
7151
|
+
var picked = selectionFor(side).filter(function (item) {
|
|
7152
|
+
return item && typeof item.path === 'string';
|
|
7153
|
+
});
|
|
7154
|
+
var containsDragged = picked.some(function (item) { return item.path === info.path; });
|
|
7155
|
+
var entries = (containsDragged && picked.length > 1 ? picked : [{ path: info.path, name: info.name, isDir: Boolean(info.isDir) }])
|
|
7156
|
+
.map(function (item) {
|
|
7157
|
+
return { path: item.path, name: item.name, isDir: Boolean(item.isDir) };
|
|
7158
|
+
});
|
|
7014
7159
|
try {
|
|
7015
7160
|
event.dataTransfer.setData(DRAG_MIME, JSON.stringify({
|
|
7016
|
-
side: side, path: info.path, name: info.name, isDir: Boolean(info.isDir),
|
|
7161
|
+
side: side, path: info.path, name: info.name, isDir: Boolean(info.isDir), entries: entries,
|
|
7017
7162
|
}));
|
|
7018
|
-
event.dataTransfer.effectAllowed = '
|
|
7163
|
+
event.dataTransfer.effectAllowed = 'copyMove';
|
|
7019
7164
|
} catch (error) { /* drag payload unsupported */ }
|
|
7020
7165
|
}
|
|
7021
7166
|
|
|
@@ -7076,41 +7221,142 @@ function attributeViolation(name, value, tagName) {
|
|
|
7076
7221
|
var raw = '';
|
|
7077
7222
|
try { raw = transfer.getData(DRAG_MIME); } catch (error) { raw = ''; }
|
|
7078
7223
|
if (!raw) return;
|
|
7079
|
-
var
|
|
7080
|
-
try {
|
|
7081
|
-
if (!
|
|
7082
|
-
|
|
7083
|
-
|
|
7224
|
+
var payload;
|
|
7225
|
+
try { payload = JSON.parse(raw); } catch (error) { return; }
|
|
7226
|
+
if (!payload || typeof payload.path !== 'string') return;
|
|
7227
|
+
var entries = Array.isArray(payload.entries)
|
|
7228
|
+
? payload.entries.filter(function (item) { return item && typeof item.path === 'string'; })
|
|
7229
|
+
: [];
|
|
7230
|
+
if (entries.length === 0) entries = [{ path: payload.path, name: payload.name, isDir: Boolean(payload.isDir) }];
|
|
7231
|
+
if (payload.side === side) {
|
|
7232
|
+
moveEntries(side, entries, targetDir);
|
|
7084
7233
|
return;
|
|
7085
7234
|
}
|
|
7086
|
-
if (
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7235
|
+
if (payload.side === 'remote') {
|
|
7236
|
+
var files = entries.filter(function (item) { return !item.isDir; });
|
|
7237
|
+
if (files.length < entries.length) showNotice('error', t('dropDirUnsupported'));
|
|
7238
|
+
if (files.length > 0) pullEntries(files, targetDir);
|
|
7239
|
+
return;
|
|
7240
|
+
}
|
|
7241
|
+
var localFiles = entries.filter(function (item) { return !item.isDir; });
|
|
7242
|
+
if (localFiles.length < entries.length) showNotice('error', t('dropLocalDirUnsupported'));
|
|
7243
|
+
if (localFiles.length > 0) pushEntries(localFiles, targetDir);
|
|
7244
|
+
}
|
|
7245
|
+
|
|
7246
|
+
// Batch transfer: one request per entry, so a conflict is still answered
|
|
7247
|
+
// per file and a partial batch reports how many files actually landed.
|
|
7248
|
+
function pullEntries(entries, targetDir) {
|
|
7249
|
+
var done = 0;
|
|
7250
|
+
function settled() {
|
|
7251
|
+
if (done > 0) {
|
|
7252
|
+
showNotice('success', t('dropImported', { count: done }));
|
|
7253
|
+
refreshTree();
|
|
7090
7254
|
}
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7255
|
+
}
|
|
7256
|
+
function step(index) {
|
|
7257
|
+
if (index >= entries.length) { settled(); return; }
|
|
7258
|
+
var params = Object.assign({ path: entries[index].path, targetDir: targetDir }, scopeParams(scopeRef));
|
|
7259
|
+
apiCall('fs.pullToLocal', params).then(function () {
|
|
7260
|
+
done += 1;
|
|
7261
|
+
step(index + 1);
|
|
7262
|
+
}).catch(function (error) {
|
|
7263
|
+
if (openConflict(error, 'fs.pullToLocal', params)) return;
|
|
7264
|
+
settled();
|
|
7265
|
+
noticeError(error);
|
|
7266
|
+
});
|
|
7267
|
+
}
|
|
7268
|
+
step(0);
|
|
7269
|
+
}
|
|
7270
|
+
|
|
7271
|
+
function pushEntries(entries, targetDir) {
|
|
7272
|
+
var done = 0;
|
|
7273
|
+
var skipped = 0;
|
|
7274
|
+
function settled() {
|
|
7275
|
+
if (done > 0) {
|
|
7276
|
+
showNotice('success', t('dropImported', { count: done }));
|
|
7094
7277
|
refreshTree();
|
|
7278
|
+
}
|
|
7279
|
+
if (skipped > 0) showNotice('warn', t('dropSkipped', { count: skipped }));
|
|
7280
|
+
}
|
|
7281
|
+
function step(index) {
|
|
7282
|
+
if (index >= entries.length) { settled(); return; }
|
|
7283
|
+
var params = Object.assign({ path: targetDir, paths: [entries[index].path] }, scopeParams(scopeRef));
|
|
7284
|
+
apiCall('fs.upload', params).then(function (result) {
|
|
7285
|
+
if (Number(result && result.skipped) > 0) skipped += Number(result.skipped);
|
|
7286
|
+
else done += 1;
|
|
7287
|
+
step(index + 1);
|
|
7095
7288
|
}).catch(function (error) {
|
|
7096
|
-
if (openConflict(error, 'fs.
|
|
7289
|
+
if (openConflict(error, 'fs.upload', params)) return;
|
|
7290
|
+
settled();
|
|
7097
7291
|
noticeError(error);
|
|
7098
7292
|
});
|
|
7099
|
-
return;
|
|
7100
7293
|
}
|
|
7101
|
-
|
|
7102
|
-
|
|
7294
|
+
step(0);
|
|
7295
|
+
}
|
|
7296
|
+
|
|
7297
|
+
// Moves several entries into one directory (same side). Items already in
|
|
7298
|
+
// the target folder and folders dropped onto themselves are skipped.
|
|
7299
|
+
function moveEntries(side, entries, targetDir) {
|
|
7300
|
+
if (typeof targetDir !== 'string' || targetDir === '') return;
|
|
7301
|
+
var moving = entries.filter(function (entry) {
|
|
7302
|
+
if (!entry || typeof entry.path !== 'string' || entry.path === '') return false;
|
|
7303
|
+
if (entry.path === targetDir) return false;
|
|
7304
|
+
if (entry.isDir && pathUnder(targetDir, entry.path)) return false;
|
|
7305
|
+
return parentPathOf(entry.path, side) !== targetDir;
|
|
7306
|
+
});
|
|
7307
|
+
if (moving.length === 0) return;
|
|
7308
|
+
var blocked = openFiles.some(function (file) {
|
|
7309
|
+
if (file.side !== side || !fileDirty[file.key]) return false;
|
|
7310
|
+
return moving.some(function (entry) { return pathUnder(file.path, entry.path); });
|
|
7311
|
+
});
|
|
7312
|
+
if (blocked) {
|
|
7313
|
+
showNotice('error', t('moveDirty'));
|
|
7103
7314
|
return;
|
|
7104
7315
|
}
|
|
7105
|
-
var
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7316
|
+
var movedPaths = [];
|
|
7317
|
+
var firstError = null;
|
|
7318
|
+
function finish() {
|
|
7319
|
+
if (movedPaths.length > 0) {
|
|
7320
|
+
var keep = openFiles.filter(function (file) {
|
|
7321
|
+
return !(file.side === side && movedPaths.some(function (moved) { return pathUnder(file.path, moved); }));
|
|
7322
|
+
});
|
|
7323
|
+
setOpenFiles(keep);
|
|
7324
|
+
setActiveFileKey(function (activeKey) {
|
|
7325
|
+
var stillOpen = keep.some(function (file) { return file.key === activeKey; });
|
|
7326
|
+
if (stillOpen) return activeKey;
|
|
7327
|
+
return keep.length > 0 ? keep[keep.length - 1].key : null;
|
|
7328
|
+
});
|
|
7329
|
+
setFileDirty(function (previous) {
|
|
7330
|
+
var next = Object.assign({}, previous);
|
|
7331
|
+
openFiles.forEach(function (file) {
|
|
7332
|
+
if (file.side !== side) return;
|
|
7333
|
+
if (movedPaths.some(function (moved) { return pathUnder(file.path, moved); })) delete next[file.key];
|
|
7334
|
+
});
|
|
7335
|
+
return next;
|
|
7336
|
+
});
|
|
7337
|
+
setMulti([]);
|
|
7338
|
+
setDialog(null);
|
|
7339
|
+
refreshTree();
|
|
7340
|
+
showNotice('success', movedPaths.length === 1 ? t('moveDone') : t('moveDoneCount', { count: movedPaths.length }));
|
|
7341
|
+
}
|
|
7342
|
+
if (firstError) noticeError(firstError);
|
|
7343
|
+
}
|
|
7344
|
+
function step(index) {
|
|
7345
|
+
if (index >= moving.length) { finish(); return; }
|
|
7346
|
+
var entry = moving[index];
|
|
7347
|
+
var method = side === 'remote' ? 'fs.move' : 'local.move';
|
|
7348
|
+
var params = side === 'remote'
|
|
7349
|
+
? Object.assign({ path: entry.path, targetDir: targetDir }, scopeParams(scopeRef))
|
|
7350
|
+
: { path: entry.path, targetDir: targetDir, root: selected.localPath };
|
|
7351
|
+
apiCall(method, params).then(function (result) {
|
|
7352
|
+
movedPaths.push(result && result.path ? result.path : entry.path);
|
|
7353
|
+
step(index + 1);
|
|
7354
|
+
}).catch(function (error) {
|
|
7355
|
+
if (!firstError) firstError = error;
|
|
7356
|
+
step(index + 1);
|
|
7357
|
+
});
|
|
7358
|
+
}
|
|
7359
|
+
step(0);
|
|
7114
7360
|
}
|
|
7115
7361
|
|
|
7116
7362
|
function submitRenamed(side, oldPath, name) {
|
|
@@ -7133,49 +7379,6 @@ function attributeViolation(name, value, tagName) {
|
|
|
7133
7379
|
return normalized === parent || normalized.indexOf(parent + '/') === 0 || normalized.indexOf(parent + '\\') === 0;
|
|
7134
7380
|
}
|
|
7135
7381
|
|
|
7136
|
-
function moveEntry(side, oldPath, targetDir) {
|
|
7137
|
-
var blocked = openFiles.some(function (file) {
|
|
7138
|
-
return file.side === side && pathUnder(file.path, oldPath) && fileDirty[file.key];
|
|
7139
|
-
});
|
|
7140
|
-
if (blocked) {
|
|
7141
|
-
showNotice('error', t('moveDirty'));
|
|
7142
|
-
return;
|
|
7143
|
-
}
|
|
7144
|
-
var method = side === 'remote' ? 'fs.move' : 'local.move';
|
|
7145
|
-
var params = side === 'remote'
|
|
7146
|
-
? Object.assign({ path: oldPath, targetDir: targetDir }, scopeParams(scopeRef))
|
|
7147
|
-
: { path: oldPath, targetDir: targetDir, root: selected.localPath };
|
|
7148
|
-
apiCall(method, params).then(function (result) {
|
|
7149
|
-
var nextPath = result && result.path ? result.path : oldPath;
|
|
7150
|
-
setOpenFiles(function (previous) {
|
|
7151
|
-
return previous.filter(function (file) {
|
|
7152
|
-
return !(file.side === side && pathUnder(file.path, oldPath));
|
|
7153
|
-
});
|
|
7154
|
-
});
|
|
7155
|
-
setActiveFileKey(function (activeKey) {
|
|
7156
|
-
var stillOpen = openFiles.filter(function (file) {
|
|
7157
|
-
return file.key === activeKey && !(file.side === side && pathUnder(file.path, oldPath));
|
|
7158
|
-
});
|
|
7159
|
-
if (stillOpen.length > 0) return activeKey;
|
|
7160
|
-
var remaining = openFiles.filter(function (file) {
|
|
7161
|
-
return !(file.side === side && pathUnder(file.path, oldPath));
|
|
7162
|
-
});
|
|
7163
|
-
return remaining.length > 0 ? remaining[remaining.length - 1].key : null;
|
|
7164
|
-
});
|
|
7165
|
-
setFileDirty(function (previous) {
|
|
7166
|
-
var next = Object.assign({}, previous);
|
|
7167
|
-
openFiles.forEach(function (file) {
|
|
7168
|
-
if (file.side === side && pathUnder(file.path, oldPath)) delete next[file.key];
|
|
7169
|
-
});
|
|
7170
|
-
return next;
|
|
7171
|
-
});
|
|
7172
|
-
setDialog(null);
|
|
7173
|
-
showNotice('success', t('moveDone'));
|
|
7174
|
-
refreshTree();
|
|
7175
|
-
if (nextPath !== oldPath) refreshTree();
|
|
7176
|
-
}).catch(noticeError);
|
|
7177
|
-
}
|
|
7178
|
-
|
|
7179
7382
|
function submitNew(side, dirPath, name, isDir) {
|
|
7180
7383
|
var request = newEntryRequest(side, dirPath, name, isDir, scopeParams(scopeRef));
|
|
7181
7384
|
return apiCall(request.method, request.params).then(function () {
|
|
@@ -7224,6 +7427,14 @@ function attributeViolation(name, value, tagName) {
|
|
|
7224
7427
|
batch.forEach(function (item) { enqueueTransfer(item.side, item.path, item.name); });
|
|
7225
7428
|
} });
|
|
7226
7429
|
items.push({ label: t('ctxDeleteSelected', { count: batch.length }), onSelect: deleteSelection });
|
|
7430
|
+
if (batch.some(function (item) { return item.path === menu.path; })) {
|
|
7431
|
+
items.push({ label: t('ctxMoveSelected', { count: batch.length }), onSelect: function () {
|
|
7432
|
+
setDialog({
|
|
7433
|
+
kind: 'move', side: menu.side, entries: batch, name: menu.name, isDir: true,
|
|
7434
|
+
initialPath: parentPathOf(menu.path, menu.side),
|
|
7435
|
+
});
|
|
7436
|
+
} });
|
|
7437
|
+
}
|
|
7227
7438
|
items.push({ separator: true });
|
|
7228
7439
|
}
|
|
7229
7440
|
if (isRemote) {
|
|
@@ -7366,16 +7577,21 @@ function attributeViolation(name, value, tagName) {
|
|
|
7366
7577
|
h('button', { type: 'button', className: 'rw-btn rw-btn-sm rw-btn-danger', onClick: function () { resolveConflict('overwrite'); } }, t('conflictOverwrite'))));
|
|
7367
7578
|
}
|
|
7368
7579
|
if (dialog.kind === 'move') {
|
|
7580
|
+
var moveTargets = Array.isArray(dialog.entries) && dialog.entries.length > 0
|
|
7581
|
+
? dialog.entries
|
|
7582
|
+
: [{ path: dialog.path, name: dialog.name, isDir: dialog.isDir }];
|
|
7369
7583
|
return h(MoveDialog, {
|
|
7370
7584
|
t: t, locale: locale,
|
|
7371
7585
|
title: t('moveTitle'),
|
|
7372
|
-
message:
|
|
7586
|
+
message: moveTargets.length > 1
|
|
7587
|
+
? t('moveMessageMany', { count: moveTargets.length })
|
|
7588
|
+
: t('moveMessage', { name: dialog.name }),
|
|
7373
7589
|
side: dialog.side,
|
|
7374
7590
|
scope: dialog.side === 'remote' ? sourceScopeOf(selected) : null,
|
|
7375
7591
|
root: dialog.side === 'remote' ? selected.remotePath : selected.localPath,
|
|
7376
7592
|
initialPath: dialog.initialPath,
|
|
7377
7593
|
onClose: function () { setDialog(null); },
|
|
7378
|
-
onPick: function (targetDir) {
|
|
7594
|
+
onPick: function (targetDir) { moveEntries(dialog.side, moveTargets, targetDir); },
|
|
7379
7595
|
});
|
|
7380
7596
|
}
|
|
7381
7597
|
if (dialog.kind === 'closeDirty') {
|
|
@@ -9375,6 +9591,23 @@ function attributeViolation(name, value, tagName) {
|
|
|
9375
9591
|
console.error('[dsh-linked-workspace] settings icon registration failed', error && error.message ? error.message : error);
|
|
9376
9592
|
}
|
|
9377
9593
|
|
|
9594
|
+
// First-run welcome card: shell.overlay is the frame-wide floating layer,
|
|
9595
|
+
// so the card lands above every column without touching any panel.
|
|
9596
|
+
try {
|
|
9597
|
+
ctx.slots.inject('shell.overlay', function () {
|
|
9598
|
+
return ctx.slots.register({
|
|
9599
|
+
name: 'shell.overlay',
|
|
9600
|
+
id: 'linked-workspace-welcome',
|
|
9601
|
+
order: 80,
|
|
9602
|
+
label: function () { return makeT(readLocale(ctx))('welcomeTitle'); },
|
|
9603
|
+
}, function (props) {
|
|
9604
|
+
return h(WelcomeCard, Object.assign({}, props, { ctx: ctx }));
|
|
9605
|
+
});
|
|
9606
|
+
});
|
|
9607
|
+
} catch (error) {
|
|
9608
|
+
console.error('[dsh-linked-workspace] welcome card registration failed', error && error.message ? error.message : error);
|
|
9609
|
+
}
|
|
9610
|
+
|
|
9378
9611
|
try {
|
|
9379
9612
|
ctx.slots.inject('settings.section', function () {
|
|
9380
9613
|
return ctx.slots.register({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-linked-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
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",
|