Skip to content

fix(desktop): persist zoom level across app restarts#1033

Merged
Kitenite merged 1 commit into
mainfrom
kiet-ho/debug-zoom-reset
Jan 28, 2026
Merged

fix(desktop): persist zoom level across app restarts#1033
Kitenite merged 1 commit into
mainfrom
kiet-ho/debug-zoom-reset

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Jan 28, 2026

Summary

  • Add zoomLevel to WindowState interface to persist user's zoom preference
  • Save zoom level when window closes
  • Restore zoom level when app starts

Addresses user-reported issue where zoom level would reset.

Test plan

  • Zoom in/out using CMD+Plus/Minus
  • Close and reopen the app
  • Verify zoom level is preserved

Summary by CodeRabbit

New Features

  • Application now automatically saves and restores your window zoom level preference between sessions.

Tests

  • Added comprehensive validation tests for zoom level handling, covering numeric values and edge cases.

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

Add zoomLevel to WindowState to persist user's zoom preference. The zoom
level is now saved when the window closes and restored when the app starts.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

Adds support for persisting and restoring window zoom level. The WindowState interface includes an optional zoomLevel property with validation logic accepting finite numbers. Window load/close events now capture and restore the zoom level alongside other window state.

Changes

Cohort / File(s) Summary
Window state validation
apps/desktop/src/main/lib/window-state/window-state.ts, apps/desktop/src/main/lib/window-state/window-state.test.ts
Adds optional zoomLevel?: number property to WindowState interface. Extends validation to reject non-finite zoomLevel values (NaN, Infinity) and enforce boolean type on isMaximized. Test suite covers valid zoom values, invalid cases (NaN, Infinity, string), and optional behavior.
Window zoom persistence
apps/desktop/src/main/windows/main.ts
Implements zoom level save/restore in window lifecycle: restores saved zoomLevel on window load and captures current zoom level when window closes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A zoom so fine, now saved with care,
Restored with every window's stare,
In and out, the level stays,
Through the desktop's testing maze!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
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.
Description check ❓ Inconclusive The description provides a clear summary of changes, test plan, and context, but does not follow the structured template with labeled sections like 'Related Issues' and 'Type of Change'. Restructure the description to follow the template with proper sections (Related Issues, Type of Change, Testing, etc.) for consistency and clarity.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: persisting zoom level across app restarts, which aligns with the primary objective of the changeset.

✏️ 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.

@Kitenite Kitenite merged commit d9df255 into main Jan 28, 2026
5 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

@Kitenite Kitenite deleted the kiet-ho/debug-zoom-reset branch January 29, 2026 20:40
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