Skip to content

Add responded checkbox to system notifications index#1493

Draft
maebeale wants to merge 1 commit into
mainfrom
maebeale/notification-responded
Draft

Add responded checkbox to system notifications index#1493
maebeale wants to merge 1 commit into
mainfrom
maebeale/notification-responded

Conversation

@maebeale
Copy link
Copy Markdown
Collaborator

What is the goal of this PR and why is this important?

  • Staff need a way to track which contact-us submissions have been replied to.
  • Currently there's no signal in the notifications index — admins have to remember (or open each notification) to know what's outstanding.

How did you approach the change?

  • Added a responded:boolean column to notifications (default false).
  • New "Responded" column on the system notifications index renders an inline-editable checkbox only for contact_us / contact_us_fyi kinds; other rows show an em-dash so staff aren't tempted to mark unrelated notifications.
  • The checkbox uses the existing autosave Stimulus controller, so toggling fires a PATCH to notifications#update — no submit button, no page reload.
  • update? policy is admin-only (matches the index permission).
  • Checkbox uses accent-green-600 so the native check renders green.

UI Testing Checklist

  • Sign in as admin → visit /notifications
  • Filter to a contact_us_fyi row → checkbox renders unchecked
  • Tick the checkbox → green ring flashes (autosave success), refresh → still checked
  • Untick → state persists after refresh
  • Non-contact-us rows show "—" in the Responded column
  • Sign in as a non-admin → PATCH /notifications/:id is denied

Anything else to add?

  • Migration is reversible (explicit up/down with if_exists: true).
  • Started with a boolean rather than responded_at datetime — YAGNI; we can layer a timestamp later if audit needs it.

🤖 Generated with Claude Code

Lets staff mark contact-us notifications as responded inline from the
index, so the team can track which messages have been replied to without
opening each one. Non-contact-us rows show an em-dash since the field
isn't meaningful for them.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant