feat: add Fanfou sync settings UI (connect account + choose sync rule) - #55
Merged
Merged
Conversation
Add a Fanfou (饭否) sync-settings surface mirroring the existing Mastodon/Telegram settings, consuming the backend OAuth + settings endpoints from HappyNotes.Api#12: - FanfouUserAccount entity + fromJson (sync-type / status text getters) - FanfouUserAccountApi (requestToken, getAll, nextSyncType, activate, disable, delete) — mutating routes are bodyless (single account per user) - FanfouUserAccountService + FanfouService.authorize() (request token -> launch authorize URL -> bounded poll of getAll) - AddFanfouUserAccount connect screen, FanfouSyncSettings screen + controller - Fanfou Sync entry in Settings; DI registrations - Unit test for the entity and a widget test asserting the Settings tile Closes #52 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- FanfouService.authorize now snapshots the current account id and waits for a *replacement* id (the backend replaces the account on success, minting a fresh id). A cancelled/failed re-authorization no longer reports success against the pre-existing account. Poll interval and attempt cap are now injectable for fast, deterministic tests. - fanfou_sync_settings: guard setState with mounted after awaited loads; catch and surface Delete errors like the Activate/Disable path. - Add focused tests: FanfouUserAccountService (getAll mapping, requestToken success/failure, bodyless mutations + ApiException) and FanfouService waitForNewAccount transition, including the pre-existing-account and cancelled-re-auth regressions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI's `dart format --set-exit-if-changed --page-width=120 .` flagged the new test/DI/mock files. Reformat them to the repository standard so the formatting check is clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #52