Repository navigation
Conversation
When the Shell/SSH launcher or the command palette finds no match and the query looks like a host address, offer one "Add and connect" row. It opens a workspace overlay instead of navigating to Settings; the form's field order, wording and authentication segmented row mirror the Settings editor's basic form, and "More settings" hands the composed destination to the full editor. Persistence reuses the existing authorities (validate_ssh_destination, SshProfiles::save, the credential store) and then connects through add_ssh_terminal, so tab naming, the remote file drawer and host recording behave like any built-in connection. The overlay cannot collect private-key files, so a public-key profile is rejected with guidance instead of being written in a state that cannot connect. The palette action enum moves to workspace/palette_action.rs: the workspace root file sits at its line budget and the row actions belong beside the palette projection that renders them. Refs Kuddev#864.
Kuddev
left a comment
There was a problem hiding this comment.
The quick-add form can replace an existing host without going through its editor. For example, save deploy@box.example with a private key and a jump host, start quick-add for a different address, then edit the form to deploy@box.example and save. The search miss only opens the form; saving never rechecks the final destination. persist_quick_add constructs a new profile with empty keys and default connection options; SshProfiles::upsert replaces the existing profile for that exact destination. This discards the route, key paths, label and icon, then tries to connect using the replacement.
Please resolve duplicates against the final validated destination at save time. Reuse the saved profile for connecting or open it explicitly for editing. Add a regression that starts with a populated profile and asserts that it survives a quick-add collision. Also cover password storage failure: currently the profile file has already changed when the form reports the save error.
Saving a quick-add whose final validated destination already has a stored profile used to replace it wholesale (empty keys, default connection options), discarding private keys, jump route, label and icon, and then connected with the degraded replacement. Save now resolves duplicates first: an existing profile is reused untouched and the connect path picks it up by destination. Credentials are also written before the profile file, so a keychain failure leaves the host library exactly as it was instead of reporting an error over a half-written save.
|
All three points are addressed on head 19da736 (branch also merged current main first):
The decision and the rejected partial-success-message alternative are recorded in |
Kuddev
left a comment
There was a problem hiding this comment.
复核了 19da7363。在 Linux 用真实的主机库落盘和本版快捷保存逻辑测试,已有目标能原样复用,凭据没有写入。但两个窗口同时新建同一目标时,后保存失败的一方仍能覆盖另一方的密码。
我用临时主机库和注入的内存凭据库固定了顺序:A 读取主机库,B 保存同一目标及其密码,A 写密码后才调用 profiles.save。实际结果是 A 收到 Host profiles changed,主机库保留 B 的配置,凭据却已被 A 覆盖。独立的文件快照校验只保护主机库。请让主机重复检查、凭据写入和主机库提交遵循同一保存事务,补上这个交错顺序以及主机库写入失败后的凭据结果。测试用假的凭据存储即可。
当前 lint 还报 ssh_quick_add.rs 的格式差异,原生矩阵因此未启动。请按项目固定工具链跑 cargo fmt --all -- --check 后更新。
Two windows quick-adding the same destination could interleave as A loads the library, B saves profile and password, A writes its password, then A's commit fails on the changed file: the library kept B's profile while A had already overwritten B's credential. The duplicate check, the credential write and the library commit now run under the same OS-handle lifetime lease (SshProfiles::save_leased), so another window's save is rejected as lease-busy and retried on a fresh snapshot instead. When the commit itself fails, the credential is rolled back to its pre-transaction state: the prior password is restored, or the just-typed one is deleted. The credential seam is extended to the full transaction (CredentialOp), and the interleaving plus both rollback outcomes are pinned by tests. Test coverage also moved to the sibling ssh_quick_add/tests.rs module, and the note records the superseded credential-ordering decision. The stray rustfmt drift that kept the lint job red came from the local default toolchain (1.99.1) formatting two set_value calls differently than the pinned 1.97.1; cargo +1.97.1 fmt is clean now.
|
Both points are addressed on head 140d95c (branch also merged current main first):
Locally: 7 quick-add tests and 38 ssh_profiles tests pass; |
Kuddev
left a comment
There was a problem hiding this comment.
复核了 140d95c6。快捷添加持有租约时,另一窗口通过 SshProfiles::save 提交会收到 WouldBlock,上轮的主机库并发写入已被挡住。
保存失败的回滚 仍会删除没有修改过的凭据。wants_password 为 false 时跳过读取和写入,prior 却同样是 None,提交失败后就会调用 Forget。我在 Linux 用当前提交的保存函数、真实临时主机库和内存凭据夹具实测:在已存在锁文件、但目录禁止新建文件的情况下,自动认证与密码留空两种保存均报权限错误,且都删掉了该目标原有的测试密码;填写新密码的对照则正确恢复旧值。
请在本次凭据写入成功后才执行凭据回滚,区分「本次没写」和「写入前没有旧值」。回归可预置一条已有凭据,让主机库提交失败,确认自动认证和空密码不会调用删除接口。
The commit-failure rollback keyed on prior alone: a save that never writes a password (auto auth, or password auth with the field left empty) shares the prior=None shape with wrote-and-nothing-existed, so a failed commit called the delete path on a credential this transaction never touched — an existing password for the destination was wiped. Reproduced on Linux with a pre-seeded credential, an existing lock file and a read-only directory: both no-write saves errored on the commit and deleted the pre-existing password. The transaction now records whether it wrote a password at all; the restore/delete path only runs for a written one, and a no-write save reports the commit error with the credential untouched. Regression covers auto auth and empty-password saves through the same injection; the note records the narrowed rollback scope.
|
Fixed on head 5e6a130: the rollback is now keyed on what this transaction wrote, not on prior alone. |
…cfg budget The unix-only injection carried a platform cfg attribute, and the platform-cfg budget outside platform/ only ever shrinks (459 -> 460 failed CI lint). Gate on the runtime OS constant instead, following the existing workspace test pattern, and go through the chmod binary for the read-only directory so the file compiles on every platform while the injection still only runs on Unix.
Kuddev
left a comment
There was a problem hiding this comment.
复核了 9e69edb0。上次的凭据回滚问题已修复:在主机库写入失败时,自动认证、密码留空和填写新密码三种路径都保留了原凭据。
用这个提交构建并运行 Linux GPUI 后,确认启动器回车能打开预填表单,保存能创建一个 SSH 标签并发起连接。仍有一处键盘操作回归:在表单里按 Esc 后,表单会关闭,主机库没有写入;但焦点没有回到终端,接着输入的命令不执行,必须先点一下终端。
请在取消表单时把焦点交回活动窗格,并补一个键盘回归:打开「添加并连接」→ Esc → 直接输入命令,确认终端收到输入。也请检查「取消」按钮和点击遮罩这两条关闭路径。
Esc closed the overlay and left the host library untouched, but focus stayed with the dismissed overlay: the next typed command went nowhere until the user clicked the terminal first. The three cancel paths (Esc, the Cancel button, clicking the overlay mask) now funnel through cancel_ssh_quick_add, which hands focus back to the active pane via the workspace's focus_active. Save-and-connect and More-settings keep the old close_ssh_quick_add — the tab or settings page they open takes focus over itself, and the deferred refocus must not compete with it. The keyboard regression builds a real workspace over the terminal test fixture (a missing-shell pane with the test session) and pins the full chain: open the overlay from a focused terminal, Esc, focus is back on the terminal, then typing reaches the session as Msg::Input bytes.
|
Fixed on head f1a7e3b (the branch also merged current main first — the command-manager groups and i18n changes came in cleanly):
Local: 9 quick-add tests green including this regression; pinned-toolchain fmt, platform-cfg budget and the architecture gate clean. |
…host # Conflicts: # architecture/notes/pebrel_app/gpui_shell/workspace/2026-11-03-launcher-add-and-connect-ssh.md # architecture/notes/pebrel_app/gpui_shell/workspace/2026-11-13-quick-add-collision-reuse.md # pebrel_app/src/gpui_shell/workspace/palette_action.rs # pebrel_app/src/gpui_shell/workspace/ssh_quick_add.rs # pebrel_app/src/gpui_shell/workspace/ssh_quick_add/tests.rs
Result / 用户结果
Refs #864.
When the Shell/SSH launcher (Cmd/Ctrl+K) or the command palette finds no match and the typed query looks like a host address (contains
@or.), one fallback row appears: "添加并连接 {destination}". Enter opens a workspace-owned overlay — no navigation to Settings — prefilled from the typed text; "保存并连接" persists the host and immediately opens a connected tab, closing the overlay. Esc/backdrop cancels without touching the host library.Because the connection goes through
add_ssh_terminal, everything downstream behaves exactly like a built-in connection: tab naming, the remote file drawer (ready_ssh_destination), host recording (saved_hosts) and the connection pool.Design / 设计边界
filtered_palette_rowswhen filtering yields no rows (launcher and command palette share that projection). The row predicate is deliberately loose (@or., host segment ≥ 3 chars) because address validity is decided by save-time validation, not by the row.SegmentedRowin the same mode order). Divergence on purpose: no group/tags/notes block and no private-key file picker. Selecting "密钥" shows guidance; saving a public-key profile is rejected (KeysNeedAdvancedEditor) because an empty key list cannot connect. Complex configuration (proxy, jump, keys, icon, organization) stays with the full editor, reachable via "更多设置", which carries the composed destination into the Settings editor prefilled.validate_ssh_destination,join_destination_*,SshProfiles::save,ssh_credentials::store_password— writing the samessh_profiles.json; no second format, dependency, cross-layer interface or thread-model change. Persistence is split from connecting (persist_quick_add) so failures keep the overlay open with the reason.sshand~/.ssh/confighosts. Manual adds in Settings keep the existing auto-label behavior.workspace/palette_action.rs: the workspace root file sits at its line budget (2575/2575 before this change) and the row actions belong beside the palette projection that renders them.editor_input/editor_field/editor_hintare reused from the settings editor module (visibility widened topub(in crate::gpui_shell)), so the two forms share one rendering authority.hosts.add_and_connect,hosts.quick_add_*) with identical en-US/zh-CN placeholder sets.Evidence / 验证依据
Pinned Rust toolchain, macOS ARM, against
origin/mainafter merging937b7ae6:cargo test --locked -p nebula --bin pebrel --features gpui-test-support,gpui_platform/runtime_shaders:ssh_quick_add::tests— 3 passed: destination composition + port range + authority rejection; temp-file persistence asserting no auto label, Auto auth, and the public-key guard not overwriting a stored profile; prefill split.workspace::palette+shell_picker+launcher_menu— 11 passed (regression: row projection, launcher chips, menu dispatch).tools/i18n-contract): 24 passed, 1 ignored (existing manual benchmark).python3 scripts/check_architecture.py --base origin/mainpasses; no budget raised (workspace.rs 2575→2554 by the extraction).cargo fmt --all -- --check,git diff --checkclean.cargo check --locked -p nebula --bin pebrel --features gpui-shellpasses.Not run locally: native Windows/Linux keyboard acceptance, screenshots, multi-DPI visual checks. No hot-path allocation or platform-wide performance claim is made.
Required Review / 必须确认
CONTRIBUTING.md,docs/architecture.md, anddocs/project-constraints.md.python3 scripts/check_architecture.py --base <PR-base-commit>passes; budgets were not inflated to fit the change.