feat(web): explain a failed open, keep the dialog, and follow instance_state
Opening a project showed a toast on success and a bare code (`E_FORBIDDEN`) on failure: no reason, no retry, and a workspace card that kept claiming "Instance stopped" because `instance_state` frames were dropped by the socket layer. - The dialog validates a non-absolute path inline, sends `alias` (the field the daemon persists), maps the daemon's status/code/message to a specific sentence (`~` expansions, missing directory, roots allowlist, permissions), and keeps itself open on a spawn failure with the daemon's reason plus a retry that re-sends only `instance.ensure`. - `lib/ws` handles `instance_state` by invalidating `workspaces`/`health` (coalesced at 250 ms across sockets) so the grid reflects reality. - A never-started workspace renders as "not started · opens on demand" instead of "stopped", and a degraded/stopped instance shows `instance.reason`.
This commit is contained in:
1 parent
b95ff6055b
commit
d5d205a7eb
11 files changed
+673
-21
No files matched your search
@@ -667,11 +667,19 @@
|
||||
"workspaces.emptyText": "打开一个工作目录(cwd)开始。",
|
||||
"workspaces.emptyTitle": "还没有工作空间",
|
||||
"workspaces.enter": "进入 →",
|
||||
"workspaces.errPermission": "守护进程没有该目录的读写权限",
|
||||
"workspaces.errOutsideRoots": "这个路径不在守护进程允许的工作区根目录内",
|
||||
"workspaces.errNotFound": "服务器上找不到这个目录",
|
||||
"workspaces.errNotAbsolute": "请填入绝对路径,或以 ~/ 开头的路径",
|
||||
"workspaces.errInstanceUnknown": "服务器没有给出原因",
|
||||
"workspaces.errInstanceFailed": "工作区已添加,但 Neovim 实例没能启动:{reason}",
|
||||
"workspaces.errBadPath": "服务器不接受这个路径,请检查目录名后重试",
|
||||
"workspaces.hiddenHint": "这些条目默认不出现在列表中。",
|
||||
"workspaces.hideHidden": "隐藏 {n} 个隐藏项",
|
||||
"workspaces.idle": "空闲",
|
||||
"workspaces.instanceDegraded": "实例降级",
|
||||
"workspaces.instanceMissing": "工作目录不存在",
|
||||
"workspaces.instanceNotStarted": "未启动 · 打开时自动启动",
|
||||
"workspaces.instanceReady": "实例已就绪",
|
||||
"workspaces.instanceStarting": "实例正在启动",
|
||||
"workspaces.instanceStopped": "实例已停止",
|
||||
@@ -695,6 +703,7 @@
|
||||
"workspaces.reason.outside-roots": "根目录外",
|
||||
"workspaces.reason.stale": "长期未动",
|
||||
"workspaces.reason.temp": "临时目录",
|
||||
"workspaces.retry": "重试启动 Neovim",
|
||||
"workspaces.serverSummary": "{sessions} 个会话 · {running} 个运行中",
|
||||
"workspaces.sessionCount": "{n} 个会话",
|
||||
"workspaces.sessionCount.one": "{n} 个会话",
|
||||
|
||||
Reference in new issue
Block a user