Prefill input context with resolved input variables#78
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
Let's ensure this does not close a downstream issue - it puts the downstream issue into |

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