Skip to content

feat(tui): multi-select confirm button + space/enter to toggle#507

Open
gewenyu99 wants to merge 3 commits into
mainfrom
posthog-code/multi-select-confirm-button
Open

feat(tui): multi-select confirm button + space/enter to toggle#507
gewenyu99 wants to merge 3 commits into
mainfrom
posthog-code/multi-select-confirm-button

Conversation

@gewenyu99
Copy link
Copy Markdown
Collaborator

@gewenyu99 gewenyu99 commented Jun 4, 2026

Problem

In the wizard's multi-select forms, Space toggled an option but Enter submitted the whole screen. People (including the team) repeatedly got tripped up by this — they'd hit Enter expecting it to act on the focused item and instead jump to the next screen. The ask was to move to a single, Claude-Code-style pattern: Enter/Space both act on the focused row, and there's an explicit "Confirm" button you navigate to and press Enter on to proceed.

Changes

Introduces one shared interaction model for all multi-select surfaces:

  • Space OR Enter toggles the focused option — both keys do the same thing, removing the "space toggles / enter advances" split.
  • A new ConfirmButton primitive (the "physical button") renders just past the last option. Arrow navigation walks the cursor onto it (top/bottom wrap onto the button).
  • Pressing Space/Enter while on the Confirm button submits the current selection.
  • Removes the old "Enter anywhere submits" behavior, including the implicit "auto-pick the hovered item when nothing is selected" magic.

Applied to both multi-select primitives:

  • PickerMenu (mode="multi")
  • GroupedPickerMenu (also accounts for the button's height in its scroll budget)

Also: adds the ConfirmButton barrel export, a static showcase in the Layout playground demo, updated KeyboardHints demo hint labels, and documents the pattern in the ink-tui PRIMITIVES skill reference. Single-select (PickerMenu default) is unchanged — Enter already selects there.

Screen.Recording.2026-06-04.at.9.06.02.PM.mov

Test plan

  • pnpm build && pnpm test && pnpm lint — build clean, 728/728 unit tests pass (one pre-existing flaky CLI-timeout test passes in isolation), 0 lint errors.
  • Manual: pnpm try --playgroundInput and KeyHints tabs exercise the multi-select + grouped flows; Layout tab shows the ConfirmButton focused/unfocused states.

Created with PostHog Code

Multi-select menus previously used space to toggle and enter to submit,
which repeatedly confused users who expected enter to act on the focused
item. Replace that split with a single, predictable interaction model
shared by both multi-select primitives:

- space OR enter toggles the focused option (both keys do the same thing)
- a new focusable ConfirmButton renders just past the last option; arrow
  navigation walks onto it (top/bottom wrap onto the button)
- pressing space/enter on the button submits the current selection

This removes the old "enter anywhere submits" behavior (including the
implicit "auto-pick the hovered item when nothing is selected" magic).

Adds the ConfirmButton primitive, applies the pattern in PickerMenu
mode="multi" and GroupedPickerMenu, accounts for the button's height in
the grouped menu's scroll budget, updates the playground demos and the
ink-tui PRIMITIVES skill doc.

Generated-By: PostHog Code
Task-Id: 23c3cdf8-4173-4407-be82-6f2e5078b3c9
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci error-tracking-upload-source-maps
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci error-tracking-upload-source-maps/android
  • /wizard-ci error-tracking-upload-source-maps/flutter
  • /wizard-ci error-tracking-upload-source-maps/ios
  • /wizard-ci error-tracking-upload-source-maps/next
  • /wizard-ci error-tracking-upload-source-maps/next-no-posthog
  • /wizard-ci error-tracking-upload-source-maps/node-raw
  • /wizard-ci error-tracking-upload-source-maps/node-rollup
  • /wizard-ci error-tracking-upload-source-maps/node-rollup-typescript-plugin
  • /wizard-ci error-tracking-upload-source-maps/node-webpack
  • /wizard-ci error-tracking-upload-source-maps/nuxt-3-6
  • /wizard-ci error-tracking-upload-source-maps/nuxt-4-3
  • /wizard-ci error-tracking-upload-source-maps/react-native
  • /wizard-ci error-tracking-upload-source-maps/react-vite
  • /wizard-ci error-tracking-upload-source-maps/rust
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

@gewenyu99
Copy link
Copy Markdown
Collaborator Author

To be honest, I like the original controls the best if we just retained the control hints 🤷 These are always confusing and many more arrow clicks :P

Alternative style i tried.
https://github.com/user-attachments/assets/7a139bf5-8c1f-4294-a476-fe59013b61b8

Screen.Recording.2026-06-04.at.9.00.40.PM.mov

@gewenyu99 gewenyu99 marked this pull request as ready for review June 5, 2026 01:09
@gewenyu99 gewenyu99 requested review from a team and Twixes June 5, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant