Commit Graph

25 Commits

Author SHA1 Message Date
fegger 834025e560 Show leave time instead of countdown
Replace live countdown with formatted leave time in headers and list items
Remove ticking interval and calculateCountdown import from EventHeader
Update EventListScreen to derive leave countdown and labels and adjust badge,
dot color, status logic and fallbacks
Update tests to expect 'Losgehen in'
2026-05-18 13:14:05 +02:00
fegger b3edf2c47b Support multiple API base URLs with fallback
Support Multiple API Base URLs With Fallback

Make ApiClient accept multiple base URLs and try the next when
responses indicate unavailability (408, 429, 502, 503, 504 or any >=500)
or on network errors. Add fetchApi helper and selection logic, and use a
Tailscale dev server as a fallback in the mobile service. Also update
EventHeader to show a live leave-by countdown.
2026-05-18 12:43:04 +02:00
fegger 44fb492759 Use extId station lookup and clamp walk durations
Add ApiClient.findStationByExtId and toStation helper; use it in
useOriginStationWalk. Clamp OSRM route/step durations to a minimum
walking speed (1.25 m/s) and update tests to mock the new API call.
2026-05-18 12:15:13 +02:00
fegger ce1fa4972c Account for origin walk in departure time
Add useOriginStationWalk and integrate it into EventDetail/EventList to
resolve walking time from origin to station. Introduce calculateLeaveByTime
for notification scheduling and use exported Expo trigger types. Support
HAFAS 'crd' coordinates in client and destination hooks, update tests,
jest mappings, and Expo run scripts.
2026-05-18 11:56:49 +02:00
fegger 9d6efdd43b Configure Expo mobile project and update Android/iOS bundles
Initialize iOS and Android native projects for the Time to Leave app.
Rename Android package to com.floegger.timetoleave and add iOS
project files. Add FontAwesome icons, calendar types, and
dependencies.
2026-05-15 18:26:51 +02:00
fegger 04e793cbb8 Implement journey ranking and improve UI presentation
Add `rankJourneys` utility to score connections based on arrival fit,
directness, and duration. Update `JourneyList` to display the best option
first with a "Top" badge and allow expanding to see more. Fix HAFAS
parser to include train direction in journey details. Limit API result
count to 5 and add TypeScript declaration for PNG assets.
2026-05-14 17:05:56 +02:00
fegger 0501d66fdc Update mobile app icons 2026-05-14 16:41:43 +02:00
fegger c221ef934a Add nav logo image and update AppNavigator 2026-05-14 13:53:43 +02:00
fegger 498958a27c Add JSDoc documentation to all TypeScript files 2026-05-14 13:53:12 +02:00
fegger 09b5e7725d Refactor departure time calculation to account for walk duration
Introduce `trainWalkDurationSeconds` in `useDepartureTime` hooks for both
mobile and web apps to filter train journeys based on total arrival time
including walking.

Add default origin station constants in core package and use them in mobile
store instead of returning null when no origin is saved.

Normalize HAFAS coordinates in destination station hooks to handle
large integer values.

Update `cleanLocation` to preserve full addresses with commas and remove
the 10KB request body limit on ICS parsing to support larger calendar
files.

Make rate limiting configurable via environment variables to handle
higher API fan-out from calendar event pages.
2026-05-14 12:17:09 +02:00
fegger bf252a9e9b Refactor mobile UI and centralize HAFAS parsing
Introduce useColors hook to replace direct theme usage in mobile
screens. Extract EventHeader, JourneyList, BikeSection, and
NearbyStops components to reduce complexity in EventDetailScreen.

Move parseHafasJourneys to packages/core for shared usage between
web and mobile clients. Update web API route with stricter HAFAS
validation and consistent client instantiation.

Add comprehensive codebase function guide documenting data flow,
shared packages, and service integrations.
2026-05-13 19:13:27 +02:00
fegger 6c7d57106c Update logo assets and pin React 19.1.0 versions
Add new SVG icon and logo variations for web app. Revert React
and React DOM to 19.1.0 to align with type definitions and
overrides. Remove privacy policy URL from mobile config and
disable hierarchical lookup in Metro bundler.
Pin React to 19.1.0 and add new logo assets
2026-05-13 17:05:22 +02:00
fegger 9e461aab1a Switch mobile app to dark theme and fix calendar filtering
Switch mobile app to dark theme and fix calendar filtering

- Default to dark theme in mobile app, matching web app style
- Filter native calendar events by location to exclude empty ones
- Add batch edit panel for destinations on web calendar
- Add edit support to AddEventModal
- Update notification trigger input type export
2026-05-13 09:45:55 +02:00
fegger de9a8606ab Add Google Calendar integration and improve station selection
Implement full OAuth 2.0 flow for Google Calendar, including token
exchange, refresh, and status checks. Add UI for connecting, syncing,
and disconnecting Google accounts in the Calendar panel.

Additionally:
- Make mobile station selection async with error handling and alerts
- Add HAFAS LocMatch method to API client for finding nearest station
- Expose Google OAuth env vars in Next.js config
2026-05-13 09:02:58 +02:00
fegger 672d053ece Add core app features for event management and notifications
- Add new hook files for departure time, destination station, geocode, theme, walk route, and WienerLinien
- Add navigation types for centralized route definitions
- Update App.tsx to use ref for initialization logic
- Update notification service to use stable exports from expo-notifications
- Remove legacy notifications.ts and rename to expoNotifications.ts
- Add ScrollView to several screens for better layout
- Replace duplicated type definitions with imports from shared navigation types
- Add useTheme to relevant screens
- Remove notification handler duplication in App.tsx
2026-05-13 08:37:52 +02:00
fegger 316e5def72 Refactor mobile to fix dependency resolution and add polyfills
Update Expo and React dependencies to compatible versions. Create a
custom Metro config to resolve module conflicts in the workspace and
map Jest modules to local node_modules.

Add a SharedArrayBuffer polyfill for older runtimes and introduce an
adapter for expo-notifications to abstract direct imports.
2026-05-12 22:29:38 +02:00
fegger 3c6df95a86 Refactor monorepo structure and replace hardcoded colors
Add TypeScript project references, update ESLint configs to support
ESM modules, and introduce brand semantic color tokens across the web
app. Add comprehensive documentation for architecture, API reference,
development setup, and user guide.
2026-05-12 21:22:40 +02:00
fegger 98e74ee48d Update lint and typecheck scripts for all packages
Add linting to the mobile app and include core and api-client
packages in the root lint, typecheck, and test scripts. Ignore
node_modules in all subdirectories and clean up stale test results.
Update lint and typecheck scripts for all packages

Add ESLint configuration for mobile app and shared packages.
Rename mobile jest config to .cjs and enable ESM. Include
packages/core and packages/api-client in monorepo lint,
typecheck, and test scripts.
2026-05-12 17:47:47 +02:00
fegger 2eeae9a27b Add arrival buffer and transport options to notification settings
Update notification calculation to use arrival buffer
Add advanced settings toggle for arrival buffer and transport options
Fix reverse geocode call in SettingsScreen
2026-05-12 15:05:23 +02:00
fegger 35971596b3 Add API security guards, rate limiter, and manual test checklist
Implement strict CORS enforcement and per-IP rate limiting in the Next.js middleware. Add input validation helpers for
coordinates and request body size limits. Introduce SSRF protection for calendar URL fetching. Update mobile settings to
support new transport options and arrival buffers. Include a comprehensive manual testing checklist for integration
verification.
2026-05-12 14:42:11 +02:00
fegger 08794eae05 Update branding guidelines and assets
Adds a comprehensive `BRAND_GUIDELINES.md` file detailing brand assets, color palettes, and typography.

This commit also introduces multiple SVG assets for various logo usages (icon, horizontal, dark mode), updates the main
`layout.tsx` metadata, and adds the necessary component files (`LogoIcon.tsx`, `LogoHorizontal.tsx`, etc.) to support
these new assets.
2026-05-11 22:59:03 +02:00
fegger dc5b40ff6e Update .gitignore 2026-05-11 21:10:42 +02:00
fegger b541c809b2 Update .gitignore 2026-05-11 21:02:31 +02:00
fegger 5bcfafcbaf Add mobile services, web proxy, and Gemma4 agent loop
- Mobile: add push notification and calendar sync services with full test suite (calendar, eventStore, notifications,
  screens)
- Mobile: add EAS build config and Jest setup
- Web: add API proxy, update useDestinationStation/useJourneys hooks, add middleware tests
- Web: update next.config and rebuild
- Agent: add Gemma4-based agent loop (agent_base, ttl_agent, ts_agent)
- Docs: add privacy policy, post-MVP plan, and aider rules
2026-05-11 18:32:54 +02:00
fegger 20159262c1 Add getLeaveStatus utility and update project status
- Introduce `getLeaveStatus` function in `packages/core/src/status-utils.ts` to determine leave-by status based on
  journey data
- Mark Phase 1 mobile app tasks as complete in `CHECKLIST.md`
- Add mobile workspace configurations and npm scripts
2026-05-10 22:14:41 +02:00