Skip to content

feat(gui): --screenshot, and the two bugs it photographed - #8

Merged
mysma-9403 merged 1 commit into
mainfrom
feat/the-window-photographs-itself
Oct 11, 2026
Merged

mysma-9403 merged 1 commit into
mainfrom
feat/the-window-photographs-itself

Conversation

@mysma-9403

Copy link
Copy Markdown
Contributor

The README had no picture of the interface, which for a program whose point is an interface
is the first thing a visitor wants.

A screen grabber cannot supply one reproducibly. macOS refuses screen recording outright to a
process that is not an application bundle — and it does not error, it returns the desktop
picture with every window missing, which is a fun twenty minutes — and even when granted, it
photographs whoever's desktop ran it.

So the window takes the picture. --screenshot <path> asks egui for the frame it was going to
paint anyway, writes a PNG and closes. --screenshot-after is how long the station gets to
fill first, because every plot is empty until packets arrive. The image in the README has the
command that makes it again sitting underneath it.

The first picture it took showed two bugs no test had

layout: 22 of 12 saved parameters are in this definition; the other 18446744073709551606 are kept in the layout — Layout::restore counted mentions while the caller's denominator
counted the watch list, and every plotted parameter is in both, so the count exceeded its own
denominator and the subtraction wrapped. In a debug build that is a panic, not a funny number.
It had no way to show up before: it needs a layout with plots in it, and the first one only
started shipping last week. Counted by parameter now, denominator counts the same way,
regression test pins it.

The packet counters drew underneath the Pause button. The source label carries a whole
file URL with its query string, longer than everything else on the strip put together. Capped
at a third of the width and truncated, with the full value still on hover; and the controls go
in before the counters now, which reads backwards and is the only order in which a narrow
window truncates instead of overlapping.

Tooltips are suppressed while a capture is pending — whatever the pointer happens to be resting
on would otherwise be in the photograph, and was.

536 tests, fmt and clippy clean.

The README had no picture of the interface, which for a program whose point is
an interface is the one thing a visitor wants before cloning anything. A screen
grabber cannot supply it reproducibly: macOS refuses screen recording outright
to a process that is not an application bundle — it returns the desktop picture
with every window missing rather than an error — and even granted, it
photographs whoever's desktop ran it.

So the window takes the picture. `--screenshot <path>` on `run` and `replay`
asks egui for the frame it was going to paint anyway, writes it as a PNG and
closes; `--screenshot-after` is how long the station is given to fill first,
because every plot is empty until packets arrive. The image in the README now
has a command under it that makes it again.

The first picture it took showed two things no test had:

* The event log read "22 of 12 saved parameters are in this definition; the
  other 18446744073709551606 are kept". `Layout::restore` counted mentions and
  the caller counted the watch list, and every plotted parameter is in both —
  so the count exceeded its own denominator and the subtraction wrapped. In a
  debug build it would have been a panic. Counted by parameter now, with a
  denominator that counts the same way, and a regression test that pins it.

* The status strip drew the packet counters underneath the Pause button. The
  source label carries a whole file URL with its query string, which is longer
  than everything else on the strip together; it is capped at a third of the
  width and truncated, with the full value still on hover. The controls are
  also placed before the counters now, which reads backwards and is the only
  order where a narrow window truncates instead of overlapping.

Tooltips are suppressed while a capture is pending: whatever the pointer
happens to be resting on would otherwise be in the photograph.
@mysma-9403
mysma-9403 merged commit 79e5c88 into main Oct 11, 2026
1 check passed
@mysma-9403
mysma-9403 deleted the feat/the-window-photographs-itself branch October 11, 2026 11:00
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