fix(view-windows): réconcilier l'état des fenêtres détachées au boot (#50)

Branche le consommateur frontend sur la commande backend
`list_open_view_windows` : le port window expose la liste des fenêtres
de panneaux détachées réellement ouvertes côté OS, l'adaptateur Tauri
(et son double mock) l'implémente, et `ProjectsView` réconcilie le
placement des vues au démarrage à partir de ce snapshot au lieu de
supposer un état. Couvre `viewPlacement` et la réconciliation par des
tests dédiés.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-13 18:14:45 +02:00
parent afbf315e97
commit b4a01e0ae9
7 changed files with 300 additions and 1 deletions

View File

@ -90,6 +90,7 @@ import type {
UpdateTicketInput,
UiPreferencesGateway,
ViewWindowClosed,
ViewWindowSnapshot,
WindowGateway,
FocusedProject,
FocusedProjectGateway,
@ -1118,6 +1119,16 @@ export class MockWindowGateway implements WindowGateway {
}
}
async listOpenViewWindows(): Promise<ViewWindowSnapshot[]> {
// Mirror the backend enumeration: every currently-open detached window is
// reported visible, with a stable label derived from its panel id.
return [...this.open].map((panel) => ({
panel,
label: panel,
visible: true,
}));
}
async onViewWindowClosed(
handler: (event: ViewWindowClosed) => void,
): Promise<Unsubscribe> {