Repository navigation
macOS Dock 안 읽은 메일 배지 (#47 1단계) - #81
littlebit0 wants to merge 8 commits into
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06fef1b37b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var count = 0; | ||
| for (final account in accounts) { | ||
| final messages = ref.watch(accountMessagesProvider(account.id)).valueOrNull; | ||
| count += messages?.where((message) => message.unread).length ?? 0; |
There was a problem hiding this comment.
Supply real unread state before enabling the Dock count
For accounts containing already-read mail, this displays the total loaded message count rather than the unread count: MailSummary.fromJson in apps/client/lib/services/mail_api_client.dart hardcodes unread: true, and the account-messages API does not supply synchronized read state. Consequently, even a mailbox with no unread messages receives a nonzero Dock badge. Merge the read-state dependency and deserialize its value before enabling this badge; the new test bypasses this problem by constructing MailSummary objects directly.
Useful? React with 👍 / 👎.
| final accounts = ref.watch(accountsProvider).valueOrNull ?? const []; | ||
| var count = 0; | ||
| for (final account in accounts) { | ||
| final messages = ref.watch(accountMessagesProvider(account.id)).valueOrNull; |
There was a problem hiding this comment.
Refresh mailbox data fetched before synchronization finishes
If an account is synchronizing when the app starts, this watch eagerly fetches and caches its partial or empty message list while the user is still on account management. After synchronization completes, refreshing account management invalidates only accountsProvider, not accountMessagesProvider. Opening that mailbox for the first time then reuses the prematurely cached list, and _MailboxContentState starts neither polling nor a completion refresh because the account is already idle. Previously, the first mailbox visit fetched the current list. Refresh these eagerly loaded lists when synchronization completes, or avoid populating the mailbox provider until it can be kept current.
Useful? React with 👍 / 👎.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Refs
Refs #47
배경
이슈 #47 1단계: 안 읽은 메일 수를 macOS Dock 아이콘 배지로 표시한다.
변경
BadgeService(MethodChanneldailypostbox/badge)와unreadCountProvider(불러온 계정별 목록의 unread 합)를 추가하고, 값이 바뀔 때마다 앱 루트에서 네이티브로 전달한다.AppDelegate.swift에서NSApp.dockTile.badgeLabel을 설정한다(0이면 제거).검증
tsc --noEmit통과(서버 변경 없음). 클라이언트flutter analyze,flutter test(합산 테스트 추가) 통과.flutter build macos --debug성공, 가짜 계정 데이터로 서버 API(/accounts, /messages) 응답 확인.미확인/후속
MailSummary.unread가 항상 true라 현재 배지는 불러온 메일 수와 같다. 읽음 동기화 후 정확해진다.badge, 위젯(2·3단계)은 후속.