Skip to content

Make rulers flippable#199

Merged
pascalpp merged 62 commits into
mainfrom
pascal/192-flip-rulers
Jun 14, 2026
Merged

Make rulers flippable#199
pascalpp merged 62 commits into
mainfrom
pascal/192-flip-rulers

Conversation

@pascalpp

Copy link
Copy Markdown
Owner

Base branch for ruler flip project

Fixes #192 (once all child PRs are merged)

Copilot AI review requested due to automatic review settings June 13, 2026 03:38

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 establishes initial UI scaffolding for the “ruler flip” feature (Issue #192) by adding flip-related menu items to the app’s main menu, as a base branch for follow-up work that will implement the underlying zero-corner model and behavior.

Changes:

  • Adds a new Flip menu section under Options with Horizontal/Vertical entries and keyboard equivalents.
  • Updates Interface Builder metadata in MainMenu.xib (toolsVersion / plugin version).

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

Comment thread Free Ruler/Base.lproj/MainMenu.xib
Comment thread Free Ruler/Base.lproj/MainMenu.xib Outdated
Copilot AI review requested due to automatic review settings June 13, 2026 04:16
@pascalpp pascalpp force-pushed the pascal/192-flip-rulers branch from ad82008 to 396a3da Compare June 13, 2026 04:16

pascalpp commented Jun 13, 2026

Copy link
Copy Markdown
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

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 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread Free Ruler/Base.lproj/MainMenu.xib Outdated
Comment thread Free Ruler/Base.lproj/MainMenu.xib Outdated
Comment thread Free Ruler/Base.lproj/MainMenu.xib Outdated
Copilot AI review requested due to automatic review settings June 13, 2026 04:28
@pascalpp pascalpp force-pushed the pascal/192-flip-rulers branch from 92a73e7 to 982383b Compare June 13, 2026 04:28

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 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread FreeRulerTests/RulerCoreTests.swift
Comment thread Free Ruler/Base.lproj/MainMenu.xib Outdated
Comment thread Free Ruler/Base.lproj/MainMenu.xib Outdated

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 10 out of 10 changed files in this pull request and generated 5 comments.

Comment thread Free Ruler/de.lproj/MainMenu.strings
Comment thread Free Ruler/es.lproj/MainMenu.strings
Comment thread Free Ruler/fi.lproj/MainMenu.strings
Comment thread Free Ruler/ja.lproj/MainMenu.strings
Comment thread Free Ruler/zh-hans.lproj/MainMenu.strings

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 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread FreeRulerTests/RulerCoreTests.swift
pascalpp added 29 commits June 14, 2026 03:21
Switch help icon naming from a build-number-based token to a UTC timestamp+hash token. Update FreeRuler HTML and CSS to reference the new freeruler-help-icon-<timestamp>-<hash>.png name, rename the icon file accordingly, and remove the old freeruler.png legacy copy. Update scripts/generate-app-icon.sh to generate a timestamped help_cache_token, drop the Info.plist build_number dependency, remove legacy copy behavior, and propagate the new token into styles.css and FreeRuler.html while cleaning up stale icons.
Introduce a CSS variable for the help icon and refresh related assets.

- FreeRuler.html: add :root style setting --free-ruler-help-icon, update styles.css query token, tidy metadata and reformat the keyboard shortcuts/feature sections.
- styles.css: switch .title-page-header background-image to use var(--free-ruler-help-icon).
- Replace old help icon with a new freeruler-help-icon PNG and remove the old file.
- Update multiple AppIcon image assets (various sizes) — regenerated icons.
- scripts/generate-app-icon.sh: combine perl substitutions to inject the cache token and set the --free-ruler-help-icon URL in the HTML, and remove an unused variable.

These changes allow the help page to reference the generated icon dynamically and support cache-busting when regenerating icons.
Add scripts/generate-help-index.sh which runs hiutil to build English.lproj.helpindex from Free Ruler/FreeRuler.help/Contents/Resources/English.lproj (script uses strict bash flags and executes from repo root). Wire the script into package.json as the "generate:help" npm script and update the packaged help index file accordingly so the help index can be regenerated as part of build tasks.
Use a fixed help bundle identifier and stop appending the build number. Updated FreeRuler.help/Contents/Info.plist to set CFBundleIdentifier to com.pascal.freeruler.help and adjusted CFBundleVersion to 491. Replaced the templated CFBundleHelpBookName in Free Ruler/Info.github.plist and Free Ruler/Info.plist with the fixed help ID. Removed the code in scripts/release/set-version.js that modified the help CFBundleIdentifier per-build so the help bundle ID remains stable across builds.
Introduce an adjustable preview for mouse tick label offsets used in DEBUG builds. Adds a mouseTickLabelPreviewRulerLength constant and refactors MouseTickLabelOffsetPreview into smaller views: heading, grid, controls, slider panel, and individual sliders with a numeric TextField (clamped and rounded). Replaces hardcoded 260 ruler length usage, extracts a cornerPreview helper, and updates the PreviewProvider to use the interactive controls for easier testing of label offsets.
Introduce RuleView.resizeHandleEndRegionContains(...) to encapsulate logic that determines whether the mouse tick overlaps the resize-handle end region based on ruler orientation and the current zeroCorner/resize side. Replace the inline min/max checks in HorizontalRule and VerticalRule with calls to this helper. Expand and rename unit tests to cover obscuring behavior from the leading edge to the ruler end across different zeroCorner configurations. Includes an assertionFailure fallback for unexpected cases.
Prevent mouse-tick/unit labels from overlapping the ruler resize handle and from incorrectly hiding near the zero edge. MouseTickLabelLayout now accepts an optional resizeHandleFrame and tickGap was renamed to tickLabelSpacing; layout logic was extended with horizontal/vertical helper checks to prefer the side that doesn't collide with the resize handle. RuleView gained unitLabelZeroRegionContains and HorizontalRule/VerticalRule use it to compute unit-label visibility based on growth direction and bounds. Debug previews and sliders were adjusted to exercise the new behavior, and unit tests were added to cover zero-edge hiding and label flipping around the resize handle.
Pass zeroCorner into child views and clean up geometry/layout logic. ResizeHandleView now computes grip and slot frames (gripRect/gripSize/slotFrame) and draws grip/bg relative to the grip; it accepts a zeroCorner override. UnitLabelView gets explicit padding, safer draw rect to leave room for descenders, and accepts zeroCorner for placement. MouseTickLabelLayout was extended to handle unitLabelFrame, vertical lanes, and revised offsets; added labelBackgroundFrame helper. HorizontalRule/VerticalRule use growthDirection-aware mouse tick line helpers and simplified unit label / resize-handle visibility checks. Tests updated and new unit tests added to cover the new layout behavior and zeroCorner override.
Adds the flip rulers App Store screenshot in output position 3, removes Screen prefixes from preview labels, splits screenshot constants by layout, and models the flip rulers with corner-relative inset positioning, grouped copy placement, and distinct non-yellow colors.
@pascalpp pascalpp merged commit a6288f9 into main Jun 14, 2026
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.

Allow user to change ruler direction and orientation

2 participants