Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 25, 2025

Implements width and height snap guides that appear when resizing webframes to match the dimensions of other frames, similar to the existing alignment guides system.

Changes Made

New Snap Line Types

Added WIDTH_MATCH and HEIGHT_MATCH snap line types to enable dimension-based snapping during resize operations. These complement the existing edge and center alignment guides.

Enhanced Snap Manager

Extended the SnapManager class with a new calculateResizeSnapTarget() method that:

  • Detects when a frame's width or height comes within the snap threshold (12px) of another frame's dimensions
  • Returns snap targets with the matching dimension and appropriate snap lines
  • Uses the same threshold logic as existing alignment guides for consistency

Resize Integration

Modified the ResizeHandles component to integrate with the snap system:

  • Calls the snap manager during resize operations to check for dimension matches
  • Automatically snaps frame dimensions when matches are found
  • Shows/hides snap lines in real-time during resize
  • Cleans up snap lines when resize operations complete

Visual Enhancements

Updated the SnapGuidelines component to render dimension guides with visual distinction:

  • Blue guides for width/height matching (vs red for alignment guides)
  • Width guides appear as vertical lines at the right edge
  • Height guides appear as horizontal lines at the bottom edge
  • Consistent styling with existing snap line system

Demo Screenshots

Width Snapping:
Width Snap Guide

Height Snapping:
Height Snap Guide

Usage

Users can now:

  1. See width guides - Blue vertical lines appear when resizing a frame's width to match another frame's width
  2. See height guides - Blue horizontal lines appear when resizing a frame's height to match another frame's height
  3. Auto-snap dimensions - Frames automatically snap to matching dimensions when within the threshold
  4. Get visual feedback - Guides appear dynamically during resize and disappear when complete

The feature maintains the existing snap threshold of 12px and follows the same interaction patterns as the current alignment guide system.

Fixes #[issue-number]

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • f.hubspotusercontent40.net
    • Triggering command: node scripts/postinstall.mjs (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[feat] Width / Height guides</issue_title>
<issue_description>#### Describe the feature

Very similar to how we have alignment guides in the product, now make it so that users can

  1. See guides when webframes are the same width and the user is resizing
  2. "Snap" the width or height of the webframe to the closest width or height. Similar to what we have with the alignment guides.
  3. Then have the guides show up along the bottom or side where appropriate.

Image</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #2909

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

vercel bot commented Sep 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
web Ready Ready Preview Comment Sep 25, 2025 6:05am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Sep 25, 2025 6:05am

Copy link

supabase bot commented Sep 25, 2025

This pull request has been ignored for the connected project wowaemfasoptxrdjhilu because there are no changes detected in apps/backend/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel vercel bot temporarily deployed to Preview – docs September 25, 2025 05:58 Inactive
@Copilot Copilot AI changed the title [WIP] [feat] Width / Height guides [feat] Add width/height snap guides for webframe resizing Sep 25, 2025
@Copilot Copilot AI requested a review from Kitenite September 25, 2025 06:03
Copilot finished work on behalf of Kitenite September 25, 2025 06:03
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.

[feat] Width / Height guides
2 participants