feat(assistant): a card framework every addon package plugs into

This commit is contained in:
Maurice
2026-10-22 12:14:24 +02:00
parent d2a2728cde
commit 3967ca2790
514 changed files with 9868 additions and 1274 deletions
@@ -1,6 +1,7 @@
import type { AssistantApplied } from '@trek/shared';
import { createContext, useContext } from 'react';
import type { EntityTarget } from './cards/cardTypes';
/** What the parts deep inside a chat need from whoever shows it. */
export interface AssistantView {
tripId: number;
@@ -8,8 +9,12 @@ export interface AssistantView {
variant: 'window' | 'fullscreen';
/** How much room the chat has: a narrow window and the phone are 'compact'. */
density?: 'compact' | 'roomy';
/** Shows an applied change in the planner; the button is left out where nothing can show it. */
onShowOnMap?: (applied: AssistantApplied) => void;
/**
* Opens what a card or an applied change points at: a spot on the plan's
* map, a tab of the trip, another page. The buttons are left out where
* nothing can open them.
*/
onOpen?: (target: EntityTarget) => void;
/** Selects a day in the planner, from its weather; left out where no planner can show it. */
onFocusDay?: (dayId: number) => void;
/** Brings the map into view where the chat covers it (the phone), before the map moves. */