From 86d48aa48b9951b6cbc471113844d16683051f8f Mon Sep 17 00:00:00 2001 From: Trim Bresilla Date: Tue, 3 Dec 2024 01:45:29 +0100 Subject: feat: implement entry management in Bibiman TUI - Add `.devbox` to the `.gitignore` file - Create a new backup file `devbox.json.back` with package and shell initialization configurations - Introduce a new method `add_entry` in the Bibiman struct to manage adding entries - Implement functionality to handle new entry submissions using `doi2bib` - Update command actions to include `AddEntry` - Add `AddEntry` as a new popup type in the TUI for creating entries - Enhance the UI rendering to support the new entry popup with input fields and cursor positioning --- src/tui/popup.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/tui/popup.rs') diff --git a/src/tui/popup.rs b/src/tui/popup.rs index 890e5c8..9b91801 100644 --- a/src/tui/popup.rs +++ b/src/tui/popup.rs @@ -29,6 +29,7 @@ pub enum PopupKind { MessageConfirm, MessageError, Selection, + AddEntry, } #[derive(Debug, Default)] @@ -39,6 +40,8 @@ pub struct PopupArea { pub popup_scroll_pos: u16, pub popup_list: Vec, pub popup_state: ListState, + pub add_entry_input: String, + pub add_entry_cursor_position: usize, } impl PopupArea { @@ -48,6 +51,7 @@ impl PopupArea { ("TAB: ", "Toggle areas (Entries, Keywords)"), ("/|Ctrl+f: ", "Enter search mode"), ("q|Ctrl+c: ", "Quit bibiman"), + ("a: ", "Add new entry"), ("?: ", "Show help"), ("Entry Table", "sub"), ("j,k|↓,↑: ", "Select next/previous entry"), -- cgit v1.2.3