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

@@ -11,6 +11,7 @@ import curses
from .analysis import EthernetAnalyzer
from .tui import TUIInterface
from .tui.modern_interface import ModernTUIInterface
from .tui.textual.app_v2 import StreamLensAppV2
from .utils import PCAPLoader, LiveCapture
@@ -31,6 +32,8 @@ def main():
help='Launch GUI mode (requires PySide6)')
parser.add_argument('--classic', action='store_true',
help='Use classic TUI interface')
parser.add_argument('--textual', action='store_true',
help='Use modern Textual TUI interface (experimental)')
args = parser.parse_args()
@@ -101,8 +104,13 @@ def main():
generate_outlier_report(analyzer, args.outlier_threshold)
return
# TUI mode - choose between classic and modern interface
if args.classic:
# TUI mode - choose between classic, modern curses, and textual interface
if args.textual:
# Use new Textual-based interface (TipTop-inspired)
app = StreamLensAppV2(analyzer)
app.run()
return
elif args.classic:
tui = TUIInterface(analyzer)
else:
tui = ModernTUIInterface(analyzer)