Enhanced Textual TUI with proper API usage and documentation

- Fixed DataTable row selection and event handling
- Added explicit column keys to prevent auto-generated keys
- Implemented row-to-flow mapping for reliable selection tracking
- Converted left metrics panel to horizontal top bar
- Fixed all missing FlowStats/EnhancedAnalysisData attributes
- Created comprehensive Textual API documentation in Documentation/textual/
- Added validation checklist to prevent future API mismatches
- Preserved cursor position during data refreshes
- Fixed RowKey type handling and event names

The TUI now properly handles flow selection, displays metrics in a compact top bar,
and correctly correlates selected rows with the details pane.
This commit is contained in:
2025-07-27 18:37:55 -04:00
parent 5c2cb1a4ed
commit 36a576dc2c
29 changed files with 3751 additions and 51 deletions

View File

@@ -6,32 +6,52 @@ The new column layout separates transport and extended protocols for clearer flo
```
# Source Proto Destination Extended Frame Type Pkts Volume Timing Quality
1 192.168.4.89:1024 UDP 239.1.2.10:8080 CH10 CH10-Data 1452 1.9MB 77.8ms 95%
2 11.59.19.204:319 UDP 224.0.1.129:319 PTP PTP Sync 297 26.8KB 378.4ms Normal
3 11.59.19.202:4001 UDP 239.0.1.133:4001 - UDP 113 17.4KB 999.4ms Normal
4 192.168.43.111:68 UDP 255.255.255.255:67 - UDP 46 3.8KB 2.3s Normal
5 11.59.19.204:80 OTHER 224.0.0.22:80 - IGMP 6 360B 13.9s Normal
1 192.168.4.89:1024 UDP 239.1.2.10:8080 3 types Mixed 1452 1.9MB 77.8ms Enhanced
CH10 CH10-Data 1110 1.44MB 102ms 76.4%
CH10 TMATS 114 148KB 990ms 7.8%
UDP 228 296KB 493ms 15.7%
2 11.59.19.204:319 UDP 224.0.1.129:319 3 types Mixed 297 26.8KB 378.4ms Normal
PTP PTP-Signaling 226 20.4KB 498ms 76.1%
PTP PTP-Sync 57 6.1KB 2.0s 19.2%
PTP PTP-Unknown 14 1.5KB 7.5s 4.7%
3 11.59.19.202:4001 UDP 239.0.1.133:4001 1 types Single 113 17.4KB 999.4ms Normal
UDP 113 17.4KB 999ms 100.0%
```
## Key Improvements
1. **Transport Protocol Clarity**: Proto column shows TCP, UDP, ICMP, IGMP, OTHER
2. **Extended Protocol Support**: Separate column for specialized protocols (CH10, PTP, IENA, NTP)
3. **Frame Type Detail**: Shows the most common frame type for detailed analysis
4. **Distinct Source/Destination**: Clear separation with IP:port format
5. **Left-Aligned Text**: Source, destination, and protocol columns for better readability
6. **Comprehensive Flow Info**: Transport → Extended → Frame type hierarchy
1. **Hierarchical Flow Display**: Each flow shows a summary line followed by detailed sub-rows
2. **Transport Protocol Clarity**: Proto column shows TCP, UDP, ICMP, IGMP, OTHER on main flow line
3. **Extended Protocol/Frame Breakdown**: Sub-rows show each distinct extended protocol and frame type combination
4. **Detailed Packet Accounting**: Each sub-row shows packet count, volume, timing, and percentage for that specific type
5. **Visual Hierarchy**: Main flow line in bold, sub-rows indented and dimmed for clarity
6. **Complete Protocol Analysis**: See exactly what protocols and frame types comprise each flow
## Flow Structure
### Main Flow Line (Bold)
- Shows flow summary with source, transport protocol, destination
- Extended column shows "X types" indicating number of protocol/frame combinations
- Frame Type column shows "Mixed" or "Single" to indicate complexity
- Metrics show totals for entire flow
### Sub-Rows (Indented, Dimmed)
- Each sub-row represents a distinct extended protocol + frame type combination
- Source, Proto, Destination columns are empty (inherited from main flow)
- Extended column shows specific protocol (CH10, PTP, IENA, etc.)
- Frame Type shows specific frame type (CH10-Data, PTP-Sync, UDP, etc.)
- Metrics show counts, volume, timing, and percentage for that specific combination
## Column Widths
- Source: 20 characters (left-aligned) - IP:port format
- Proto: 6 characters (left-aligned) - Transport protocol (UDP, TCP, etc.)
- Destination: 20 characters (left-aligned) - IP:port format
- Extended: 10 characters (left-aligned) - Specialized protocol (CH10, PTP, etc.)
- Frame Type: 12 characters (left-aligned) - Most common frame type
- Source: 20 characters (left-aligned) - IP:port format (main flow only)
- Proto: 6 characters (left-aligned) - Transport protocol (main flow only)
- Destination: 20 characters (left-aligned) - IP:port format (main flow only)
- Extended: 10 characters (left-aligned) - Specialized protocol or summary
- Frame Type: 12 characters (left-aligned) - Specific frame type or summary
- Pkts: 6 characters (right-aligned) - Packet count
- Volume: 8 characters (right-aligned) - Data volume with units
- Timing: 8 characters (right-aligned) - Average inter-arrival time
- Quality: 8 characters (right-aligned) - Quality percentage or status
- Quality: 8 characters (right-aligned) - Quality/percentage
This layout provides clear protocol hierarchy from transport layer through specialized protocols to specific frame types.
This hierarchical layout provides complete protocol breakdown while maintaining clear visual flow structure.