Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,49 @@
= Changelog

== 2026.3.0 (work in progress)
== 2026.5.0

=== Pitches

- Measure the performance of Sirius Web based applications


=== Architectural decision records




=== Deprecation warning




=== Breaking changes




=== Dependency update




=== Bug fixes




=== New Features




=== Improvements


- https://github.com/eclipse-sirius/sirius-web/issues/6295[#6295] [diagram] Make it possible to hide the minimap by default.


== 2026.3.0

=== Shapes

Expand Down Expand Up @@ -156,7 +199,6 @@ Trees defined via the view DSL can alternatively provide a tooltip expression vi
- https://github.com/eclipse-sirius/sirius-web/issues/6268[#6268] [sirius-web] Allow customizing the labels of the Views Explorer via delegates.



== 2026.1.0

=== Shapes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test.describe('diagram', () => {
});

test('when the mini map is shown or hidden, then mini map is available or not', async ({ page }) => {
// by default, the mini map is shown
//1. by default, the mini map is shown
await expect(page.getByTestId('hide-mini-map')).toBeAttached();
await expect(page.getByTestId('show-mini-map')).not.toBeAttached();
await expect(page.locator('.react-flow__minimap')).toBeAttached();
Expand All @@ -62,6 +62,23 @@ test.describe('diagram', () => {
await expect(page.getByTestId('show-mini-map')).toBeAttached();
await expect(page.getByTestId('hide-mini-map')).not.toBeAttached();

//2. We Create a new diagram
await page.goto(`/projects/${projectId}/edit`);
const explorer = await new PlaywrightExplorer(page);
await explorer.expand('Flow');
await explorer.expand('NewSystem');
await explorer.createRepresentation('NewSystem', 'Topography unsynchronized', 'Topography2');
await expect(page.getByTestId('rf__wrapper')).toBeAttached();

//3. by default, the mini map is shown, even if it has been hidden in the previous diagram.
await expect(page.getByTestId('hide-mini-map')).toBeAttached();
await expect(page.getByTestId('show-mini-map')).not.toBeAttached();
await expect(page.locator('.react-flow__minimap')).toBeAttached();

//4. We switch to the initial Topography diagram
await explorer.select('Topography');

//5. We show the mini map
await page.getByTestId('show-mini-map').click();
await expect(page.locator('.react-flow__minimap')).toBeAttached();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*******************************************************************************
* Copyright (c) 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/

package org.eclipse.sirius.components.collaborative.diagrams.api;

import org.eclipse.sirius.components.collaborative.diagrams.DiagramContext;
import org.eclipse.sirius.components.core.api.IEditingContext;
import org.eclipse.sirius.components.diagrams.description.DiagramDescription;

/**
* Interface for services providing the diagram showminimap.
*
* @author fbarbin
*/
public interface IShowMinimapProvider {

boolean canHandle(IEditingContext editingContext, DiagramContext diagramContext, DiagramDescription diagramDescription);

boolean showMinimap(IEditingContext editingContext, DiagramContext diagramContext, DiagramDescription diagramDescription);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright (c) 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.sirius.components.collaborative.diagrams.dto;

import java.util.UUID;

import org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramInput;

/**
* The input for the "Show Minimap" query.
*
* @author fbarbin
*/
public record ShowMinimapInput(UUID id, String editingContextId, String representationId) implements IDiagramInput {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*******************************************************************************
* Copyright (c) 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.sirius.components.collaborative.diagrams.dto;

import java.util.Objects;
import java.util.UUID;

import org.eclipse.sirius.components.core.api.IPayload;

/**
* The payload of the "Show Minimap" query returned on success.
*
* @author fbarbin
*/
public record ShowMinimapSuccessPayload(UUID id, boolean showMinimap) implements IPayload {

public ShowMinimapSuccessPayload {
Objects.requireNonNull(id);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*******************************************************************************
* Copyright (c) 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.sirius.components.collaborative.diagrams.handlers;

import java.util.List;
import java.util.Objects;

import org.eclipse.sirius.components.collaborative.api.ChangeDescription;
import org.eclipse.sirius.components.collaborative.api.ChangeKind;
import org.eclipse.sirius.components.collaborative.api.Monitoring;
import org.eclipse.sirius.components.collaborative.diagrams.DiagramContext;
import org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramEventHandler;
import org.eclipse.sirius.components.collaborative.diagrams.api.IDiagramInput;
import org.eclipse.sirius.components.collaborative.diagrams.api.IShowMinimapProvider;
import org.eclipse.sirius.components.collaborative.diagrams.dto.ShowMinimapInput;
import org.eclipse.sirius.components.collaborative.diagrams.dto.ShowMinimapSuccessPayload;
import org.eclipse.sirius.components.collaborative.messages.ICollaborativeMessageService;
import org.eclipse.sirius.components.core.api.ErrorPayload;
import org.eclipse.sirius.components.core.api.IEditingContext;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.IRepresentationDescriptionSearchService;
import org.eclipse.sirius.components.diagrams.Diagram;
import org.eclipse.sirius.components.diagrams.description.DiagramDescription;
import org.springframework.stereotype.Service;

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import reactor.core.publisher.Sinks.Many;
import reactor.core.publisher.Sinks.One;

/**
* Handler used to get the diagram show minimap default value.
*
* @author fbarbin
*/
@Service
public class ShowMinimapEventHandler implements IDiagramEventHandler {

private final IRepresentationDescriptionSearchService representationDescriptionSearchService;

private final List<IShowMinimapProvider> showMinimapProviders;

private final ICollaborativeMessageService messageService;

private final Counter counter;

public ShowMinimapEventHandler(IRepresentationDescriptionSearchService representationDescriptionSearchService, List<IShowMinimapProvider> showMinimapProviders, ICollaborativeMessageService messageService, MeterRegistry meterRegistry) {
this.representationDescriptionSearchService = Objects.requireNonNull(representationDescriptionSearchService);
this.showMinimapProviders = Objects.requireNonNull(showMinimapProviders);
this.messageService = Objects.requireNonNull(messageService);

this.counter = Counter.builder(Monitoring.EVENT_HANDLER)
.tag(Monitoring.NAME, this.getClass().getSimpleName())
.register(meterRegistry);
}

@Override
public boolean canHandle(IEditingContext editingContext, IDiagramInput diagramInput) {
return diagramInput instanceof ShowMinimapInput;
}

@Override
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(), ShowMinimapInput.class.getSimpleName());
IPayload payload = new ErrorPayload(diagramInput.id(), message);

ChangeDescription changeDescription = new ChangeDescription(ChangeKind.NOTHING, editingContext.getId(), diagramInput);

if (diagramInput instanceof ShowMinimapInput) {
Diagram diagram = diagramContext.diagram();
var optionalDiagramDescription = this.representationDescriptionSearchService.findById(editingContext, diagram.getDescriptionId())
.filter(DiagramDescription.class::isInstance)
.map(DiagramDescription.class::cast);
if (optionalDiagramDescription.isPresent()) {
DiagramDescription diagramDescription = optionalDiagramDescription.get();
boolean showMinimap = this.showMinimapProviders.stream()
.filter(provider -> provider.canHandle(editingContext, diagramContext, diagramDescription))
.allMatch(provider -> provider.showMinimap(editingContext, diagramContext, diagramDescription));

payload = new ShowMinimapSuccessPayload(diagramInput.id(), showMinimap);
}
}
payloadSink.tryEmitValue(payload);
changeDescriptionSink.tryEmitNext(changeDescription);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ type DiagramDescription implements RepresentationDescription {
id: ID!
label: String!
autoLayout: Boolean!
showMinimap: Boolean!
arrangeLayoutDirection: ArrangeLayoutDirection!
nodeDescriptions: [NodeDescription!]!
childNodeDescriptionIds: [ID!]!
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*******************************************************************************
* Copyright (c) 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.sirius.components.diagrams.graphql.datafetchers.diagram;

import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;

import org.eclipse.sirius.components.annotations.spring.graphql.QueryDataFetcher;
import org.eclipse.sirius.components.collaborative.diagrams.dto.ShowMinimapInput;
import org.eclipse.sirius.components.collaborative.diagrams.dto.ShowMinimapSuccessPayload;
import org.eclipse.sirius.components.graphql.api.IDataFetcherWithFieldCoordinates;
import org.eclipse.sirius.components.graphql.api.IEditingContextDispatcher;
import org.eclipse.sirius.components.graphql.api.LocalContextConstants;

import graphql.schema.DataFetchingEnvironment;
import reactor.core.publisher.Mono;

/**
* Datafetcher to retrieve the showMinimap diagram property.
*
* @author fbarbin
*/
@QueryDataFetcher(type = "DiagramDescription", field = "showMinimap")
public class DiagramDescriptionShowMinimapDataFetcher implements IDataFetcherWithFieldCoordinates<CompletableFuture<Boolean>> {

private final IEditingContextDispatcher editingContextDispatcher;

public DiagramDescriptionShowMinimapDataFetcher(IEditingContextDispatcher editingContextDispatcher) {
this.editingContextDispatcher = Objects.requireNonNull(editingContextDispatcher);
}

@Override
public CompletableFuture<Boolean> get(DataFetchingEnvironment environment) throws Exception {
Map<String, Object> localContext = environment.getLocalContext();
String editingContextId = Optional.ofNullable(localContext.get(LocalContextConstants.EDITING_CONTEXT_ID)).map(Object::toString).orElse(null);
String representationId = Optional.ofNullable(localContext.get(LocalContextConstants.REPRESENTATION_ID)).map(Object::toString).orElse(null);

if (editingContextId != null && representationId != null) {
ShowMinimapInput input = new ShowMinimapInput(UUID.randomUUID(), editingContextId, representationId);

return this.editingContextDispatcher.dispatchQuery(input.editingContextId(), input)
.filter(ShowMinimapSuccessPayload.class::isInstance)
.map(ShowMinimapSuccessPayload.class::cast)
.map(ShowMinimapSuccessPayload::showMinimap)
.toFuture();
}

return Mono.just(true).toFuture();
}
}
Loading