Skip to content

Add resize handles#180

Merged
pascalpp merged 20 commits into
mainfrom
codex/173-resize-handle
Jun 12, 2026
Merged

Add resize handles#180
pascalpp merged 20 commits into
mainfrom
codex/173-resize-handle

Conversation

@pascalpp

@pascalpp pascalpp commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Closes #173

Summary

  • add resize-handle view support to ruler windows
  • draw resize affordances for horizontal and vertical rulers
  • wire the handle into the ruler view hierarchy

Tests

  • xcodebuild -project "Free Ruler.xcodeproj" -scheme "Free Ruler" test

Copilot AI review requested due to automatic review settings June 11, 2026 04:32

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 a visual resize-handle (“grip”) affordance to the ruler UI by introducing a dedicated ResizeHandleView, installing it into both horizontal and vertical ruler views, and adding a DEBUG-only SwiftUI preview for quicker iteration.

Changes:

  • Introduces ResizeHandleView that draws a small grip background + lines for horizontal and vertical orientations.
  • Installs the resize-handle subview from HorizontalRule and VerticalRule initializers via new RuleView.installResizeHandle.
  • Adds DEBUG-only SwiftUI previews for RuleView to visualize both ruler orientations during development.

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
Free Ruler/HorizontalRule.swift Installs the resize handle for horizontal rulers during initialization.
Free Ruler/VerticalRule.swift Installs the resize handle for vertical rulers during initialization.
Free Ruler/RuleView.swift Adds resize-handle plumbing (subview install + frame updates) and a DEBUG-only SwiftUI preview.
Free Ruler/ResizeHandleView.swift New NSView responsible for drawing the resize-handle/grip UI.
Free Ruler.xcodeproj/project.pbxproj Adds ResizeHandleView.swift to the Xcode project build sources.

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

Comment thread Free Ruler/ResizeHandleView.swift
@pascalpp pascalpp force-pushed the codex/173-resize-handle branch from 867970e to 7f53bfd Compare June 11, 2026 05:18
Copilot AI review requested due to automatic review settings June 11, 2026 05:39

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 changed the title Add resize handle drawing and preview Add resize handles Jun 11, 2026
pascalpp added 12 commits June 11, 2026 02:47
Refine the resize-handle cursor appearance and preview UI: reduce arrow/shaft sizes and stroke, add miterLimit and shadow parameters (alpha, blur, offset, padding) and draw the cursor with an NSShadow for depth. Adjust image/hotSpot APIs to account for orientation when computing size, and update cursor drawing to honor the new parameters and miter limit. Revise the debug preview defaults, layout, sliders (more granular steps and additional controls for shadow/miter), and preview sizing to better match the new visuals and allow interactive tuning.
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.
[codex] Clamp mouse tick labels before resize handles
Copilot AI review requested due to automatic review settings June 12, 2026 01:31

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

Comment thread Free Ruler/ResizeHandleView.swift
Comment thread Free Ruler/VerticalRule.swift 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 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread Free Ruler/ResizeHandleView.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 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread Free Ruler/RuleView.swift
@pascalpp pascalpp merged commit d9cf758 into main Jun 12, 2026
1 check passed
@pascalpp pascalpp deleted the codex/173-resize-handle branch June 12, 2026 02:21
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.

Show resize handle on the end of the ruler

2 participants