Skip to content

Conversation

rijkvanzanten
Copy link
Member

Closes #18

@rijkvanzanten rijkvanzanten requested a review from Copilot August 22, 2025 23:55
@rijkvanzanten rijkvanzanten changed the title Add support for snap points feat: add support for snap points Aug 22, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

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 snap point functionality to the SplitPanel component, allowing the divider to automatically snap to predefined positions during drag operations and double-click interactions.

  • Implements a utility function to find the closest number from an array
  • Adds snap point logic to the SplitPanel component with configurable threshold
  • Provides double-click functionality to jump to the nearest snap point

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
closest-number.ts New utility function to find the closest value from an array with proper tie-breaking
closest-number.test.ts Comprehensive test suite for the closest number utility
SplitPanel.vue Adds snap points props, snap logic during drag, and double-click snap behavior
App.vue Updates playground to demonstrate snap points at 25% and 50%
usage.md Documents the new snapPoints and snapThreshold properties
ExampleSnap.vue New documentation example component demonstrating snap functionality
Comments suppressed due to low confidence (1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rijkvanzanten rijkvanzanten merged commit 27cb5a5 into main Aug 22, 2025
2 of 3 checks passed
@rijkvanzanten rijkvanzanten deleted the rijk/18 branch August 22, 2025 23:56
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.

Add support for snap points

1 participant