fix(callouts): report clipped targets as quality finding + editor warning (#1853) #1868

Merged
brenno merged 1 commit from fix/callout-clipped-target-1853 into main 2026-08-30 09:38:42 +00:00
Owner

Summary

Callout targets that fall outside the visible image area under cover/zoom previously disappeared silently — no marker rendered, and nothing told the author why. This PR makes that visible in two places:

  • Quality finding: a new calloutTargetOutOfView issue kind in the slide quality analyzer, reported when a callout target maps outside the painted image rect under the current focal/zoom settings.
  • Editor feedback: the callout editor now resolves the intrinsic image dimensions (via a lightweight header-only reader — no full decode) and shows a warning badge naming which references are clipped, so the author can adjust the focal point, zoom, or target position.

What changed

  • lib/utils/image_dimensions.dart — new lightweight image dimension reader (PNG, JPEG, GIF, BMP, WebP headers only).
  • lib/services/slide_quality/slide_quality_analyzer_callouts.dart — new part file with the clip check.
  • lib/models/slide_quality.dartcalloutTargetOutOfView added to the issue kind enum.
  • lib/l10n/slide_quality_localization.dart — localization for the new issue.
  • lib/widgets/editors/callout_editor.dart — intrinsic resolution + clipped-target warning.
  • lib/widgets/editors/callout_marker_helpers.dart — extracted helper widgets (clipped badge, drag preview, Handle, DragRegion).
  • lib/widgets/slides/previews/callout_overlay.dart — shared _calloutImageProvider made public for reuse.
  • 31 translation files updated via tool/add_l10n.dart.
  • docs/SOURCE_MAP.md — entries for the two new files.

Why no bewaker-step

This touches none of the five triggers: not the file format, not storage, no new dependency, no outbound traffic or keys, no public promise in the interface. It is a quality-finding and an editor affordance within the existing callout feature.

Test plan

  • make check — all 10.968 tests pass, 87.0% coverage, per-file floor clean
  • make check-secrets — gitleaks + trufflehog clean
  • make sast — semgrep clean (0 findings)
  • test/callout_clip_check_test.dart — quality finding fires for clipped targets, not for in-view targets
  • test/image_dimensions_test.dart — dimension reader for all supported formats
  • test/callout_marker_helpers_test.dart — badge, drag preview, DragRegion, Handle
  • test/callout_editor_test.dart — editor shows warning when a callout is clipped

Generated with Devin

## Summary Callout targets that fall outside the visible image area under cover/zoom previously disappeared silently — no marker rendered, and nothing told the author why. This PR makes that visible in two places: - **Quality finding**: a new `calloutTargetOutOfView` issue kind in the slide quality analyzer, reported when a callout target maps outside the painted image rect under the current focal/zoom settings. - **Editor feedback**: the callout editor now resolves the intrinsic image dimensions (via a lightweight header-only reader — no full decode) and shows a warning badge naming which references are clipped, so the author can adjust the focal point, zoom, or target position. ### What changed - `lib/utils/image_dimensions.dart` — new lightweight image dimension reader (PNG, JPEG, GIF, BMP, WebP headers only). - `lib/services/slide_quality/slide_quality_analyzer_callouts.dart` — new part file with the clip check. - `lib/models/slide_quality.dart` — `calloutTargetOutOfView` added to the issue kind enum. - `lib/l10n/slide_quality_localization.dart` — localization for the new issue. - `lib/widgets/editors/callout_editor.dart` — intrinsic resolution + clipped-target warning. - `lib/widgets/editors/callout_marker_helpers.dart` — extracted helper widgets (clipped badge, drag preview, `Handle`, `DragRegion`). - `lib/widgets/slides/previews/callout_overlay.dart` — shared `_calloutImageProvider` made public for reuse. - 31 translation files updated via `tool/add_l10n.dart`. - `docs/SOURCE_MAP.md` — entries for the two new files. ### Why no bewaker-step This touches none of the five triggers: not the file format, not storage, no new dependency, no outbound traffic or keys, no public promise in the interface. It is a quality-finding and an editor affordance within the existing callout feature. #### Test plan - [x] `make check` — all 10.968 tests pass, 87.0% coverage, per-file floor clean - [x] `make check-secrets` — gitleaks + trufflehog clean - [x] `make sast` — semgrep clean (0 findings) - [x] `test/callout_clip_check_test.dart` — quality finding fires for clipped targets, not for in-view targets - [x] `test/image_dimensions_test.dart` — dimension reader for all supported formats - [x] `test/callout_marker_helpers_test.dart` — badge, drag preview, DragRegion, Handle - [x] `test/callout_editor_test.dart` — editor shows warning when a callout is clipped Generated with [Devin](https://devin.ai)
fix(callouts): report clipped targets as quality finding + editor warning (#1853)
All checks were successful
scans / scans (pull_request) Successful in 2m58s
static-gate / static-gate (pull_request) Successful in 8m12s
351f898162
Callout targets that fall outside the visible image area under cover/zoom
previously disappeared silently. This adds:
- A new SlideQualityIssueKind.calloutTargetOutOfView quality finding
- A lightweight image dimension reader (lib/utils/image_dimensions.dart)
- Editor feedback: a warning badge showing which references are clipped
- Translations for the new strings in all 31 languages
- Tests for the clip check, image dimensions, and marker helpers

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
brenno merged commit b96a1d2d39 into main 2026-08-30 09:38:42 +00:00
Sign in to join this conversation.
No description provided.