feat(windows): persistance et restauration des fenêtres au redémarrage (#40)

Persiste l'état des fenêtres (layout/position) et le restaure au
relancement de l'application. Découpage hexagonal :
- domaine : modèle et port d'état des fenêtres (layout, ports)
- application : use cases de persistance/restauration
- infrastructure : store window_state (adapter de persistance)
- présentation : câblage app-tauri (state, commands, lib)
Couvert par des tests ciblés domaine/application/infrastructure.

Depend de #39 (fermeture des fenêtres auxiliaires).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-13 08:00:20 +02:00
parent 55087b5d9b
commit 2eb51d3335
15 changed files with 887 additions and 40 deletions

View File

@ -1417,6 +1417,26 @@ pub trait ProjectStore: Send + Sync {
async fn load_workspace(&self) -> Result<crate::layout::Workspace, StoreError>;
}
/// Machine-local persistence of open OS window state.
#[async_trait]
pub trait WindowStateStore: Send + Sync {
/// Saves the latest open-window snapshot.
///
/// # Errors
/// [`StoreError`] on persistence failure.
async fn save_window_state(
&self,
snapshot: &crate::layout::WindowStateSnapshot,
) -> Result<(), StoreError>;
/// Loads the latest open-window snapshot.
///
/// # Errors
/// [`StoreError`] on unexpected I/O or deserialisation failure. A missing
/// snapshot is represented as an empty default snapshot.
async fn load_window_state(&self) -> Result<crate::layout::WindowStateSnapshot, StoreError>;
}
/// CRUD for the configured [`AgentProfile`]s in the global IDE store
/// (`profiles.json`, ARCHITECTURE §9.2). Profiles are the *data* that drives the
/// single generic [`AgentRuntime`] adapter (Open/Closed).