Prefill input context with resolved input variables#78
Open
Prefill input context with resolved input variables#78
Conversation
13545a4 to
1de2ce7
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements undoable reset-to-default functionality for the input panel by leveraging a new variable resolver that computes required variables from BPMN expressions. The "Clear" button has been replaced with a "Reset" button that populates the input with smart prefill values based on the element's variable requirements, and this reset operation is now undoable via CodeMirror's history extension.
Changes:
- Enabled CodeMirror undo/redo functionality (Ctrl+Z/Y) by adding
history()andhistoryKeymapextensions - Replaced "Clear" button with "Reset" button that prefills input with element-specific variable stubs
- Implemented automatic merging of variable requirements when BPMN model changes
- Changed default empty input from
{}to{\n \n}for better UX
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updates @bpmn-io/variable-resolver to git branch (needs release version before merge) |
| package-lock.json | Lockfile updates for new variable-resolver and dependencies |
| lib/utils/prefill.js | New utility module implementing prefill logic with requirement merging |
| lib/ElementConfig.js | Added getDefaultInputForElement and getMergedInputConfigForElement methods |
| lib/ElementVariables.js | Added getInputRequirementsForElement method wrapping variable resolver |
| lib/components/Input/Input.jsx | Changed "Clear" button to "Reset" button |
| lib/components/Input/InputEditor.jsx | Enabled CodeMirror history and historyKeymap extensions |
| lib/components/TaskTesting/TaskTesting.js | Integrated prefill logic with auto-merge on variable changes |
| test/fixtures/prefill.bpmn | New BPMN test fixture with script tasks requiring variables |
| test/Prefill.spec.js | Comprehensive tests for prefill computation and merging logic |
| test/components/Input/Input.spec.js | Updated prop names from setInput/reset to onSetInput/onResetInput |
| test/ElementConfig.spec.js | Updated default empty config expectation to {\n \n} |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1de2ce7 to
d1e6b9c
Compare
d1e6b9c to
10348cb
Compare
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #76
Closes camunda/camunda-modeler#5640
Proposed Changes
Note
PR still links to a git branch of variable resolver, will adjust to release version before merge. waiting on bpmn-io/variable-resolver#74
{\n \n}to make it easier to get started editing the jsonChecklist
Ensure you provide everything we need to review your contribution:
Closes {LINK_TO_ISSUE}orRelated to {LINK_TO_ISSUE}@bpmn-io/srtool