Skip to content

Comments

Prefill input context with resolved input variables#78

Open
Buckwich wants to merge 4 commits intomainfrom
5640_prefill-tasktesting
Open

Prefill input context with resolved input variables#78
Buckwich wants to merge 4 commits intomainfrom
5640_prefill-tasktesting

Conversation

@Buckwich
Copy link
Member

@Buckwich Buckwich commented Feb 19, 2026

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

  • prefill panel with variables provided by new variable resolver that contains variables needed in an expression
  • adjust clear button to a reset button
    • resets the input to the determined empty prefill value
    • reset is now part of codemirror history (ie undoable)
    • enabled codemirror history
    • adjusted empty input default to {\n \n} to make it easier to get started editing the json
npx @bpmn-io/sr camunda/task-testing#5640_prefill-tasktesting

Checklist

Ensure you provide everything we need to review your contribution:

  • Your contribution meets the definition of done
  • Any new additions or modifications are consistent with the existing UI and UX patterns
  • Pull request description establishes context:
    • Link to related issue(s), i.e. Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}
    • Brief textual description of the changes
    • Screenshots or short videos showing UI/UX changes
    • Steps to try out, i.e. using the @bpmn-io/sr tool

Copy link

Copilot AI left a comment

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 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() and historyKeymap extensions
  • 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.

@Buckwich Buckwich force-pushed the 5640_prefill-tasktesting branch from 1de2ce7 to d1e6b9c Compare February 19, 2026 14:07
@Buckwich Buckwich force-pushed the 5640_prefill-tasktesting branch from d1e6b9c to 10348cb Compare February 19, 2026 14:21
@Buckwich Buckwich marked this pull request as ready for review February 19, 2026 14:22
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Feb 19, 2026
@Buckwich Buckwich requested review from a team, AlekseyManetov and jarekdanielak and removed request for a team February 19, 2026 14:22
@jarekdanielak
Copy link
Contributor

I can undo to the empty state, which I never actually had before. I think it's unexpected:

tt-undo-1

@Buckwich Buckwich changed the title feat: adjust clear button to undoable reset to default prefill Prefill input context with resolved input variables Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Review pending

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prefill tasktesting with known required inputs Undoable Clear

2 participants