Skip to content

feat: add Fanfou sync settings UI (connect account + choose sync rule) - #55

Merged
shukebeta merged 3 commits into
masterfrom
feat/issue-52-fanfou-sync-ui
Aug 4, 2026
Merged

shukebeta merged 3 commits into
masterfrom
feat/issue-52-fanfou-sync-ui

Conversation

@shukebeta

Copy link
Copy Markdown
Collaborator

Closes #52

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>
shukebeta and others added 2 commits August 4, 2026 20:04
- 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>
@shukebeta
shukebeta merged commit f99a77c into master Aug 4, 2026
4 checks passed
@shukebeta
shukebeta deleted the feat/issue-52-fanfou-sync-ui branch August 4, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Fanfou sync settings UI (connect account + choose sync rule)

1 participant