Skip to content

feat(shot): lay previews out as with an on-screen keyboard - #20

Merged
koji-1009 merged 1 commit into
mainfrom
feat/keyboard
Sep 23, 2026
Merged

koji-1009 merged 1 commit into
mainfrom
feat/keyboard

Conversation

@koji-1009

@koji-1009 koji-1009 commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

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 --enter used 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.

  • A Scaffold shrinks its body above the keyboard (not with resizeToAvoidBottomInset: false), and so does a layout of the app's own that pads by MediaQuery.viewInsetsOf; a widget that does not read the inset is shot unchanged.
  • The keyboard is not drawn: with --capture screen, the area it covers shows what the app paints there.
  • No default height, since keyboards differ by device and input method.
  • manifest.json records keyboard, shot prints it, and diff prints both runs' when they differ; shot ids are unchanged, so a run with --keyboard pairs with one without.
  • Experimental in doc/manual.md; doc/agent.md gains 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.

preview no keyboard --keyboard 100 --keyboard 100 --capture screen
Scaffold, green background Scaffold without keyboard Scaffold with keyboard Scaffold with keyboard, screen
Scaffold(resizeToAvoidBottomInset: false) Not resized without keyboard Not resized with keyboard Not resized with keyboard, screen
own layout padding by MediaQuery.viewInsetsOf Own layout without keyboard Own layout with keyboard Own layout with keyboard, screen

🤖 Generated with Claude Code

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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@koji-1009 koji-1009 mentioned this pull request Sep 23, 2026
@koji-1009
koji-1009 added this pull request to stack #22 September 23, 2026 15:45
@koji-1009
koji-1009 merged commit d630573 into main Sep 23, 2026
5 checks passed
@koji-1009
koji-1009 deleted the feat/keyboard branch September 23, 2026 15:46
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.

2 participants