Skip to content

Conversation

@philippfromme
Copy link
Contributor

@philippfromme philippfromme commented Nov 18, 2025

Fixes the stale element issue by updating on import.done. I tried a different approach but failed. This is the only fix I found that doesn't inroduce significant changes like #1159.

The fix can be verified using https://github.com/bpmn-io/bpmn-js-properties-panel/tree/1131-stale-element-tmp:

npx @bpmn-io/sr bpmn-io/bpmn-js-properties-panel#1131-stale-element-tmp

Fixes #1131

Proposed Changes

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Nov 18, 2025
Copilot finished reviewing on behalf of philippfromme November 18, 2025 10:00
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 fixes a stale element issue by changing the event listener from root.added to import.done in the BpmnPropertiesPanel component. The change ensures the properties panel is properly updated when a BPMN diagram is imported, addressing issue #1131.

Key changes:

  • Event listener changed from root.added to import.done in the main component
  • Test updated to reflect the new event being listened to
  • Canvas mock infrastructure enhanced to support testing

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/render/BpmnPropertiesPanel.js Changed event listener from root.added to import.done, now retrieves root element from canvas service, and removed selectedElement from dependency array
test/spec/BpmnPropertiesPanel.spec.js Updated test name and event firing to match new import.done behavior, added canvas mock setup in test helper
test/spec/mocks/index.js Enhanced Injector mock to accept canvas option for testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@philippfromme philippfromme marked this pull request as ready for review November 18, 2025 10:01
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Nov 18, 2025
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.

Properties panel updated with stale element

2 participants