tui: compact tool selector with bidirectional cycle navigation#977
Merged
njbrake merged 3 commits intonjbrake:mainfrom May 8, 2026
Merged
tui: compact tool selector with bidirectional cycle navigation#977njbrake merged 3 commits intonjbrake:mainfrom
njbrake merged 3 commits intonjbrake:mainfrom
Conversation
Fixes two issues with the New Session dialog tool selector: - Render: replace flat inline list (overflows on small terminals or with many custom agents) with a compact single-entry display showing the currently selected tool, a [current/total] counter, and ← → hints - Navigate: split the combined Left|Right handler so ← moves backward (wrapping) and → moves forward, matching standard UX conventions Before: Tool: ● claude ○ opencode ○ codex ○ gemini ○ copilot ○ cl-| After: Tool: ← ● cl-ki [6/10] →
Contributor
|
Thanks for the PR ! Can you edit the body to follow the template ? Otherwise the fix you are proposing sounds good, I am on my phone so I can't test it further right now |
Custom agents (defined in config.session.custom_agents) resolve to agent = None in get_agent() since they are not built-in. This caused the YOLO mode flag to be silently skipped for custom agents regardless of the YOLO toggle in the New Session dialog. Fix: fall back to detect_as (the agent_detect_as mapping already stored on the instance) when the primary get_agent lookup returns None. This lets custom agents inherit the correct YoloMode (e.g. CliFlag for claude, EnvVar for opencode) from their declared detect_as agent.
Address review feedback on PR njbrake#977: - mod.rs: collapse the duplicated Left / Right / Space tool-field arms into a single match arm with an inline direction switch, mirroring the neighboring profile_field handler. - render.rs: only render the ← / → cycle hints when the tool field is focused, so the unfocused row is less visually noisy. - tests.rs: add test_tool_selection_left_right_three_tools to actually exercise direction (the existing 2-tool test cannot distinguish forward from backward since wrap-around makes them look identical). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Description
This PR fixes three issues affecting custom agents (defined via
config.session.custom_agents) in the New Session dialog.Fix 1: Tool selector overflow (render.rs)
The dialog renders all tools in a single horizontal line. With 5+ built-ins plus custom agents, the line overflows — custom agents become invisible and unreachable.
Before:
After:
Fix 2: Bidirectional navigation broken (mod.rs)
Both
←and→performed the same action (forward increment).←was effectively broken.Split into two separate handlers:
→increments,←decrements with wrap-around.Fix 3: YOLO mode ignored for custom agents (instance.rs)
Custom agents are not in the built-in
AGENTSlist, soget_agent(&self.tool)returnsNonefor them. This caused the YOLO flag to be silently skipped regardless of the YOLO toggle in the dialog —apply_yolo_modewas never called.Fix: fall back to
self.detect_as(already stored on the instance fromagent_detect_asconfig) when the primary lookup returnsNone:This lets custom agents inherit the correct
YoloModefrom their declaredagent_detect_asagent (e.g.--dangerously-skip-permissionsforclaude).Changes
src/tui/dialogs/new_session/render.rs— compact selector display with countersrc/tui/dialogs/new_session/mod.rs— split Left/Right handler, fix←directionsrc/session/instance.rs— YOLO mode fallback viadetect_asfor custom agentsPR Type
Checklist
AI Usage
AI Model/Tool used: Claude Sonnet 4.6 via Claude Code CLI
Any Additional AI Details you'd like to share: All three bugs were discovered while using custom Ollama cloud model aliases with AOE. Fixes were implemented, built locally, and tested before submitting.