Skip to content

Refresh overlay positioning after boot display changes - #87

Merged
apyfz merged 1 commit into
mainfrom
fix/overlay-boot-position
Oct 19, 2026
Merged

apyfz merged 1 commit into
mainfrom
fix/overlay-boot-position

Conversation

@apyfz

@apyfz apyfz commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

The overlay reads monitor geometry only once during startup. If Windows initially reports no displays or later changes their geometry, placement continues using the initial snapshot. A DPI change can also leave CSS dimensions unchanged without triggering ResizeObserver.

Wait for saved settings before positioning, refresh display enumeration every two seconds, and reapply placement when geometry or DPI changes. Preserve saved coordinates, retain the last usable geometry during transient failures, prevent overlapping reads, and clean up subscriptions and pending responses on unmount.

This addresses startup positioning gaps found while investigating the boot-position feedback. The supplied logs contain no display geometry or saved coordinates, so the reporter's exact failure still needs on-device confirmation.

Validation: 15 tests passed across display refresh and pixel-shift suites; production frontend build and git diff --check passed. Full TypeScript checking still has existing errors in unchanged files. Manual Windows boot and mixed-DPI verification remain pending.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: fc9a2f23-124d-4d0b-802f-72fe96626a0f
📥 Commits

Reviewing files that changed from the base of the PR and between 0eb9f7c and 599e88c.

📒 Files selected for processing: 3
  • tauri-app/src/OverlayApp.tsx
  • tauri-app/src/lib/overlay-displays.test.ts
  • tauri-app/src/lib/overlay-displays.ts

Included review availability: This review used your included allowance. 7 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

📝 Walkthrough

The overlay now tracks display geometry changes and waits for settings to load before positioning. It recalculates positioning after display, device-pixel-ratio, and window-size changes. Tests cover polling, geometry changes, failed reads, overlapping requests, and stopping.

Changes: Overlay Display Tracking

Layer / File(s) Summary
Display polling and change detection
tauri-app/src/lib/overlay-displays.ts, tauri-app/src/lib/overlay-displays.test.ts
watchOverlayDisplays reads monitor data immediately and at intervals. It skips overlapping reads and calls changed only for nonempty results with a changed JSON signature. Tests cover failures, unchanged geometry, overlapping reads, and stopping.
Overlay positioning lifecycle
tauri-app/src/OverlayApp.tsx
OverlayApp waits for settings before positioning and uses watchOverlayDisplays to update monitor state. Positioning also responds to device-pixel-ratio changes and window resizes. Cleanup stops polling and removes listeners.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 599e8

The overlay now repositions after display, DPI, or window-size changes and after settings load. No concrete defect was found. Manual Windows boot and mixed-DPI verification are still pending, as the author notes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: refreshing overlay positioning after display geometry changes during or after boot.
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.
Description check Passed The pull request description directly matches the changes. It covers display refresh, positioning after settings load, geometry and DPI updates, failure handling, overlap prevention, cleanup, and vali…
Full details: Description check

Explanation

The pull request description directly matches the changes. It covers display refresh, positioning after settings load, geometry and DPI updates, failure handling, overlap prevention, cleanup, and validation results.

  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@apyfz
apyfz merged commit 0254d5c into main Oct 19, 2026
4 checks passed
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