Skip to content

feat: Focus mode reminder when recording without DND#112

Open
StevenLi-phoenix wants to merge 1 commit intomainfrom
pr/focus-mode-103
Open

feat: Focus mode reminder when recording without DND#112
StevenLi-phoenix wants to merge 1 commit intomainfrom
pr/focus-mode-103

Conversation

@StevenLi-phoenix
Copy link
Copy Markdown
Owner

Summary

  • Add FocusModeService (nonisolated enum) that checks macOS Focus/DND status via INFocusStatusCenter
  • Add FocusReminderBanner overlay in ContentView shown when recording starts without Focus mode active — includes "Open Settings" (opens Focus system preferences), dismiss, and "don't remind again" buttons
  • Add focusReminderEnabled toggle in Recording settings tab
  • 6 tests covering status API, defaults behavior, and setting-gated logic

Test plan

  • Build succeeds (CODE_SIGNING_ALLOWED=NO)
  • FocusModeServiceTests — 6/6 pass
  • Manual: start recording with Focus off — banner appears
  • Manual: dismiss banner — disappears with animation
  • Manual: "Don't remind again" — persists across recordings
  • Manual: toggle off in Settings > Recording — no banner on next recording
  • Manual: "Open Settings" button opens System Settings Focus pane

Closes #103

Add FocusModeService to check macOS Focus/DND status via INFocusStatusCenter,
FocusReminderBanner overlay in ContentView, and a toggle in Recording settings.
When recording starts without Focus mode active, a dismissable banner suggests
enabling DND to avoid notification sounds in the recording.

Closes #103
@claude
Copy link
Copy Markdown

claude bot commented Mar 28, 2026

❌ Claude Code Review: REJECT

FocusModeService.requestAuthorization() never calls INFocusStatusCenter.default.requestAuthorization() (it just reads isFocused), and the required com.apple.developer.focus-status entitlement is not added to the entitlements file — meaning isFocused will always be nil, currentStatus() will always return .unknown, and shouldShowReminder() will always return false, so the banner will silently never appear.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Auto-merge skipped: Claude Code review did not approve. Manual review required.

@StevenLi-phoenix
Copy link
Copy Markdown
Owner Author

Notes — Focus Mode Reminder (#103)

232 行、6 文件——轻量但高价值。

1. INFocusStatusCenter

INFocusStatusCenter 是正确的 API。注意:

  • 需要 com.apple.developer.focus-status entitlement
  • 用户需要在 System Settings > Focus > Share Across Devices 中授权 app 读取 Focus 状态
  • 首次检查时可能需要权限请求

2. Banner 设计

"Open Settings" + dismiss + "Don't show again"三个操作覆盖了所有用户意图。

建议补充第四个选项:"Auto-enable DND"——直接为用户开启 Focus 模式(通过 INFocusStatusCenter 或 Shortcuts automation)。这需要用户预先在 System Settings 中配置 Shortcuts 触发器。

3. 与 Meeting Templates 集成

PR #101 的模板可以指定"此模板总是启用 Focus"——面试模板、保密会议模板等。FocusModeService.shouldRemind() 可以检查模板配置。

4. 通知声录入问题

Focus mode 的核心价值:录音过程中通知声会被 ASR 捕获,影响转录质量。这一点建议在 banner 文案中明确告知用户——"通知声可能被录入音频"比"建议开启勿扰"更有说服力。

5. 持久化

"Don't show again" 用 @AppStorage 存储——后续可以在 Settings 中重新开启。确认 key 名称与项目约定一致(如 focusReminderDismissed)。

@StevenLi-phoenix
Copy link
Copy Markdown
Owner Author

Focus Mode 集成路径

macOS 的 Focus 状态检测有权限限制。最低成本的实现:

  1. 使用 DistributedNotificationCenter 监听 DND 状态变化通知
  2. 录音开始时检查并显示 NSAlert 建议开启 DND
  3. 不需要额外的 entitlement 或系统扩展
  4. Focus 模式集成 — 自动暂停通知 (Focus Mode Integration) #103 Implementation Plan 保持一致

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.

Focus 模式集成 — 自动暂停通知 (Focus Mode Integration)

1 participant