You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're implementing string/regex filtering for states in the time graph visualization. While states are properly filtered via the tags property from the backend, we've identified a gap in handling related arrows and annotations.
Current Data Structures (tsp-typescript-client / trace-server-protocol)
interfaceTimeGraphState{start: bigint;end: bigint;label?: string;tags?: number;// Indicates if state is filteredstyle?: OutputElementStyle;}interfaceTimeGraphArrow{end: bigint;sourceId: number;start: bigint;targetId: number;style: OutputElementStyle;}interfaceAnnotation{duration: bigint;entryId: number;time: bigint;style: OutputElementStyle;}
Core Issue
Currently, there's no explicit relationship between:
States and their related arrows
States and their related annotations
This makes it very difficult for the frontend to efficiently determine which arrows/annotations should be filtered when their associated states are filtered.
Proposed Solutions
Solution 1: Backend-Handled Filtering (Preferred)
Approach
Extend the current filtering mechanism where the backend applies tags to arrows and annotations in addition to states.
Modified Data Structures
interfaceTimeGraphArrow{end: bigint;sourceId: number;start: bigint;targetId: number;style: OutputElementStyle;tags?: number;// NEW: Indicates if arrow should be filtered}interfaceAnnotation{duration: bigint;entryId: number;time: bigint;style: OutputElementStyle;tags?: number;// NEW: Indicates if annotation should be filtered}
Benefits
Maintains current architecture where filtering logic lives in the backend
No complex relationship mapping needed in frontend
Better performance as filtering is pre-computed
Consistent with current filtering approach for states
Frontend remains simple: just check tags property
Implementation Notes
Backend would need to extend its filtering logic to arrows and annotations
Frontend can use the same filtering logic it uses for states
We recommend implementing Solution 1 (Backend-Handled Filtering) because:
Maintains clean separation of concerns
Consistent with existing architecture
Better performance characteristics
Simpler frontend implementation
Easier to maintain and debug
The backend team already handles filtering logic for states, so extending this to arrows and annotations would be a natural progression of the current architecture.
Next Steps
Discuss any technical constraints or considerations
Agree on implementation approach
Please let me know if you need any clarification or have additional considerations to discuss.
The text was updated successfully, but these errors were encountered:
Current Problem
We're implementing string/regex filtering for states in the time graph visualization. While states are properly filtered via the
tags
property from the backend, we've identified a gap in handling related arrows and annotations.Current Data Structures (tsp-typescript-client / trace-server-protocol)
Core Issue
Currently, there's no explicit relationship between:
This makes it very difficult for the frontend to efficiently determine which arrows/annotations should be filtered when their associated states are filtered.
Proposed Solutions
Solution 1: Backend-Handled Filtering (Preferred)
Approach
Extend the current filtering mechanism where the backend applies tags to arrows and annotations in addition to states.
Modified Data Structures
Benefits
Implementation Notes
Solution 2: Relationship-Based Filtering (Alternative)
Approach
Add explicit relationships between states and their associated arrows/annotations.
Modified Data Structures
Considerations
Recommendation
We recommend implementing Solution 1 (Backend-Handled Filtering) because:
The backend team already handles filtering logic for states, so extending this to arrows and annotations would be a natural progression of the current architecture.
Next Steps
Please let me know if you need any clarification or have additional considerations to discuss.
The text was updated successfully, but these errors were encountered: