-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Multi-selection in viewer causes black boxes #2135
Comments
I think that we need to be clear on what a viewer is. The default viewer in my opinion, should behave like viewing an SVG. No interactivity at all. I never liked the fact that you get selection behavior in the viewer. Now, there are use cases that need an interactive viewer. In these cases, users need to include the required features and stylesheets as well. Alternatively, we could offer something similar to the navigated viewer. |
No interactivity means that you cannot properly react to states in i.e. overlays. Hence the viewer would always offer basic interactivity, including hover and selection. |
Overlays is a feature of an interactive viewer, I'd say. |
I'd say there are 4 ways to display diagram:
Otherwise we should rename the Viewer to Renderer, as that's what it is without any interactivity. |
Thanks for #2135 (comment) @barmac. I subscribe to it. Without interactivity the viewer is simply a renderer. You can roll your own barebones renderer if you so desire on top of the |
In the modeler starter example it works fine, it does not work locally in viewer starter example with same issue as in the linked example. I can see that the issue occurs cause there are no |
The selection and outline features are part of the both the viewer and the modeler. Unless we decide to remove it from the viewer I'd say you simply must include But even then there are a couple of issues:
|
After adding the missing Screencast.from.2024-10-29.15-43-07.webm |
After discussing this with @nikku our proposal is:
As a result you can use the viewer without any additional CSS file, the selection feature works but no outline will be shown by default, you can add it by adding the outline feature or applying custom CSS using the |
Won't this require the |
@misiekhardcore The purpose of the outline feature is to render an outline (around elements), to be styled based on selection and other state. It is an optional feature in the toolbox. Selection on the other hand is a more core feature of the toolbox, and hence we want to keep it as minimal as possible. The way components plug into selection is through events, so we already loosely couple things (nothing breaks if selection ends up not being there, but it is, if you want to make anything selectable): function MyComponent(eventBus) {
eventBus.on('selection.changed', function({ newSelection, oldSelection }) {
...
});
} We could consider to not move the SelectionOutline into the What I propose is to add a What is also useful in terms of design is to clearly separate UI and non-UI components. As part of bpmn-js-headless we investigated a way to make core bpmn-js available for headless use. This works as long as only non-UI components ("the business logic") is used, but breaks if components wildly mix UI and non-UI concerns. In this particular case, using the actual selection (to do whatever, i.e. trigger an editor action afterwards) will blow up the headless tool, unless explicitly detangled. Another reason to make this change. I don't necessarily agree with bpmn-io/diagram-js@5db35ec, "just moving the selection visuals out", as this will also make the markers unavailable. Hence I propose moving the outline (the only UI aspect) to an actual UI component, the |
Okay, that brings some more light into the problem we want to fix. I personally like the idea of having a separate |
So, I opened a PR, but should I open an issue in |
You can link the PR in your comment, to establish the context. No other issue is needed, if the PR is self explainatory in what we want to accomplish, and why. It should provide a clear rationale, along the lines of this. |
I have decided to create a separate issue for moving multi-select outlines to a separate module as this won't fix the issue described here. How should we handle this case? Should these styles be added to |
That is the resolution, and we'll ship the viewer without the outline. As a result the viewer will not depend on the external style sheet, which always has been our intention. Or do I miss anything? If I understood correctly, then #2253 and bpmn-io/diagram-js#943 solve this issue, which was our intention. |
Yes, exactly |
Ok, moved this issue to |
# Changes Siehe Changelog: https://github.com/bpmn-io/bpmn-js/blob/develop/CHANGELOG.md ## 18.1.2 * `FIX`: canvas `autoFocus` must explicitly be enabled ([bpmn-io/diagram-js#956](bpmn-io/diagram-js#956)) * `FIX`: properly integrate `zoomscroll` with canvas focus ([bpmn-io/diagram-js#956](bpmn-io/diagram-js#956)) * `FIX`: properly integrate `movecanvas` with canvas focus ([bpmn-io/diagram-js#956](bpmn-io/diagram-js#956)) ## 18.1.1 * `FIX`: adjust search to prioritize start of word and exact matches ([bpmn-io/diagram-js#953](bpmn-io/diagram-js#953)) * `FIX`: ignore whitespace when searching ([bpmn-io/diagram-js#954](bpmn-io/diagram-js#954)) ## 18.1.0 * `FIX`: clear selection when opening search pad ([bpmn-io/diagram-js#947](bpmn-io/diagram-js#947)) * `FIX`: correct dangling selection after search pad interaction ([bpmn-io/diagram-js#947](bpmn-io/diagram-js#947)) * `DEPS`: update to `[email protected]` ## 18.0.0 * `FEAT`: remove `outline` from `Viewer` modules ([bpmn-io#2135](bpmn-io#2135)) * `FEAT`: make `Canvas` a focusable element ([bpmn-io/diagram-js#662](bpmn-io/diagram-js#662)) * `FEAT`: implicit keyboard binding ([bpmn-io/diagram-js#662](bpmn-io/diagram-js#662)) * `FEAT`: integrate with global `search` ([bpmn-io#2235](bpmn-io#2235)) * `FEAT`: integrate `popup-menu` with `search` ([bpmn-io/diagram-js#932](bpmn-io/diagram-js#932)) * `FEAT`: recognize modern `search` tokens in `search-pad` ([bpmn-io/diagram-js#932](bpmn-io/diagram-js#932)) * `FIX`: correctly handle duplicate entries and whitespace in `search` ([bpmn-io/diagram-js#932](bpmn-io/diagram-js#932)) * `FIX`: find `search` terms across all keys ([bpmn-io/diagram-js#932](bpmn-io/diagram-js#932)) * `FIX`: `search` always returns tokens for matched items ([bpmn-io/diagram-js#932](bpmn-io/diagram-js#932)) * `FIX`: prevent crash during label adjustment ([bpmn-io#2239](bpmn-io#2239)) * `FIX`: keep existing loop characteristics when toggling through the replace menu ([bpmn-io#2251](bpmn-io#2251)) * `FIX`: prevent covering multi selection with black box in `Viewer` ([bpmn-io#2135](bpmn-io#2135)) * `FIX`: generate types for main entry ([`986e2bb`](bpmn-io@986e2bb)) * `FIX`: correct handling of group name with whitespace only ([bpmn-io#2231](bpmn-io#2231)) * `DEPS`: update to `bpmn-moddle@9` ([bpmn-io#2114](bpmn-io#2114)) * `DEPS`: update to `[email protected]` * `DEPS`: update to `[email protected]` ### Breaking Changes * Require `Node >= 20` * `Canvas` is now a focusable element and provides better support for native browser behaviors. Focus can be controlled with new `focus` and `restoreFocus` APIs ([bpmn-io/diagram-js#662](bpmn-io/diagram-js#662)). * Keyboard is now implicitly bound to canvas SVG element. Calls to `keyboard.bind` and `keyboard.bindTo` now result with a descriptive console error and have no effect ([bpmn-io/diagram-js#662](bpmn-io/diagram-js#662)). ## 17.11.1 * `FIX`: handle searching elements without labels ([bpmn-io#2232](bpmn-io#2232), [bpmn-io#2234](bpmn-io#2234)) ## 17.11.0 * `FEAT`: align search styles with other popups ([bpmn-io#2187](bpmn-io#2187)) * `FEAT`: prioritize start of tokens in search results ([bpmn-io#2187](bpmn-io#2187)) * `FIX`: do not commit viewport changes on `ESC` ([bpmn-io#2189](bpmn-io#2189), [bpmn-io#2187](bpmn-io#2187)) * `DEPS`: update to `[email protected]` ## 17.10.0 * `CHORE`: correct various type hints ([bpmn-io#2228](bpmn-io#2228)) * `FIX`: pasting compensation activity without boundary event ([bpmn-io#2070](bpmn-io#2070)) * `FIX`: lane resize constraints for se and nw direction ([bpmn-io#2209](bpmn-io#2209)) * `FIX`: auto place elements vertically in sub-processes ([bpmn-io#2127](bpmn-io#2127)) * `FIX`: hide lane label during direct editing * `DEPS`: update to `[email protected]` ## 17.9.2 * `FIX`: keep direction when collapsing pools ([bpmn-io#2208](bpmn-io#2208))
Describe the Bug
As a user I'm embedding the viewer as recommended in the starter project. When I select elements no outline is shown, I can still react to selected events; this I expect.
However when I select more than one element a black box appears that hides the diagram:
Steps to Reproduce
SHIFT + click
Expected Behavior
Environment
The text was updated successfully, but these errors were encountered: