Skip to content

fix(dmn): resync overview viewbox when the panel is reopened - #6223

Merged
barmac merged 2 commits into
camunda:developfrom
drakeo338:claude/4549-fix
Oct 13, 2026
Merged

barmac merged 2 commits into
camunda:developfrom
drakeo338:claude/4549-fix

Conversation

@drakeo338

Copy link
Copy Markdown
Contributor

Proposed Changes

Closes #4549.

The DRG overview panel is only ever attached once; after that it's just toggled visible/hidden via CSS on its container. DmnModeler#updateOverview only calls canvas.resized() on that first attach, so if the diagram changes while the panel is closed (its container is 0px wide), the overview canvas caches a 0-width viewbox and keeps using it once the panel is shown again, rendering the DMN diagram shifted. The fix resyncs the overview canvas whenever the panel becomes visible, not just on first attach.

Checklist

Ensure you provide everything we need to review your contribution:

  • Contribution meets our definition of done
  • Pull request 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

Only the two checked boxes above reflect work actually done for this PR; I ran the added regression test on the committed HEAD (0 passed, 1 failed -> 1 passed, 0 failed) but didn't capture screenshots or a manual repro walkthrough.

Copilot AI lite review requested due to automatic review settings September 28, 2026 15:01
@CLAassistant

CLAassistant commented Sep 28, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Copilot review overview

🟡 Changes recommended

Apply the fix and tests to the Camunda 8 modeler as well.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Fixes stale DMN DRG overview viewboxes when the panel is reopened.

Changes:

  • Resizes the overview canvas on reopen.
  • Adds regression coverage.
  • Documents the fix in the changelog.
File Description
client/​src/​app/​tabs/​dmn/​modeler/​DmnModeler.js Resynchronizes the overview canvas on reopen.
client/​src/​app/​tabs/​dmn/​modeler/​__tests__/​DmnModelerSpec.js Adds regression coverage.
CHANGELOG.md Documents the fix.

The Camunda 8 modeler remains affected and needs the equivalent fix and regression coverage.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@barmac

barmac commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Hi, can you please look into the copilot review comment? Thanks

@drakeo338

Copy link
Copy Markdown
Contributor Author

Applied the same reopen-time resize to the Camunda 8 (cloud-dmn) modeler, with its own regression test, in fbd683b.

drakeo338 and others added 2 commits October 13, 2026 16:52
`DmnModeler#updateOverview` only calls `canvas.resized()` on the
overview canvas the first time it is attached, comparing the DOM
node's `parentNode` identity. The overview panel is never actually
detached and reattached when it is opened or closed though -- its
ancestor's CSS width is just toggled between 0 and its visible size
-- so after the first mount `_attachOverview` is a permanent no-op
and `resized()` is never called again.

If the diagram content changes while the panel is closed, re-
importing the overview invalidates diagram-js' cached viewbox, and
the next read recomputes it against the container's live width,
which is 0 while the panel is hidden. That 0-width viewbox then
stays cached once the panel becomes visible again, so the DMN
diagram renders shifted.

Resync the overview canvas whenever it becomes visible, regardless
of whether it was just attached.

Closes camunda#4549
Apply the same reopen-time resize to the cloud-dmn DmnModeler and add
its regression test.

Related to camunda#4549

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@barmac
barmac requested a review from a team October 13, 2026 14:52

@barmac barmac left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, this works correctly.

@barmac
barmac merged commit 5d7f2bb into camunda:develop Oct 13, 2026
15 of 16 checks passed
@barmac barmac added this to the M107 milestone Oct 13, 2026
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.

While decision overview is closed entering any value to the table/expression shifts the DMN diagram

4 participants