MCPcopy Create free account
hub / github.com/github/spec-kit / create_selection_panel

Function create_selection_panel

src/specify_cli/_console.py:174–194  ·  view source on GitHub ↗

Create the selection panel with current selection highlighted.

()

Source from the content-addressed store, hash-verified

172 selected_key = None
173
174 def create_selection_panel():
175 """Create the selection panel with current selection highlighted."""
176 table = Table.grid(padding=(0, 2))
177 table.add_column(style="cyan", justify="left", width=3)
178 table.add_column(style="white", justify="left")
179
180 for i, key in enumerate(option_keys):
181 if i == selected_index:
182 table.add_row("▶", f"[cyan]{key}[/cyan] [dim]({options[key]})[/dim]")
183 else:
184 table.add_row(" ", f"[cyan]{key}[/cyan] [dim]({options[key]})[/dim]")
185
186 table.add_row("", "")
187 table.add_row("", "[dim]Use ↑/↓ to navigate, Enter to select, Esc to cancel[/dim]")
188
189 return Panel(
190 table,
191 title=f"[bold]{prompt_text}[/bold]",
192 border_style="cyan",
193 padding=(1, 2)
194 )
195
196 console.print()
197

Callers 1

run_selection_loopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected