Skip to content

refactor: simplify after a codebase review - #17

Merged
koji-1009 merged 8 commits into
mainfrom
refactor/simplify
Sep 23, 2026
Merged

koji-1009 merged 8 commits into
mainfrom
refactor/simplify

Conversation

@koji-1009

Copy link
Copy Markdown
Owner

Simplifications found in a review of lib/, each checked with a second reviewer before applying:

  • shutter init writes the shell template without a no-op trimLeft().
  • RunManifest holds its actions, capture, and viewport as one RunSetup, as RunDiff does.
  • FlutterTestEngine looks up google_fonts once per capture.
  • ShotAction.label / source build the optional --enter text once.
  • The harness uses null-aware map elements, like Shot.toJson.
  • widgetHelper is private; shotStaticId is folded into Candidate.staticId.
  • Engine and harness doc comments are corrected and reflowed.

No behaviour or output format changes.

🤖 Generated with Claude Code

koji-1009 and others added 8 commits September 23, 2026 15:33
The template already starts with its import: Dart drops the newline
after the opening quotes, so trimLeft() changed nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
lib/ only read the fields back through the setup getter; RunDiff
already holds its setups this way. The manifest JSON is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
_capture looked the package up again for the generated config; the
flag now comes from the lookup capture branches on.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
label and source repeated their whole string for --enter; the optional
part is built as a suffix, as WidgetShot does for its size.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The harness writes the same keys as Shot.toJson, which already uses
them; brightness loses its null assertion.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Only generator.dart uses it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Its only caller in lib/ was the getter, as WidgetShot.staticId
computes its own; the id format is documented on the getter.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The engine writes a per-run directory and deletes it, not one file;
two harness doc lines ran past 80 columns.

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 merged commit 719b051 into main Sep 23, 2026
5 checks passed
@koji-1009
koji-1009 deleted the refactor/simplify branch September 23, 2026 06:59
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