diff --git a/components/ideas/idea-detail-layout.tsx b/components/ideas/idea-detail-layout.tsx index a10c968..f6798d0 100644 --- a/components/ideas/idea-detail-layout.tsx +++ b/components/ideas/idea-detail-layout.tsx @@ -40,13 +40,6 @@ const API_TO_DB: Record[0]> type TabKey = 'idee' | 'grill' | 'plan' | 'timeline' -const TABS: { key: TabKey; label: string }[] = [ - { key: 'idee', label: 'Idee' }, - { key: 'grill', label: 'Grill' }, - { key: 'plan', label: 'Plan' }, - { key: 'timeline', label: 'Timeline' }, -] - interface IdeaLog { id: string type: string @@ -106,7 +99,8 @@ export function IdeaDetailLayout({ const searchParams = useSearchParams() const [pending, startTransition] = useTransition() - const tab = (TABS.some((t) => t.key === initialTab) ? initialTab : 'idee') as TabKey + const TAB_KEYS: TabKey[] = ['idee', 'grill', 'plan', 'timeline'] + const tab = (TAB_KEYS.includes(initialTab as TabKey) ? initialTab : 'idee') as TabKey function setTab(key: TabKey) { const params = new URLSearchParams(searchParams.toString()) @@ -138,7 +132,7 @@ export function IdeaDetailLayout({ className="inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground" > - Alle ideeën + Alle ideas {/* Header */} @@ -171,18 +165,29 @@ export function IdeaDetailLayout({ {/* Tab-switcher */} diff --git a/lib/realtime/use-notifications-realtime.ts b/lib/realtime/use-notifications-realtime.ts index b773861..13947e2 100644 --- a/lib/realtime/use-notifications-realtime.ts +++ b/lib/realtime/use-notifications-realtime.ts @@ -122,6 +122,13 @@ export function useNotificationsRealtime() { status: payload.status as 'queued', error: payload.error, }) + // Refresh zodra job klaar is — server heeft nu grill_md/plan_md + // geschreven en de idea-status bijgewerkt. router.refresh() triggert + // een server-component re-fetch zodat de Timeline de nieuwe + // GRILL_RESULT/PLAN_RESULT logs en de bijgewerkte status oppikt. + if (payload.status === 'done' || payload.status === 'failed') { + router.refresh() + } return }