From b649a7ab8de6488c1341e94c37d032c07d5b3f13 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Thu, 26 Mar 2026 19:19:47 -0700 Subject: feat: Use eye-declare for more performant and flexible AI TUI (#3343) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR replaces the mess of custom rendering code in Atuin AI with [eye-declare](https://github.com/BinaryMuse/eye-declare), and updates the TUI to feel more terminal-native: output appears inline and persists in scrollback, so you can scroll up and look at previous conversations for reference. The "review" state — which used to exist between the LLM generating a response and the user either executing or following up — has been removed; just start typing to follow up with the LLM, or press `enter` at the empty input box to execute the suggested command. image --- crates/atuin-ai/src/tui/events.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 crates/atuin-ai/src/tui/events.rs (limited to 'crates/atuin-ai/src/tui/events.rs') diff --git a/crates/atuin-ai/src/tui/events.rs b/crates/atuin-ai/src/tui/events.rs new file mode 100644 index 00000000..a791bb80 --- /dev/null +++ b/crates/atuin-ai/src/tui/events.rs @@ -0,0 +1,27 @@ +/// Application-domain events emitted by UI components. +/// +/// Components translate raw key events into these semantic events, +/// which are sent via an `mpsc::Sender` provided through +/// eye-declare's context system. The main event loop in `inline.rs` +/// receives them and mutates `AppState` accordingly. +#[derive(Debug)] +pub enum AiTuiEvent { + /// User updated the input text + InputUpdated(String), + /// User submitted text input (Enter in Input mode) + SubmitInput(String), + /// User entered a slash command (e.g. "/help") + SlashCommand(String), + /// Cancel active generation or streaming (Esc during Generating/Streaming) + CancelGeneration, + /// Execute the suggested command + ExecuteCommand, + /// Insert command without executing + InsertCommand, + /// Cancel confirmation of dangerous command + CancelConfirmation, + /// Retry after error + Retry, + /// Exit the application + Exit, +} -- cgit v1.3.1