fix(tui): fix list state cloning bug, filter status rendering, and quit logic - #6
Open
RXVEN-1907 wants to merge 2 commits into
Open
fix(tui): fix list state cloning bug, filter status rendering, and quit logic#6RXVEN-1907 wants to merge 2 commits into
RXVEN-1907 wants to merge 2 commits into
Conversation
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes several TUI bugs identified during verification and polish:
Bug Fixes
List state cloning bug -
render_scans_tabandrender_settings_tabwere using.clone()onListState, which prevented selection tracking from working. Fixed by using mutable references to the actual state.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.Quit logic clarity - In
handle_key_event, when 'q' or Esc pressed during a running scan, the code now explicitly returnsOk(false)instead of falling through.Code Quality
tokio::time::sleep,Finding)&mut Appwhere needed for stateful widget renderingTesting