Skip to content

feat: add preference to show/hide widget while recording#67

Open
Shahor wants to merge 1 commit intoamicalhq:mainfrom
Shahor:feat-preference-show-widget-active
Open

feat: add preference to show/hide widget while recording#67
Shahor wants to merge 1 commit intoamicalhq:mainfrom
Shahor:feat-preference-show-widget-active

Conversation

@Shahor
Copy link

@Shahor Shahor commented Jan 21, 2026

Adds a new "Show widget while active" toggle in preferences that allows
users to control whether the recording widget is visible during active
recording sessions. Previously the widget was always shown when recording.

The changes add:

  • New showWidgetWhileActive preference with UI toggle
  • Logic in app-manager.ts to conditionally show/hide widget based on recording state
  • Schema, settings service, and tRPC updates to support the new setting

Why

When using tiling window managers like Aerospace, the recording widget appearing can be
disruptive. These window managers automatically manage window focus and workspace
placement, so when the widget appears and takes focus, it can:

  • Trigger an unwanted workspace/space change
  • Unfocus the window you're currently working in
  • Disrupt your workflow by rearranging windows

This preference allows users to hide the widget during active recording, avoiding these
focus-stealing issues while still being able to record.

Summary by CodeRabbit

  • New Features
    • Added a "Show widget while active" preference so you can control widget visibility when the app is in use separately from when it's idle.
    • Settings now include a toggle for this option and the app will update widget visibility immediately when either active or inactive visibility preferences change.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

Added a new boolean preference showWidgetWhileActive across database schema, settings service, API schema, UI, and app manager; widget visibility logic now chooses between active/inactive preferences based on idle state.

Changes

Cohort / File(s) Summary
Database Schema
apps/desktop/src/db/app-settings.ts, apps/desktop/src/db/schema.ts
Add showWidgetWhileActive boolean to default settings and AppSettingsData.preferences (optional).
Service Layer
apps/desktop/src/services/settings-service.ts
Add showWidgetWhileActive to AppPreferences; default to true in getPreferences; support updates and emit showWidgetWhileActiveChanged in setPreferences.
API Schema Validation
apps/desktop/src/trpc/routers/settings.ts
Add showWidgetWhileActive: z.boolean().optional() to AppPreferencesSchema.
Widget Visibility Logic
apps/desktop/src/main/core/app-manager.ts
Update preferences-changed handler to accept showWidgetWhileActiveChanged; updateWidgetVisibility now selects visibility using idle state -> (showWidgetWhileInactive if idle, else showWidgetWhileActive).
UI Settings Panel
apps/desktop/src/renderer/main/pages/settings/preferences/index.tsx
Add UI toggle "Show widget while active", handleShowWidgetWhileActiveChange, and derive showWidgetWhileActive (default true) from preferences; insert between existing sections.

Sequence Diagram(s)

sequenceDiagram
  participant UI as "Renderer UI\n(Settings Page)"
  participant TRPC as "trpc Router\n(API)"
  participant Service as "Settings Service"
  participant DB as "DB / App Settings"
  participant App as "Main App\n(AppManager / Idle)"

  UI->>TRPC: setPreferences({ showWidgetWhileActive })
  TRPC->>Service: setPreferences(payload)
  Service->>DB: persist preferences (showWidgetWhileActive)
  Service-->>App: emit "preferences-changed" (showWidgetWhileActiveChanged: true)
  App->>App: evaluate idle state
  alt idle
    App->>App: use showWidgetWhileInactive to set widget visibility
  else active
    App->>App: use showWidgetWhileActive to set widget visibility
  end
  App-->>UI: (optionally) update widget state / UI
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nibble code at break of day,
A tiny toggle finds its way,
When active sun or idle night,
The widget springs to view or hides from sight,
Hooray — a hop, a joyful sway! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a preference to control widget visibility while recording.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@Shahor Shahor force-pushed the feat-preference-show-widget-active branch from 52e4dd2 to fffcd14 Compare January 21, 2026 09:58
  Adds a new "Show widget while active" toggle in preferences that allows
  users to control whether the recording widget is visible during active
  recording sessions. Previously the widget was always shown when recording.

  The changes add:
  - New showWidgetWhileActive preference with UI toggle
  - Logic in app-manager.ts to conditionally show/hide widget based on recording state
  - Schema, settings service, and tRPC updates to support the new setting
@Shahor Shahor force-pushed the feat-preference-show-widget-active branch from fffcd14 to 0d8e769 Compare January 21, 2026 10:00
@haritabh-z01
Copy link
Contributor

Hey @Shahor
Can you share the steps to reproduce? Would the widget not taking focus be a better solution here?
I want to limit additions of new settings / configurations unless they are really needed. We do have plans to have separate advanced/simplified configurations to make things easier for users, but thats a still bit off.

If you can help me with the reproduction of the issue, and if just ensuring widget doesn't grab focus won't solve it, I should be able to better help out here.

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.

2 participants