| 469 | const items = createMemo<CommandEntry[]>(() => match(query(), entries())) |
| 470 | const menu = createFooterMenuState({ count: () => items().length, limit: PANEL_LIST_ROWS }) |
| 471 | const pick = (item: CommandEntry) => { |
| 472 | if (item.action === "model") { |
| 473 | props.onModel() |
| 474 | return |
| 475 | } |
| 476 | |
| 477 | if (item.action === "editor") { |
| 478 | props.onEditor() |
| 479 | return |
| 480 | } |
| 481 | |
| 482 | if (item.action === "skill") { |
| 483 | props.onSkill() |
| 484 | return |
| 485 | } |
| 486 | |
| 487 | if (item.action === "subagent") { |
| 488 | props.onSubagent() |
| 489 | return |
| 490 | } |
| 491 | |
| 492 | if (item.action === "queued") { |
| 493 | props.onQueued() |
| 494 | return |
| 495 | } |
| 496 | |
| 497 | if (item.action === "variant.cycle") { |
| 498 | props.onVariantCycle() |
| 499 | return |
| 500 | } |
| 501 | |
| 502 | if (item.action === "variant.list") { |
| 503 | props.onVariant() |
| 504 | return |
| 505 | } |
| 506 | |
| 507 | if (item.action === "exit") { |
| 508 | props.onExit() |
| 509 | return |
| 510 | } |
| 511 | |
| 512 | if (item.name === "new") { |
| 513 | props.onNew() |
| 514 | return |
| 515 | } |
| 516 | |
| 517 | props.onCommand(item.name) |
| 518 | } |
| 519 | const select = () => { |
| 520 | const item = items()[menu.selected()] |
| 521 | if (!item) { |