Skip to content

Add Viewer Guides overlay to preview canvas#169

Open
ofcskn wants to merge 1 commit into
palmier-io:mainfrom
ofcskn:feature/167-viewer-guides
Open

Add Viewer Guides overlay to preview canvas#169
ofcskn wants to merge 1 commit into
palmier-io:mainfrom
ofcskn:feature/167-viewer-guides

Conversation

@ofcskn

@ofcskn ofcskn commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Closes #167

What

Adds a non-destructive Viewer Guides overlay to the preview canvas, toggled via a new viewfinder icon in the tab bar (left of the ⋯ menu).

Guides

Safe Zones (SMPTE ST 2046-1 / ITU-R BT.1848-1):

  • Action Safe — 93% of frame (3.5% inset)
  • Title Safe — 90% of frame (5% inset)
  • Center — crosshair at geometric center

Format Reference (letterbox/pillarbox bars):

  • Scope 2.39:1, Wide 1.85:1, Square 1:1, Portrait 9:16

Implementation

  • ViewerGuide.swift — enum with 7 cases, safe-zone insets and format aspect ratios
  • ViewerGuidesOverlay.swiftCanvas-based renderer, allowsHitTesting(false), zero cost when inactive
  • PreviewContainerView.swift — guides toggle button, Toggle+Binding for native macOS checkmarks, active guides persisted to UserDefaults keyed per project

Performance

  • Overlay skipped entirely from the view tree when no guides are active
  • Canvas draws into a single Metal-backed layer — no extra layout passes
  • UserDefaults writes only on user toggle, never during playback

- ViewerGuide enum with 7 presets: Action Safe (93%), Title Safe (90%),
  Center crosshair, Scope (2.39:1), Wide (1.85:1), Square (1:1), Portrait (9:16)
- ViewerGuidesOverlay renders guides via Canvas — zero layout cost, skipped entirely when no guides active
- Guides toggle button (viewfinder icon) added left of the overflow menu in the tab bar
- Toggle uses native SwiftUI Toggle+Binding so macOS checkmarks work correctly
- Active guides persisted to UserDefaults keyed per project (viewerGuides.<projectId>)

Closes palmier-io#167
TimLai666 added a commit to TimLai666/fronda that referenced this pull request Jul 10, 2026
…r-io#169 palmier-io#67 palmier-io#164)

palmier-io#45 arrow/line shapes: compositor rasterize_line_or_arrow — endpoints
normalized 0..1 of the box (documented assumption; shapes are Rust-native,
no Swift rasterizer), horizontal-centre default, Arrow barbs scaled to
stroke width. 3 golden tests.

palmier-io#65 variable-font wght: ab_glyph 0.2.32 supports the wght axis
(VariableFont::set_variation) — applied in render_text (no-op on static
faces). Wired the bundled variable families (Inter/Geist/GeistMono/DMSans/
Caveat/PlayfairDisplay/SpaceGrotesk) into font_for so the axis is reachable,
matching Swift BundledFonts. 2 tests.

palmier-io#169 viewer guides: completed the Guides dropdown UI over the existing
palmier-io#167 overlay/state — guide_menu_rows + ⊞ button toggle + toggle_guide,
mutually exclusive with the settings menus. Pure-function test.

palmier-io#67 project-card Duplicate: card menu entry (accessible-gated) → host-side
plan_duplicate + recursive package copy → "(Copy).palmier" + recents
register + Home cards refresh. Menu + fs-copy tests. Hub save_now() absent
(data slice palmier-io#211) — Home-transition autosave deferred.

palmier-io#164 shortcut parity: added [ / ] trim aliases and Shift+Backspace ripple
delete (menu.rs route table 44->47, global_shortcuts !input bindings,
app_root RippleDeleteSelection handler). V/C/A/Shift+A/Esc deferred — no
tool-mode/deselect concept yet (gap list in tasks.md).

Gates (exit 0): render_core lib 263, app_shell_gpui desktop-app lib 407,
cargo check --bin fronda.
TimLai666 added a commit to TimLai666/fronda that referenced this pull request Jul 10, 2026
palmier-io#211 autosave, palmier-io#138 HDR export, palmier-io#176 duplicate_clips (56→57), palmier-io#284 aspect
labels, palmier-io#45 arrow/line shapes, palmier-io#65 wght variable-font axis, palmier-io#169 viewer
guides, palmier-io#67 project-card duplicate, palmier-io#164 shortcut parity (+ cross-slice
autosave/aspect wiring). Deferred (feature-absent, documented): V/C/A tool
shortcuts, HDR runtime verify (no libx265 in CI).
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.

Feature: Viewer Guides for the preview canvas

1 participant