Mirrors the NotificationType pattern. Removes duplicated _deviceTypes
list and _deviceIcon() helper from both device screens, centralising
all type-to-icon logic in the model.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 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>
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>
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>
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>
- 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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>