Make focusing a service view edit mode - #1144
Merged
Merged
Conversation
Focusing a service view is now editing it. Every path that selects a service — /serve, /service edit, the title menu, a click, a pane focus move, a session-list row — leaves its editor open, so the old view-only state (and the extra keystroke to leave it) is gone. /serve also closes the orchestrator panel it was typed into, which used to keep swallowing every keystroke aimed at the new view. With no view-only state to close back into, Esc reverts unsaved edits and, once there is nothing to revert, hands keyboard focus back to the session list with the editor still open. A trailing `*` on the pane title says whether what is on screen has been saved; channel attach/detach goes straight to the daemon and never counts as unsaved. The redundant "Channels" definition row is gone — the Channels section below it already lists them. The view is now one navigable list: fields, then channel rows, then routed session rows, wrapping back. Enter on a routed session opens it, matching a click.
Renaming a service that has not been saved yet left the pane pointing at the old name, so the view rendered "service definition is no longer available" while the editor was still open behind it. The selection now follows the Name field while a service is being created.
Contributor
Author
After (recording)Recorded with vhs against an isolated daemon (
The GIF blob is committed on this branch only so the link resolves; it is removed in the next commit (the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Three UX fixes to the TUI service create/edit view.
1. Focusing a service view is edit mode
There is no longer a read-only service view the operator has to step out of. Every path that selects a service —
/serve,/service edit, the title menu, a click on the pane, a pane-focus move (C-x o, windmove), the session-list row — leaves the editor open on that service. Selection is the hook (select_service/focus_main_window), not each individual call site, so new entry points get this for free./serve [name]additionally dismisses the minibuffer. It's normally typed into the orchestrator panel, which stayed open and swallowed every keystroke aimed at the brand-new view.Since Esc can no longer "close to view-only", it now means:
The editor also stopped closing itself to make room for
C-xchords; it stands aside for the chord continuation instead, so the view stays in edit mode across global commands.2. Unsaved marker in the title
The pane title is now
service: assistant*while what's on screen differs from what the daemon last confirmed.ServiceDialogcarries asavedbaseline, refreshed everywhere a daemon-confirmed definition is adopted. A Create-mode service counts as unsaved until its first save. Channel attach/detach goes straight to the daemon and is excluded from the comparison, so toggling a channel never leaves a stale dirty flag.3. Channels row removed; Down walks State → Channels → Sessions
The "Channels" definition row was redundant with the Channels section below it, so the fields are now Name, Instruction, Harness, Model, Working dir, Routing, State. The view is one continuous navigable list: fields → channel catalog rows → routed session rows → wrap. Up/BackTab and
C-n/C-pfollow the same order (the oldselected_field == 6special case is gone).Selection is modelled explicitly as
ServiceDialogFocus::{Field, Channel, Session}rather than overloading a field index alongside a separate channel index. All channel-row actions are unchanged (Space attach/detach,acreate,e/Enter edit,ddelete,rrotate,p/o/ypublication). New: Enter on a routed session row opens that session, matching a click. With an empty catalog the "no channels" line stays navigable soa/Enter can still reach channel creation by keyboard.Spec
specs/0175-service-view-focus-is-edit-mode.md.Testing
cargo test -p construct-cli— 1320 passed (existingservice_view_*tests updated; new coverage for/servelanding focused + editing, the*marker appearing/clearing/reverting, and Down walking State → channel rows → session rows).cargo test --workspace— one pre-existing failure,playbook_selection_fork_run_delivers_and_submits_prompt("annotated block should shimmer"), which reproduces identically onmainat aa3229e and is unrelated to this change.