fix(windows): restauration panel-only des fenêtres détachées suivant le projet en focus (#47)

Partie backend. Les fenêtres/panneaux détachés étaient restaurés avec un
project_id figé au moment du détachement, si bien qu'ils restaient collés à
un projet mort ou incohérent après redémarrage. Ils sont désormais restaurés
en mode panel-only, sans project_id figé, et suivent le projet en focus de la
fenêtre principale via un event focused-project exposé par la couche fenêtre.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-13 12:37:25 +02:00
parent 1e0cb16ead
commit 6387fac34f
6 changed files with 156 additions and 107 deletions

View File

@ -1081,15 +1081,14 @@ pub struct PersistedMonitorState {
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PersistedWindowState {
/// Stable Tauri label. For detached views this is
/// `view-<panel>-<projectId-simple>`.
/// Stable Tauri label. For detached views this is `view-<panel>`.
pub label: String,
/// Window kind.
pub kind: PersistedWindowKind,
/// Detached view panel id. Present only for [`PersistedWindowKind::View`].
#[serde(default, skip_serializing_if = "Option::is_none")]
pub panel: Option<String>,
/// Detached view project id. Present only for [`PersistedWindowKind::View`].
/// Legacy detached view project id. Ignored by panel-only restore.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub project_id: Option<crate::ids::ProjectId>,
/// App URL loaded in the window.