Skip to content

feat(toast): action-confirmation toasts with undo & change-list - #2995

Open
ElMagnea wants to merge 1 commit into
mainfrom
feat/action-confirmation-toasts
Open

feat(toast): action-confirmation toasts with undo & change-list#2995
ElMagnea wants to merge 1 commit into
mainfrom
feat/action-confirmation-toasts

Conversation

@ElMagnea

@ElMagnea ElMagnea commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Visuals

Marking something as watched by mistake
Screenshot 2026-07-23 at 15 09 29

Accidentally removing an item from a watchlist
Screenshot 2026-07-23 at 21 34 12

When adding an item to your watchlist, you can pick another list right after (if need be)
Screenshot 2026-07-23 at 21 34 18

What

Adds a global action-confirmation toast engine, gated behind a new ActionConfirmations preview flag (off by default; on for directors). The shared media mutation hooks fire a confirmation toast after each action, with an inline undo / "change list" affordance.

Action Toast Affordance
Add to watchlist "Title was added to your watchlist" Change list → opens the manage-lists drawer
Remove from watchlist / favorites / history "Title was removed…" Undo
Rate / remove rating "You rated Title X/10" / "Rating removed" Undo

How

  • New feature module lib/features/action-toast/ — a module-store singleton (mirrors useDismissals / markAsWatchedDrawerStore) + ActionToastHost mounted once in the layout, reusing the existing Snackbar primitive.
  • Undo runs the sibling hook method (via executeOrEnqueue), not the raw *Request — so it stays offline-aware, cache-invalidating, and consistent with the optimistic read overlay.
  • Global manage-lists drawer opener (manageListsDrawerStore + provider) so "change list" can open the drawer from anywhere.
  • Snackbar polish (shared): bold inline title (MessageWithBold), a theme-aware outline "pill" action (stroke token added to both modes.scss mixins), a hairline border, and a bottom fly-in/out animation (|global; respects prefers-reduced-motion).

Notes / scope

  • Behind a flag → safe to merge; no behavior change until toggled on.
  • Verified in both light and dark themes.
  • Deferred (follow-ups): useRemoveFromHistory (row-level, lossy undo) not wired; ratings "Change" (needs a global rating drawer); the outline-button look is scoped to the toast — a global button restyle is its own pass.

Verification

deno fmt ✓ · svelte-check 0/0 ✓ · vitest 2418 passed ✓ · i18n:check ✓. Undo is covered by tests that assert the real reverse request fires (watchlist / favorites / history).

🤖 Generated with Claude Code

@ElMagnea ElMagnea added this to the Reloaded milestone Jul 23, 2026
@ElMagnea ElMagnea self-assigned this Jul 23, 2026
@ElMagnea
ElMagnea requested a review from seferturan July 23, 2026 19:44
@trakt-bot
trakt-bot Bot enabled auto-merge (rebase) July 23, 2026 19:44
@michaldrabik

michaldrabik commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator
  • for actions that already have a confirmation dialog "Are you sure..." adding this seems a bit excessive and just noise?
  • for Rating Prompt UI can we do this somehow so it does not make everything taller and break symmetry? :P Maybe just an undo icon button next to X is enough, should be clear.
  • also just thinking now that Rating Prompt is not something strictly related to your active action of marking as watched so that might not be the best place to undo anything (might have scrobbled, checkin might have ended, other client might have marked etc.). 🤔

@Marius-TV
Marius-TV force-pushed the main branch 3 times, most recently from d6ed106 to 637bdc2 Compare August 2, 2026 05:08
Adds a global action-confirmation toast engine, gated behind a new
`ActionConfirmations` preview flag (off by default; directors on). The
shared media mutation hooks fire a confirmation toast after each action:

- watchlist add -> "change list" opens the manage-lists drawer
- watchlist/favorites/history removals + ratings -> "Undo", which
  reverses via the sibling hook (routes through executeOrEnqueue, so it
  stays offline-aware and cache-invalidating - not the raw request)

Engine lives in lib/features/action-toast (module-store singleton +
ActionToastHost), reusing the Snackbar primitive. Also adds a global
manage-lists drawer opener so the toast can open the drawer from
anywhere.

Snackbar polish (shared): bold inline title via MessageWithBold, a
theme-aware outline "pill" action (stroke token in modes.scss for both
light/dark), a hairline border, and a bottom fly-in/out animation
(|global so it plays on parent-mounted toasts; respects
prefers-reduced-motion).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@seferturan
seferturan force-pushed the feat/action-confirmation-toasts branch from 1fecc66 to 50f6171 Compare August 14, 2026 15:43
@deepsource-io

deepsource-io Bot commented Aug 14, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in c78500c...50f6171 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Coverage  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Aug 14, 2026 3:43p.m. Review ↗
Code coverage Aug 14, 2026 3:43p.m. Review ↗

Code Coverage Summary

Language Line Coverage (Overall)
Aggregate
68.2%
[▼ down 0.1% from main]
Javascript
68.2%
[▼ down 0.1% from main]

➟ Additional coverage metrics may have been reported. See full coverage report ↗


Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

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.

2 participants