Skip to content

Conversation

Skaiir
Copy link
Contributor

@Skaiir Skaiir commented Sep 18, 2025

Related to camunda/camunda-modeler#5109

Proposed Changes

In the context of AO, one of the things we want to be able to do is display disabled connectors for future versions. The first step to this is this here extension of the popup menu allowing disabled entries.

PR contains:

  • support for disabled list entries, which mostly just set some styles and swallow actions from enter and click (although we could also just trust the users not to set the action, but generally I don't think we should allow a disabled state with an action).
  • (optional) extension of support for disabled header entries, there actually was already some support as a disabled class was passed to the headers, it however wasn't reflected in the types and was generally very barebones, I'm happy to exclude this one out of the current scope as I do not need it for my use case.
  • fixing the popup test suites, those 60~ tests were responsible for half the run time of the 2000 tests due to 500ms wait times for events to go through, I managed to get rid of these at least locally, let's see the CI :D

Styling needs some advice from @YanaSegal, I can't go with this super low contrast approach but anything else seems to be too much for the light disabled look.

I've treated the header entries fundamentally different from the list entries. Header entries are only actions, so they become completely un-interactive spans if they are disabled. This already looked like the behavior we were going for if no action was supplied, so I think it makes sense, this can be changed, or again we can drop this part of the PR if this is time sensitive.

List items still need to allow for keyboard based navigation, so they can still be list selected / navigated, just not triggered via enter and mouse clicks. On that note the naming is a bit confusing here so to clarify for review context: "selected" means fake focused / highlighted, and "onSelect" is a trigger/click/enter.

Screencast.from.2025-09-18.23-49-16.webm

Can't seem to get my cursor to record, but hovering gives us a not allowed cursor.

To try it out, you can use bpmn-js-create-append-anything, get this PR as the dependencies (bpmn-js styles will have to be overwritten manually as diagram-js styles aren't used directly, or you can change the style loading to take it directly from djs), and then in CreateMenuProvider you can set disabled: Math.random() < 0.5, under label: label && this._translate(label),

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 Sep 18, 2025
@nikku nikku requested review from a team and jarekdanielak and removed request for a team September 19, 2025 09:13
@Skaiir Skaiir force-pushed the modeler-5109-support-disabled-entries branch from ad8f601 to 46f9ae7 Compare September 23, 2025 07:38
@Skaiir
Copy link
Contributor Author

Skaiir commented Sep 23, 2025

@barmac Hey Maciej, yup I'll need some support here, this is the basic disabled entries support, we'll also need to merge an element template PR later to support getting disabled entries from the element template registry and finally an create-append-anything PR to bring it all together.

@Skaiir Skaiir marked this pull request as ready for review September 23, 2025 07:41
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Sep 23, 2025
@Skaiir Skaiir force-pushed the modeler-5109-support-disabled-entries branch from 46f9ae7 to 16365fb Compare September 23, 2025 07:43
@Skaiir Skaiir requested a review from barmac September 23, 2025 07:50
@Skaiir
Copy link
Contributor Author

Skaiir commented Sep 23, 2025

Man it's a different life when CI doesn't take 30 minutes to execute, definitely less concerned about strategically sending in commits :D

@Skaiir Skaiir requested a review from barmac September 23, 2025 08:37
@barmac
Copy link
Member

barmac commented Sep 23, 2025

Hmm CI became brittle now. I experience timeout issues on my machine now too.

@barmac
Copy link
Member

barmac commented Sep 23, 2025

Hmm CI became brittle now. I experience timeout issues on my machine now too.

I can reproduce it on main and also before your changes (v15.3.0).

@Skaiir
Copy link
Contributor Author

Skaiir commented Sep 23, 2025

I can reproduce it on main and also before your changes (v15.3.0).

Was gonna say, if we look at the commit history these errors are present even a few months back.

@barmac
Copy link
Member

barmac commented Sep 23, 2025

Regarding the contrast, we can go with opacity as low as 0.6 if we keep the default font color. Contrast is then above 4.5.

image

@Skaiir
Copy link
Contributor Author

Skaiir commented Sep 23, 2025

How does it look with the hover state?

@barmac
Copy link
Member

barmac commented Sep 23, 2025

image

@barmac
Copy link
Member

barmac commented Sep 23, 2025

Right, with hover the contrast is super low.

@Skaiir
Copy link
Contributor Author

Skaiir commented Sep 23, 2025

Right, with hover the contrast is super low.

There are styles to make it lighter normally, not sure why it's so dark.

@barmac
Copy link
Member

barmac commented Sep 23, 2025

I just noticed that you also changed the hover background style which was not applied in my local build. Maybe it's good enough.

@Skaiir
Copy link
Contributor Author

Skaiir commented Sep 23, 2025

Good contrast without hover and slightly below with, I think it's okay. If we make it any darker it becomes very unclear that this is disabled. Until they patch human vision I don't think we have a much better approach aside from completely changing the styles.

@barmac
Copy link
Member

barmac commented Sep 23, 2025

No opacity changes, slightly lighter color which meets contrast requirements:

image image image

@barmac
Copy link
Member

barmac commented Sep 23, 2025

I think it looks good enough now. I'll merge it and release it. Thanks!

@barmac barmac merged commit 6de6427 into develop Sep 23, 2025
4 of 9 checks passed
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Sep 23, 2025
@barmac barmac deleted the modeler-5109-support-disabled-entries branch September 23, 2025 09:48
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.

2 participants