diff options
| author | Trim Bresilla | 2024-12-03 01:45:29 +0100 |
|---|---|---|
| committer | lukeflo | 2024-12-23 21:03:19 +0100 |
| commit | 86d48aa48b9951b6cbc471113844d16683051f8f (patch) | |
| tree | 91a1af8050312f5646170da00fab6972903fce12 /src/tui/commands.rs | |
| parent | eadd906fc25125a61811247262836b9afe8adee1 (diff) | |
| download | bibiman-86d48aa48b9951b6cbc471113844d16683051f8f.tar.gz bibiman-86d48aa48b9951b6cbc471113844d16683051f8f.zip | |
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
Diffstat (limited to 'src/tui/commands.rs')
| -rw-r--r-- | src/tui/commands.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tui/commands.rs b/src/tui/commands.rs index a3049ee..626b11b 100644 --- a/src/tui/commands.rs +++ b/src/tui/commands.rs @@ -69,6 +69,8 @@ pub enum CmdAction { Exit, // Show keybindings ShowHelp, + // Add new entry + AddEntry, // Do nothing. Nothing, } @@ -118,6 +120,8 @@ impl From<KeyEvent> for CmdAction { KeyCode::PageUp => Self::ScrollInfoUp, // Exit App KeyCode::Char('q') => Self::Exit, + // Add new entry + KeyCode::Char('a') => Self::AddEntry, KeyCode::Char('c') | KeyCode::Char('C') => { if key_event.modifiers == KeyModifiers::CONTROL { Self::Exit |
