Skip to content

Conversation

@mentatbot
Copy link
Contributor

@mentatbot mentatbot bot commented Jul 21, 2025

Adds a comprehensive line type system that allows users to create multiple independent connection types with separate controls for positioning and visual appearance.

Key Features

Independent Configuration per Line Type:

  • Force Configuration: Enable/disable positioning effects, adjustable strength (0-100%), configurable base distance (30-200px)
  • Visual Configuration: Color picker, opacity control (0-100% for invisible lines), thickness multiplier (0-100%)
  • Data Source Mapping: Each line type can use different weighted combinations of semantic similarity, filesystem proximity, and code references

Default Line Types:

  • Code Connections: Visible blue lines for imports/calls with strong positioning force
  • Semantic Clustering: Invisible semantic grouping lines with moderate positioning force (0% opacity by default)
  • Filesystem Structure: Optional red lines for file proximity (disabled by default)

Enhanced UI:

  • Tabbed controls interface separating Visual Features from Line Types
  • Dynamic add/remove line types with live configuration updates
  • Comprehensive controls for each line type including enable/disable toggles

Use Cases Enabled

  • Invisible semantic clustering: Lines that position nodes without visual clutter
  • Visible call graphs: Lines that show relationships without affecting layout
  • Custom hybrid approaches: Any combination of force/visual settings per line type

Technical Implementation

  • New LineType interface with force/visual/data source configuration
  • Updated visualization engine to handle multiple independent line types
  • Enhanced generateLinksForLineTypes function replacing legacy edge processing
  • Proper D3 key handling for multiple line types between same nodes
  • Full TypeScript support with comprehensive type definitions

This enables the requested functionality where users can have "as many kinds of lines as they want" with independent control over force (positioning), color (visibility), and thickness (visual weight) attributes.


🤖 This PR was created with Mentat. See my steps and cost here

  • Wake on any new activity.

mentatbot bot and others added 3 commits July 21, 2025 16:38
…thickness controls

Added a comprehensive line type system that allows users to create multiple independent connection types with separate controls for:

**Force Configuration:**
- Enable/disable force for node positioning
- Adjustable strength (0-100%)
- Configurable base distance (30-200px)

**Visual Configuration:**
- Color picker for line appearance
- Opacity control (0-100%, allows invisible lines)
- Thickness multiplier (0-100%)

**Data Source Mapping:**
- Each line type can use different relationship data sources
- Weighted combination of semantic similarity, filesystem proximity, code references

**Default Line Types:**
- Code Connections: Visible imports/calls with strong force
- Semantic Clustering: Invisible semantic grouping with moderate force
- Filesystem Structure: Optional filesystem-based connections

**UI Enhancements:**
- Tabbed controls interface (Visual Features | Line Types)
- Dynamic add/remove line types
- Live configuration updates
- Comprehensive controls for each line type

This enables scenarios like invisible semantic clustering that positions nodes without visual clutter, while visible call graphs show relationships without affecting layout.

Mentat precommit script failed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/d7019731-55ec-4f90-888e-05ebaa150f26

Co-authored-by: jakethekoenig <[email protected]>
Fixed critical JSX syntax errors in UnifiedVisualizationControls.tsx and updated RepositoryGraph.tsx to use the new line type system consistently.

Key fixes:
- Properly structured React components with correct JSX closing tags
- Updated config update effect to use new generateLinksForLineTypes function
- Fixed link visual properties to use getLinkVisualProperties helper
- Removed references to deprecated getLinkColor function

The line types system now works correctly with:
- Independent force and visual configuration
- Tabbed interface for features vs line types
- Real-time updates when changing line type settings
- Default line types for common use cases

Successfully tested - the application builds and runs without errors.

Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/e94382ae-b4f0-4eb7-8ca5-b0f29d7d14dd

Co-authored-by: jakethekoenig <[email protected]>
Removed unused imports (calculateEdgeStrength, calculateEdgeWidth) from RepositoryGraph.tsx that were causing TypeScript warnings.

Fixed D3 link key function to include lineTypeId, preventing conflicts when multiple line types connect the same source-target pair. This ensures each line type renders independently even when they share the same endpoints.

Changes:
- Removed calculateEdgeStrength and calculateEdgeWidth from imports
- Updated D3 data key function to include lineTypeId for unique link identification
- TypeScript compilation passes without errors or warnings

This completes the line types implementation with proper handling of multiple independent connection types.

Mentat precommit script passed. Log: https://mentat.ai/gh/AbanteAI/repo-visualizer/log/ba1da941-ca4b-4a0c-8dab-67411e6072d4

Co-authored-by: jakethekoenig <[email protected]>
@mentatbot mentatbot bot requested a review from jakethekoenig July 21, 2025 17:01
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.

1 participant