Skip to content

A minimum window size: window.minWidth and window.minHeight - #10

Merged
theetherGit merged 1 commit into
mainfrom
min-window-size
Nov 26, 2026
Merged

theetherGit merged 1 commit into
mainfrom
min-window-size

Conversation

@theetherGit

Copy link
Copy Markdown
Contributor

Lets an app set how small its window can be made.

An app's layout has a size below which it can't work, and nothing stopped the window from being squeezed below it. At 400 px wide, the Tracker was a sidebar and slivers.

  • The setting: window.minWidth and window.minHeight in sepal.config.ts, which end up in app.json. They're in logical pixels, and either one alone works. Values of the wrong type are ignored, as for width and height.
  • The host: it gives them to winit as the window's minimum surface size (with_min_surface_size). The window never opens smaller than its minimum (Manifest::size() raises the initial size).
  • The Tracker sets 720 × 520. Below 720 px a row's date no longer fits beside its title, and below 520 px the sidebar's last entries don't fit. This complements Clicks clipped by boxes that clip; the Tracker in narrow windows #8, which makes the layout work at every width down to that.
  • Docs: the sepal.config.ts type, README and CHANGELOG are updated.

Tests

  • a_minimum_window_size_is_read_and_the_window_starts_no_smaller (manifest): both values, one alone, nonsense values, and the initial size raised to the minimum.
  • pnpm test passes locally (134 host tests).

The minimum itself only exists in a real window, so no headless test can exercise it. To check by hand: open the Tracker and try to narrow the window below 720 px.

🤖 Generated with Claude Code

An app's layout has a size below which it cannot work, and nothing kept
the window from being squeezed below it: the Tracker at 400px wide was a
sidebar and slivers. `window.minWidth` and `window.minHeight` in
sepal.config.ts (app.json) now say how small the window can be made, in
logical pixels; either alone does. The host gives them to winit as the
window's minimum surface size, and the window never opens smaller than
them. Values of the wrong type are ignored, as for width and height.

The Tracker sets 720 x 520: below 720px a row's date no longer fits
beside its title, and below 520px the sidebar's last entries do not.

A manifest test reads both, one alone, nonsense, and checks the initial
size is raised to the minimum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
theetherGit added a commit that referenced this pull request Nov 26, 2026
At 720px (the smallest window the Tracker asks for, #10) the Board's
filter bar ran out of the window, Project out of reach, and the
Insights tiles and lower panels were cut off at its right edge. Both are
the example's CSS, as headless Chrome shows with the same build: the
Board's bar was one line that could not wrap, and the Insights rows were
`2fr 1fr 1fr 1fr` and `3fr 2fr`, whose fr tracks cannot shrink below
their content (the tiles' large numbers, the priority table).

- The Board's filter bar wraps onto another line when it has to, as the
  list's toolbar does. Its columns scroll sideways, as before.
- Insights puts its four tiles in one row where each 1fr tile gets the
  ~155px its number needs (1120px of window), and two by two below
  that; its two panels sit side by side from the same width and stack
  below it.

A test opens both at 720px: the Board's filters stay in the window and
can be clicked, and every Insights tile and panel is inside it. It
failed before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@theetherGit
theetherGit marked this pull request as ready for review November 26, 2026 15:31
@theetherGit
theetherGit merged commit 578cafc into main Nov 26, 2026
6 of 8 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