[6295] Make it possible to hide the minimap by default#6305
[6295] Make it possible to hide the minimap by default#6305frouene merged 1 commit intofba/doc/minimapShapfrom
Conversation
0e5490b to
035c8d6
Compare
| * | ||
| * @author fbarbin | ||
| */ | ||
| public record ShowMinimapSuccessPayload(UUID id, Boolean showMinimap) implements IPayload { |
There was a problem hiding this comment.
Does this need to be a Boolean rather than a boolean ?
| public void handle(One<IPayload> payloadSink, Many<ChangeDescription> changeDescriptionSink, IEditingContext editingContext, DiagramContext diagramContext, IDiagramInput diagramInput) { | ||
| this.counter.increment(); | ||
|
|
||
| String message = this.messageService.invalidInput(diagramInput.getClass().getSimpleName(), GetToolbarInput.class.getSimpleName()); |
There was a problem hiding this comment.
Wrong input in the error message
There was a problem hiding this comment.
fixed, copy paste issue :D
| VariableManager variableManager = new VariableManager(); | ||
| variableManager.put(VariableManager.SELF, targetElement); | ||
| variableManager.put(IEditingContext.EDITING_CONTEXT, editingContext); | ||
| variableManager.put(DiagramContext.DIAGRAM_CONTEXT, diagramContext); |
There was a problem hiding this comment.
What is this variableManager for? It's not an expression that can be evaluated.
| * @author fbarbin | ||
| */ | ||
| @Service | ||
| public class ShowMinimapProvider implements IShowMinimapProvider { |
There was a problem hiding this comment.
This implementation is specific for the view description, it should be mentioned in its name.
By the way what happen if it's not a view description, I think that this code will not work.
I think we need to add a canHandle method to the interface
There was a problem hiding this comment.
Done: I added a canHandle on the service and the EventHandler take a list of IShowMinimapProvider and use the first one that can handle.
There was a problem hiding this comment.
The name of this class still doesn't make it clear that it's meant to handle descriptions from the view.
I think it might be a good idea to specify that.
There was a problem hiding this comment.
something like DiagramDescriptionViewShowMinimapProvider ?
There was a problem hiding this comment.
Even just ViewShowMinimapProvider is enough for me
035c8d6 to
23e633c
Compare
|
|
||
| //4. We switch to the initial Topography diagram | ||
| const representationItem = await explorer.getTreeItemLabel('Topography'); | ||
| representationItem.click(); |
| await expect(page.locator('.react-flow__minimap')).toBeAttached(); | ||
|
|
||
| //4. We switch to the initial Topography diagram | ||
| const representationItem = await explorer.getTreeItemLabel('Topography'); |
There was a problem hiding this comment.
could be done with explorer.select
25d9a82 to
b76394f
Compare
f0c80b1 to
2169af3
Compare
b76394f to
c90ca3e
Compare
| DiagramDescription diagramDescription = optionalDiagramDescription.get(); | ||
| var optionalShowMinimapProvider = this.showMinimapProviders.stream() | ||
| .filter(iShowMinimapProvider -> iShowMinimapProvider.canHandle(editingContext, diagramContext, diagramDescription)) | ||
| .findFirst(); |
There was a problem hiding this comment.
To test the functionality, I wanted to create a simple scenario where the minimap is only displayed once there is at least one node on the diagram. The problem with this approach (where we simply look for the first provider that returns true) is that, depending on the order in which Spring scans the beans, we might end up having to skip beans in order to implement a new mechanism.
I wonder if it wouldn’t be better to take all providers with canHandle set to true and aggregate all the booleans (using an and operator) to get a consolidated value.
There was a problem hiding this comment.
I have changed the code to perform a reduce operation (with and operator) with each providers that can handle the request
c90ca3e to
bcb48fb
Compare
bcb48fb to
0785d3d
Compare
- The specifier can choose to hide the minimap by default for a specific diagram description - The minimap hide/reveal action is now persisted for a specific diagram. Bug: #6295 Signed-off-by: Florian Barbin <florian.barbin@obeosoft.com> Signed-off-by: Florian ROUËNÉ <florian.rouene@obeosoft.com>
0785d3d to
aadc04e
Compare
|
I just moved the entry in the changelog to be in the 2026.3.0 section. |
Bug: #6295
Pull request template
General purpose
What is the main goal of this pull request?
Project management
priority:andpr:labels been added to the pull request? (In case of doubt, start with the labelspriority: lowandpr: to review later)area:,difficulty:,type:)CHANGELOG.adocbeen updated to reference the relevant issues?CHANGELOG.adoc? (Including changes in the GraphQL API)CHANGELOG.adoc? For example indoc/screenshots/2022.5.0-my-new-feature.pngArchitectural decision records (ADR)
[doc]?CHANGELOG.adoc?Dependencies
CHANGELOG.adoc?CHANGELOG.adoc?Frontend
This section is not relevant if your contribution does not come with changes to the frontend.
General purpose
Typing
We need to improve the typing of our code, as such, we require every contribution to come with proper TypeScript typing for both changes contributing new files and those modifying existing files.
Please ensure that the following statements are true for each file created or modified (this may require you to improve code outside of your contribution).
useMutation<DATA_TYPE, VARIABLE_TYPE>(…)useQuery<DATA_TYPE, VARIABLE_TYPE>(…)useSubscription<DATA_TYPE, VARIABLE_TYPE>(…)useMachine<CONTEXT_TYPE, EVENTS_TYPE>(…)useState<STATE_TYPE>(…)?.(if the GraphQL API specifies that a field cannot benull, do not treat it has potentiallynullfor example)let diagram: Diagram | null = null;)Backend
This section is not relevant if your contribution does not come with changes to the backend.
General purpose
Architecture
Review
How to test this PR?
Please describe here the various use cases to test this pull request