Skip to content

macOS Dock 안 읽은 메일 배지 (#47 1단계) - #81

Open
littlebit0 wants to merge 8 commits into
mainfrom
feat/issue-47-unread-badge
Open

littlebit0 wants to merge 8 commits into
mainfrom
feat/issue-47-unread-badge

Conversation

@littlebit0

@littlebit0 littlebit0 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Refs

Refs #47

배경

이슈 #47 1단계: 안 읽은 메일 수를 macOS Dock 아이콘 배지로 표시한다.

변경

  • BadgeService(MethodChannel dailypostbox/badge)와 unreadCountProvider(불러온 계정별 목록의 unread 합)를 추가하고, 값이 바뀔 때마다 앱 루트에서 네이티브로 전달한다.
  • AppDelegate.swift에서 NSApp.dockTile.badgeLabel을 설정한다(0이면 제거).

검증

  • 서버 tsc --noEmit 통과(서버 변경 없음). 클라이언트 flutter analyze, flutter test(합산 테스트 추가) 통과.
  • flutter build macos --debug 성공, 가짜 계정 데이터로 서버 API(/accounts, /messages) 응답 확인.

미확인/후속

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T18:56:05.696959Z
We couldn’t complete this review. Comment @codex review to try again.
7e18e05 New commits
🔒 Security Review ✅ Completed 2026-11-21T16:14:06.212652Z 08800b7 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@littlebit0

Copy link
Copy Markdown
Owner Author

실제 macOS 앱 확인 결과를 반영해 PR 본문 "미확인/후속"에 의존 관계를 적었습니다: 이 PR은 PR #67(읽음·별표 동기화) 이후 병합해야 배지가 실제 안 읽은 수를 반영합니다. 코드 변경은 없습니다.

@codex review

언어 (최우선)

리뷰 제목·본문·요약·지적 사항은 모두 한국어로 작성하세요.

댓글작성

지적은 문제, 재현 조건, 수정 방향 순서로 짧게 쓰세요.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 08800b7d84

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 08800b7d84

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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