Add Dismiss label to toast button, reactivate on remind_at change

- Toast dismiss button now shows X icon + 'Dismiss' text to match
  the snooze button style
- Updating remind_at on a dismissed reminder clears is_dismissed
  and snoozed_until, making the reminder active again

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kyle 2026-02-24 03:31:29 +08:00
parent 38bce21ac3
commit 6cd5b71d1c
2 changed files with 5 additions and 3 deletions

View File

@ -139,9 +139,10 @@ async def update_reminder(
update_data = reminder_update.model_dump(exclude_unset=True) update_data = reminder_update.model_dump(exclude_unset=True)
# Clear stale snooze if remind_at is being changed # Reactivate reminder if remind_at is being changed
if 'remind_at' in update_data: if 'remind_at' in update_data and update_data['remind_at'] is not None:
reminder.snoozed_until = None reminder.snoozed_until = None
reminder.is_dismissed = False
for key, value in update_data.items(): for key, value in update_data.items():
setattr(reminder, key, value) setattr(reminder, key, value)

View File

@ -114,9 +114,10 @@ export function AlertsProvider({ children }: { children: ReactNode }) {
<button <button
onClick={() => dismissRef.current(reminder.id)} onClick={() => dismissRef.current(reminder.id)}
aria-label={`Dismiss "${reminder.title}"`} aria-label={`Dismiss "${reminder.title}"`}
className="p-1 rounded hover:bg-accent/10 hover:text-accent text-muted-foreground transition-colors" className="flex items-center gap-1 px-1.5 py-1 rounded hover:bg-accent/10 hover:text-accent text-muted-foreground transition-colors"
> >
<X className="h-3.5 w-3.5" /> <X className="h-3.5 w-3.5" />
<span className="text-[11px] font-medium">Dismiss</span>
</button> </button>
</div> </div>
</div> </div>