Notechondria

Version: 0.1.56 Build Date: 2026-04-22T17:49

What's Changed

Cross-app dedup — AppShellOAuthMixin + shared url_strategy (step 3 of 8)

  • Third shared mixin. 225 lines of OAuth launch + callback handling move into notechondria_shared/lib/src/app_shell/app_shell_oauth_mixin.dart. Two methods exposed: launchOAuth(provider, invitationCode, intent) (stash invitation/intent in SharedPreferences, then browserRedirect to the provider's authorize URL); and handleOAuthCallback() (parse ?code=&state=, run the bind-flow if intent == 'bind', otherwise call the login-flow and pass the result to the subclass's applyAuthPayload).

  • Mixin declared on State<W>, AppShellAuthActionsMixin<W> so it inherits authClient, logAppTag, and applyAuthPayload from the auth mixin without re-declaring them. Two new abstract getters: String? get token (session token, used by the bind-flow's "session expired before redirect" guard) and ValueNotifier<String> get splashStatus (drives the splash screen's provider-specific labels).

  • notechondria_shared/lib/src/app_shell/url_strategy.dart

    • url_strategy_web.dart — promoted up from each per-app core/url_strategy*.dart so the three apps share one copy of the browser History API wrappers (push/replace/redirect). Conditional import: the web copy is resolved at compile time when dart.library.html is available.
  • editor_app/lib/app_shell.dart adds the new mixin and overrides token + splashStatus. core/auth_flows.dart shrinks 303 → 90 lines, keeping only the editor-specific deep-link dialog wiring (_openNoteByUuid, _showNoteDialogForDeepLink) and _restoreSession. The 213 lines of OAuth code are gone.

Files Changed

  • frontend/notechondria_shared/lib/src/app_shell/app_shell_oauth_mixin.dart (new).
  • frontend/notechondria_shared/lib/src/app_shell/url_strategy.dart
    • url_strategy_web.dart (new).
  • frontend/notechondria_shared/lib/notechondria_shared.dart — exports AppShellOAuthMixin.
  • frontend/editor_app/lib/app_shell.dartwith AppShellLogMixin, AppShellAuthActionsMixin, AppShellOAuthMixin.
  • frontend/editor_app/lib/core/auth_flows.dart — slimmed.