feat(shot): lay previews out as with an on-screen keyboard - #20
Merged
Merged
Conversation
shot --keyboard <height> reports a bottom view inset of that many logical pixels from the first frame, so a Scaffold, or any layout reading MediaQuery.viewInsets, makes room for the keyboard as on a device. The keyboard itself is not drawn. There is no default height: keyboards differ by device and input method. The run records the height in manifest.json, shot prints it, and diff prints both runs' when they differ; it is not part of shot ids. Documented as experimental in the manual. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
shutter shot --keyboard <height>lays every preview out as a device does while its on-screen keyboard is up: the view reports a bottom inset of that many logical pixels (MediaQuery.viewInsets) from the first frame.Text entered with
--enterused to be shot without the keyboard's effect on the layout; with--keyboard, a screen that overflows, hides a button, or does not scroll to the field under the keyboard shows it in the image.Scaffoldshrinks its body above the keyboard (not withresizeToAvoidBottomInset: false), and so does a layout of the app's own that pads byMediaQuery.viewInsetsOf; a widget that does not read the inset is shot unchanged.--capture screen, the area it covers shows what the app paints there.manifest.jsonrecordskeyboard,shotprints it, anddiffprints both runs' when they differ; shot ids are unchanged, so a run with--keyboardpairs with one without.doc/manual.md;doc/agent.mdgains one bullet. An e2e test checks the three layouts above and the screen capture pixel by pixel.Images
The e2e test's previews (200×300), shot without
--keyboard, with--keyboard 100, and with--keyboard 100 --capture screen --viewport 200x300.The red bar ends at the bottom of the preview, and above the 100-high keyboard when the layout reads the inset.
--keyboard 100--keyboard 100 --capture screenScaffold, green backgroundScaffold(resizeToAvoidBottomInset: false)MediaQuery.viewInsetsOf🤖 Generated with Claude Code