Skip to content

Add loading and error feedback to settings NotificationRow toggle persistence #194

Description

@Jagadeeshftw

📌 Description

NotificationRow (src/features/settings/components/notifications/NotificationRow.tsx) toggles email/weekly preferences with no pending state and no error feedback if the save fails, and its aria-label lacks the "notification preference" context.

💡 Why it matters: Users can't tell whether a preference change saved or failed.

🧩 Requirements and context

  • Disable the toggle and show a pending indicator while saving.
  • Surface an error (and revert) if the save fails.
  • Improve the toggle aria-label to describe the preference being changed.

Non-functional requirements

  • Must be secure, tested, and documented.
  • Should be efficient and easy to review.

🛠️ Suggested execution

1. Fork the repo and create a branch

git checkout -b feat/notificationrow-feedback

2. Implement changes

  • Write/modify the relevant source: src/features/settings/components/notifications/NotificationRow.tsx
  • Write comprehensive tests: src/features/settings/components/notifications/NotificationRow.test.tsx
  • Add documentation: inline TSDoc
  • Include TSDoc doc comments
  • Validate security assumptions: n/a

3. Test and commit

  • Run tests:
npm run test
  • Cover edge cases: save success, save failure + revert, pending disable
  • Include test output and security notes in the PR description.

Example commit message

feat(notifications): pending + error feedback on toggle row

✅ Acceptance criteria

  • Toggle disabled + pending indicator while saving
  • Error surfaced and state reverted on failure
  • aria-label describes the preference
  • Tests cover success/failure/pending

🔒 Security notes

None.

📋 Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions