fix(dashboard): intentions page priority + trigger rendering

IntentionItem.priority was typed as string but the API returns the
numeric FSRS-style scale (1=low, 2=normal, 3=high, 4=critical), so the
dashboard always rendered 'normal priority' regardless of the real
value. trigger_value was also a plain string but the API actually
returns trigger_data as a JSON-encoded payload (e.g. {"type":"time",
"at":"..."}), so the UI surfaced raw JSON or empty strings for every
non-manual trigger.

Swap to numeric priority + PRIORITY_LABELS map and add a
summarizeTrigger() helper that parses trigger_data and picks the most
human-readable field (condition / topic / formatted at / in_minutes /
codebase/filePattern) before truncating for display.

Extends PR #26 (snake_case in_minutes / file_pattern on TriggerSpec)
end-to-end to the UI layer.
This commit is contained in:
Sam Valladares 2026-04-18 18:16:56 -05:00
parent e9b2aa6d4d
commit d58e851af5
2 changed files with 51 additions and 13 deletions

View file

@ -178,12 +178,12 @@ export interface IntentionItem {
id: string;
content: string;
trigger_type: string;
trigger_value: string;
trigger_data: string; // JSON-encoded trigger payload (e.g. {"type":"time","at":"..."} )
status: string;
priority: string;
priority: number; // 1=low, 2=normal, 3=high, 4=critical
created_at: string;
deadline?: string;
snoozed_until?: string;
deadline?: string | null;
snoozed_until?: string | null;
}
// Node type colors for visualization — bioluminescent palette