Skip to content

feat(NewBlockLayer, ConnectionLayer): added validation and duplication of blocks by a group#62

Merged
Antamansid merged 2 commits intomainfrom
feat_add_group_block_copy_func
Apr 24, 2025
Merged

feat(NewBlockLayer, ConnectionLayer): added validation and duplication of blocks by a group#62
Antamansid merged 2 commits intomainfrom
feat_add_group_block_copy_func

Conversation

@Antamansid
Copy link
Collaborator

@Antamansid Antamansid commented Apr 2, 2025

Brief Summary of PR

Key Changes

Connection Validation

  • Added isConnectionAllowed function to ConnectionLayer that validates if a connection can be created from a source component
  • Updated event documentation with more detailed information about connection events and how they can be prevented

Block Duplication Validation

  • Added isDuplicateAllowed function to NewBlockLayer that validates if a block can be duplicated
  • Implemented validation logic that checks each block before duplication and cancels the process if no blocks can be duplicated

Group Block Duplication

  • Added support for duplicating multiple blocks at once when a selected block is Alt+dragged
  • Implemented two duplication modes:
    1. "Single block duplication": When Alt+dragging a non-selected block, only that block is duplicated
    2. "Multiple block duplication": When Alt+dragging a selected block, all selected blocks are duplicated together
  • Updated event types to handle multiple blocks instead of a single block
  • Added code to maintain the relative positions of blocks during group duplication

Technical Improvements

  • Added AbortController integration for ConnectionLayer and NewBlockLayer for proper handling of operation cancellations
  • Updated documentation to reflect the new functionality
  • Fixed a bug with addLayer that was causing unnecessary graph re-renders

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@Antamansid Antamansid marked this pull request as ready for review April 2, 2025 16:09
@Antamansid Antamansid force-pushed the feat_add_group_block_copy_func branch from 536a20d to e4e81f6 Compare April 11, 2025 09:13
@draedful draedful self-assigned this Apr 14, 2025
Copy link
Collaborator

@draedful draedful left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the comment.

@Antamansid Antamansid force-pushed the feat_add_group_block_copy_func branch from e4e81f6 to fb6c74e Compare April 24, 2025 08:09
@Antamansid Antamansid merged commit 4df468d into main Apr 24, 2025
4 checks passed
@Antamansid Antamansid deleted the feat_add_group_block_copy_func branch April 24, 2025 08:12
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.

3 participants