🔌 v0.21.0 — Forms, Dates & MCP
What's New
Form::RepeatableComponent
A dynamic field array for adding and removing nested form sets. Built with a Stimulus controller and wired into Rails accepts_nested_attributes_for out of the box. Supports min/max limits, animated add/remove transitions, _destroy-based soft deletion, and template-based new rows. A form builder shorthand (f.repeatable) keeps view code concise.
<%= midwest_form_with(model: @product) do |f| %> <%= f.repeatable(:variants, min: 1, max: 5) do |r| %> <%= r.input(:name, label: "Name") %> <%= r.input(:price, label: "Price", type: :number) %> <%= r.input(:sku, label: "SKU") %> <% end %><% end %>CalendarDateComponent
Date and time display tiles with range support. Renders single dates or date ranges as calendar-style tiles connected by an arrow separator. Features include an analog SVG clock face with accurate hour/minute hand rotation, formatted time text, custom strftime format mode, inline two-column time layout, vertical stacking, three sizes (sm/default/lg), and semantic state theming.
<%= midwest_calendar_date( start_date: "2026-06-24T14:30", end_date: "2026-06-26T09:00", show_time: true, clock: true) %>MCP Server (Alpha)
The first release of the Midwest Model Context Protocol server, providing AI-powered component assistance. Ships with four tools, a component metadata parser, and the midwest_mcp executable.
list_components— Full component catalog with categories, descriptions, and option/slot countsget_component_api— Detailed API for a specific component: options, slots, constants, and public methodssearch_components— Ranked keyword search across component names, descriptions, and capabilitiesget_component_examples— Lookbook preview examples with parameter annotations
The server is built on the mcp gem and uses lightweight regex-based parsing to extract component metadata without loading Rails.
What Changed
BreadcrumbComponent — as: :button render mode
Pass as: :button to render a breadcrumb as a <button> element instead of a link. Useful for breadcrumbs that trigger JavaScript actions — opening a dialog, navigating in a SPA, or controlling Stimulus targets.
<%= midwest_breadcrumb(title: "Edit", as: :button) %>Form::SelectComponent — no_clear: and resize: false
Two new options for finer control over select behavior. Pass no_clear: true to remove the blank option that allows clearing the selection. Pass resize: false to prevent the browser from allowing the user to resize the select element.
<%= midwest_select(name: :role, label: "Role", choices: roles, no_clear: true, resize: false) %>What Was Removed
Nothing removed.
Dev Process
MCP server infrastructure
The MCP server ships with a layered architecture: ComponentParser and PreviewParser extract metadata from Ruby source files via regex, ComponentIndex and SearchIndex provide lookup and ranked search, and four tool classes expose the data over the Model Context Protocol. All modules live under Midwest::MCP.
Coverage badge updated to 95%
Automated coverage badge updated via CI.
Expanded test coverage
New and updated test files:
Form::RepeatableComponentTest— nested attributes, add/remove, min/max limits,_destroysupport.CalendarDateComponentTest— single date, date ranges, clock face, sizes, states, string parsing.BreadcrumbComponentTest—as: :buttonrender mode.Form::SelectComponentTest—no_clear:andresize: falseoptions.Midwest::MCP::ComponentIndexTest— index build, find, category detection, helper name resolution.Midwest::MCP::ComponentParserTest— option, slot, constant, and method extraction.Midwest::MCP::PreviewParserTest— preview scanning and parameter annotation parsing.Midwest::MCP::SearchIndexTest— keyword ranking and category filtering.Midwest::MCP::ToolsTest— all four MCP tool responses.
System tests
Browser-level system test added for Form::RepeatableComponent covering add/remove interactions, limit enforcement, and animation behavior.