Skip to content

[codex] Clamp mouse tick labels before resize handles#185

Merged
pascalpp merged 7 commits into
codex/173-resize-handlefrom
codex/178-mouse-tick-label
Jun 12, 2026
Merged

[codex] Clamp mouse tick labels before resize handles#185
pascalpp merged 7 commits into
codex/173-resize-handlefrom
codex/178-mouse-tick-label

Conversation

@pascalpp

Copy link
Copy Markdown
Owner

Summary

  • clamp horizontal mouse tick labels so their right edge stays 8 pt before the resize handle
  • clamp vertical mouse tick labels so their bottom edge stays 8 pt above the resize handle
  • keep the mouse tick line itself following the mouse position

Fixes #178.

Validation

  • Passed: xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" -only-testing:FreeRulerTests/RulerCoreTests test
  • Attempted: xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test, but the UI suite failed in unrelated interaction/visibility tests while another agent was also running tests on this machine.

pascalpp added 3 commits June 11, 2026 09:08
Pin mouse label X to a max right bound and choose left/right placement to avoid overflowing the resize handle. HorizontalRule now computes a pinnedRightPosition and clamps left/right label Xs, then selects the final labelX based on the label number to ensure it flips correctly before colliding with the resize handle. Tests in RulerCoreTests were adjusted to use numbers that exercise the flip behavior, to assert against the resizeHandleExclusionFrame (with a guard that fails the test if the frame is missing), and to validate the label no longer overlaps the resize handle instead of relying on a hardcoded X value.
@pascalpp pascalpp force-pushed the codex/178-mouse-tick-label branch from 04449b8 to 2bc45d9 Compare June 11, 2026 13:25
@pascalpp pascalpp marked this pull request as ready for review June 12, 2026 00:58
@pascalpp pascalpp requested a review from Copilot June 12, 2026 00:58

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 adjusts mouse tick label positioning so it doesn’t slide under the resize handle, while keeping the mouse tick line itself anchored to the live mouse position (addressing #178).

Changes:

  • Clamp horizontal mouse tick labels so their right edge stays 8pt left of the resize handle.
  • Clamp vertical mouse tick labels so their bottom edge stays 8pt above the resize handle.
  • Add unit tests to validate the new clamping behavior.

Reviewed changes

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

Show a summary per file
File Description
FreeRulerTests/RulerCoreTests.swift Adds tests asserting horizontal/vertical mouse tick label clamping near the resize handle.
Free Ruler/HorizontalRule.swift Refactors mouse label positioning into a helper and clamps the label before the resize handle.
Free Ruler/VerticalRule.swift Refactors mouse label positioning into a helper and clamps the label above the resize handle.
Free Ruler/RuleView.swift Exposes resize handle frame for layout exclusion and centralizes the 8pt spacing constant.
Free Ruler/Localizable.xcstrings Adds a new Unavailable string catalog entry and bumps catalog version.

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

Comment thread Free Ruler/Localizable.xcstrings 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 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread Free Ruler/Localizable.xcstrings Outdated
Comment thread FreeRulerTests/RulerCoreTests.swift

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.

Comment thread FreeRulerTests/RulerCoreTests.swift

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 no new comments.

@pascalpp pascalpp merged commit d95a94b into codex/173-resize-handle Jun 12, 2026
1 check passed
@pascalpp pascalpp deleted the codex/178-mouse-tick-label branch June 12, 2026 01: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