Skip to content

Conversation

@siarheihuzarevich
Copy link
Member

Summary

This MR introduces a unified installation mechanism that works seamlessly in both Angular CLI and Nx workspaces without requiring Nx as a dependency, and includes several performance improvements related to node/connection rendering and zoom inside f-canvas.

Changes

🛠 Installation / Tooling
• Added add schematic alias so the library can now be installed in Nx as well:
• Angular CLI: ng add @foblex/flow
• Nx: nx g @foblex/flow:add
• No @nx/devkit dependency added — the library remains framework-agnostic
• Existing schema structure remains fully backward-compatible

🎛 Content Projection (Slots)
• Unified and simplified ng-content slot selectors
• Introduced group selectors ([fNodes], [fConnections]) to correctly handle nested control flow blocks (@for, @if)
• Ensured correct projection without element loss when using the new Angular control flow syntax

⚡ Performance Improvements
• Connection rendering optimized to reduce unnecessary path recalculations
• Zoom performance improved by minimizing layout thrashing and reducing redraw frequency
• Less jitter and better stability when dragging or rearranging nodes

🧩 Browser Compatibility Fixes
• Fixed Safari (macOS) rendering issue where connection paths were occasionally clipped / not fully drawn

Result
• Smooth installation experience in both Angular CLI and Nx workspaces
• More stable and efficient rendering pipeline
• Improved zoom + drag experience
• Reliable behavior across Chrome / Firefox / Safari

Testing Notes
• Verified in Angular CLI projects (18.x)
• Verified in Nx workspaces (18.x)
• Tested in Safari, Chrome, and Firefox
• Stress-tested node dragging and zooming performance

…tions

- add grouped selectors ([fNodes], [fConnections], [fGroups]) to support consecutive @for/@if blocks
- unify and simplify ng-content matching logic
- keep specific selectors before grouped ones to preserve slot projection priority
…ve zoom performance

- reduce redundant connection redraw operations and path recalculations
- fix macos safari issue where connection path could render incompletely
- improve zoom rendering performance by reducing layout thrashing and recalculation frequency
- added `add` schematic alias so Nx users can run `nx g @foblex/flow:add`
- ensured `ng add @foblex/flow` continues to work without requiring Nx
- no runtime changes, only install/usage improvements
Copy link

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 unifies the installation flow for both Angular CLI and Nx workspaces by adding an "add" schematic alias, improves canvas rendering performance by optimizing connection path calculations and zoom behavior, and enhances content projection to better support Angular's control flow syntax.

Key changes:

  • Added add schematic alias enabling Nx users to install via nx g @foblex/flow:add
  • Optimized connection and zoom rendering by reducing layout thrashing and unnecessary recalculations
  • Updated content projection slots to support @for and @if control flow blocks

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
projects/f-flow/schematics/collection.json Added "add" schematic alias for Nx compatibility
projects/f-flow/package.json Version bump to 17.9.5
projects/f-flow/src/f-canvas/f-canvas.component.html Enhanced ng-content selectors with group selectors for control flow support
projects/f-flow/src/f-flow/f-flow.component.scss Changed connection positioning from fixed to absolute and added z-index layering
projects/f-flow/src/f-connection/f-connection/f-connection.component.scss Moved position styling to SVG element with !important overflow rule
projects/f-flow/src/f-connection/common/f-connection-base.ts Made fTextComponent optional to prevent errors when text is absent
projects/f-flow/src/f-zoom/f-zoom.directive.ts Refactored to use signals and direct event listeners instead of Renderer2
projects/f-flow/src/f-draggable/f-draggable-base.ts Moved to direct event listeners, removed NgZone dependency injection
projects/f-flow/src/drag-toolkit/drag-and-drop-base.ts Injected dependencies directly, removed ICanRunOutsideAngular interface
projects/f-flow/src/drag-toolkit/event.extensions.ts Improved type safety and code consistency
projects/f-pro-examples/tournament-bracket/* Updated to use new control flow syntax and group selectors
projects/f-examples/nodes/stress-test/* Added connection toggle feature for performance testing

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

@siarheihuzarevich siarheihuzarevich merged commit f9e6603 into main Oct 27, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants