Skip to content

Updater: the window fits its content (#761) - #764

Merged
Skeyelab merged 7 commits into
mainfrom
761-window-fit
Nov 23, 2026
Merged

Skeyelab merged 7 commits into
mainfrom
761-window-fit

Conversation

@Skeyelab

Copy link
Copy Markdown
Member

Closes #761

The updater window now fits its content. It opens big enough for everything the first look shows, grows when new text appears, stops at the screen's visible frame (then the content scrolls, newest text kept in view), and keeps a size the owner sets by hand, across launches.

What changed

  • Kit, UpdaterScreen/WindowFit.swift (tested red first): WindowFit.size(content:titleBar:visible:handSet:) (content + title bar, at least 560 wide, never below a hand-set size, clamped to the screen's visible frame), and HandSetSize (the hand-set size in UserDefaults).
  • App, WindowFitting.swift: reads the content's size, sets the window frame by that rule, keeps the top edge, and saves the size after a live resize. .windowResizability(.contentSize) and the fixed 480×360 minimum are gone; the sections sit in a ScrollView.
  • Screenshot preview, Debug builds only: FirmwareUpdater --preview nothing|found|backup|updating. Updater.preview(_:) (Kit, #if DEBUG) runs on fake ports defined in that file: no IOKit, CoreMIDI or serial object, no DeckBridge handoff (no borrow), fixed firmware line. In the app, Live.updater() is never called in preview; the backup model's buttons do nothing there, so no MIDI message is sent and no chip is read. Tested in PreviewTests (each state's first look, the update held at 42 %).

Not testable here

  • The AppKit sizing itself (frame set, live-resize detection, scroll-to-newest). Checked by building and running the Debug preview; cos does a real check on the owner's Mac after merge.
  • I didn't shoot "taller than the screen": no preview state is that tall. The clamp is covered by WindowFitTests.

Screenshots

These are from the Debug build with --preview, at the size the app chose. A panel and an LC6000 were on USB during the shots; the preview never touched them. The PNGs are in ~/Documents/deckbridge-761-screenshots/ on the Mac:

  • nothing.png: 560×384, nothing plugged in.
  • found.png: 560×586, panel and LC6000 found.
  • backup.png: 560×624, after a backup message.
  • updating.png: 560×622, during a panel update at 42 %, with Cancel off.

All four fit with no scroll bar and nothing cut off.

Devices

This PR doesn't change what the updater sends to any device. The device code is untouched.

Tests: swift test in Packages/FirmwareUpdaterKit passes. scripts/updater.sh build (Debug) builds.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VCgWWsrZ4EvHNNNTAe7RC1

Skeyelab and others added 6 commits November 22, 2026 18:47
…ontent scrolls (#761)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgWWsrZ4EvHNNNTAe7RC1
…he window (#761)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgWWsrZ4EvHNNNTAe7RC1
…he next launch (#761)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgWWsrZ4EvHNNNTAe7RC1
…ports (#761)

Nothing plugged in, panel and LC6000 found, and an update stopped on its
writing step. No IOKit, CoreMIDI, serial or handoff anywhere in it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgWWsrZ4EvHNNNTAe7RC1
…he newest text in view (#761)

The sections sit in a scroll view whose content size drives the window by
WindowFit's rule; a live resize is kept as the hand-set size. In Debug
builds, --preview <nothing|found|backup|updating> opens a fixed state on
fake ports for screenshots; the backup model's buttons do nothing there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgWWsrZ4EvHNNNTAe7RC1
@Skeyelab Skeyelab added this to the Firmware updater app milestone Nov 22, 2026
@Skeyelab
Skeyelab enabled auto-merge November 22, 2026 23:53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgWWsrZ4EvHNNNTAe7RC1
@Skeyelab
Skeyelab added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit dc0c405 Nov 23, 2026
7 checks passed
Skeyelab added a commit that referenced this pull request Nov 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgWWtMsRLyAoGPQD9M6xN
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.

Updater: the window fits its content (no manual resizing)

1 participant