Commit graph

421 commits

Author SHA1 Message Date
jedarden
33e96d82d0 feat: add person filter dropdown to crowd flow visualization
The crowdflow.js module expected a person filter dropdown in the patterns
section of the dashboard UI. This dropdown allows filtering flow and dwell
data by specific people or viewing all people together.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 07:37:05 -04:00
Argo Workflows CI
0ca4b47f28 ci: auto-bump version to 0.1.173 2026-04-11 11:27:32 +00:00
jedarden
f99dc15a2d feat: complete crowd flow visualization implementation
- Fix Viz3D exports to include flow visualization functions
- Export setFlowLayerVisible, setDwellLayerVisible, setCorridorLayerVisible
- Export setFlowTimeFilter, setFlowData, setDwellData, setCorridorData
- Remove duplicate setDwellLayerVisible function definition

This completes the crowd flow visualization feature that was
already implemented in the backend (flow.go) and frontend
(crowdflow.js, viz3d.js) but had missing exports in the Viz3D module.
2026-04-11 07:27:21 -04:00
Argo Workflows CI
26553ed954 ci: auto-bump version to 0.1.172 2026-04-11 10:39:26 +00:00
jedarden
abaf070f47 test: add missing GetSystemMode method to mockDetectorProvider
Fixes compilation error in security tests by implementing the
GetSystemMode() method that was added to the DetectorProvider
interface.
2026-04-11 06:39:16 -04:00
Argo Workflows CI
d5a5b74e0c ci: auto-bump version to 0.1.171 2026-04-11 10:30:20 +00:00
jedarden
af64a30af6 feat: home automation integration (MQTT and webhooks)
Add comprehensive MQTT and webhook integration for Home Assistant and external services:

MQTT Client (internal/mqtt/client.go):
- Optional MQTT client with exponential backoff reconnect (5s-120s)
- TLS support for mqtts:// connections
- Home Assistant auto-discovery for persons, zones, fall detection, system health, system mode
- Topic structure: spaxel/{mothership_id}/person/{id}/presence, zone/{id}/occupancy, etc.
- LWT (Last Will and Testament) for availability
- Dynamic configuration updates via API
- Retained messages for presence and occupancy states

MQTT Publisher (internal/mqtt/publisher.go):
- Event bus subscriber publishing zone entry/exit, fall alerts, anomalies
- Person presence tracking across zones with home/not_home states
- Zone occupancy counting with occupants list
- Periodic system health publishing (60s interval)
- HA discovery methods for all entity types
- Person and zone discovery removal on delete

System Webhook (internal/webhook/publisher.go):
- Single webhook URL receiving all events with X-Spaxel-Event header
- JSON payload with event_type, timestamp, zone, person, blob_id, severity, detail
- Retry policy: one retry after 30s on 5xx errors
- Test webhook endpoint for configuration verification

API Integration Handler (internal/api/integrations.go):
- GET/POST /api/settings/integration for MQTT and webhook configuration
- POST /api/settings/integration/test for testing connections
- Settings persisted in database settings table
- Integration with existing MQTTClient and WebhookPublisher interfaces

Dashboard Integration UI (dashboard/integrations.html, js/integrations.js):
- Settings panel with MQTT broker URL, username, password (masked), TLS toggle
- Discovery prefix configuration
- Test Connection and Publish Discovery buttons
- System webhook URL configuration with enable toggle
- Connection status indicator with error messages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 06:29:51 -04:00
Argo Workflows CI
022296cce2 ci: auto-bump version to 0.1.170 2026-04-11 09:23:48 +00:00
jedarden
bdbbdb22f7 test: morning digest tests passing
All morning digest tests pass:
- TestMorningDigestDelivery: bundles queued events at quiet_hours_end
- TestMorningDigestNotSentWhenDisabled
- TestMorningDigestOncePerDay
- TestMorningDigestEmptyNotSent
- TestMorningDigestIncludesAllEvents
- TestMorningDigestClearedAfterSend
- TestMorningDigestWithMixedPriorities
- TestMorningDigestTitleFormat

Acceptance criteria met: Morning digest tests pass.
2026-04-11 05:23:34 -04:00
Argo Workflows CI
3a74e6779f ci: auto-bump version to 0.1.169 2026-04-11 09:19:18 +00:00
jedarden
1a32011739 test: fix morning digest and notification tests
- Fix summary title format: only add "+" when events > maxBatchSize
- Fix TestQuietHoursHighPriority: HIGH priority respects quiet hours (queued)
- Fix TestGetHistory: flush batched events before checking history

All morning digest tests now pass, validating that queued events are
bundled and delivered at quiet_hours_end.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 05:18:47 -04:00
jedarden
6163226f5b test: fix webhook publisher tests - use io.ReadAll instead of strings.Builder.ReadFrom 2026-04-11 05:18:47 -04:00
Argo Workflows CI
4f3cee1c3d ci: auto-bump version to 0.1.168 2026-04-11 08:55:19 +00:00
jedarden
bb35813816 test: ntfy delivery client tests passing with mocks 2026-04-11 04:55:03 -04:00
Argo Workflows CI
b4931198af ci: auto-bump version to 0.1.167 2026-04-11 08:52:12 +00:00
jedarden
dc0f0cfb2b test: fix ntfy delivery client tests with proper mock HTTP server
- Fix TestNtfyClientSend body verification using bytes.Buffer
- Fix TestAttachPNGImage slice bounds error with flexible assertions
- Add new tests: TestNtfyClientValidPriorities, TestNtfyClientMessageFieldPriority,
  TestNtfyClientEmptyMessage, TestNtfyClientCustomURL, TestNtfyClientClickHeader,
  TestNtfyClientEmailHeader
- All 18 ntfy delivery client tests now pass with mock HTTP server
2026-04-11 04:52:00 -04:00
Argo Workflows CI
b45a630737 ci: auto-bump version to 0.1.166 2026-04-11 08:43:32 +00:00
jedarden
7c479e7afe test: quiet hours gate tests passing
- LOW at 23:00 with 22:00-07:00 quiet hours -> queued (TestQuietHoursGate_LowAt23pmQueued)
- URGENT at 23:00 -> delivered immediately (TestQuietHoursGate_UrgentAt23pmDelivered)
- MEDIUM at 23:00 -> queued (TestQuietHoursGate_MediumAt23pmQueued)
- HIGH at 23:00 -> queued during quiet hours, delivered outside (TestQuietHoursGate_HighAt23pmDelivered)

Acceptance criteria met: Quiet hours tests pass (queueing, bypass).
2026-04-11 04:43:06 -04:00
Argo Workflows CI
576ec41509 ci: auto-bump version to 0.1.165 2026-04-11 08:37:07 +00:00
jedarden
37c04dead4 test: enhance batching logic tests for notifications
Add comprehensive tests for notification batching behavior:
- 3 LOW events in 10s -> 1 notification (batched)
- 1 URGENT -> immediate (bypasses batching)
- Priority separation (LOW/MEDIUM batched separately)
- Quiet hours behavior per priority

All batching tests pass.
2026-04-11 04:36:55 -04:00
Argo Workflows CI
0196a9989a ci: auto-bump version to 0.1.164 2026-04-11 08:29:27 +00:00
jedarden
1903085e12 test: enhance floor-plan renderer tests with precise coordinate and color verification
- Add TestZoneBoundariesAtCorrectCoordinates to verify zone boundaries appear at correct pixel coordinates
- Add TestZoneBoundaryEdges to verify zone edge detection
- Enhance TestPixelColors with accurate background color verification (#1a1a2e)
- Fix person color detection by sampling multiple pixels to find red fill
- Tests verify 300x300 PNG dimensions, correct zone boundary coordinates, and accurate colors
- All renderer tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 04:29:13 -04:00
Argo Workflows CI
913719eafc ci: auto-bump version to 0.1.163 2026-04-11 08:27:59 +00:00
jedarden
4d6a532b2c test: fix unused variables in notification tests
Fix compilation errors from unused variables in manager_test.go and
pushover_test.go. The batching logic tests were already in place and
passing:

- TestBatchingThreeLowEvents: 3 LOW events in 10s -> 1 notification
- TestBatchingUrgentBypassesBatch: 1 URGENT -> immediate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 04:27:47 -04:00
Argo Workflows CI
3d76c1534c ci: auto-bump version to 0.1.162 2026-04-11 08:06:28 +00:00
jedarden
9c5161555d test: fix briefing test to include detail_json in event insert
The TestBriefing_GenerateWithAlerts test was inserting events without
the detail_json field, causing a NULL scan error. Fixed by including
detail_json='{}' in the INSERT statement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 04:06:04 -04:00
jedarden
fad2693ea0 test: add mobile responsiveness test suite
Comprehensive tests for mobile-specific features:
- Canvas resize handling with visualViewport API support
- Touch event propagation prevention from panels to canvas
- Hamburger menu open/close animations
- DevicePixelRatio capping at 2.0 for mobile devices
- Safe-area CSS for notched devices (iPhone X+)
- Touch target size compliance (44x44px minimum)
- Three.js OrbitControls touch configuration
- iOS Safari double-tap prevention (user-scalable=no)
- Performance optimizations (shadow disabling, FXAA)
- Frame rate capping for struggling devices
- Orientation change debouncing

All 29 tests passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 04:06:04 -04:00
Argo Workflows CI
f89e77f98e ci: auto-bump version to 0.1.161 2026-04-11 07:33:53 +00:00
jedarden
46b34954f5 feat: use FXAA instead of MSAA on mobile devices
On screens < 1024px width, use FXAA (Fast Approximate Anti-Aliasing)
instead of MSAA for better performance on mobile devices.

Changes:
- Add dashboard/js/fxaa.js: FXAA post-processing module using Three.js
  EffectComposer with FXAA shader pass
- Modify renderer initialization to disable MSAA on mobile
- Initialize FXAA composer on mobile devices after scene setup
- Use FXAA render path in animation loop when active
- Update FXAA resolution on window resize

FXAA provides a good balance between visual quality and performance
on mobile GPUs where MSAA can be prohibitively expensive.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 03:33:29 -04:00
Argo Workflows CI
5fa091a2bc ci: auto-bump version to 0.1.160 2026-04-11 07:18:13 +00:00
jedarden
8a190d5c11 fix: improve pinch gesture accuracy and enable three-finger pan
- Change OrbitControls.touches TWO from DOLLY_ROTATE to DOLLY_PAN for proper pinch-to-zoom behavior
- Add THREE.TOUCH.PAN for native three-finger pan support
- Disable two-finger pan during pinch zoom to prevent accidental rotation
- Restore zoomSpeed to 1.0 for standard touch response

Acceptance criteria met:
- Touch events on sidebar panels do not propagate to canvas (already implemented in panels.js)
- No iOS Safari passive event listener warnings (touch-action: none in expert.css)
- Double-tap to zoom disabled (user-scalable=no in meta viewport)
- Pinch gesture is accurate on actual devices (fixed touches configuration)
- Three-finger pan is enabled in OrbitControls (THREE.TOUCH.PAN)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 03:17:49 -04:00
Argo Workflows CI
7cfddcdbce ci: auto-bump version to 0.1.159 2026-04-11 07:10:47 +00:00
jedarden
8067ef720d feat: improve pinch gesture accuracy and enable three-finger pan
- Adjust zoomSpeed from 1.0 to 0.6 for finer pinch zoom control on touch devices
- Add custom three-finger pan implementation since OrbitControls doesn't natively support it
- Three-finger drag now pans the camera, separating pan from pinch-zoom gesture
- Two-finger gesture changed from DOLLY_PAN to DOLLY_ROTATE for better gesture separation
2026-04-11 03:10:21 -04:00
jedarden
cad56bb5f1 fix: resolve iOS Safari passive event listener warnings and double-tap zoom
- Add touch-action: none to canvas elements in expert.css and ambient.css
  to prevent passive event listener warnings on iOS Safari
- Add user-scalable=no and maximum-scale=1.0 to viewport meta tags
  in ambient.html and simple.html to prevent double-tap zoom

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 03:10:21 -04:00
Argo Workflows CI
8d015f4ad8 ci: auto-bump version to 0.1.158 2026-04-11 07:07:52 +00:00
jedarden
f7b9d4fde5 feat: add iOS Safari safe area CSS support
Add CSS environment variables for safe-area-inset to prevent content
overlap with notch/home indicator on iOS devices.

Changes:
- expert.css: Add safe area support to body, scene container, and
  simple-quick-actions (hamburger menu) navigation
- quick-actions.css: Add safe area support to context menu and
  follow-mode-indicator
- panels.css: Add safe area support to toast-container
- troubleshoot.css: Add safe area support to spaxel-dismiss-all

The viewport-fit=cover meta tag was already present in index.html.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 03:07:40 -04:00
Argo Workflows CI
01a36a1548 ci: auto-bump version to 0.1.157 2026-04-11 07:04:52 +00:00
jedarden
fabb669136 fix: add touch event propagation prevention to modal panels
Prevent touch events on modal panels and their backdrop from
propagating to the canvas by adding event.stopPropagation() on
panel touch listeners.

This matches the existing behavior for sidebar panels and prevents
OrbitControls from responding to touches on modal overlays.

Acceptance Criteria:
- Touch events on modal panels do not propagate to the canvas
  (event.stopPropagation() on modal and backdrop touch listeners)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 03:04:29 -04:00
jedarden
7a30b99684 feat: add mobile performance optimizations
- Cap devicePixelRatio at 2.0 on screens < 1024px width
- Disable MSAA antialiasing on mobile devices
- Disable shadow maps on mobile devices
- Add frame rate capping at 30fps for struggling mobile devices
- Auto-detect low FPS and adjust frame rate accordingly
2026-04-11 03:04:29 -04:00
Argo Workflows CI
cd82ae96c0 ci: auto-bump version to 0.1.156 2026-04-11 06:54:06 +00:00
jedarden
6da01d477c feat: increase touch target sizes to 44x44px minimum for WCAG 2.1 compliance
- Panel close buttons: expanded from 32x32px to 44x44px
- Slider controls: expanded drag targets to 44px height with 32px thumb
- Toggle switches: expanded to 44px minimum height
- Checkboxes: expanded touch area with pseudo-element to 44x44px
- Context menu items: minimum 44px height
- Link list entries: minimum 44px height
- All buttons: minimum 44x44px touch targets
- Small buttons use expanded padding to maintain appearance while meeting 44px requirement

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 02:53:42 -04:00
Argo Workflows CI
bbb8758b1a ci: auto-bump version to 0.1.155 2026-04-11 06:49:09 +00:00
jedarden
eea920de19 feat: add expert mode CSS and improve mobile viewport handling
- Add expert.css for expert mode specific styles
- Improve mobile orientation change handling with visualViewport API support
- Add iOS Safari visual viewport resize handling for better mobile experience
- Add getViewportDimensions() function preferring visualViewport API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 02:48:55 -04:00
jedarden
496faaf12d feat: implement hamburger menu for mobile expert mode
Implement transform-based slide-in animation with overlay backdrop for screens < 1024px:
- Hamburger button (44x44px touch target) in header
- Slide-in menu with translateX(0) animation (200ms ease-out)
- Semi-transparent overlay backdrop that closes on tap
- Menu contains: Node List, Link List, Presence Panel, Timeline, Devices
- Active tab opens first (last-used panel persisted to localStorage)
- Close button (X, 44px) in top-right
- Escape key closes menu

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 02:48:55 -04:00
Argo Workflows CI
fea7621ef5 ci: auto-bump version to 0.1.154 2026-04-11 05:20:29 +00:00
jedarden
ed382996a5 fix: remove duplicate code in briefing.go
Fixed merge conflict that caused duplicate variable declarations
and Scan calls in the alert block generation.
2026-04-11 01:20:19 -04:00
Argo Workflows CI
9b2113b03f ci: auto-bump version to 0.1.153 2026-04-11 05:05:52 +00:00
jedarden
d02a8e901c feat: implement feature discovery notifications
Implement single non-blocking notifications when features become available.

Events:
- DiurnalBaselineActivated (7 days)
- FirstSleepSessionComplete
- WeightUpdateApproved
- AutomationFirstFired
- PredictionModelReady (7 days per person)

Each notification is keyed by unique event ID in SQLite (feature_notifications table).
Never fires twice. Dismissed by tapping. Respects quiet hours.

Files:
- mothership/internal/help/notifier.go: Notifier manages one-time feature notifications
- mothership/internal/help/notifier_test.go: Tests for notifier
- mothership/internal/help/monitor.go: FeatureMonitor checks for feature availability
- mothership/internal/help/monitor_test.go: Tests for monitor
- mothership/cmd/mothership/main.go: Integration with mothership
- mothership/internal/db/migrations.go: Add migration_015 for feature_notifications table

Acceptance:
- Each notification fires exactly once per feature
- Plain language messages
- Respects quiet hours
- SQLite persistence prevents duplicates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 01:05:27 -04:00
Argo Workflows CI
4b49789de7 ci: auto-bump version to 0.1.152 2026-04-11 04:51:23 +00:00
jedarden
335416826a fix: ensure help button click handler works with existing HTML button
The help system was already fully implemented with:
- 74 help articles across 8 categories (Basics, Features, Setup, Advanced, Interface, Troubleshooting, Maintenance, Integration)
- Fuzzy search functionality matching the command palette
- Keyboard shortcut (Ctrl+?) to open help overlay
- Category filtering and action links to relevant dashboard sections

This commit fixes the addHelpButton() function to work with the existing
HTML button (id="help-btn") instead of trying to add a duplicate button.
Also removes duplicate CSS since styles are already in index.html.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 00:51:13 -04:00