@@ -2,7 +2,7 @@ import React, { useMemo, useState } from "react";
22import { Box , Text , useApp , useInput , useStdin } from "ink" ;
33import type { Command } from "commander" ;
44import { useNavigate } from "react-router" ;
5- import { CommandKey } from "../router" ;
5+ import { CommandKey , isTuiCommandSupported } from "../router" ;
66import { Layout } from "./Layout" ;
77import { Divider } from "./ui/divider" ;
88import { TextInput } from "./ui/text-input" ;
@@ -44,18 +44,13 @@ export interface RouterScreenProps extends ScreenProps {
4444 // segment is the app root; the last is the command whose subcommands are the
4545 // menu options.
4646 path : string [ ] ;
47- // omit hides subcommands from the menu by name. The command tree still carries
48- // them (they remain usable from the CLI), but they are not offered here — used
49- // when the TUI intentionally does not route a command yet, so it can't fall
50- // through to the HelpScreen catch-all (which exits the app).
51- omit ?: string [ ] ;
5247}
5348
5449// RouterScreen renders the interactive command menu for a Router node: a filter
5550// input at the top and the node's subcommands (read straight off the Commander
5651// Command) as navigable options below. Selecting an option routes to that
5752// subcommand's screen.
58- export function RouterScreen ( { ctx, path, omit } : RouterScreenProps ) {
53+ export function RouterScreen ( { ctx, path } : RouterScreenProps ) {
5954 const navigate = useNavigate ( ) ;
6055 const { isRawModeSupported } = useStdin ( ) ;
6156 const { exit } = useApp ( ) ;
@@ -64,9 +59,9 @@ export function RouterScreen({ ctx, path, omit }: RouterScreenProps) {
6459 const options : Option [ ] = useMemo (
6560 ( ) =>
6661 command . commands
67- . filter ( ( c ) => ! omit ?. includes ( c . name ( ) ) )
62+ . filter ( isTuiCommandSupported )
6863 . map ( ( c ) => ( { name : c . name ( ) , description : c . description ( ) } ) ) ,
69- [ command , omit ] ,
64+ [ command ] ,
7065 ) ;
7166
7267 const [ query , setQuery ] = useState ( "" ) ;
0 commit comments