Skip to content

feat(flutter): present controller notices as Sonner toasts - #110

Open
darwin67 wants to merge 1 commit into
feat/flutter-shadcn-brand-themefrom
feat/flutter-shadcn-notice-infra
Open

darwin67 wants to merge 1 commit into
feat/flutter-shadcn-brand-themefrom
feat/flutter-shadcn-notice-infra

Conversation

@darwin67

Copy link
Copy Markdown
Member

Summary

Layer 2 of the Shadcn stack (base: the brand-theme PR). Introduces the Elm-consistent transient-notice boundary and uses it for the first event (reader settings saved).

  • shared/notice.dart: Notice/NoticeKind value data (no closures).
  • shared/sonner_bridge.dart: SonnerBridge, a view-layer adapter that observes the immutable model, presents a ShadToast exactly once per notice id, and reports back via a consumption callback. It never mutates model state.
  • LibraryModel gains a nullable notice; LibraryController raises a success notice on settings save and clears it on LibraryNoticeConsumed.
  • ProductShell wraps its scaffold in SonnerBridge.

This layer keeps the existing retry banners untouched; the next layers migrate the banners to toasts.

Testing

  • Controller test: settings save raises a success notice and consumption clears it.
  • Component test: SonnerBridge presents a notice once and reports consumption.
  • make test-flutter (284), make lint-flutter, make check-fmt-flutter.

Stack

  1. brand theme + reader theme consolidation (feat(flutter): apply the Shosai brand accent and unify reader theming on Shadcn #109)
  2. this PR — notice/Sonner infrastructure
  3. library operation results → toasts (retire banners)
  4. library retryable errors → destructive toasts with Retry
  5. reader transient errors → toasts
  6. ShadSheet/ShadTabs responsive surfaces
  7. ShadContextMenu/ShadBadge/ShadSeparator
  8. reader/dialog goldens + boundary docs

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