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:
@ -846,11 +846,17 @@ export class MockLayoutGateway implements LayoutGateway {
|
||||
return { activeId: ps.activeId };
|
||||
}
|
||||
|
||||
async setActiveLayout(projectId: string, layoutId: string): Promise<void> {
|
||||
async setActiveLayout(
|
||||
projectId: string,
|
||||
layoutId: string,
|
||||
): Promise<{ activeId: string }> {
|
||||
const ps = this.getProjectLayouts(projectId);
|
||||
// Self-heal (I4): only adopt the requested id when it exists; otherwise keep
|
||||
// the current active id. Either way the returned id is authoritative.
|
||||
if (ps.layouts.some((l) => l.id === layoutId)) {
|
||||
ps.activeId = layoutId;
|
||||
}
|
||||
return { activeId: ps.activeId };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user