Skip to content

fix(window): reset to default size when restored geometry exceeds monitor resolution#112

Merged
j4rviscmd merged 2 commits intomainfrom
feat/window-size-guard
Mar 28, 2026
Merged

fix(window): reset to default size when restored geometry exceeds monitor resolution#112
j4rviscmd merged 2 commits intomainfrom
feat/window-size-guard

Conversation

@j4rviscmd
Copy link
Copy Markdown
Owner

Summary

  • Add fits_on_any_monitor() validation to window geometry restoration
  • When saved window size exceeds every connected monitor's logical resolution (e.g. after disconnecting an external display), the window falls back to default 1200×800 and is centred by the OS
  • Extract available_monitors() helper to reduce duplication between is_position_on_screen and fits_on_any_monitor

Related Issue

N/A

Type of Change

  • ✨ New feature
  • 💥 Breaking change
  • 🐛 Bug fix
  • 📝 Documentation
  • ♻️ Refactoring
  • 🔧 Chore

Breaking Changes

None.

Test

  • Run npm run dev (starts Tauri dev server)
  • Verify the app launches with correct window size on the current monitor
  • Optionally: save geometry larger than current monitor, restart, confirm fallback to 1200×800

Screenshots / Videos (Optional)

N/A

Checklist

  • Code follows clean architecture (proper separation of concerns)
  • Code is simple and concise (no unnecessary complexity)
  • Comments are sufficient for non-obvious logic
  • No sensitive information included (credentials, secrets, personal data)
  • Conventional Commits format followed in commit messages
  • Tests added/updated (or N/A for docs/chore)

🤖 Generated with Claude Code

j4rviscmd and others added 2 commits March 28, 2026 23:00
…tor resolution

When restoring saved window geometry on startup, the saved size is now
validated against all connected monitors. If the width or height exceeds
every monitor's logical resolution (e.g. after disconnecting an external
display), the window falls back to the default 1200x800 and is centred
by the OS instead of rendering off-screen.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@j4rviscmd j4rviscmd added the bug Something isn't working label Mar 28, 2026
@j4rviscmd j4rviscmd merged commit c37d072 into main Mar 28, 2026
2 checks passed
@j4rviscmd j4rviscmd deleted the feat/window-size-guard branch March 28, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant