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:
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user