111 lines
4.1 KiB
Markdown
111 lines
4.1 KiB
Markdown
---
|
|
phase: 02-interactive-tui
|
|
plan: 02
|
|
subsystem: tui
|
|
tags: [ratatui, crossterm, sorting, filtering, keyboard-navigation, cli-flags]
|
|
|
|
# Dependency graph
|
|
requires:
|
|
- phase: 02-interactive-tui-01
|
|
provides: "Core TUI framework with draw, event, app modules and main.rs wiring"
|
|
provides:
|
|
- "Fully interactive sort/filter/navigation in TUI"
|
|
- "CLI filter flags (--port, --pid, --process, --tcp, --udp)"
|
|
- "Independent column navigation (Tab/Left/Right) and row scrolling (j/k/Up/Down)"
|
|
affects: [03-output-packaging]
|
|
|
|
# Tech tracking
|
|
tech-stack:
|
|
added: []
|
|
patterns:
|
|
- "Column navigation (Tab/Left/Right) independent of row selection (j/k/Up/Down)"
|
|
- "CLI filters applied before live filter in filter_records pipeline"
|
|
|
|
key-files:
|
|
created: []
|
|
modified:
|
|
- tcptop/src/tui/event.rs
|
|
- tcptop/src/tui/draw.rs
|
|
- tcptop/src/tui/app.rs
|
|
- tcptop/src/main.rs
|
|
|
|
key-decisions:
|
|
- "Left/Right arrows navigate column headers, Up/Down arrows scroll rows -- independent axes"
|
|
- "BackTab (Shift+Tab) added for reverse column navigation"
|
|
|
|
patterns-established:
|
|
- "Column and row navigation are orthogonal: column nav keys (Tab/Left/Right) and row nav keys (j/k/Up/Down) never conflict"
|
|
|
|
requirements-completed: [DISP-03, DISP-07, FILT-01, FILT-02, FILT-03, FILT-04]
|
|
|
|
# Metrics
|
|
duration: 5min
|
|
completed: 2026-03-22
|
|
---
|
|
|
|
# Phase 02 Plan 02: Interactive TUI Polish Summary
|
|
|
|
**Sorting, filtering, CLI flags, and independent column/row navigation with Left/Right arrow support**
|
|
|
|
## Performance
|
|
|
|
- **Duration:** 5 min
|
|
- **Started:** 2026-03-22T02:25:00Z
|
|
- **Completed:** 2026-03-22T02:30:00Z
|
|
- **Tasks:** 2
|
|
- **Files modified:** 4
|
|
|
|
## Accomplishments
|
|
- Verified all 9 mnemonic sort keys, Tab/Enter header navigation, filter-as-you-type, CLI filter flags
|
|
- Fixed column navigation to work independently of row selection (Left/Right arrows + BackTab)
|
|
- Human-verified on Linux VM -- all features working except the column/row navigation conflict (now fixed)
|
|
|
|
## Task Commits
|
|
|
|
Each task was committed atomically:
|
|
|
|
1. **Task 1: Verify and fix sorting, filtering, and keyboard interactions** - `3ea37aa` (fix)
|
|
2. **Task 2: Fix column navigation independent of row selection** - `ec09dbb` (fix)
|
|
|
|
## Files Created/Modified
|
|
- `tcptop/src/tui/event.rs` - Added Left/Right/BackTab for column navigation, kept Up/Down for row scrolling
|
|
- `tcptop/src/tui/draw.rs` - Updated help overlay to document Left/Right column navigation
|
|
- `tcptop/src/tui/app.rs` - Sort, filter, and column index logic (verified, minor fixes in Task 1)
|
|
- `tcptop/src/main.rs` - CLI filter wiring and --interface warning (Task 1)
|
|
|
|
## Decisions Made
|
|
- Left/Right arrows map to column header navigation (forward/backward), making them independent of Up/Down row scrolling
|
|
- BackTab (Shift+Tab) added for reverse column navigation to match standard terminal conventions
|
|
|
|
## Deviations from Plan
|
|
|
|
### Auto-fixed Issues
|
|
|
|
**1. [Rule 1 - Bug] Column navigation blocked by row selection**
|
|
- **Found during:** Task 2 (human-verify checkpoint feedback)
|
|
- **Issue:** After selecting a row with Up/Down arrows, Left/Right arrows and Tab stopped navigating column headers because Left/Right were not bound at all
|
|
- **Fix:** Added KeyCode::Left and KeyCode::Right as column navigation keys alongside Tab; added BackTab for reverse navigation
|
|
- **Files modified:** tcptop/src/tui/event.rs, tcptop/src/tui/draw.rs
|
|
- **Verification:** cargo check passes; column and row navigation are now independent match arms
|
|
- **Committed in:** ec09dbb
|
|
|
|
---
|
|
|
|
**Total deviations:** 1 auto-fixed (1 bug)
|
|
**Impact on plan:** Essential UX fix -- column navigation was broken when a row was highlighted. No scope creep.
|
|
|
|
## Issues Encountered
|
|
- User reported during human-verify that arrow keys stopped working for column navigation after row selection -- root cause was that Left/Right were simply not bound for column navigation (only Tab was). Fixed by adding Left/Right/BackTab handlers.
|
|
|
|
## User Setup Required
|
|
None - no external service configuration required.
|
|
|
|
## Next Phase Readiness
|
|
- Full interactive TUI complete with sorting, filtering, CLI flags, and keyboard navigation
|
|
- Ready for Phase 03 (output, packaging, tests)
|
|
- No blockers
|
|
|
|
---
|
|
*Phase: 02-interactive-tui*
|
|
*Completed: 2026-03-22*
|