Skip to content

chore: single-app cleanup — track overlay lockfile, fix electron dep, drop dead audio_level path - #69

Merged
Snehit70 merged 3 commits into
mainfrom
chore/single-app-cleanup
Jul 15, 2026
Merged

Snehit70 merged 3 commits into
mainfrom
chore/single-app-cleanup

Conversation

@Snehit70

@Snehit70 Snehit70 commented Jul 15, 2026 •

Copy link
Copy Markdown
Owner

Post-Phase-1 cleanup (follows #68). Three independent commits, no behaviour change intended.

1. chore(overlay): track bun.lock

The root bun.lock is tracked but the overlay workspace's was not, leaving overlay dependency resolution unpinned across machines and CI.

2. fix(overlay): declare electron as a runtime dependency

src/cli/app-launcher.ts:10 spawns overlay/node_modules/.bin/electron as the app's process runtime, so electron is load-bearing at runtime — not just for the overlay's tsc build. Declared as a devDependency it would be absent from any production / --omit=dev install and the app could not launch at all. The comment at app-launcher.ts:8 already asserted "the Electron runtime is the overlay package's dependency"; this makes the manifest match. Lockfile diff is a pure reclassification — no version drift, no new packages.

3. refactor: remove the vestigial daemon audio_level path

The daemon computed an RMS/peak level per PCM chunk, throttled to 30fps, smoothed with an EMA, and shipped it main → renderer as an audio_level IPC message. Nothing consumed it: overlay/src/renderer/LiveWaveform.tsx runs its own getUserMedia + Web Audio AnalyserNode, and App.tsx never read the audioLevel the hook exposed. The path existed for the native GTK overlay (#65, closed as superseded by ADR-0003), which had no Web Audio and needed levels computed host-side.

Removed end to end: producer (AudioRecorder.getAudioLevel + level event), relay (DaemonService.handleRecorderLevel, EMA fields, 33ms throttle), transport (AudioLevelMessage, main→renderer forward, preload bridge), and dead renderer state in useDaemonState. docs/ARCHITECTURE.md updated to match; the ADR-0003 mention was left intact as a dated historical record of what Phase 1 landed.

Verification

  • bun run typecheck + bun run typecheck:app — clean
  • bun run test — 240/240 vitest pass
  • bun test — 252/252 bun pass
  • bun run build:overlay and bun run build:app — both succeed
  • biome check findings identical to baseline (verified by diffing the uncapped github reporter output against main)

Summary by CodeRabbit

  • Changes
    • Removed audio-level events and subscriptions from the overlay and daemon communication.
    • The application now reports daemon state and connection status only.
    • Added overlay lifecycle controls, including readiness notifications, visibility updates, status access, and reconnect notifications.
    • Audio recording continues to provide raw and processed audio data without calculating or displaying audio-level updates.
    • Updated architecture documentation to reflect the streamlined event model.

Snehit70 added 3 commits July 15, 2026 15:20
The root bun.lock is tracked but the overlay workspace's was not, so overlay
dependency resolution was unpinned across machines and CI.
The app launcher spawns overlay/node_modules/.bin/electron as the process
runtime (src/cli/app-launcher.ts), so electron is load-bearing at runtime, not
just for the overlay's tsc build. Declared as a devDependency it would be
absent from any production/--omit=dev install and the app could not launch.
The daemon computed an RMS/peak audio level per PCM chunk, throttled it to 30fps,
smoothed it with an EMA, and shipped it main -> renderer as an audio_level IPC
message. Nothing consumed it: the overlay's LiveWaveform runs its own
getUserMedia + Web Audio AnalyserNode, and App.tsx never read the audioLevel the
hook exposed. The path existed for the native GTK overlay (PR #65, closed as
superseded by ADR-0003), which had no Web Audio and needed levels computed
host-side.

Removes the producer (AudioRecorder.getAudioLevel and its 'level' event), the
relay (DaemonService.handleRecorderLevel, the EMA fields, the 33ms throttle),
the transport (AudioLevelMessage, the main->renderer forward, the preload
bridge), and the dead renderer state in useDaemonState.
@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d797002a-0a0a-42f2-871d-c7fc0d849467

📥 Commits

Reviewing files that changed from the base of the PR and between f857959 and d20fed6.

⛔ Files ignored due to path filters (1)
  • overlay/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • docs/ARCHITECTURE.md
  • overlay/package.json
  • overlay/src/global.d.ts
  • overlay/src/preload.ts
  • overlay/src/renderer/useDaemonState.ts
  • src/app/main.ts
  • src/audio/recorder.ts
  • src/daemon/service.ts
  • src/shared/ipc-types.ts
💤 Files with no reviewable changes (4)
  • src/shared/ipc-types.ts
  • src/audio/recorder.ts
  • overlay/src/renderer/useDaemonState.ts
  • src/daemon/service.ts

📝 Walkthrough

Walkthrough

The audio-level event pipeline was removed from the recorder, daemon, IPC contracts, Electron bridge, and renderer hook. Daemon state events remain available, and Electron is now a runtime dependency for the overlay.

Changes

Audio-Level Pipeline Removal

Layer / File(s) Summary
Remove recording-level production and daemon handling
src/audio/recorder.ts, src/daemon/service.ts
Recorder level payloads, level events, smoothing, throttling, and daemon audio-level emissions were removed.
Remove audio-level IPC contracts and forwarding
src/shared/ipc-types.ts, src/app/main.ts, overlay/src/preload.ts, overlay/src/global.d.ts, overlay/package.json
Audio-level IPC types, forwarding, and bridge methods were removed; Electron was moved to runtime dependencies.
Remove renderer audio-level state
overlay/src/renderer/useDaemonState.ts, docs/ARCHITECTURE.md
The renderer hook no longer tracks audio levels, and architecture documentation describes state-only daemon events.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • Snehit70/hyprvox#21: Defines an overlay IPC design centered on daemon state without audio-level messages.
  • Snehit70/hyprvox#68: Introduced the single-app topology that previously forwarded audio-level events to the overlay.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main cleanup areas: overlay lockfile tracking, Electron dependency fix, and removing the unused audio_level path.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/single-app-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Snehit70

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Snehit70
Snehit70 merged commit 4eda481 into main Jul 15, 2026
2 checks passed
@Snehit70
Snehit70 deleted the chore/single-app-cleanup branch July 15, 2026 10:26
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