feat(tui): command-line-only screens for every command without a TUI - #2194
Conversation
Every menu lists its subcommands without a screen below a "command line only" divider, and selecting one opens its help (CliOnlyScreen) instead of hiding it or exiting the TUI. One wildcard route replaces the project-only fallback and HelpScreen.
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Nice consolidation. Collapsing the two agentcore/project/* + * fallback routes into a single CommandFallbackScreen, deleting HelpScreen, and removing the showCliOnly toggle in favor of always showing CLI-only children below a divider makes the routing and menu behavior noticeably simpler. The added supportedTuiCommands(...) calls on the root, eval, and per-service routers correctly encode which children have screens, and the tests match the resulting ordering.
A few things I sanity-checked and they hold up:
CommandFallbackScreenno longer needsbasePath:resolveCommandstops at unknown segments andcommandPath()reconstructs the correct route, so/agentcore/gateway/no-such-commandstill lands on the gateway menu (covered by the new test).- The
menuEntrieshelper's regex (/^\s{1,3}(?:❯ )?\s*([a-z][a-z0-9-]*)\s{2,}\S/) is fine given every registered command has both a lowercase name and a non-empty description; thepadEnd(nameWidth) = longest + 3ensures ≥2 spaces before the description even for the longest name. - The generated
CLI_ONLYmatrix (>50 cases) exercises the escape-to-parent path across the whole tree, which nicely guards future additions.
No changes requested.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2194 +/- ##
=========================================
Coverage 97.08% 97.08%
=========================================
Files 544 544
Lines 37768 37772 +4
=========================================
+ Hits 36666 36671 +5
+ Misses 1102 1101 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AlexanderRichey
left a comment
There was a problem hiding this comment.
Looks good! But we hav some merge conflicts and I'm not sure we want to remove the HelpScreen fallback.
| <CommandFallbackScreen ctx={ctx} core={core} basePath={["agentcore", "project"]} /> | ||
| } | ||
| /> | ||
| <Route path="*" element={<HelpScreen ctx={ctx} core={core} />} /> |
There was a problem hiding this comment.
Are we sure we want to remove the HelpScreen fallback?
There was a problem hiding this comment.
Hmm good question. I think we should preserve it because if an unknown or a new route is introduced, we should have that as a fallback. Let me revert it
There was a problem hiding this comment.
added help screen back
…creens-everywhere # Conflicts: # src/handlers/eval/batch-evaluation/index.tsx # src/handlers/eval/index.tsx
|
Claude Security Review: no high-confidence findings. (run) |
Follow-up to #2177, for everything outside
project.Every menu now lists its subcommands without a screen below a
command line onlydivider, and selecting one opens its help via the existingCliOnlyScreen. Previously these were either hidden from the menu (create/update/delete,runtime logs/traces, mostevalmutators — 67 commands) or listed but exited the TUI with a help dump (feedback,config,update,eval ondemand/recommendation,batch-evaluation evaluate/simulate).RouterScreenalways partitions; theshowCliOnlyprop is gone.*route →CommandFallbackScreenreplaces theproject/*wildcard andHelpScreen(deleted).root,eval,batch-evaluationdeclare their screen-backed children viasupportedTuiCommands, like the other routers already do, so the menu labels them correctly.feedback/config/updatenever used the TUI middleware, so no CLI behaviour changes.menuEntriestest helper reads a menu frame into{screens, cliOnly}; the existing "offers only read-only commands" tests now assert placement instead of absence.CliOnlyScreen.test.tsxwalks the compiled Commander tree and checks every command-line-only command (currently 94) opens its menu or help andescreturns to the parent.KeyValueTable's parent is now a column box so long option terms don't wrap on wide terminals.bun test2944 pass;tsc,oxlint,prettierclean.