Add functionality for 'select all'
This commit is contained in:
parent
5aaa57a6a2
commit
8534fa4988
2 changed files with 20 additions and 1 deletions
16
src/app.rs
16
src/app.rs
|
|
@ -39,6 +39,7 @@ pub enum LogViewSelection {
|
|||
Entry, // Individual entry selected
|
||||
Project, // Whole project selected (ByProject mode only)
|
||||
Day, // Whole day selected
|
||||
All, // Entire view/period selected
|
||||
}
|
||||
|
||||
pub struct App {
|
||||
|
|
@ -373,6 +374,9 @@ impl App {
|
|||
// Jump to next day
|
||||
self.jump_to_next_day();
|
||||
}
|
||||
LogViewSelection::All => {
|
||||
// No navigation at All level - already selecting everything
|
||||
}
|
||||
}
|
||||
}
|
||||
KeyCode::Char('k') | KeyCode::Up => {
|
||||
|
|
@ -391,6 +395,9 @@ impl App {
|
|||
// Jump to previous day
|
||||
self.jump_to_previous_day();
|
||||
}
|
||||
LogViewSelection::All => {
|
||||
// No navigation at All level - already selecting everything
|
||||
}
|
||||
}
|
||||
}
|
||||
KeyCode::Char('e') => {
|
||||
|
|
@ -408,7 +415,8 @@ impl App {
|
|||
KeyCode::Char('h') | KeyCode::Left => {
|
||||
// Zoom out selection level
|
||||
self.log_view_selection_level = match (&self.log_view_selection_level, &self.log_view_grouping) {
|
||||
(LogViewSelection::Day, _) => LogViewSelection::Day, // Already at highest
|
||||
(LogViewSelection::All, _) => LogViewSelection::All, // Already at highest
|
||||
(LogViewSelection::Day, _) => LogViewSelection::All,
|
||||
(LogViewSelection::Project, _) => LogViewSelection::Day,
|
||||
(LogViewSelection::Entry, LogViewGrouping::ByProject) => LogViewSelection::Project,
|
||||
(LogViewSelection::Entry, LogViewGrouping::ByDate) => LogViewSelection::Day,
|
||||
|
|
@ -421,6 +429,8 @@ impl App {
|
|||
(LogViewSelection::Project, _) => LogViewSelection::Entry,
|
||||
(LogViewSelection::Day, LogViewGrouping::ByProject) => LogViewSelection::Project,
|
||||
(LogViewSelection::Day, LogViewGrouping::ByDate) => LogViewSelection::Entry,
|
||||
(LogViewSelection::All, LogViewGrouping::ByProject) => LogViewSelection::Day,
|
||||
(LogViewSelection::All, LogViewGrouping::ByDate) => LogViewSelection::Day,
|
||||
};
|
||||
}
|
||||
KeyCode::Char('c') => {
|
||||
|
|
@ -656,6 +666,10 @@ impl App {
|
|||
// Copy the entire day
|
||||
self.get_selected_day_text()
|
||||
}
|
||||
LogViewSelection::All => {
|
||||
// Copy the entire view/period
|
||||
self.log_view_content.join("\n")
|
||||
}
|
||||
};
|
||||
|
||||
// Copy to clipboard using the persistent clipboard instance
|
||||
|
|
|
|||
|
|
@ -563,6 +563,11 @@ fn render_log_view(frame: &mut Frame, app: &App) {
|
|||
}
|
||||
}
|
||||
}
|
||||
LogViewSelection::All => {
|
||||
// Select everything
|
||||
selected_line_start = 0;
|
||||
selected_line_end = app.log_view_content.len().saturating_sub(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Third pass: render with highlighting
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue