feat(assistant): trip assistant chat with your own AI connection

Adds an in-app assistant that reads and plans the open trip. Users connect
their own provider (Sign in with ChatGPT, or an Anthropic, OpenAI, Gemini or
OpenRouter key) or use the one the admin set up, including a custom
OpenAI-compatible server. It is an addon and only shows while a connection
is usable.

The chat runs on the existing MCP tools, pinned to the trip. Every change is
held as a change card the user applies or discards, and applied changes can
be undone. On the desktop it is a floating window that can be moved and
resized; on the phone it is fullscreen. Search results show as place cards
that can go onto a day, weather lookups as a strip, proposed places as
ghost markers on the map with a before/after switch, and an answer can be
shared into the trip chat. Booking files can be dropped in and are read
into change cards.
This commit is contained in:
Maurice
2026-10-21 18:52:44 +02:00
parent bb3c0151d5
commit 214984f398
505 changed files with 51841 additions and 227 deletions
+27
View File
@@ -0,0 +1,27 @@
// FE-UTIL-MOTION-001 to 002: the one reading of "reduce motion", the app's switch or the system's.
import { afterEach, describe, expect, it, vi } from 'vitest';
import { prefersReducedMotion } from './reducedMotion';
function stubMedia(matches: boolean) {
vi.stubGlobal('matchMedia', (query: string) => ({ matches, media: query }) as MediaQueryList);
}
afterEach(() => {
vi.unstubAllGlobals();
document.documentElement.removeAttribute('data-reduce-motion');
});
describe('prefersReducedMotion', () => {
it('FE-UTIL-MOTION-001: follows the system setting when the app says nothing', () => {
stubMedia(true);
expect(prefersReducedMotion()).toBe(true);
stubMedia(false);
expect(prefersReducedMotion()).toBe(false);
});
it("FE-UTIL-MOTION-002: the app's own switch wins over a system that allows motion", () => {
stubMedia(false);
document.documentElement.setAttribute('data-reduce-motion', '');
expect(prefersReducedMotion()).toBe(true);
});
});
+15
View File
@@ -0,0 +1,15 @@
const REDUCE_MOTION = '(prefers-reduced-motion: reduce)';
/**
* Whether motion should be kept to a minimum: the app's own switch (the
* `data-reduce-motion` attribute the appearance settings put on <html>) or the
* system's. Read at the moment of asking, so a change takes effect on the next
* animation without a subscription. Without a window (tests, SSR) there is
* nothing to animate, so it answers true.
*/
export function prefersReducedMotion(): boolean {
if (typeof window === 'undefined') return true;
return (
document.documentElement.hasAttribute('data-reduce-motion') || (window.matchMedia?.(REDUCE_MOTION).matches ?? false)
);
}