Commit Graph
124 Commits
Author SHA1 Message Date
rzuastiandClaude Sonnet 4.6 2da339a2b0 Add device detail screen and navigate to it from notifications and devices
- New /devices/:macAddress route showing all device fields with Register/Forget actions
- Device list items are now tappable; popup menu gains a "View details" item
- Notification list items with a linked device are tappable; popup menu gains a "View device" item
- Backend: new DB migration adds optional mac_address column to notifications
- Device-related notifications (NewDeviceFound, DeviceOnlineAfterTime, DeviceChanged) now store the triggering device's MAC address

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 18:24:35 -04:00
rzuastiandClaude Sonnet 4.6 07f7d54531 Extract snackbar notifications to UISnackbars utility
Centralises all SnackBar calls behind UISnackbars.showError/showSuccess/
showWarning/showInfo, each themed via AppColorExtension. New warning and
info colour tokens added to both themes. Calling any method clears any
visible snackbar before showing the new one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 17:43:01 -04:00
rzuastiandClaude Sonnet 4.6 3094753587 Add Register and Forget actions to devices list
Adds a context menu to each device card with contextual actions:
- Unregistered devices show a Register option (dialog with owner field
  and device type dropdown)
- Registered devices show a Forget option (confirmation dialog)

Also fixes CORS to allow PUT and DELETE methods, adds device type
tooltips on the icon, and renames the "New" filter/badge to
"Not registered".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 15:33:24 -04:00
rzuastiandClaude Sonnet 4.6 d0b9855bad Add devices screen to the Flutter frontend
Lists devices with New/Registered/All filtering, pull-to-refresh,
device-type icons, and visual differentiation between new and registered
devices. Introduces a reusable StatusBadge widget for colour-coded labels.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 14:58:11 -04:00
rzuastiandClaude Sonnet 4.6 6d72ba7202 Update project docs and dev environment
- Add linter commands to CLAUDE.md
- Add clippy to Nix dev shell
- Add TODO.md with project task list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 14:09:02 -04:00
rzuastiandClaude Sonnet 4.6 4f5a228aec Improve notifications list UX with auto-refresh and friendly timestamps
- Show "Just now" for notifications 2 minutes old or less
- Auto-refresh the list every minute, preserving the active filter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 14:08:30 -04:00
rzuastiandClaude Sonnet 4.6 f34dfe8386 Fix all dart analyze warnings in the Flutter frontend
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 13:57:03 -04:00
rzuastiandClaude Sonnet 4.6 cb2b3c6af7 Fix all clippy warnings in the Rust backend
Addresses all 31 warnings emitted by cargo clippy: redundant field
names in struct initialisers, unnecessary unwrap after is_some checks
(replaced with if-let), needless borrows, filter+next replaced with
find, iter().count() replaced with len(), clone on Copy type, and
manual match-to-Option replaced with .ok().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 13:48:33 -04:00
rzuastiandClaude Sonnet 4.6 44d593fccc Add OpenAPI documentation via Utoipa
Annotates all API handlers and model structs with Utoipa macros to generate
an OpenAPI 3.0 spec at runtime. Serves an interactive Swagger UI at /api/docs
and the raw JSON spec at /api/docs/openapi.json, both publicly accessible
outside the auth middleware.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 13:36:05 -04:00
rzuastiandClaude Sonnet 4.6 6002597383 Add mark all as read action to notifications list
Shows a done_all icon button in the AppBar when the New filter is active
and the list is non-empty, calling the notifications/mark_all_as_old endpoint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 12:10:02 -04:00
rzuastiandClaude Sonnet 4.6 bda7b87cc7 Add mark all as old API endpoint for notifications
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 11:55:30 -04:00
rzuastiandClaude Sonnet 4.6 a647e0d061 Add theme selection to settings page
Adds a dropdown in the settings page to switch between available themes
(Catppuccin Mocha, Gruvbox Dark). The selected theme is applied immediately
on save and persisted across restarts via SharedPreferences.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 11:38:16 -04:00
rzuastiandClaude Sonnet 4.6 527e2bd6c8 Style notification list items by read/unread status
Unread notifications (isNew=true) now show a secondaryContainer background,
bold title, and primary-colored icon per Material 3 guidelines. State changes
via mark-as-read/unread update the item's styling immediately in the All filter
view using mapItems with a copyWith, ensuring PagingStateBase's deep equality
check detects the change and triggers a rebuild.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 11:00:46 -04:00
rzuastiandClaude Sonnet 4.6 e320d54b38 Add mark as unread action to notifications list
Adds a "Mark as unread" option to the notification popup menu (shown only
for already-read items) and a swipe-right gesture, mirroring the existing
"Mark as read" actions. Swipe/menu actions respect the active filter:
items are removed from the list only when filtered to New or Old, and
snap back when viewing All.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 10:43:10 -04:00
rzuastiandClaude Sonnet 4.6 c04e76157e Add run.sh and fix run_tests.sh to use user's cargo cache
Add run.sh script to start the backend (erases db, runs cargo with sudo
using user's CARGO_HOME to avoid full recompilation). Remove sudo from
cargo test in run_tests.sh for the same reason.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 10:21:43 -04:00
rzuastiandClaude Sonnet 4.6 8153a216b9 Add mark as new API endpoint for notifications
POST /api/notifications/{id}/mark_as_new sets is_new=1, allowing a notification to be flagged as unread after it has been read.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 10:13:56 -04:00
rzuastiandClaude Sonnet 4.6 913bf0e839 Add mark as read action to notifications list
Users can now mark a notification as read via a popup menu on each list
item or by swiping left. Both actions call the backend API, remove the
item from the list, and show a snackbar confirmation. Swiping an already
read notification shows an error snackbar and bounces the item back.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 09:58:39 -04:00
rzuasti 09b67c2707 Added claude to the dev environment 2026-05-27 08:24:48 -04:00
rzuasti 12df11e2ee Added CLAUDE.md 2026-05-27 08:17:26 -04:00
rzuasti b8db6db83b Filters working on notifications 2026-03-04 16:22:00 -05:00
rzuasti 63ac1d04d5 Backend list notifications now supports pagination. Frontend
notification list is inifinite and lazy
2026-03-04 11:05:24 -05:00
rzuasti dc2521da65 Settings working on front-end and with it the notifications list 2026-03-03 12:20:57 -05:00
rzuasti 1d029c8c5f Added configuration redirect and partial settings form 2026-03-02 19:41:01 -05:00
rzuasti e6b5594226 Refactored events to notifications on front-end, added prefutils to read
shared  preferences.
2026-03-02 13:59:50 -05:00
rzuasti 2d64efa44b Frontend events are being returned from the API (yey!) 2026-02-27 12:28:16 -05:00
rzuasti 874a70969f Externalized web server config 2026-02-26 16:30:51 -05:00
rzuasti 7f754b3d17 Added API key validation on requests 2026-02-26 12:19:58 -05:00
rzuasti c50cd81be9 Added several endpoints to devices, mostly there! 2026-02-26 10:08:41 -05:00
rzuasti 884738196b Web server split into modules 2026-02-26 08:31:48 -05:00
rzuasti d3d8681626 TODO 2026-02-25 15:58:32 -05:00
rzuasti 9ff6c9ec7e List devices API working 2026-02-25 15:54:19 -05:00
rzuasti f45a22a892 Added list devices to database handler 2026-02-25 12:54:39 -05:00
rzuasti be38d2b15f Typo 2026-02-25 09:13:02 -05:00
rzuasti f88e02478a enhanced device database structure, added methods to device db module
and unit tests
2026-02-24 17:25:57 -05:00
rzuasti 5ca3b61dae Added endpoints to read notification and to read without flagging as old 2026-02-23 19:45:19 -05:00
rzuasti 03d2e6c9b1 Improved notifications structure and now saving notifications to
database when triggered
2026-02-23 13:23:36 -05:00
rzuasti e38b875052 Added notification read and insert from database 2026-02-23 11:04:57 -05:00
rzuasti 47788a6738 Refactored errors from String to custom error types 2026-02-23 09:57:22 -05:00
rzuasti 851a9419dc Added DEV_SHELL to flag the development shell 2026-02-22 11:43:33 -05:00
rzuasti 4b905bdde5 Made fish the develop shell 2026-02-21 15:10:35 -05:00
rzuasti 203d0dd98e List notifications endpoint working 2026-02-19 11:24:23 -05:00
rzuasti 5085bc0848 List notifications working 2026-02-19 10:57:04 -05:00
rzuasti e0e05823d1 Fixing tests 2026-02-19 10:49:38 -05:00
rzuasti 54e6dba496 Testing setup working, settings moved to a singleton and initialized on
main.
2026-02-18 11:23:20 -05:00
rzuasti 93b27c7205 About to change clap usage to builder (instead of derive) 2026-02-18 09:35:05 -05:00
rzuasti bc6a613a23 Trying to setup tests 2026-02-17 19:34:26 -05:00
rzuasti 08465fb847 Migrated db connections to pool 2026-02-17 15:20:47 -05:00
rzuasti f1093078bd Before moving to connection pooling for the DB 2026-02-17 14:10:39 -05:00
rzuasti 7d63859222 Added notifications table and model 2026-02-17 12:15:46 -05:00
rzuasti 1d1d0f150a Split device scanner and web server in modules 2026-02-17 09:34:22 -05:00