Skip to content

fix(tui): fix list state cloning bug, filter status rendering, and quit logic - #6

Open
RXVEN-1907 wants to merge 2 commits into
mainfrom
worktree-agent-ae09f4f260cc33c2f
Open

fix(tui): fix list state cloning bug, filter status rendering, and quit logic#6
RXVEN-1907 wants to merge 2 commits into
mainfrom
worktree-agent-ae09f4f260cc33c2f

Conversation

@RXVEN-1907

Copy link
Copy Markdown
Owner

Summary

Fixes several TUI bugs identified during verification and polish:

Bug Fixes

  1. List state cloning bug - render_scans_tab and render_settings_tab were using .clone() on ListState, which prevented selection tracking from working. Fixed by using mutable references to the actual state.

  2. Filter status rendering overlap - In render_findings_tab, the filter status was being rendered on top of the last table row. Now properly splits the area to render filter status below the table.

  3. Quit logic clarity - In handle_key_event, when 'q' or Esc pressed during a running scan, the code now explicitly returns Ok(false) instead of falling through.

Code Quality

  • Removed unused imports (tokio::time::sleep, Finding)
  • Fixed search overlay cursor to show a static cursor block
  • Updated function signatures to accept &mut App where needed for stateful widget rendering

Testing

  • All 12 integration tests pass
  • Build completes without new warnings

…it logic

- Fix list_state cloning bug in render_scans_tab and render_settings_tab:
  Using .clone() on ListState/TableState prevented selection tracking from working
  Changed to use mutable references to the actual state

- Fix filter status rendering in render_findings_tab:
  Filter status was being rendered on top of the last table row
  Now properly splits the area to render filter status below the table

- Fix quit logic in handle_key_event:
  Added explicit return Ok(false) when 'q' or Esc pressed during running scan
  Previously fell through without clear intent

- Remove unused imports (sleep, Finding)
- Fix search overlay cursor to show static cursor block
- Update function signatures to accept &mut App where needed
…, error handling, terminal cleanup

- Fix get_current_list_len() to return actual length (remove .max(1)) for empty collections
- Fix off-by-one in scan progress reporting (i+1 instead of i for 1-based display)
- Fix run_scan() to return Err for empty target instead of Ok(())
- Fix terminal cleanup in run_tui() to always run even on error (use let _ = pattern)
- Handle empty lists properly in next_item/previous_item/goto_top/goto_bottom (already had len > 0 guards)
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