Implement 400ms debounce with AbortController in useGeocode and
useDestinationStation to prevent excessive API calls. Add dark mode
toggle via new useTheme hook, persisting preference to localStorage
and applying to document root.
Pre-group calendar events by date using a Map in CalendarView to
replace O(n) filter operations with O(1) lookups.
- Wire `api/geocode` and `api/bike-route` to use `GeocodingClient`
and `BikeRoutingClient` instead of raw fetch calls
- Move `parseHafasJourneys` from `useJourneys` to `hafas-client`
- Remove dead code `src/lib/live-status-utils.ts`
- Update test setup to import `@testing-library/jest-dom/vitest`
Update CHECKLIST.md and REWRITE_PLAN.md to reflect the current
post-rewrite status and remaining tasks.
- Add input validation to /api/hafas route to enforce request shape
and cap results
- Fix SSR crash in useBikeRoute by using relative fetch URLs
- Wire CalendarPanel to fetch calendar events and merge them into the
global events store
Bump Next.js from v9 to v16.2.6 and add node-ical to
serverExternalPackages. Remove Geist font dependencies in favor
of system fonts. Fix state updates in geocode hooks to prevent
stale closures. Expose ApiClient methods as public and improve
error handling in fetchWithRetry.
Replace naive timezone offset calculation with a verification loop.
Try plausible offsets (CET/CEST), verify against actual offset at
candidate timestamp, and return the first match. This correctly
handles daylight saving time transitions in Vienna.
Mark completed items in CHECKLIST.md. Update API tests to use
NextRequest instead of Request and fix type assertions. Add missing
imports in unit tests for calendar and countdown utils.
Replace mock data in geocoding, HAFAS, and bike routing clients with
actual implementations using fetch and appropriate interfaces. Update
typescript definitions to match the new data structures, including
Journey, Station, and BikeRoute. Add vitest and related testing
dependencies, replacing the placeholder test script with actual tests
for the new client logic. Refactor calendar and countdown utilities to
use the new types and remove unused files.
Implement real API clients and update types
Replace mock data in HafasClient, GeocodingClient, and
BikeRoutingClient with actual fetch implementations. Update
types to match API responses and add Vitest tests.
- Set fixed test port before requiring server
- Mock global fetch to avoid external network calls
- Implement server readiness check via health endpoint
- Add explicit mock assertions for HAFAS proxy tests
- Split large test block into focused describe sections