Repository navigation
feat(gui): --screenshot, and the two bugs it photographed - #8
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 topaint anyway, writes a PNG and closes.
--screenshot-afteris how long the station gets tofill 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::restorecounted mentions while the caller's denominatorcounted 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
Pausebutton. The source label carries a wholefile 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.