fix(layout): auto-réparer l'onglet actif
stale
Le backend renvoie l'id actif autoritaire et le
frontend l'adopte pour éviter de rejouer un layout
disparu après overwrite externe.
Co-Authored-By: Claude Opus 4.8
<noreply@anthropic.com>
This commit is contained in:
@ -390,7 +390,7 @@ pub fn parse_session_id(raw: &str) -> Result<SessionId, ErrorDto> {
|
||||
|
||||
use application::{
|
||||
CreateLayoutOutput, DeleteLayoutOutput, LayoutInfo, LayoutOperation, ListLayoutsOutput,
|
||||
LoadLayoutOutput, MutateLayoutOutput,
|
||||
LoadLayoutOutput, MutateLayoutOutput, SetActiveLayoutOutput,
|
||||
};
|
||||
use domain::{AgentId, Direction, LayoutId, LayoutTree, NodeId};
|
||||
|
||||
@ -700,6 +700,23 @@ pub struct DeleteLayoutRequestDto {
|
||||
pub layout_id: String,
|
||||
}
|
||||
|
||||
/// Response DTO for `set_active_layout`.
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SetActiveLayoutResultDto {
|
||||
/// The layout actually activated — equals the requested id when valid, else
|
||||
/// the unchanged current active id (self-healing fallback). Authoritative.
|
||||
pub active_id: String,
|
||||
}
|
||||
|
||||
impl From<SetActiveLayoutOutput> for SetActiveLayoutResultDto {
|
||||
fn from(out: SetActiveLayoutOutput) -> Self {
|
||||
Self {
|
||||
active_id: out.active_id.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Request DTO for `set_active_layout`.
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
||||
Reference in New Issue
Block a user