camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.47k stars 471 forks source link

New Context Pad is not repositioned on Properties panel move #4338

Open marstamm opened 1 month ago

marstamm commented 1 month ago

Describe the bug

The Context pad is automatically repositioned when I move the canvas. When I expand the properties panel instead, to context pad can be (partially) hidden and is repositioned/removed when I hover over the canvas

Recording 2024-06-06 at 10 25 14

Steps to reproduce

  1. Open Modeler with --enable-new-context-pad
  2. Select an element
  3. Expand Properties panel over the selected element
  4. The properties panel is partially hidden

Expected behavior

Context pad position position is updated on resize

Environment

Additional context

No response

philippfromme commented 1 month ago

I'd expect a canvas.resized event that the context pad can react to.

nikku commented 1 month ago

Yea. We could use such event to hook up other changes such as the responsive palette, too.

nikku commented 1 month ago

@philippfromme after further investigating this we have most measures in place:


Update: Canvas#resized is already there, but not properly hooked up.

options-a11y commented 1 month ago

I don't know if I understand correctly but Canvas has a resized method which fires a canvas.resized event to the eventBus. The issue can be fixed by listening on it in the contextPad to fire the updatePosition method. However, the contextPad is only positioned after the sizing is done. But it fixes necessary hovering after resizing the propertiesPanel.

https://github.com/camunda/camunda-modeler/assets/171981126/ef987380-a190-476a-80c7-8a778a698d5e

nikku commented 1 month ago

@options-a11y My appologies! In fact canvas already has the resize method, and event as you mentioned :tada:.

We just need to ensure we properly hook this up and/or fire canvas.viewbox.changed on canvas.resized.

CC @philippfromme