Skip to content

Fix microphone notice teardown after dismissal - #1037

Open
jshph wants to merge 3 commits into
altic-dev:mainfrom
jshph:fix/microphone-notice-idle-cpu
Open

jshph wants to merge 3 commits into
altic-dev:mainfrom
jshph:fix/microphone-notice-idle-cpu

Conversation

@jshph

@jshph jshph commented Sep 30, 2026 •

Copy link
Copy Markdown

Description

Fix the microphone-change notice retaining its 30 Hz SwiftUI countdown after dismissal. A long-running FluidVoice 1.6.9 process used 15–17% idle CPU, and a scrubbed sample showed TransientOverlayCountdownBar in the SwiftUI/AttributeGraph stack.

The notice controller previously hid its panel while retaining the hosted view. An app-hosted test also found that AppKit could fade the panel to alpha 0 without calling the animation completion, leaving even the hide step unfinished. This change releases the hosted view on dismissal and adds a 200 ms fallback for the 100 ms fade. Its generation check prevents an older dismissal from removing a newer notice.

This is a focused candidate for FluidVoice's own idle CPU signature. It does not claim to resolve every report in #948 or the separate coreaudiod assertions.

Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Related to #948. This fix remains under testing while manual and long-uptime checks are pending.

Testing

  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS 26 (local Mac)
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml Sources Tests Package.swift
  • Ran formatter locally: swiftformat --config .swiftformat Sources
  • Ran a focused app-hosted test on the 1.6.10-beta.2 checkout: show a microphone notice, wait beyond its five-second timeout, and verify the panel is hidden and its hosted view is released. The test failed before the completion fallback and passed after it (1 test, 0 failures).
  • During the post-dismissal test window, FluidVoice Debug measured 0.1–0.8% CPU across four checks. A three-second sample contained no TransientOverlayCountdownBar or TimelineView frames.
  • Release build, signing verification, install, and idle smoke check passed on the 1.6.10-beta.2 checkout. The installed app measured 0.0% CPU across eight checks.
  • Build on current main: blocked by a Swift type-check timeout at Sources/Fluid/UI/DictionaryWordWizard.swift:754, which this PR does not change. The PR branch has not been installed over the tested app.
  • In a separate short hotkey recording check on the installed patched build (September 30), FluidVoice measured 0.0% CPU before capture, 10.3% during capture, and 0.0% after release. A three-second active sample showed direct Core Audio input and Parakeet/CoreML streaming work, with no TransientOverlayCountdownBar or TimelineView frames. A separate three-second idle sample also lacked those frames. This distinguishes expected work during capture from the reported sustained idle CPU; it does not establish a long-uptime fix.
  • Committed deterministic regression tests in 8a30ce7 for a withheld AppKit fade completion and for an older fallback firing after a newer notice. The two edited Swift files pass parsing and git diff --check, but these tests have not executed: unrelated existing Swift compile errors in MeetingStage05EvidenceAutorun.swift and later files stop the current-main test build before the test target can run. Temporary local build workarounds were reverted and are not in the PR.
  • Manually switch between two available microphones and restore the original selection; confirm each notice disappears after about five seconds and idle CPU returns near zero.
  • Use Parakeet for normal dictations and observe long idle uptime. Capture a hot sample if sustained idle CPU returns. Apple Speech Analyzer and coreaudiod remain separate follow-up checks.

Screenshots / Video

  • No UI/visual changes; screenshots/video are not applicable. The notice retains its existing appearance and five-second presentation. The patch changes teardown of its hidden hosting view and completion handling.

Notes

This PR is a provisional fix while the manual and long-uptime checks remain open. It intentionally does not close #948.

@github-actions github-actions Bot added needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence. labels Sep 30, 2026
@github-actions

Copy link
Copy Markdown

The PR Policy check is blocking this PR because required template information is missing.

Please update the PR description with:

  • Description
  • Type of Change
  • Related Issue or Discussion
  • Testing
  • Screenshots / Video

Visual files detected:

  • Sources/Fluid/Views/AutomaticDictionaryCorrectionOverlay.swift

Screenshots or video are required for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes. If this PR has no visual changes, check the no-visual-change box in the template.

If this remains incomplete for 48 hours after opening, the PR may be closed.

@github-actions github-actions Bot removed needs PR template Pull request is missing required template content. needs screenshots Pull request needs screenshot or video evidence. labels Sep 30, 2026
@altic-dev altic-dev self-assigned this Sep 30, 2026
@altic-dev altic-dev mentioned this pull request Oct 1, 2026
8 of 12 tasks
@jshph
jshph marked this pull request as ready for review October 1, 2026 19:00
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Refactors microphone notice dismissal and animation handling.

The PR appears safe to merge based on the reviewed changes, though its new tests remain unexecuted on current main.

Summary

The PR releases the microphone notice’s hosted view after dismissal and adds a fallback when AppKit omits the fade completion.

  • Adds regression tests for a missing completion and for an older fallback firing after a newer notice appears.
  • The previous request for fallback coverage has been addressed; the new tests have not yet run on current main.

Reviews (3) · Last reviewed commit: "Merge main into microphone notice fix"

Comment thread Sources/Fluid/Views/AutomaticDictionaryCorrectionOverlay.swift Outdated
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

This pull request has been marked stale because it has had no activity for 5 days. It will be closed in 2 days if there is no further activity. Add the keep-open or pinned label to prevent automatic closure.

@github-actions github-actions Bot added the stale label Oct 8, 2026
@jshph

jshph commented Oct 8, 2026

Copy link
Copy Markdown
Author

Bumping, this is still relevant. Happy to adjust based on any feedback.

@github-actions github-actions Bot removed the stale label Oct 9, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been marked stale because it has had no activity for 5 days. It will be closed in 2 days if there is no further activity. Add the keep-open or pinned label to prevent automatic closure.

@github-actions github-actions Bot added the stale label Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] FluidVoice accumulates high idle CPU over a long session (204 min CPU time in ~17 h uptime) — M4 Pro

2 participants