fix(frontend): refresh immédiat de la liste des agents après ajout — bus d'événements agent-roster (CustomEvent + BroadcastChannel multi-fenêtres) publié à la création d'un agent et écouté par useAgents, LayoutGrid et les panneaux skills/permissions/tâches planifiées/templates/tickets/workstate, plus besoin d'ajouter-retirer une cellule pour forcer le refresh — #361 (QA verte: typecheck OK, vitest agents/singletonAgent OK, npm test 1416 tests OK)

This commit is contained in:
2026-09-16 20:14:51 +02:00
parent 3f6beb149b
commit 1cc842fd8b
13 changed files with 169 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import { useCallback, useEffect, useState } from "react";
import type { GatewayError, Template } from "@/domain";
import type { CreateTemplateInput, UpdateTemplateInput } from "@/ports";
import { useGateways } from "@/app/di";
import { publishAgentRosterChanged } from "@/features/agents/agentRosterEvents";
/** What the templates UI needs from this hook. */
export interface TemplatesViewModel {
@ -127,6 +128,7 @@ export function useTemplates(): TemplatesViewModel {
setError(null);
try {
await template.createAgentFromTemplate(projectId, templateId, opts);
publishAgentRosterChanged(projectId);
} catch (e) {
setError(describe(e));
} finally {