Skip to content

feat: diff and doctor from Dart - #47

Merged
koji-1009 merged 2 commits into
mainfrom
feat/library-diff-doctor
Nov 1, 2026
Merged

koji-1009 merged 2 commits into
mainfrom
feat/library-diff-doctor

Conversation

@koji-1009

Copy link
Copy Markdown
Owner

A Dart tool that shoots with shot still had to start shutter diff and read its YAML to compare runs, and had no way to learn what shutter doctor finds: shot checks neither the Flutter version nor the font cache.

How it works

  • diff(projectDir, before, after, {images, composite}) compares two runs as shutter diff does. Each run is named the same way: a directory (relative to projectDir, or absolute) such as ShotRun.dir, a run id, latest, or latest~N. DiffComposite(direction:, title:) asks for the sheets.
  • It returns a ShotDiff: both run directories, what each run was shot with (ShotSetup: shell, actions, capture, keyboard, network images, semantics, platform), the directory the images went into, and per shot id a ShotDiffEntry with its DiffStatus, the shot, the diff ratio, the earlier size, and the absolute paths of its before, after, diff, and composite images.
  • Changes are the result, not an error. A missing run, or a title with no Flutter SDK to draw it, throws ShutterException. A title that could not be drawn, or does not fit one line, is a warning in ShotDiff.warnings; shutter diff prints it to stderr as before, now without the flag name (The title does not fit one line on the 38px sheets; ...).
  • doctor(projectDir, {shell}) returns the checks of shutter doctor as DoctorChecks, each with its CheckLevel (ok, warn, fail), what was found, and what to do about it.
  • shutter diff and diff share one comparison (lib/src/api/compare.dart), and shutter doctor and doctor one set of checks (lib/src/api/doctor.dart); the CLI only prints them.
  • Every new argument and result compares by value and prints what it holds, as shot's do.
  • A run directory given relative was resolved against the process's current directory; it is now resolved against the working directory the command or function was given. The CLI's working directory is the current one, so shutter diff behaves as before.

Docs

  • The README's "From Dart" section, the library doc, AGENTS.md, and the CHANGELOG cover diff and doctor.

🤖 Generated with Claude Code

koji-1009 and others added 2 commits November 1, 2026 20:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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 170f415 into main Nov 1, 2026
5 checks passed
@koji-1009
koji-1009 deleted the feat/library-diff-doctor branch November 1, 2026 12:03
@koji-1009 koji-1009 mentioned this pull request Nov 1, 2026
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