Repository navigation
feat(tui): start a session from the composer and the navigator tab row - #701
Merged
Merged
Conversation
Starting a session required knowing `n` while the Sessions tab held the keyboard, or `F3` then `n`. Nothing on screen said so, and the composer — one printable key from anywhere — had no create verb at all. `/new` adds that verb to the palette. The navigator's tab row gains a `+` cell as its third stop: `←`/`→` walk `Sessions · Files · +` and halt at each end rather than wrapping, `Enter` activates the stop, and the cell is clickable. It is not a tab — it never takes the active tab's ground, so the tab bar keeps showing which tab is active, and the row's cursor is the only thing that marks it. All three surfaces run one `create_session_now`, which replaced three copies of the same supervisor command. Creation stays prompt-less on purpose: a prompt is what parks creation on the trust modal, and the session is named from the first prompt submitted in its composer. Outside a repository `/new` explains what to do instead of answering with the generic "Sessions are unavailable". The cell's three columns come from the `Files` tab, the only elastic box on the row, so the needs-you badge needs three more columns before it reappears beside it.
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.
Why
Starting a session required knowing
nwhile the navigator'sSessionstab already held the keyboard, orF3thenn. Nothing on screen said so, and the composer — one printable key from anywhere — had no create verb at all.What
/newin the composer palette. A fresh session with no focus change needed: the composer is one printable key away from every block, and the verb works at any terminal width, including widths where the navigator has collapsed to the status-row chip.A
+cell on the navigator tab row. The row now has three stops instead of two:←/→walkSessions · Files · +and halt at each end rather than wrapping, so movement always matches what is drawn.↑still lands on the tab on screen, never on+.Enteractivates the stop: a tab steps back into its pane (unchanged),+creates a session. Resting on+moves nothing else — the active tab keeps its ground and the pane under the row keeps the keys.Ctrl+1/Ctrl+2/Ctrl+Eretarget the cursor with the tab they switch to, so it can never rest on a tab that is no longer the active one.One create verb.
n,+, and/newall run a singlecreate_session_now, which replaced three copies of the same supervisor command. Creation stays prompt-less on purpose: a prompt is what parks creation on the trust modal, and the session is named from the first prompt submitted in its composer. Outside a repository,/newsays/new needs a repository · /fork starts a separate conversation hereinstead of the genericSessions are unavailable.The one tradeoff
The cell's three columns come from the
Filestab, the only elastic box on the row, so the needs-you badge needs three more columns before it reappears beside the cell — frames around 126–139 columns lose the badge while viewingFiles. Frames ≥ 140 are unaffected. Below the widthlayout.rslays the navigator out at, the cell is dropped and skipped as a cursor stop, so the frame and the keyboard cannot disagree.Design doc
FORGE-DESIGN.md§7.7, the §8.3 binding table and prose, and §9.6 chrome describe the new stop, its focus treatment, and why the cell never takes the active-tab ground (the tab bar must keep showing which tab is active).README.mdgains/newin the command list, the row's bindings in the key table, and a sentence in Sessions and resume.Testing
9 new tests:
crates/forge-tui/src/widgets/navigator.rs— the cell is painted with its own frame and joints, never takes a tab's active ground, steps to accent only as the row's cursor, takes hover, and is dropped when the row is too narrow.crates/forge-tui/src/app/tests/multi_task.rs— the keyboard ring andEnter, the click (which must beat theFilestab branch the cell sits inside), the chord retarget, and the drawn frame matching the pointer's hit target.crates/forge-tui/src/app/tests/mouse.rs— a move over the cell sets the cell's hover and not theFilestab's.Green locally:
widgets::164,app::tests::multi_task::43,app::tests::mouse::28,app::tests::focus::36,app::tests::commands::70, plus theme/workspace/approval/explorer/questions/characterization.cargo fmt --all -- --checkandcargo clippy -p forge-tui --all-targets --locked -- -D warningsclean.