Skip to content

[FEAT] Extra fields can hold several values, and a prefetch can split a group into entries - #160

Merged
TomPlanche merged 1 commit into
mainfrom
feat/multi-select-fields
Sep 6, 2026
Merged

TomPlanche merged 1 commit into
mainfrom
feat/multi-select-fields

Conversation

@TomPlanche

@TomPlanche TomPlanche commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • A scope is often a list: feat(records,pds,ui): .... A select field returns one value, so the second and third scope had to be typed by hand every time the exact combination was not already in the candidate list.
  • kind = "multi-select" turns the picker into a checklist. Space ticks the highlighted row, Enter confirms, and the ticked values become one template variable joined by separator (, by default). The ticked values are listed next to the prompt label, so they stay in sight when the row that holds one scrolls off the list.
  • While a filter is up, Enter ticks the highlighted row instead of confirming: typed text that was never ticked would otherwise be lost on the way out. So ui Enter ux Enter Enter picks two values without reaching for Space.
  • A Create "..." row is ticked like any other, and the created value joins the candidate list so it shows up ticked instead of vanishing with the filter that produced it.
  • prefetch.item_regex is the second stage the candidate list needed. extract_regex reads one value per match, so a subject line gives the whole records,pds,ui group. item_regex runs over each extracted value and splits it into its entries; deduplicate then applies to those entries, so the picker lists every scope used in the repository exactly once.
  • validation on a multi-select matches each ticked value on its own, never the joined result. required means at least one ticked value; an optional field with nothing ticked is skipped, exactly like (none).
[[extra_fields]]
name = "scope"
prompt = "Select scopes"
kind = "multi-select"
required = false
prefetch.source = "command"
prefetch.command = "git log -50 --pretty=format:%s"
prefetch.extract_regex = "\\w+\\((?P<value>[^)]*)\\):"
prefetch.item_regex = "[\\w-]+"
prefetch.deduplicate = true
$ Select scopes [ui, ux] ›
  [x] ui
  [ ] records
  [x] ux
  [ ] pds
  Space to tick, Enter to confirm

Notes

  • One picker serves both kinds: Mode::Single returns the accepted row, Mode::Multi returns every ticked value in the order it was ticked. select_or_create and the new select_or_create_many are the two entry points.
  • Space is the tick key, so a multi-select query cannot hold a space. Values that need one are typed into a text field instead.
  • The kind is spelled multi-select, and multiselect and multi_select are accepted as aliases.
  • item_regex is available to every field, not only a multi-select: a select field can use it to list the entries of a group as separate candidates.
  • Version bumped to 2.35.0. README, CLAUDE.md, and .rona.example.toml describe the new keys.

…ues, and a prefetch can split a group into entries
@TomPlanche
TomPlanche merged commit 462895b into main Sep 6, 2026
11 checks passed
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