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:
2026-06-25 16:23:40 +02:00
parent 137620daa3
commit e916ecd95e
14 changed files with 372 additions and 51 deletions

View File

@ -375,8 +375,14 @@ export interface LayoutGateway {
renameLayout(projectId: string, layoutId: string, name: string): Promise<void>;
/** Deletes a layout; returns the new active layout id. */
deleteLayout(projectId: string, layoutId: string): Promise<{ activeId: string }>;
/** Sets the active layout for a project. */
setActiveLayout(projectId: string, layoutId: string): Promise<void>;
/**
* Sets the active layout for a project. Returns the layout id the backend
* *actually* activated — authoritative (invariant I4): it equals the requested
* id when valid, else the unchanged current active id (self-healing fallback
* when the requested id was stale, e.g. after an external overwrite of
* `layouts.json`). Callers must adopt this id rather than the one they asked for.
*/
setActiveLayout(projectId: string, layoutId: string): Promise<{ activeId: string }>;
}
/** Git: status/commit/checkout/… (L8). */