Conversation
|
Awesome @giantatwork ! What about adding a shortcut to Mark All? I was thinking that after filtering, I can mark all and then export? Of course, this is pending @YS-L 's review.... |
Thanks!
That’s a great suggestion. My only concern is the potential performance impact when handling a large number of records. We’d likely run into the same bottleneck described in #167. We should consider how to handle the 'Select All' action efficiently for high-volume exports. |
|
As to performance, I wonder if a "streaming" approach can be used instead? |
| KeyCode::Left => Control::ScrollLeftMost, | ||
| KeyCode::Right => Control::ScrollRightMost, | ||
| KeyCode::Char('j') => Control::ToggleNaturalSort, | ||
| KeyCode::Char('m') => Control::SelectMarks, |
There was a problem hiding this comment.
I couldn't get Ctrl + m to work in iTerm2 or the macOS Terminal (it's treated the same as Enter there), though it does work in Ghostty. Might need to use a more portable key binding such as Ctrl + e.
| if marked.is_empty() { | ||
| return Some(String::new()); | ||
| } |
There was a problem hiding this comment.
Would it make sense to return None when there are no marked rows, so the program doesn't exit?
| .iter() | ||
| .map(|&n| n.saturating_sub(1) as u64) | ||
| .collect(); | ||
| indices.sort_unstable(); |
There was a problem hiding this comment.
Is this sort still needed? The passed in record_numbers is already sorted.
|
Thanks @giantatwork for the PR! I agree with your concerns about handling large numbers of records. In this case in particular, we need to be careful not to read a large number of rows into memory. |
|
@jqnatividad Would this still be a useful addition without a “Mark All” option? Curious since you raised the original feature request. |
|
Yes @YS-L , IMHO, it's still a useful addition. Insofar as "Mark All" causing memory issues, perhaps we can include some simple heuristics to ensure it doesn't cause OOM - i.e. "Mark All" will not work without any filters in place; Maximum hardcoded row limit; some OOM checking for folks with the memory to spare, etc. |
|
Thanks @giantatwork ! |
Hi @jqnatividad,
As requested in #186, I've added a shortcut (Ctrl+m) that prints/exports marked rows to stdout with their headers, similar to how single cells are currently handled.
@YS-L, let me know what you think!