Skip to content

Commit 57f83ed

Browse files
committed
[6295] Add pitch for minimap default visibility
Bug: #6295 Signed-off-by: Florian Barbin <florian.barbin@obeosoft.com>
1 parent 3afab90 commit 57f83ed

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

CHANGELOG.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Measure the performance of Sirius Web based applications
88
- Add support for the auto-alignment edge feature
9+
- Add support for diagram minimap default visibility
910

1011

1112
=== Architectural decision records
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
:author: Florian Barbin
2+
:date: 2026-03-27
3+
:status: proposed
4+
:consulted: Florian Rouëné
5+
:informed: Florian Rouëné
6+
:deciders: Stéphane Bégaudeau
7+
:issue: https://github.com/eclipse-sirius/sirius-web/issues/6295
8+
9+
= (S) Diagram-Specific Minimap Persistence
10+
11+
== Problem
12+
13+
Currently, the minimap visibility is controlled by a global `localStorage` setting. If a user hides the minimap on one diagram, it remains hidden on all diagrams. Furthermore, diagram specifiers have no way to define a default state for their diagram via the View DSL.
14+
15+
== Key Result
16+
17+
Users will experience a minimap state that is contextually aware of the diagram they are viewing. We will measure success by the successful transition from a single global key in `localStorage` to a per-diagram key-value store.
18+
19+
=== Acceptance Criteria
20+
* **Initial Load:** A diagram loads with the minimap state (visible/hidden) defined in the View DSL.
21+
* **User Override:** If a user toggles the minimap, this preference is saved for *that specific diagram ID* only.
22+
* **Persistence:** Refreshing the page or returning to the diagram later respects the user's last manual toggle.
23+
* **No Global Interference:** Toggling the minimap on Diagram A does not change the visibility on Diagram B.
24+
25+
== Solution
26+
27+
We will move the minimap visibility logic away from a global boolean and into a hierarchy of concerns: **View DSL Default** => **User Interaction (Local Storage)**.
28+
29+
1. **View DSL integration:** Add a property to the View DSL, on the `DiagramDescription` to set the initial `showMinimap` state.
30+
2. **State Lookup:** On diagram component mount, the app checks for a user preference in `localStorage` keyed by the diagram ID. If null, it falls back to the default View DSL value.
31+
3. **Removal of Global Key:** Deprecate the existing global `sirius-diagram-mini-map-visibility` key to prevent state pollution.
32+
33+
=== Scenario
34+
35+
* **Scenario steps:**
36+
1. User opens a diagram "Complex Architecture" with UUID `dbce8f60-177b-46b9-975f-0f8e4e8b7297` (View DSL says `minimap: true`). Minimap is shown.
37+
2. User hides minimap. Local storage saves `{ "dbce8f60-177b-46b9-975f-0f8e4e8b7297": false }`.
38+
3. User opens "Simple Flow" (View DSL says `minimap: false`). Minimap is hidden.
39+
4. User returns to "Complex Architecture". Minimap remains hidden based on previous interaction.
40+
41+
=== Breadboarding
42+
43+
`[Minimap Toggle Button] -> Update Component State -> Persist to LocalStorage[DiagramID]`
44+
45+
`[Diagram rendering] -> Check LocalStorage[DiagramID] ?? View DSL Default -> Set Component State`
46+
47+
=== Cutting backs
48+
* **Nice-to-have:** A "Reset to Default" button in the UI to clear the `localStorage` override.
49+
50+
== Rabbit holes
51+
* **Diagram Identification:** If IDs are non-persistent (transient diagrams), the user preference will be lost.
52+
* **Storage Bloat:** If a user views thousands of diagrams, `localStorage` will accumulate thousands of small keys. We should consider to delete the oldest keys when deleting a diagram.
53+
* **View DSL Updates:** If a specifier changes the View DSL default *after* a user has already toggled it, the user will not see the "new" default. This is intended, but worth noting.
54+
55+
== No-gos
56+
* **Forcing State:** We will not implement a "Hard Lock" that prevents users from opening the minimap if the specifier hid it.
57+
* **Global Settings:** We will not maintain a "Global Toggle".

0 commit comments

Comments
 (0)