Commit Graph

18 Commits

Author SHA1 Message Date
shawn 6c1d5c3910 feat: add comprehensive empty states & onboarding
- Enhanced empty-state design pattern (icon + heading + description + CTA)
- Customers: 'No Customers Yet' with Add Customer CTA
- Locations: 'No Locations Yet' with Add Location CTA
- Dashboard: Full empty state when no assets exist, preserves activity card
- Activity Feed: Enhanced empty state with Add Asset CTA
- Reports: Guidance cards explaining what each section shows when empty
- Onboarding: Welcome overlay for first-time users (localStorage flag)
- CSS: empty-state-card, guidance-card, esc-* classes, onboard-overlay
2026-05-20 22:36:11 -04:00
shawn e66ed51e7f fix(navigate): fix Navigate tab routing, add empty state, route search, mode toggle
- Fixed switchTab recursion bug when leaving tabNavigate (set currentTab early + return)
- Fixed closeNavigate to not call switchTab (caller handles tab transition)
- Added renderNavPage call in switchTab lifecycle for tabNavigate
- Added empty state with asset search on Navigate page
- Added route-finding: search assets, navigate from search results
- Added driving/walking mode toggle with OSRM route display
- Added ETA display for driving mode
- Fixed route polyline to use OSRM road geometry when available
- Added switchNavMode function for mode switching
- Improved directions label (Walking vs Driving)
2026-05-20 22:35:49 -04:00
shawn fae2a84213 feat: custom modal system - alert/confirm/prompt/form, animations, ESC/click-outside close, focus trap, aria, full test coverage 2026-05-20 22:33:00 -04:00
shawn 0c0d3e6be3 T6 - Map Page Improvements: clustering, real GPS heatmap, dismissible GPS warning, address geocoding fallback, legend
- Add Leaflet.markercluster CDN + cluster group for dense asset pins
- Replace placebo heatmap with real check-in GPS data (/api/checkins/heatmap)
- GPS warning dismissible with ✕ button + re-enable option
- GPS-denied fallback: geocode asset addresses via /api/geocode-address when lat/lng missing
- Add map legend showing category colors for asset markers
- Fix modal HTML: add prompt area + modalActions id for prompt/modals
- Add modal prompt CSS, legend CSS, GPS badge dismiss styles
2026-05-20 22:32:13 -04:00
shawn 828fd5c482 T5 - Dashboard Fixes: active technicians, interactive bars, quick actions, caching
- Fix Active Technicians: query users WHERE role='technician' instead of counting from visit data
- Interactive bar charts: hover tooltips show label+count, click drills down to filtered asset list
- Quick action icons: coin for Assets, Sites, Check-in replaces CSV export buttons
- No visit data: suggestion card with 'Add a Check-in' button
- No manufacturer data: hide section entirely when empty
- 30-second TTL cache on both backend (/api/stats) and frontend (loadDashboard)
- Add dashboard cache module with time-based invalidation
2026-05-20 22:25:24 -04:00
shawn d844429f56 Fix: test_map_api.py DB isolation — set CANTEEN_DB_PATH inside client fixture
Previously relied on module-level env var which got overwritten
when frontend tests' conftest.py test_db_path fixture ran first.
Now explicitly sets env var inside client fixture + invalidates
caches before import. Also fixed importlib order.
2026-05-20 19:57:39 -04:00
shawn dd02fb36d1 Refactor: dedicated navigation page (tabNavigate)
- New tabNavigate panel with its own map, route info, walking directions, Google Maps link
- Added to bottom nav bar (🧭 Nav) and drawer nav (🧭 Navigate)
- navigateToAsset() now switches to tabNavigate instead of cluttering the map tab
- Back button returns to previous tab
- Auto-cleanup navMap when leaving the tab
2026-05-20 19:24:54 -04:00
shawn ffe9090668 Fix: move GPS geocode block outside payload object literal
The F2 auto-populate address block was accidentally inserted inside
the payload={} object literal, causing a JS syntax error that
broke the entire script and prevented the login screen from showing.
2026-05-20 18:35:23 -04:00
shawn d7f2e07c68 feat: 6 UX improvements for field technicians
F1: Scan existing asset → auto check-in (handleBarcode now autoCheckins)
F2: Auto-generate address from GPS reverse geocode (Nominatim, all 3 modes)
F3: Larger camera viewport (3:4 aspect ratio, full-width)
F4: Building # already syncs to Address/Trailer field (existing)
F5: Parking location GPS button already exists (fillGpsParking)
F6: Navigation tool with route line on map (existing navigateToAsset)

Backend: Added GET /api/geocode endpoint for reverse geocoding
2026-05-20 18:01:39 -04:00
shawn b69bffe44a feat: auto check-in on barcode scan of existing assets
- handleBarcode() now calls autoCheckin() after finding asset via barcode
- showScannedAsset() no longer shows manual checkin card
- Replace 'Check In' button with 'Auto checked in' indicator
- Add CSS for sr-checkin-done span
2026-05-20 17:57:04 -04:00
shawn c1020ac702 feat: add 📍 GPS button next to parking_location to fill current coordinates 2026-05-20 17:55:16 -04:00
shawn 02b3ba665e feat: oninput handler copies building # to trailer number
- Manual asset form: manBuildingNumber → manAddress (address/trailer field)
- Location form: locFormBldgNum → locFormTrailer
2026-05-20 17:55:00 -04:00
shawn 8b92d37d01 camera: taller viewport (16/14), less bottom margin (4px) 2026-05-20 17:51:52 -04:00
shawn fc0a3ee9be fix: auto-update asset lat/lng on check-in so map shows pins
Previously assets never had coordinates populated - only checkins did.
Now when a checkin is created with GPS data, the asset's latitude/longitude
fields are auto-updated. Also backfilled existing assets from their latest
checkin history. This fixes empty maps — loadAssetPins() filters by
a.latitude != null.
2026-05-20 15:43:43 -04:00
shawn 8cc563374d fix: call listVideoInputDevices on reader instance, not static
ZXing.BrowserMultiFormatReader.listVideoInputDevices is an instance
method, not a static method. Call codeReader.listVideoInputDevices()
after creating the reader. Also wrap in try/catch with null fallback
so decodeFromVideoDevice picks the default camera if enumeration fails.
2026-05-20 15:32:44 -04:00
shawn 45af141073 docs: update README and PROJECT.md with OCR, barcode, auto-checkin changes 2026-05-20 15:06:05 -04:00
shawn b20998e8e3 fix: OCR last-5-digits extraction, barcode 1D-only scanning, auto-checkin on create
- OCR: Extract only last 5 digits from Connect ID (XXXXX-XXXXXX → last 5)
- Barcode: Switch to decodeFromVideoDevice with 1D-only format hints
  (Code 128/39/EAN/UPC/ITF/Codabar), TRY_HARDER, 50ms scan interval
- Auto check-in: New assets auto-checkin with GPS on creation via
  all three entry modes (barcode, OCR, manual)
- Tests: Updated e2e tests for login wait and API flow
2026-05-20 15:03:20 -04:00
shawn 7da3f28c6a Initial commit: Canteen Asset Geolocation Tool v2 2026-05-17 18:55:28 -04:00