Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump BPMN and DMN modeling dependencies / integrate implicit keyboard binding #4620

Merged
merged 5 commits into from
Nov 21, 2024

Conversation

jarekdanielak
Copy link
Contributor

@jarekdanielak jarekdanielak commented Oct 18, 2024

Proposed Changes

Updates BPMN and DMN modeling dependencies, integrating implicit keyboard / focusable canvas into the modeler application, but also addressing various other issues in the process.

Formal parameters suggestions are available without reloading:

Nov-19-2024 14-27-48

Closes #4544
Closes #4684
Closes #4310


Work log

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}

Try out via better-actions feature branch + npm run dev, alternatively use this command:

npx @bpmn-io/sr camunda/camunda-modeler#better-actions

Child of https://github.com/bpmn-io/internal-docs/issues/1081

@jarekdanielak jarekdanielak requested review from nikku and barmac October 18, 2024 10:20
@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Oct 18, 2024
Copy link

This Pull Request targets develop branch, but contains fix commits.

Consider targeting main instead.

@jarekdanielak jarekdanielak added the enhancement New feature or request label Oct 18, 2024
@jarekdanielak
Copy link
Contributor Author

jarekdanielak commented Oct 27, 2024

Blockers:

  • Undo/Redo actions trigger twice and seem to trigger when focus is outside of canvas, despite being dependent on canvasFocused parameter.

Nice to have:

  • Edit label action can be triggered with keyboard (E) for multiple selected elements, despite being dependent on selectionLength === 1 and menu action being disabled.

@nikku nikku requested a review from lmbateman November 4, 2024 21:33
@jarekdanielak jarekdanielak changed the title Better modeler menu actions with new diagram-js Integrate implicit keyboard binding into BPMN & DMN editors Nov 15, 2024
@jarekdanielak jarekdanielak force-pushed the better-actions branch 3 times, most recently from 56ae8f1 to 8ed2972 Compare November 18, 2024 10:38
@nikku

This comment was marked as outdated.

nikku

This comment was marked as outdated.

@nikku

This comment was marked as outdated.

@nikku nikku added the dependencies Updates a dependency label Nov 19, 2024
@jarekdanielak

This comment was marked as outdated.

@jarekdanielak jarekdanielak marked this pull request as ready for review November 19, 2024 12:47
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Nov 19, 2024
@barmac barmac mentioned this pull request Nov 19, 2024
11 tasks
@nikku

This comment was marked as outdated.

@nikku

This comment was marked as outdated.

@jarekdanielak
Copy link
Contributor Author

Cleaned up git history.

dirty,
distribute: selectionLength > 2,
editLabel: !inputActive && !!selectionLength,
editLabel: canvasFocused && selectionLength === 1,
Copy link
Collaborator

Choose a reason for hiding this comment

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

A good one!

@barmac
Copy link
Collaborator

barmac commented Nov 21, 2024

Not a big problem, but when I click outside of the canvas (tab bar), some of the menu items are enabled but don't do anything:

Screen.Recording.2024-11-21.at.10.05.30.mov

@barmac
Copy link
Collaborator

barmac commented Nov 21, 2024

SelectAll does not work in the BPMN properties panel. It works in DMN though.

Screen.Recording.2024-11-21.at.10.11.31.mov

@nikku
Copy link
Member

nikku commented Nov 21, 2024

Cleaned up git history.

Standard pattern when combining commits is:

commit summary

  This is the body, indented

second commit summary

third commit summary
  
  some more details on the third commit
  
  Closes #102121

You may want to account for that. Also, you may want to remove transient things, i.e. stuff that fixes behavior on top of existing contributions on this branch from the summary:

feat: expose `canvasFocused` to menu actions

  This allows menu actions in plug-ins to properly react to the newly
  introduced canvas focused state, and make them activate only on
  canvas focus, not _any_ focus.

fix: only trigger core editor keyboard shortcuts on canvas focus

>>> REMOVE START
fix(dmn): remove decision table keyboard module

fix(bpmn): hook up to `canvas.focus.changed`

  We'd previously not properly update the keyboard shortcuts on focus
changes.
<<< REMOVE END

fix: focus canvas on attach

>>> FIX INDENT START
  This ensures that users can do modeling operations right away.
<<< FIX INDENT END

@@ -432,45 +434,46 @@ export class BpmnEditor extends CachedComponent {

const selectionLength = selection.get().length;

const inputActive = isInputActive();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is breaking for all plugins relying on inputActive. I'd say let's leave the state property as is, but the shortcuts don't need to rely on it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, as just discovered with @jarekdanielak, the getEditMenu still depends on inputActive.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it had been, the properties panel select all wouldn't have broken #4620 (comment)

save: true,
selectAll: true,
selectAll: canvasFocused,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
selectAll: canvasFocused,
selectAll: canvasFocused || inputActive,

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or we keep it as is, but adjust in the getEditMenu.

@@ -635,7 +617,6 @@ describe('<BpmnEditor>', function() {
find: true,
globalConnectTool: true,
handTool: true,
inputActive: false,
Copy link
Member

Choose a reason for hiding this comment

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

Should still indicate inputActive, right?

jarekdanielak and others added 2 commits November 21, 2024 10:45
  Related to bpmn-io/internal-docs#1081

feat: expose `canvasFocused` to menu actions

  This allows menu actions in plug-ins to properly react to the newly
  introduced canvas focused state, and make them activate only on
  canvas focus, not _any_ focus.

fix: only trigger core editor keyboard shortcuts on canvas focus

fix: focus canvas on attach

  This ensures that users can do modeling operations right away.
  Makes the panel focusable.

deps: bump to `[email protected]`

  Related to #4590
@jarekdanielak
Copy link
Contributor Author

Brought back inputActive into menu state for the sake of compatibility and selectAll. Works as intended now both on canvas and in properties panel.

Fix git history once again.

@barmac
Copy link
Collaborator

barmac commented Nov 21, 2024

This commit contains a merge conflict in package-lock 86ddafa: 86ddafa#diff-053150b640a7ce75eff69d1a22cae7f0f94ad64ce9a855db544dda0929316519R41585

@barmac
Copy link
Collaborator

barmac commented Nov 21, 2024

Besides the comment above, I believe the PR is ready to merge. We could squash the modeling deps updates to mitigate #4620 (comment)

nikku and others added 2 commits November 21, 2024 11:32
@jarekdanielak
Copy link
Contributor Author

Fixed package-lock.

Leaving it up to you how we want to squash dependencies updates together.

@philippfromme can you give it a quick run on Windows?

@nikku waiting for the final thumbs up and we can merge.

@nikku nikku added this to the M83 milestone Nov 21, 2024
Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

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

Good to have this wrapped up!

@nikku nikku merged commit 1fdf4fd into develop Nov 21, 2024
12 checks passed
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Nov 21, 2024
@nikku nikku deleted the better-actions branch November 21, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Updates a dependency enhancement New feature or request
Projects
None yet
4 participants