Skip to content

[FEAT] Select fields accept a value the candidate list does not hold - #159

Merged
TomPlanche merged 1 commit into
mainfrom
feat/better-picker
Sep 5, 2026
Merged

TomPlanche merged 1 commit into
mainfrom
feat/better-picker

Conversation

@TomPlanche

Copy link
Copy Markdown
Collaborator

Summary

  • A select extra field showed the prefetched candidates, then (none), then Other (enter manually). Every new scope went through that last row: move to it, press Enter, then type the value in a second prompt.
  • The new picker removes that detour. The typed text filters the list and becomes a Create "..." row. When nothing matches, that row is the only one and it is already selected, so a new value costs one Enter.
  • dialoguer::FuzzySelect returns one of the items it was built with and nothing else, so the picker is a new prompt in src/prompt/picker.rs. It draws itself on the terminal but renders every line through theme::prompt_theme(), so it looks like the other prompts.
  • Candidates rank by whole-string equality, then prefix, then substring, then scattered subsequence. Matching ignores case. Equal scores keep the order the prefetch returned.
  • (none) stays for an optional field, and returns no value. Arrow keys, Tab, Home, End, Backspace, and Del work. Esc and Ctrl-C cancel the prompt. A validation regex that rejects the value prints the message under the list and the prompt stays open.
$ Select scope › billin
⮕ Create "billing"

Fix found along the way

rona -g -i fell back to the built-in message format when the user skipped an optional extra field. build_commit_message validated the template against the fields that were answered, so {?scope} was an unknown variable as soon as the scope was absent:

WARNING: Template validation error: Unknown variable in conditional block: {?scope}
Using fallback format...
Message: [3] (feat on main) Tidy up

Validation now uses the declared commit_extra_fields, like rona branch and rona pr already did. The message is feat: Tidy up.

…ndidate list does not hold, typed and validated in place
@TomPlanche TomPlanche self-assigned this Sep 4, 2026
@TomPlanche TomPlanche added enhancement New feature or request fix labels Sep 4, 2026
@TomPlanche
TomPlanche merged commit 074a5e8 into main Sep 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant