🔍 v0.16.0 — Autocomplete, Input Polish & Deep-Merge Fix
What's New
Form::AutocompleteComponent
A multi-select autocomplete field that renders each chosen option as a removable BadgeComponent token inside the input. Two modes:
- Data mode — pass a static
options:array and the component filters client-side. - Async mode — pass a
url:(or rely on the newMidwest::Autocompleteconcern to auto-mount the endpoint) and the component fetches suggestions on each keystroke via JSON.
Supports multiple: false for a single-value picker, values: for pre-populated tokens, and options with a support: key for secondary display text. Available in form_builder as f.autocomplete_field.
Midwest::Autocomplete controller concern
A Rails controller concern that exposes an autocomplete class macro. Declare it in any controller with key:, value:, support:, and theme: kwargs, and the concern mounts a JSON lookup endpoint automatically — no manual route or action required. Paired with a new Midwest::Routing module that hooks into the engine to register the generated route.
What Changed
BadgeComponent — pulse: option
A new pulse: boolean option adds an animated expanding ring around the dot indicator. Use with dot: true to draw attention to live status indicators and unread counts.
Form::InputComponent — prefix/suffix addons and character counter
with_prefixandwith_suffixslots render an icon or short label inside the input border — useful for currency symbols, units, URL prefixes, and search icons.- Setting
maxlength:now automatically shows a live character counter below the input. Passcounter: falseto suppress it.
BaseComponent — data: attributes deep-merged everywhere (fix #35)
Caller-supplied data: hashes are now always deep-merged with component defaults rather than overwriting them. This was a correctness bug affecting: BadgeComponent, BannerComponent, CardComponent, CarouselComponent, CountdownTimerComponent, DialogComponent, Form::FileComponent, Form::InputComponent, Form::RangeComponent, LiveSummaryComponent, and ProseComponent. A new deep_merge_data helper on OptionHelper centralises the merge logic.
What Was Removed
Nothing removed.
Dev Process
New test coverage
Form::AutocompleteComponent— full unit test suite plus a system test suite covering data mode, async mode, pre-selected tokens, single-select, keyboard navigation, and removal.Form::InputComponent— expanded tests for prefix/suffix addons and the character counter.BadgeComponent— pulse variant tests.OptionHelper— dedicated unit tests for thedeep_merge_datahelper.
Preview expansions
InputComponentPreview gained addons and counter scenarios. AutocompleteComponentPreview ships with six scenarios (default, async, preselected, single-select, with support text, and playground).
Roadmap relocated
roadmap.md.erb moved from demo/app/docs/changelog/ to demo/app/docs/ for better discoverability.