Fix PopOut dashboard collapsing to its minimum size (SOU-222)#37
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ceiling | ea8ecca | Commit Preview URL Branch Preview URL |
Jul 16 2026, 10:25 PM |
📝 WalkthroughWalkthroughProgrammatic window restoration now suppresses temporary geometry persistence. Window sizing also respects configured minimum dimensions while capping to monitor work areas, with tests covering suppression expiry and sizing floors. ChangesGeometry capture and sizing
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/desktop-tauri/src-tauri/src/shell/window.rs (1)
150-201: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMake
cap_to_availableenforce its lower-bound contract.For example,
(width, height) = (100, 100)with minima(520, 400)returns(100, 100), because the current code only caps the upper bound. Add.max(floor)to each result and a regression test for requested sizes below the minimum.Also applies to: 318-358
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop-tauri/src-tauri/src/shell/window.rs` around lines 150 - 201, The cap_to_available function currently enforces only upper bounds and can return sizes below the configured minimums. Update each returned dimension to clamp between its corresponding minimum floor and computed maximum, while preserving the 320x240 fallback floors for absent minima; add a regression test covering requested dimensions below configured minima.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/desktop-tauri/src-tauri/src/shell/window.rs`:
- Around line 89-105: Move the geometry-capture suppression setup in the window
sizing flow so it runs after logical_size_from_geometry and capped_logical_size
have computed the final dimensions, immediately before set_size. Keep the
existing 750ms deadline and AppState locking behavior, ensuring the guard covers
the geometry mutation rather than the preceding load, monitor lookup, and
capping work.
---
Outside diff comments:
In `@apps/desktop-tauri/src-tauri/src/shell/window.rs`:
- Around line 150-201: The cap_to_available function currently enforces only
upper bounds and can return sizes below the configured minimums. Update each
returned dimension to clamp between its corresponding minimum floor and computed
maximum, while preserving the 320x240 fallback floors for absent minima; add a
regression test covering requested dimensions below configured minima.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 68753ed8-409a-4120-a1d5-d47d2e0bd3a8
📒 Files selected for processing (3)
apps/desktop-tauri/src-tauri/src/shell/position.rsapps/desktop-tauri/src-tauri/src/shell/window.rsapps/desktop-tauri/src-tauri/src/state.rs
Fixes SOU-222.
Problem
The main dashboard (PopOut) reopened at exactly its 520x400 minimum instead of the 720x560 default, on every launch (reported in 0.43.3: tiny/hard-to-find window, felt non-resizable). Evidence:
window_geometry.jsonhadpopOutsaved at exactly the minimum.Root cause
A self-reinforcing collapse:
capped_logical_sizecapped the window to the monitor work area, flooring only to 320x240 — on a transient/incorrect monitor read it could cap below PopOut's 520x400 minimum.set_sizethen requested a sub-minimum size; the OS +set_min_sizeclamped it back up to 520x400.remember_current_geometry_if_eligiblepersisted the clamped minimum as if the user had resized — so it reopened tiny forever.Fix
AppState::suppress_geometry_capture_until:apply_window_layoutarms a 750 ms suppression right before itsset_size, and the window-event save path skips while it's active. The app's open/transition layout can no longer be mistaken for a user drag. (This is the core fix — even a transient collapse is never persisted.)cap_to_availablehelper; the work-area cap floors to the window's ownmin_width/min_height(320x240 baseline for min-less modes). No sub-minimumset_size-> no OS clamp -> nothing to mis-persist.Tests
cap_to_available: floors to the minimum on a tiny work area, applies the available size between min and requested, keeps the requested size when it fits, and keeps the 320x240 baseline for min-less modes.AppStategeometry-capture suppression arms and expires correctly.clippy -D warningsclean,fmt --checkclean.Note: couldn't reproduce the GUI end-to-end headlessly; logic + unit tests verified. The "can't resize" secondary note in the issue (borderless hit-testing) is left for follow-up — at the restored default size the window resizes fine.
Summary by CodeRabbit
Bug Fixes
Tests