From 99249ea319fca96ace8f3f4962534dc7a4bc5923 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Fri, 12 Jan 2024 16:02:08 +0000 Subject: feat: Add interactive command inspector (#1296) * Begin work on command inspector This is a separate pane in the interactive mode that allows for exploration and inspecting of specific commands. I've restructured things a bit. It made logical sense that things were nested under commands, however the whole point of `atuin` is to provide commands. Breaking things out like this enables a bit less crazy nesting as we add more functionality to things like interactive search. I'd like to add a few more interactive things and it was starting to feel very cluttered * Some vague tab things * functioning inspector with stats * add interactive delete to inspector * things * clippy * borders * sus * revert restructure for another pr * Revert "sus" This reverts commit d4bae8cf614d93b728621f7985cf4e387b6dc113. --- atuin-client/src/history.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'atuin-client/src/history.rs') diff --git a/atuin-client/src/history.rs b/atuin-client/src/history.rs index 8c312dc2..0147e25b 100644 --- a/atuin-client/src/history.rs +++ b/atuin-client/src/history.rs @@ -71,6 +71,26 @@ pub struct History { pub deleted_at: Option, } +#[derive(Debug, Clone, PartialEq, Eq, sqlx::FromRow)] +pub struct HistoryStats { + /// The command that was ran after this one in the session + pub next: Option, + /// + /// The command that was ran before this one in the session + pub previous: Option, + + /// How many times has this command been ran? + pub total: u64, + + pub average_duration: u64, + + pub exits: Vec<(i64, i64)>, + + pub day_of_week: Vec<(String, i64)>, + + pub duration_over_time: Vec<(String, i64)>, +} + impl History { #[allow(clippy::too_many_arguments)] fn new( -- cgit v1.3.1