tui: wire up reverse-forward adding via the a prompt - #12
Merged
Conversation
added 2 commits
June 19, 2026 15:56
The reverse_set field added to App was never initialized, breaking the build (E0063). Thread it through App::new, and use it: the `a` add prompt now routes a spec prefixed with `-R`/`--reverse` to ReverseSet::add as a reverse forward (mirroring the CLI flag). Both forward and reverse grammars use `->`, so the flag is the only disambiguator. Add reverse_flag_rest (matches the flag only as a whole token) with a unit test, and document the prefix in the add prompt and help overlay.
- 'a' then '-R <spec>' (or --reverse) adds a reverse forward - reverse rows are now selectable; the table selection spans forwards (→ <port>) then reverse (← <port>), with a unified Selection enum - 'd' drops and 'i' inspects whichever row is selected; o/y/v hint that they apply to forwards only on a reverse row - reverse detail card (no sparkline; reverse rates aren't sampled) - footer/help/README updated Test: reverse row renders, is selectable, and drops via the table.
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.
What
Fixes a build break in
src/tui.rsand finishes the in-progress feature it was part of.The
reverse_setfield onApphad been added but never initialized, so the build failed withE0063(./scripts/pm.sh build). Rather than just silence the resulting unused-field warning (which would fail CI'sclippy -D warnings), this wires the field up to the feature it was intended for.Changes
App::newnow takesreverse_set: Arc<ReverseSet>;run()and all test call sites updated.aadd prompt now routes a spec prefixed with-R/--reversetoReverseSet::add(...)as a reverse forward; without the prefix it stays a normal forward. The prefix is the disambiguator because both forward and reverse grammars use->— mirroring the CLI's-R/--reverseflag.reverse_flag_resthelper (matches the flag only as a whole token, so-R3000->3000isn't misread) with a unit test.Usage
In the TUI: press
a, then e.g.-R 3000->3000to bind a reverse forward on the remote.Testing
./scripts/pm.sh build— passescargo clippy --all-targets -- -D warnings— cleancargo fmt --check— cleancargo test --lib— 87 passedNote
I chose the
-Rprefix convention for the prompt since the field's comment only said "theaprompt can add reverse forwards" without specifying UX. If a dedicated reverse-add keybinding was intended instead, happy to switch.