feat: risk acknowledgement — accept/snooze known risks (#77) - #83
Merged
Merged
Conversation
Backend:
- Add acknowledged_at (DateTime) and acknowledged_note (String) to Risk model
- Migrate existing DBs via _migrate_schema()
- Preserve acknowledgements on re-scan: save (check_id → ack) mapping before
deleting rows, re-apply when inserting new rows
- GET /risks: add ?acknowledged=true/false filter
- risks_summary: count only non-acknowledged risks (keeps dashboard accurate)
- PATCH /risks/{id}/acknowledge: set acknowledged_at + optional note
- PATCH /risks/{id}/unacknowledge: clear acknowledged_at and note
Frontend:
- Risk type gains acknowledged_at and acknowledged_note fields
- useRisks hook gains acknowledged filter option
- RisksPage: Active/Accepted tab toggle; active tab is default
- Summary cards only shown on Active tab
- Risk detail modal: Acknowledge button opens AcknowledgeModal with optional
free-text note; accepted risks show 'accepted' badge + note + Reopen button
- Acknowledge and Reopen actions refetch both risk list and summary counts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #77
What
Lets users mark a risk as accepted (acknowledged) so it's hidden from the active list and excluded from risk counts. Acknowledgements survive re-scans — keyed on
(device_id, check_id).Backend
Riskmodelacknowledged_at(DateTime), +acknowledged_note(String)_migrate_schemarun_checksGET /risks?acknowledged=true/falsefilterGET /risks/summaryPATCH /risks/{id}/acknowledgeacknowledged_at+ optional notePATCH /risks/{id}/unacknowledgeFrontend
acceptedbadge, display the note, and have a Reopen risk buttonTests
207 backend tests pass (unchanged — acknowledgement is plumbing-level).