Skip to content

Add guided params editor to schema UI#206

Merged
eviltester merged 10 commits into
masterfrom
202-params-ui
Jun 14, 2026
Merged

Add guided params editor to schema UI#206
eviltester merged 10 commits into
masterfrom
202-params-ui

Conversation

@eviltester

@eviltester eviltester commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a guided params editor dialog to the shared schema editor while keeping direct text editing available
  • validate and format documented params into valid command syntax, with Storybook coverage and browser/page-object support
  • add focused controller/view/modal tests plus Playwright coverage for guided params editing

Testing

  • pnpm run verify:local
  • pnpm run verify:ui
  • pnpm run test:browser
  • pnpm run test:storybook
  • pnpm run build-storybook

Fixes #202

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a guided parameters editor dialog for commands with documented parameters, enabling structured parameter entry with validation instead of raw text formatting.
  • Documentation

    • Updated component migration plan to document the new guided parameter-entry capability.
  • Tests

    • Added comprehensive test coverage including browser and component tests for the new parameters editor dialog.

Copilot AI review requested due to automatic review settings June 14, 2026 00:20
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@eviltester, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 97f0ee30-d473-404c-937a-aa507e947654

📥 Commits

Reviewing files that changed from the base of the PR and between 5bab03a and 0956d00.

📒 Files selected for processing (15)
  • apps/web/src/stories/shared-schema-definition.stories.js
  • apps/web/src/tests/browser/shared/abstractions/components/params-editor-dialog.component.js
  • docs/frontend-component-migration-plan.md
  • packages/core-ui/js/gui_components/shared/domain-command-help-metadata.js
  • packages/core-ui/js/gui_components/shared/test-data/help/help-model-builder.js
  • packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js
  • packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-ui.js
  • packages/core-ui/js/gui_components/shared/test-data/ui/method-picker-modal.js
  • packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.css
  • packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.js
  • packages/core-ui/src/tests/shared/help-model-builder.test.js
  • packages/core-ui/src/tests/shared/shared-schema-definition-view.test.js
  • packages/core-ui/src/tests/shared/shared-schema-editor-controller.test.js
  • packages/core-ui/src/tests/utils/method-picker-modal.test.js
  • packages/core-ui/src/tests/utils/params-editor-modal.test.js
📝 Walkthrough

Walkthrough

Adds a guided params-editor modal to the shared schema row editor. A new openParamsEditorModal module provides top-level comma splitting, mode inference, entry initialization, and a params-text builder. The schema editor UI renders a dedicated params control with an edit button; the controller wires a new edit-params action to open the modal and apply results. Full unit tests, Playwright abstractions, an E2E spec, and a Storybook story are included.

Changes

Guided Params Editor Dialog

Layer / File(s) Summary
Params modal parsing and formatting helpers
packages/core-ui/js/gui_components/shared/domain-command-help-metadata.js, packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.js
datatype.enum metadata gains a required values arg; new helpers handle outer-paren stripping, top-level comma splitting with nesting/quote awareness, value unquoting, mode inference, entry initialization from documented params, raw validation, and final (…) params-text building with required-ordering constraints.
Params editor modal UI
packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.css, packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.js
Complete modal stylesheet with light/dark CSS variables and responsive layout; openParamsEditorModal renders the overlay + table of per-parameter inputs with mode selects, wires live preview sync, Apply/Cancel/Escape/Enter handling, and returns a Promise resolving to the generated params text or null.
Schema row UI constants, rendering, and CSS
packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-ui.js, apps/web/styles.css
Adds SHARED_SCHEMA_PARAMS_CONTROL_CLASS and SHARED_SCHEMA_PARAMS_BUTTON_CLASS, conditionally renders a params input + edit button in the command-row template based on hasDocumentedParams, and updates grid layout to target the new .shared-schema-params-control wrapper with disabled-button styling.
Controller edit-params action wiring
packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js
Imports openParamsEditorModal and normaliseSourceType; adds helpers to find the matching method picker option and validate candidate params; adds a [data-action="edit-params"] branch in handleClick that opens the modal, applies accepted params to the row, clears semantic issues, revalidates/re-renders/syncs, and triggers immediate semantic validation.
Unit tests: modal, UI, controller, view
packages/core-ui/src/tests/utils/params-editor-modal.test.js, packages/core-ui/src/tests/shared/shared-schema-editor-ui.test.js, packages/core-ui/src/tests/shared/shared-schema-editor-controller.test.js, packages/core-ui/src/tests/shared/shared-schema-definition-view.test.js
Full params-editor-modal test suite for parsing/building helpers and interactive Apply/Cancel/warning behavior; schema-editor-ui tests extended for params control classes and enabled/disabled button states; controller and view tests add navigator setup and end-to-end dialog flow assertions producing normalized (active,inactive,pending) params.
Browser abstractions, E2E spec, Storybook story, and docs
apps/web/src/tests/browser/shared/abstractions/components/params-editor-dialog.component.js, apps/web/src/tests/browser/shared/abstractions/components/schema-editor.component.js, apps/web/src/tests/browser/generator/functional/schema-edit.spec.js, apps/web/src/stories/shared-schema-definition.stories.js, docs/frontend-component-migration-plan.md
Adds ParamsEditorDialogComponent Playwright helper and editRowParamsWithDialog on SchemaEditorComponent; E2E spec asserts enum row params are updated via the guided dialog; ParamsDialog Storybook story exercises the full play flow; docs note the new shared dialog capability.

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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐇 A dialog blooms where raw text once did reign,
With dropdowns and previews to ease param pain.
The enum hops in with its values aligned,
Parentheses balanced, no syntax left behind.
The rabbit clicks Apply with a satisfied hop—
Guided params forever, the guesswork can stop! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add guided params editor to schema UI' accurately captures the main change of this PR, which introduces a new interactive dialog for guided parameter editing in the schema UI.
Linked Issues check ✅ Passed The PR implementation successfully addresses all coding requirements from issue #202: adds a params editor button with a pop-up dialog, displays all available params with easy-to-use interface, auto-generates valid syntax with parentheses and quotes, enforces syntax rules with error display, maintains backward compatibility for direct text entry, and shows generated valid text in schema UI.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the params editor feature requested in issue #202. Changes include modal UI/logic, schema editor components, test abstractions, documentation updates, and comprehensive test coverage for the new functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 202-params-ui

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.js Outdated
@greptile-apps

greptile-apps Bot commented Jun 14, 2026

Copy link
Copy Markdown

Greptile Summary

This 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.

  • params-editor-modal.js is the new core modal: it parses existing params back into per-field entries (handling positional, named, and variadic), renders boolean radio groups or text inputs per param type, and formats the output using appropriate quoting for each type.
  • shared-schema-editor-controller.js wires the pencil button to the modal, guarding against missing getMethodPickerOptions, and logging unexpected errors via console.error instead of swallowing them.
  • Test coverage spans focused unit tests for all parsing/formatting helpers, DOM/component tests for controller and view behaviour, and a Playwright end-to-end test; page objects use getByRole throughout in line with the project's Frontend Selector Contracts.

Confidence Score: 5/5

Safe 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

Filename Overview
packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.js New guided params editor modal: parses existing params into named fields, renders boolean radios and text inputs, builds formatted params text with quoting logic, and resolves as a promise. All previously flagged issues are present and correct.
packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js Adds edit-params click handler, getMethodOptionForRow (with typeof guard), and validateParamsForRow; upgrades silent catch to console.error. Addresses all three previously flagged issues.
packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-ui.js Adds a pencil button wrapped in a params-control div next to the params text input; button is disabled when no documented params exist; exports two new class constants.
packages/core-ui/js/gui_components/shared/test-data/help/help-model-builder.js Adds normalizeHelpParam/normalizeHelpParams to unify optional/required conventions and extract default values from descriptions; adds resolveDomainHelpParams for the datatype.enum fallback.
packages/core-ui/src/tests/utils/params-editor-modal.test.js Comprehensive unit and DOM tests covering parsing, formatting, boolean radios, warning state, variadic params, tooltip help, mixed positional+named params, and round-trip apply flow.
packages/core-ui/src/tests/shared/shared-schema-editor-controller.test.js Adds three focused controller tests using role/name selectors throughout, consistent with AGENTS.md Frontend Selector Contracts.
apps/web/src/tests/browser/shared/abstractions/components/params-editor-dialog.component.js New Playwright page object using getByRole for dialog and Apply button — consistent with the Frontend Selector Contracts in AGENTS.md.
apps/web/src/tests/browser/generator/functional/schema-edit.spec.js Adds an end-to-end Playwright test exercising the full guided params dialog flow for datatype.enum.

Reviews (3): Last reviewed commit: "Refine params editor dialog behavior" | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4925f5a and 5bab03a.

📒 Files selected for processing (15)
  • apps/web/src/stories/shared-schema-definition.stories.js
  • apps/web/src/tests/browser/generator/functional/schema-edit.spec.js
  • apps/web/src/tests/browser/shared/abstractions/components/params-editor-dialog.component.js
  • apps/web/src/tests/browser/shared/abstractions/components/schema-editor.component.js
  • apps/web/styles.css
  • docs/frontend-component-migration-plan.md
  • packages/core-ui/js/gui_components/shared/domain-command-help-metadata.js
  • packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js
  • packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-ui.js
  • packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.css
  • packages/core-ui/js/gui_components/shared/test-data/ui/params-editor-modal.js
  • packages/core-ui/src/tests/shared/shared-schema-definition-view.test.js
  • packages/core-ui/src/tests/shared/shared-schema-editor-controller.test.js
  • packages/core-ui/src/tests/shared/shared-schema-editor-ui.test.js
  • packages/core-ui/src/tests/utils/params-editor-modal.test.js

@eviltester eviltester merged commit 1e7c567 into master Jun 14, 2026
14 checks passed
@eviltester eviltester deleted the 202-params-ui branch June 14, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extend ui schema editor to support params

2 participants