Description
This is a UI/UX issue. The current ApiUsage parameters input is a single freeform JSON textarea that punishes mistakes. Build a form-based params builder that lets users add typed key/value rows with a one-click "Switch to raw JSON" escape hatch, and keep both modes synchronized.
Requirements and Context
- Reference:
src/ApiUsage.tsx parameters block
- Each row exposes: key input, type selector (string/number/boolean), value input, remove button
- "Add parameter" button below the rows; live count of params shown next to the heading
- Switching from form -> raw should serialize current rows; raw -> form should attempt to parse and surface errors inline
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested Execution
- Fork the repo and create a branch
git checkout -b feature/api-usage-params-builder
- Implement changes
src/components/ParamsBuilder.tsx — new component owning rows state
src/ApiUsage.tsx — host the builder, lifted state for current params
src/index.css — .params-builder__row grid styles with token-driven borders
- Test and commit
- Manually add/remove/edit rows and verify the serialized JSON matches
- Toggle to raw, mutate, toggle back — assert errors are surfaced inline
npm test
Example commit message
feat: add form-based params builder to ApiUsage
Acceptance Criteria
Guidelines
- Follow WCAG 2.1 AA on row inputs (visible labels, error association)
- Use design tokens, no inline hex
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
This is a UI/UX issue. The current ApiUsage parameters input is a single freeform JSON textarea that punishes mistakes. Build a form-based params builder that lets users add typed key/value rows with a one-click "Switch to raw JSON" escape hatch, and keep both modes synchronized.
Requirements and Context
src/ApiUsage.tsxparameters blockSuggested Execution
src/components/ParamsBuilder.tsx— new component owning rows statesrc/ApiUsage.tsx— host the builder, lifted state for current paramssrc/index.css—.params-builder__rowgrid styles with token-driven bordersnpm testExample commit message
Acceptance Criteria
Guidelines