Skip to content

Keep the Todo window on screen when its app enforces a wider minimum width - #1950

Merged
rxhanson merged 1 commit into
rxhanson:mainfrom
AkiyamaKunka:fix/todo-window-minimum-width
Nov 3, 2026
Merged

rxhanson merged 1 commit into
rxhanson:mainfrom
AkiyamaKunka:fix/todo-window-minimum-width

Conversation

@AkiyamaKunka

Copy link
Copy Markdown
Contributor

Closes #1307

When the Todo app refuses to shrink to the sidebar width because its minimum width is larger, the Todo window kept the wider size at the sidebar's origin, so with the sidebar on the right it extended past the screen edge. You asked on the issue whether the window could not be resized to the Todo area, and the reporter confirmed that was the case.

What changes

  • TodoManager.moveTodoWindow still issues the same setFrame. It then reads the frame back once and, only when the app kept a wider (or taller) window than its zone, moves it so that it ends flush with the outer edge of the zone, the screen edge or the gap in front of it, and stays within the visible frame. Only the position is written, through setImmediateFrame, with the size the app accepted: the alignment to the zone's outer edge follows ClampedWindowAligner, as the edge-aligning movers do, and the position-only write is the one BestEffortWindowMover uses after the other actions.
  • A window that accepts the size sees one extra frame read and nothing else. A left-side sidebar already starts at its edge, so it only moves when that is the one way to fit the wider window on the display. A window wider or taller than the visible frame keeps its leading edges, where the title bar is, on screen and overflows at the far side.
  • The remaining windows are still reflowed around the configured sidebar width, so an oversized Todo window now stays on screen but overlaps its neighbours by the difference. Reserving the width the app actually keeps would be a separate change; happy to propose it if you would like that.
  • The correction is logged (View Logging) with the size the app kept. No new preference, no WindowManager change, no HUD.

Tests

TodoWindowMinimumSizeTests drives moveTodoWindow with a window double that enforces a minimum width: a window that accepts the width is placed once; a wider minimum keeps a right sidebar flush with the screen edge with a single position-only write; gaps keep it in front of the outer edge; a left sidebar is left alone, and moves to the screen edge only when that is the one way to fit; a window wider than the screen keeps its leading edge on screen on either side; a taller minimum height ends with the visible frame, and a window taller than the screen keeps its top; an unreadable frame is left alone. The existing TodoWindowPlacementTests now also record any correction, so they would notice an unintended one.

The full RectangleTests suite passes: 662 tests, 0 failures, on macOS 27.0.1 / Xcode 27. I have not yet tried it with a real Todo app that enforces a minimum width; happy to do so and report before merge if you would like.

…width

An app can refuse a width below its minimum. The Todo window was placed
at the sidebar's origin and kept the wider size, so with the sidebar on
the right it extended past the screen edge (rxhanson#1307).

After the usual placement, moveTodoWindow reads the frame back and, when
the app kept a wider or taller window, moves it so that it ends flush
with the outer edge of its zone and stays on screen as far as it fits,
writing only the position, as BestEffortWindowMover does for the other
actions. The remaining windows are still reflowed around the configured
sidebar width.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@rxhanson
rxhanson merged commit 646bbd2 into rxhanson:main Nov 3, 2026
1 check 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.

Todo Mode Causes Application to Display Partially, extending beyond the monitor's display area.

2 participants