Skip to content

Add flip ruler UI#205

Merged
pascalpp merged 5 commits into
pascal/198-grouped-zero-corner-flipsfrom
pascal/195-flip-ruler-ui
Jun 13, 2026
Merged

Add flip ruler UI#205
pascalpp merged 5 commits into
pascal/198-grouped-zero-corner-flipsfrom
pascal/195-flip-ruler-ui

Conversation

@pascalpp

Copy link
Copy Markdown
Owner

Summary

  • Wire Flip Horizontal and Flip Vertical menu items to AppDelegate actions.
  • Add Shift+H and Shift+V focused-ruler hotkeys with origin-side bezel feedback.
  • Localize the new bezel strings and update the Help shortcut table.

Validation

  • python3 -m json.tool "Free Ruler/Localizable.xcstrings"
  • xmllint --noout "Free Ruler/Base.lproj/MainMenu.xib"
  • xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test -only-testing:FreeRulerTests

Part of #192. Addresses #195.

Copilot AI review requested due to automatic review settings June 13, 2026 06:25
@pascalpp pascalpp marked this pull request as ready for review June 13, 2026 06:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the user-facing “Flip Horizontal” / “Flip Vertical” UI wiring and introduces Shift+H / Shift+V hotkeys that flip the shared ruler zero-corner, including localized bezel feedback and updated Help documentation. It builds on the existing zero-corner model by exposing it through menu actions and focused-ruler key handling.

Changes:

  • Wire “Flip Horizontal” and “Flip Vertical” menu items to new AppDelegate IBAction methods and show origin-side bezel feedback.
  • Extend focused-ruler hotkey handling to accept modifier flags and support Shift+H / Shift+V flips.
  • Add unit tests for the new shift-modified hotkeys and localize the new bezel strings; update the Help shortcut table.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
FreeRulerTests/RulerCoreTests.swift Adds coverage for Shift+H / Shift+V flipping prefs.zeroCorner, plus a guard test for non-shift modifiers.
Free Ruler/RulerController.swift Passes modifier flags into AppDelegate.performRulerHotkey(...) so shift-modified hotkeys can be handled.
Free Ruler/AppDelegate.swift Implements flip IBActions, modifier-aware hotkey routing, and origin-side bezel messaging tied to prefs.zeroCorner.
Free Ruler/Base.lproj/MainMenu.xib Connects the Flip menu items to the new AppDelegate actions.
Free Ruler/Localizable.xcstrings Adds localized strings for horizontal/vertical origin bezel formats and side labels.
Free Ruler/FreeRuler.help/Contents/Resources/English.lproj/FreeRuler.html Documents the new Shift+H / Shift+V shortcuts in the Help shortcut table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

pascalpp commented Jun 13, 2026

Copy link
Copy Markdown
Owner Author

Copilot AI review requested due to automatic review settings June 13, 2026 16:07
@pascalpp pascalpp force-pushed the pascal/198-grouped-zero-corner-flips branch from 94fdaa2 to 1c2d2b6 Compare June 13, 2026 16:07
@pascalpp pascalpp force-pushed the pascal/195-flip-ruler-ui branch from 04e005c to db245c7 Compare June 13, 2026 16:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

FreeRulerTests/RulerCoreTests.swift:1227

  • The new shift-hotkey path is sensitive to extra modifier bits (notably .capsLock when Caps Lock is enabled). Adding a test case that uses modifierFlags: [.shift, .capsLock] would prevent regressions around modifier normalization.
            let verticalController = RulerController(
                ruler: Ruler(.vertical, frame: NSRect(x: 61, y: 140, width: Ruler.thickness, height: 160))
            )
            appDelegate.rulers = [verticalController, horizontalController]
            let horizontalFrame = horizontalController.rulerWindow.frame

Comment thread Free Ruler/AppDelegate.swift Outdated

@pascalpp pascalpp left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[codex reviewer] No findings in this incremental diff. I reviewed the menu/hotkey wiring, Shift+H/Shift+V handling including Caps Lock, bezel copy, help update, and the added unit/flip tests.

@pascalpp pascalpp merged commit 4f49ea3 into pascal/198-grouped-zero-corner-flips Jun 13, 2026
@pascalpp pascalpp deleted the pascal/195-flip-ruler-ui branch June 13, 2026 16:31
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