Skip to content

Commit

Permalink
Fixed compile issues on newer versions of rust + bumped dependencies …
Browse files Browse the repository at this point in the history
…+ clippy fixes + added extra info if no cards are present in a board + code refactoring for readability + shifted from saving access tokens to saving refresh tokens + fixed horizontal scrollbar not rendering
  • Loading branch information
yashs662 committed Nov 20, 2023
1 parent 820c2e5 commit bffb171
Show file tree
Hide file tree
Showing 20 changed files with 3,417 additions and 2,870 deletions.
186 changes: 133 additions & 53 deletions Cargo.lock

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust-kanban"
version = "0.8.1"
version = "0.8.2"
authors = ["Yash Sharma <yashs662@gmail.com>"]
edition = "2021"
license = "MIT"
Expand All @@ -11,24 +11,24 @@ categories = ["command-line-utilities", "text-editors"]

[dependencies]
log = "0.4.20"
ratatui = { version = "0.23.0", features = ["serde"] }
ratatui = { version = "0.24.0", features = ["serde"] }
crossterm = "0.27.0"
tokio = { version = "1.32.0", features = ["full"] }
chrono = "0.4.30"
tokio = { version = "1.34.0", features = ["full"] }
chrono = "0.4.31"
textwrap = "0.16"
eyre = "0.6.8"
eyre = "0.6.9"
home = "0.5.5"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.106"
clap = { version = "4.4.2", features = ["derive"] }
uuid = { version = "1.4.1", features = ["v4"] }
regex = "1.9.5"
serde = { version = "1.0.192", features = ["derive"] }
serde_json = "1.0.108"
clap = { version = "4.4.8", features = ["derive"] }
uuid = { version = "1.5.0", features = ["v4"] }
regex = "1.10.2"
linked-hash-map = "0.5.6"
ngrammatic = "0.4.0"
lazy_static = "1.4.0"
fxhash = "0.2.1"
parking_lot = "0.12.1"
reqwest = { version = "0.11.20", features = ["json"] }
aes-gcm = "0.10.2"
base64 = "0.21.4"
reqwest = { version = "0.11.22", features = ["json"] }
aes-gcm = "0.10.3"
base64 = "0.21.5"
bunt = "0.2.8"
176 changes: 88 additions & 88 deletions src/app/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,110 +8,110 @@ use std::{

#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum Action {
Quit,
NextFocus,
PrvFocus,
OpenConfigMenu,
Up,
ChangeCardStatusToActive,
ChangeCardStatusToCompleted,
ChangeCardStatusToStale,
ClearAllToasts,
Delete,
DeleteBoard,
Down,
Right,
Enter,
GoToMainMenu,
GoToPreviousUIMode,
HideUiElement,
Left,
MoveCardUp,
MoveCardDown,
MoveCardRight,
MoveCardLeft,
TakeUserInput,
StopUserInput,
GoToPreviousUIMode,
Enter,
HideUiElement,
SaveState,
MoveCardRight,
MoveCardUp,
NewBoard,
NewCard,
Delete,
DeleteBoard,
ChangeCardStatusToCompleted,
ChangeCardStatusToActive,
ChangeCardStatusToStale,
NextFocus,
OpenConfigMenu,
PrvFocus,
Quit,
Redo,
ResetUI,
GoToMainMenu,
Right,
SaveState,
StopUserInput,
TakeUserInput,
ToggleCommandPalette,
Undo,
Redo,
ClearAllToasts,
Up,
}

impl Action {
pub fn iterator() -> Iter<'static, Action> {
static ACTIONS: [Action; 31] = [
Action::Quit,
Action::NextFocus,
Action::PrvFocus,
Action::OpenConfigMenu,
Action::Up,
Action::ChangeCardStatusToActive,
Action::ChangeCardStatusToCompleted,
Action::ChangeCardStatusToStale,
Action::ClearAllToasts,
Action::Delete,
Action::DeleteBoard,
Action::Down,
Action::Right,
Action::Enter,
Action::GoToMainMenu,
Action::GoToPreviousUIMode,
Action::HideUiElement,
Action::Left,
Action::MoveCardUp,
Action::MoveCardDown,
Action::MoveCardRight,
Action::MoveCardLeft,
Action::TakeUserInput,
Action::StopUserInput,
Action::GoToPreviousUIMode,
Action::Enter,
Action::HideUiElement,
Action::SaveState,
Action::MoveCardRight,
Action::MoveCardUp,
Action::NewBoard,
Action::NewCard,
Action::Delete,
Action::DeleteBoard,
Action::ChangeCardStatusToCompleted,
Action::ChangeCardStatusToActive,
Action::ChangeCardStatusToStale,
Action::NextFocus,
Action::OpenConfigMenu,
Action::PrvFocus,
Action::Quit,
Action::Redo,
Action::ResetUI,
Action::GoToMainMenu,
Action::Right,
Action::SaveState,
Action::StopUserInput,
Action::TakeUserInput,
Action::ToggleCommandPalette,
Action::Undo,
Action::Redo,
Action::ClearAllToasts,
Action::Up,
];
ACTIONS.iter()
}

pub fn keys(&self) -> &[Key] {
match self {
Action::Quit => &[Key::Ctrl('c'), Key::Char('q')],
Action::NextFocus => &[Key::Tab],
Action::PrvFocus => &[Key::BackTab],
Action::OpenConfigMenu => &[Key::Char('c')],
Action::Up => &[Key::Up],
Action::ChangeCardStatusToActive => &[Key::Char('2')],
Action::ChangeCardStatusToCompleted => &[Key::Char('1')],
Action::ChangeCardStatusToStale => &[Key::Char('3')],
Action::ClearAllToasts => &[Key::Char('t')],
Action::Delete => &[Key::Char('d')],
Action::DeleteBoard => &[Key::Char('D')],
Action::Down => &[Key::Down],
Action::Right => &[Key::Right],
Action::Enter => &[Key::Enter],
Action::GoToMainMenu => &[Key::Char('m')],
Action::GoToPreviousUIMode => &[Key::Esc],
Action::HideUiElement => &[Key::Char('h')],
Action::Left => &[Key::Left],
Action::MoveCardUp => &[Key::ShiftUp],
Action::MoveCardDown => &[Key::ShiftDown],
Action::MoveCardRight => &[Key::ShiftRight],
Action::MoveCardLeft => &[Key::ShiftLeft],
Action::TakeUserInput => &[Key::Char('i')],
Action::StopUserInput => &[Key::Ins],
Action::GoToPreviousUIMode => &[Key::Esc],
Action::Enter => &[Key::Enter],
Action::HideUiElement => &[Key::Char('h')],
Action::SaveState => &[Key::Ctrl('s')],
Action::MoveCardRight => &[Key::ShiftRight],
Action::MoveCardUp => &[Key::ShiftUp],
Action::NewBoard => &[Key::Char('b')],
Action::NewCard => &[Key::Char('n')],
Action::Delete => &[Key::Char('d')],
Action::DeleteBoard => &[Key::Char('D')],
Action::ChangeCardStatusToCompleted => &[Key::Char('1')],
Action::ChangeCardStatusToActive => &[Key::Char('2')],
Action::ChangeCardStatusToStale => &[Key::Char('3')],
Action::NextFocus => &[Key::Tab],
Action::OpenConfigMenu => &[Key::Char('c')],
Action::PrvFocus => &[Key::BackTab],
Action::Quit => &[Key::Ctrl('c'), Key::Char('q')],
Action::Redo => &[Key::Ctrl('y')],
Action::ResetUI => &[Key::Char('r')],
Action::GoToMainMenu => &[Key::Char('m')],
Action::Right => &[Key::Right],
Action::SaveState => &[Key::Ctrl('s')],
Action::StopUserInput => &[Key::Ins],
Action::TakeUserInput => &[Key::Char('i')],
Action::ToggleCommandPalette => &[Key::Ctrl('p')],
Action::Undo => &[Key::Ctrl('z')],
Action::Redo => &[Key::Ctrl('y')],
Action::ClearAllToasts => &[Key::Char('t')],
Action::Up => &[Key::Up],
}
}

Expand All @@ -123,37 +123,37 @@ impl Action {
impl Display for Action {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let str = match self {
Action::Quit => "Quit",
Action::NextFocus => "Focus next",
Action::PrvFocus => "Focus previous",
Action::OpenConfigMenu => "configure",
Action::Up => "Go up",
Action::ChangeCardStatusToActive => "Change card status to active",
Action::ChangeCardStatusToCompleted => "Change card status to completed",
Action::ChangeCardStatusToStale => "Change card status to stale",
Action::ClearAllToasts => "Clear all toasts",
Action::Delete => "Delete focused element",
Action::DeleteBoard => "Delete Board",
Action::Down => "Go down",
Action::Right => "Go right",
Action::Enter => "Accept",
Action::GoToMainMenu => "Go to main menu",
Action::GoToPreviousUIMode => "Go to previous mode",
Action::HideUiElement => "Hide Focused element",
Action::Left => "Go left",
Action::MoveCardUp => "Move card up",
Action::MoveCardDown => "Move card down",
Action::MoveCardRight => "Move card right",
Action::MoveCardLeft => "Move card left",
Action::TakeUserInput => "Enter input mode",
Action::StopUserInput => "Stop input mode",
Action::GoToPreviousUIMode => "Go to previous mode",
Action::Enter => "Accept",
Action::HideUiElement => "Hide Focused element",
Action::SaveState => "Save Kanban state",
Action::MoveCardRight => "Move card right",
Action::MoveCardUp => "Move card up",
Action::NewBoard => "Create new board",
Action::NewCard => "Create new card in current board",
Action::Delete => "Delete focused element",
Action::DeleteBoard => "Delete Board",
Action::ChangeCardStatusToCompleted => "Change card status to completed",
Action::ChangeCardStatusToActive => "Change card status to active",
Action::ChangeCardStatusToStale => "Change card status to stale",
Action::NextFocus => "Focus next",
Action::OpenConfigMenu => "configure",
Action::PrvFocus => "Focus previous",
Action::Quit => "Quit",
Action::Redo => "Redo",
Action::ResetUI => "Reset UI",
Action::GoToMainMenu => "Go to main menu",
Action::Right => "Go right",
Action::SaveState => "Save Kanban state",
Action::StopUserInput => "Stop input mode",
Action::TakeUserInput => "Enter input mode",
Action::ToggleCommandPalette => "Open command palette",
Action::Undo => "Undo",
Action::Redo => "Redo",
Action::ClearAllToasts => "Clear all toasts",
Action::Up => "Go up",
};
write!(f, "{}", str)
}
Expand Down
Loading

0 comments on commit bffb171

Please sign in to comment.