Merge branch 't3code/improve-job-status-notification-details'

This commit is contained in:
2026-03-09 18:54:02 -04:00
22 changed files with 2243 additions and 302 deletions

View File

@@ -152,6 +152,53 @@ export type TaskStage =
| 'insights.generate'
| 'insights.persist';
export type TaskStageContext = {
progress?: {
current: number;
total: number;
unit: string;
} | null;
counters?: Record<string, number>;
subject?: {
ticker?: string;
accessionNumber?: string;
label?: string;
} | null;
};
export type TaskNotificationStat = {
label: string;
value: string;
};
export type TaskNotificationAction = {
id:
| 'open_details'
| 'open_filings'
| 'open_analysis'
| 'open_analysis_report'
| 'open_search'
| 'open_portfolio';
label: string;
href: string | null;
primary?: boolean;
};
export type TaskNotificationView = {
title: string;
statusLine: string;
detailLine: string | null;
tone: 'info' | 'success' | 'error';
progress: {
current: number;
total: number;
unit: string;
percent: number | null;
} | null;
stats: TaskNotificationStat[];
actions: TaskNotificationAction[];
};
export type Task = {
id: string;
user_id: string;
@@ -159,6 +206,7 @@ export type Task = {
status: TaskStatus;
stage: TaskStage;
stage_detail: string | null;
stage_context: TaskStageContext | null;
resource_key: string | null;
notification_read_at: string | null;
notification_silenced_at: string | null;
@@ -172,6 +220,7 @@ export type Task = {
created_at: string;
updated_at: string;
finished_at: string | null;
notification: TaskNotificationView;
};
export type TaskStageEvent = {
@@ -180,6 +229,7 @@ export type TaskStageEvent = {
user_id: string;
stage: TaskStage;
stage_detail: string | null;
stage_context: TaskStageContext | null;
status: TaskStatus;
created_at: string;
};