Add flip ruler UI#205
Conversation
There was a problem hiding this comment.
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
AppDelegateIBAction 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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
9c71cc1 to
94fdaa2
Compare
121c669 to
04e005c
Compare
94fdaa2 to
1c2d2b6
Compare
04e005c to
db245c7
Compare
Verify flippable ruler integration
There was a problem hiding this comment.
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
.capsLockwhen Caps Lock is enabled). Adding a test case that usesmodifierFlags: [.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
pascalpp
left a comment
There was a problem hiding this comment.
[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.

Summary
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:FreeRulerTestsPart of #192. Addresses #195.