Skip to content

[v0.2] Choose a saved profile as a jump hop in the form - #32

Merged
Lingbou merged 1 commit into
mainfrom
feat/jump-hop-field
Sep 30, 2026
Merged

Lingbou merged 1 commit into
mainfrom
feat/jump-hop-field

Conversation

@Lingbou

@Lingbou Lingbou commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Parent: #1

Closes #27

What changed

  • New Jump selector in the connection form, rendered inline as Jump ‹ … ›:
    • direct,
    • one entry per saved connection (shown by name, stored by id),
    • custom (n hops) for a pasted or already-saved chain.
  • FormState gains jump: JumpChoice { Direct, Profile(id), Custom }, derived from the saved chain when editing: empty → Direct, a single profile hop → that profile, anything else → Custom.
  • Left/Right (or Space) cycle the selector, matching the existing Authentication and key-source selectors; the field joins the Tab order between Port and Authentication.
  • draft() maps the choice back to a chain. A chain pasted into the Host field still wins over the selector, because that paste is explicit input — the existing paste tests keep passing unchanged.
  • A reference that no longer resolves renders as missing (<id>) in the form, which is the same wording the browse detail uses.

Layout

This is where the ticket earned its keep. The form is a fixed-height stack with hard-coded body heights per auth mode, and the first attempt (a hint row, a selector row, and a blank separator) broke four layout regressions — at 56x22 and at 40 columns the public-key box was pushed out of the visible body. The shipped version is a single inline row, which costs exactly one row: the jump block reuses the row structure above Authentication, and every body_height grows by one. editor_stays_content_sized_on_large_terminals was updated to the new content height (20 → 21) because that is precisely what it measures.

Verification

  • cargo test --all-targets --locked (123 lib tests plus every integration suite), cargo clippy --all-targets --all-features --locked -- -D warnings, cargo +1.88.0 check --all-targets --locked, cargo fmt --check.
  • New coverage: selector cycling order, saving a chosen profile as the only hop, direct clearing a saved chain, pasted chain beating the selector, editing profile-backed and pasted chains, form rendering of a selected profile and of a missing one, and the layout regressions that pinned the sizing.

The connection form gains a Jump selector: direct, one entry per saved
connection, and custom for a pasted or already-saved chain. Pasting a
chain into Host still wins, editing a profile-backed hop selects that
profile, and an unresolvable reference is shown rather than hidden.

Refs #27

Signed-off-by: Xingqiu Xu <hilbertanjou83@gmail.com>
@Lingbou
Lingbou merged commit b74d31f into main Sep 30, 2026
11 checks passed
@Lingbou
Lingbou deleted the feat/jump-hop-field branch September 30, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v0.2] Choose a saved profile as a jump hop in the form

1 participant