Repository navigation
feat(shot): shoot a --widget at a width and its own height with --size <width>x - #53
Merged
Merged
Conversation
…e <width>x shot --widget ... --size <width>x (and WidgetExpression(size: WidgetWidth(...))) lays the widget out at that width with its height left unbounded, as Size(360, double.infinity) does in a preview, so a list item is shot at the list's width with its text wrapping there and the image as tall as the widget. --size still takes <width>x<height> and unbounded; --viewport keeps both dimensions. The width is not part of shot ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
WidgetSize is sealed and public, so a new subtype breaks a tool that switches over it. A width with the height left to the widget is now LogicalSize(width, double.infinity), as a preview's Size(360, double.infinity) is, and prints as `360x`. The manual's sentence on it moves after `--size unbounded`, whose "that limit" again follows the sentence that sets the limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.


Stacked on #52.
A preview shoots a list item at the list's width and its own height with
Size(360, double.infinity), which the agent playbook recommends for widgets. A--widgetshot could not:--sizetook both dimensions orunbounded, and without--sizethe width stopped at the 800-wide fallback viewport, so a list item shot without a preview file was either stretched to a fixed height or laid out far wider than on a phone, with its text wrapping in other places.How it works
shutter shot --widget ... --size <width>xshoots the widget at that width and its own height; from Dart,WidgetExpression(size: LogicalSize(390, double.infinity)), as a preview'sSize(390, double.infinity).--sizestill takes<width>x<height>andunbounded. No newWidgetSizesubtype: the class is sealed and public, so one would break a tool that switches over it.shootpasses it to the engine as(width, double.infinity), which the harness already lays out with an unbounded height. Such a size prints as390x.shootrejects a width that is not > 0 and finite with exit 64.--viewportnow has a parser of its own and still takes both dimensions, so--viewport 390xis a usage error.--sizeis.Tests
test/e2e/widget_test.dart: aTextof ten words shot with--size 120xis 120 wide and more than twice as tall as the same text on one line.Docs
doc/manual.md(One widget without a preview file),doc/agent.md, and the CHANGELOG cover it.🤖 Generated with Claude Code