Skip to content

Preview: divider reaches both frame edges; Original / Split / Processed modes - #158

Draft
StuartCameronCode wants to merge 1 commit into
mainfrom
agentbob/6-preview-divider-reaches-both-frame-edges
Draft

StuartCameronCode wants to merge 1 commit into
mainfrom
agentbob/6-preview-divider-reaches-both-frame-edges

Conversation

@StuartCameronCode

Copy link
Copy Markdown
Owner

Forum feedback (videohelp thread 419911): the preview's divider couldn't reach the far left or right, so judging a left crop was guesswork.

Why

BeforeAfterComparisonWidget clamped the divider to 5–95% of the panel. The left and right 5% therefore always showed the same frame: 36 px on a 720-wide source, wider than a typical left crop (Detect borders suggested left: 14 on the reporter's clip).

Change

  • The divider reaches both edges. Drag and tap now clamp to 0–1. The line and the handle are drawn inset at the edges, so the handle stays fully on screen and can still be grabbed.
  • New Original / Split / Processed view modes (ComparisonViewMode). Pick one from a pill at the top of the preview, or with B / S / P.
    • The shortcuts are AppShortcut entries without modifiers, so they don't fire while you're typing in a text field.
    • The tooltips come from the shortcuts.
  • The mode survives new previews. It is stored in MainViewModel.previewViewMode, so it stays when you move the scrubber, a new preview arrives or you switch videos.
  • Each mode draws only its own frame. Original is drawn at beforeAspectRatio and Processed at afterAspectRatio, keeping the Preview window #149 aspect rules.
  • 1:1 is measured against the frame on screen. In Original mode that is the source. Otherwise it is the processed frame, or the source while there is no processed frame yet.
  • Docs. CLAUDE.md ("Keyboard Shortcuts, Timeline and Themes") and the README's preview notes and shortcut table are updated.

The optional crop-rectangle guide is left out.

Tests

  • before_after_comparison_test.dart:
    • a drag past either edge takes the divider to 0 and 1, and a tap at an edge puts it there;
    • each mode shows only its own side;
    • dragging does nothing outside Split;
    • 1:1 is measured against the frame on screen;
    • the mode and divider survive a new processed frame;
    • the control reports taps and shows the shortcuts in its tooltips.
  • app_shortcut_test.dart: B / S / P are wired, aren't taken from a focused text field, and don't clash with other shortcuts.
  • preview_aspect_test.dart: the view-model wiring.
  • flutter test --exclude-tags heavy,gpu: 1476 passed, 7 skipped.

Known minor issue

When the histogram is open on a preview narrower than about 680 px, its card covers the right end of the mode pill. The P shortcut still works. Offsetting the histogram card down while it's open would fix it.

🤖 Generated with Claude Code

…rocessed modes

The comparison's divider was clamped to 5-95% of the panel, so the left and
right 5% always showed the same side: 36 px on a 720-wide frame, wider than a
typical left crop (forum feedback, videohelp thread 419911). It now spans
0-1, with the line and handle drawn inset at the edges.

A view mode (ComparisonViewMode: Original / Split / Processed) shows either
frame whole. It lives in MainViewModel.previewViewMode, so it survives
scrubber moves and new previews, and is picked from a pill at the top of the
preview or with B / S / P (bare keys, so text fields keep them). Each mode
draws only its side at its own aspect (#149), and 1:1 measures the frame on
screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant