Files
ai-agent/frontend/vitest.config.ts
Gabriel Vidal d3ed893d85 feat(nav): the bottom bar is now @gabvdl/ui's BottomNav, with sub-links and swipe
The bar's markup moved into the design system (BottomNav 0.35.4) and
BottomBar became what only this app can know: which sections exist, what
each one routes to, and that tapping Conversation on home brings the
tucked-away composer back instead of navigating nowhere.

What is new for the user:

- a second level. Tap the section you are already in and its pages rise
  from behind the bar — Dashboards (activity, analytics, environment,
  graph), Files (memories, plans, goals, skills, agents, notifs) and
  Settings (shortcuts, tags, cron). Five slots per drawer; the rest wait
  in the hold-to-rearrange stash, and both orders persist server-side
  under the new "nav-sub" list.
- swipe navigation. A left/right swipe on the content area walks the bar
  one section at a time, with the page following the finger; inside an
  expanded section it walks that section's pages and steps out past
  either end. Swipes that start in a horizontal scroller or on the bar
  itself are left alone.

nav.ts grew SUB_SECTIONS (the second level, with the route prefixes each
entry owns) and navKeyOf(), which resolves a path to the finest-grained
bar destination — sectionOf() is unchanged and still owns the sections.

Also the frontend's first test setup: vitest + testing-library + jsdom,
60 tests covering the bar (sections, active route, taps, the composer
tap, drawers, swipes) and the route→section/sub-section mapping.
2026-08-11 21:26:32 +02:00

23 lines
800 B
TypeScript

import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import path from "node:path";
/**
* Test config, kept apart from `vite.config.ts`: the app build carries the PWA
* plugin and a build-time `__BUILD_ID__`, neither of which a jsdom run wants.
*/
export default defineConfig({
define: { __BUILD_ID__: JSON.stringify("test") },
resolve: { alias: { "@": path.resolve(__dirname, "src") } },
plugins: [react()],
test: {
environment: "jsdom",
globals: true,
setupFiles: ["./src/test/setup.ts"],
include: ["src/**/*.test.{ts,tsx}"],
// @gabvdl/ui is ESM with a few extensionless deep imports (prismjs); let
// Vite resolve it instead of Node, which insists on the extension.
server: { deps: { inline: [/@gabvdl\/ui/] } },
},
});