Method Picker UI Spec
Purpose
Replace schema type/method dropdown editing with a shared modal picker that supports:
- Fast search by command, summary, params, and examples
- Domain/Faker discovery with recent history
- Inline schema definition help (summary, params, examples)
- Light and dark theme support
Scope
Applies to both schema-editing surfaces:
- Generator schema rows
- Embedded test-data schema grid (Tabulator + AG Grid)
Functional Requirements
- Open picker from command/type editor cells and command row controls.
- Search input filters on:
- command key (
domain.method,helpers.method) - help summary
- parameter names
- help example text
- command key (
- Tabs:
All,Core, domain category tabs,Faker,Recently used. Coreincludes built-in schema primitives:enum,literal,regex.- Initial tab defaults by source type:
- faker rows open on
Faker - enum/literal/regex rows open on
Core - domain rows open on
All
- faker rows open on
- Selection applies only:
sourceType(domain/faker/enum/literal/regex)command
- Existing row
params/valuefields are preserved.
Information Architecture
- Left/center results list: command tiles with name, summary, source tag.
- Right details panel:
- Summary
- Schema heading/signature
- Parameter Details table (name/details) shown first
- Parameter Types table (name/type/required) shown second
- Example block
- Footer actions:
Cancel,Apply.
Keyboard + Accessibility
/focuses search when modal is open.Esccloses without applying.Enterin search selects top result.- Dialog uses
role="dialog"andaria-modal="true". - Search field and actions are keyboard reachable.
Theming
- Uses body theme classes already used by app:
body.theme-lightbody.theme-dark
- Modal styling is token-based via CSS custom properties (
--mp-*) with separate light/dark values. - Focus, contrast, selected state, and borders are theme-aware.
Data + Metadata Sources
- Command lists:
- domain: visible domain catalog (
getVisibleDomainCommands) - faker: approved
helpers.*commands - top-level schema types:
enum,literal,regex
- domain: visible domain catalog (
- Help metadata:
buildSchemaHelpModel(...)
State Model
- Modal local state:
- active tab
- search term
- selected command
- prepared options with prebuilt search text
- Persisted state:
- recent selections in localStorage key
anywaydata.method-picker.recent
- recent selections in localStorage key
Non-Goals
- No auto-population of
paramsorvalue. - No backend/API changes.
- No forced migration of existing schema text format.
Test Coverage Expectations
- Unit:
- Filtering and search match behavior
- Cancel vs apply behavior
- Metadata rendering (params/examples)
- Browser:
- Open, search, select, apply across both surfaces
- Existing generation flows continue working
- Theme readability in light/dark
Compatibility Notes
- Generator keeps a hidden command
<select>for interaction-test compatibility while the visible control is the new modal picker. - Grid editors commit through existing
success/stopEditingflows to preserve sync semantics.