Add guided params editor to schema UI#206
Conversation
|
Warning Review limit reached
More reviews will be available in 45 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughAdds a guided params-editor modal to the shared schema row editor. A new ChangesGuided Params Editor Dialog
Sequence Diagram(s)sequenceDiagram
participant User
participant SchemaEditorUI
participant SharedSchemaEditorController
participant openParamsEditorModal
participant buildParamsTextFromEditorEntries
User->>SchemaEditorUI: clicks edit-params button on enum row
SchemaEditorUI->>SharedSchemaEditorController: handleClick [data-action="edit-params"]
SharedSchemaEditorController->>openParamsEditorModal: { commandLabel, helpModel, initialParams, validateParams }
openParamsEditorModal-->>User: renders overlay + per-param input table
User->>openParamsEditorModal: fills "values" input, clicks Apply
openParamsEditorModal->>buildParamsTextFromEditorEntries: build final params text
buildParamsTextFromEditorEntries-->>openParamsEditorModal: "(active,inactive,pending)"
openParamsEditorModal-->>SharedSchemaEditorController: Promise resolves with params text
SharedSchemaEditorController->>SchemaEditorUI: update row params, clear issues, re-render, sync schema text
SchemaEditorUI-->>User: params input shows "(active,inactive,pending)", schema text updated
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds a guided “params editor” dialog to the shared schema editor UI so users can safely edit documented command params via a structured form while still allowing direct raw text editing. It also wires semantic validation into the dialog flow and extends unit/Storybook/Playwright coverage around the new interaction.
Changes:
- Introduces a params editor modal that parses existing params, formats values into valid command syntax, and blocks apply on validation errors.
- Adds a params “settings” button beside the params textbox (enabled only when documented params exist) and connects it to the shared schema editor controller.
- Expands coverage with focused modal/controller/view tests, Storybook play coverage, and Playwright page-object + functional test support.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core-ui/src/tests/utils/params-editor-modal.test.js | New unit tests for params parsing/formatting and modal interaction states. |
| packages/core-ui/src/tests/shared/shared-schema-editor-ui.test.js | Verifies params control/button rendering and disabled state when no documented params exist. |
| packages/core-ui/src/tests/shared/shared-schema-editor-controller.test.js | Adds controller test ensuring dialog output is applied back into the row’s params field. |
| packages/core-ui/src/tests/shared/shared-schema-definition-view.test.js | Adds view-level test for guided params editing end-to-end within the shared component. |
| packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.js | Implements the guided params editor modal (parsing, preview, apply/cancel, validation hook). |
| packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.css | Adds modal styling and theme variables for light/dark modes. |
| packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-ui.js | Adds params control wrapper + edit-params button (enabled only when params metadata exists). |
| packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js | Wires edit-params click handling to open the modal and revalidate/apply returned params text. |
| packages/core-ui/js/gui_components/shared/domain-command-help-metadata.js | Adds documented args metadata for datatype.enum to drive the guided params table. |
| docs/frontend-component-migration-plan.md | Updates documentation to mention the new guided params dialog capability in the shared editor. |
| apps/web/styles.css | Updates responsive layout to accommodate the new params control wrapper and button styling. |
| apps/web/src/tests/browser/shared/abstractions/components/schema-editor.component.js | Extends Playwright schema editor page-object with a helper to edit params via the dialog. |
| apps/web/src/tests/browser/shared/abstractions/components/params-editor-dialog.component.js | New Playwright page-object for interacting with the params editor dialog. |
| apps/web/src/tests/browser/generator/functional/schema-edit.spec.js | Adds functional Playwright coverage for editing documented params via the guided dialog. |
| apps/web/src/stories/shared-schema-definition.stories.js | Adds a Storybook story + play function demonstrating the guided params dialog workflow. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bab03ae90
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR adds a guided params editor dialog to the shared schema editor, letting users fill named fields for documented command params and apply a validated, auto-formatted params string — while keeping the raw text input available for undocumented commands.
Confidence Score: 5/5Safe to merge. The change is additive (new modal, new button, new tests), the three previously flagged issues were all addressed in this iteration, and no new logical defects were found. All parsing, formatting, and modal lifecycle logic was traced through; round-trips for positional, named, and variadic params are correct, HTML escaping in attribute contexts is applied consistently, and the getMethodPickerOptions guard prevents silent crashes on misconfigured consumers. The previous thread concerns (data-role selectors, swallowed errors, missing function guard) are resolved. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "Refine params editor dialog behavior" | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@apps/web/src/tests/browser/shared/abstractions/components/params-editor-dialog.component.js`:
- Around line 14-16: In the valueInput method, the name parameter is used
directly in a RegExp constructor without escaping regex metacharacters, which
will cause special characters like dots, asterisks, brackets, and parentheses to
be interpreted as regex syntax instead of literal characters. Escape the name
parameter using a utility function that replaces regex metacharacters with their
escaped equivalents before constructing the RegExp pattern in the return
statement.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2cd9ff35-8477-4fb8-b696-6b066d768bd7
📒 Files selected for processing (15)
apps/web/src/stories/shared-schema-definition.stories.jsapps/web/src/tests/browser/generator/functional/schema-edit.spec.jsapps/web/src/tests/browser/shared/abstractions/components/params-editor-dialog.component.jsapps/web/src/tests/browser/shared/abstractions/components/schema-editor.component.jsapps/web/styles.cssdocs/frontend-component-migration-plan.mdpackages/core-ui/js/gui_components/shared/domain-command-help-metadata.jspackages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.jspackages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-ui.jspackages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.csspackages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.jspackages/core-ui/src/tests/shared/shared-schema-definition-view.test.jspackages/core-ui/src/tests/shared/shared-schema-editor-controller.test.jspackages/core-ui/src/tests/shared/shared-schema-editor-ui.test.jspackages/core-ui/src/tests/utils/params-editor-modal.test.js
Summary
Testing
Fixes #202
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests