Radish alpha
r
rad:z39mP9rQAaGmERfUMPULfPUi473tY
Radicle terminal user interface
Radicle
Git
all: More keybindings
Merged did:key:z6MkgFq6...nBGz opened 2 years ago

patch: Exit on ESC

inbox: Exit on ESC

issue: Exit on ESC

inbox: move up / down with ‘j’ and ‘k’

issue: move up / down with ‘j’ and ‘k’

patch: move up / down with ‘j’ and ‘k’

3 files changed +12 -15 187586c5 8f4b9922
modified bin/commands/inbox/flux/select/ui.rs
@@ -82,7 +82,7 @@ impl Widget<InboxState, Action> for ListPage {

    fn handle_key_event(&mut self, key: termion::event::Key) {
        match key {
-
            Key::Char('q') | Key::Ctrl('c') => {
+
            Key::Esc | Key::Ctrl('c') => {
                let _ = self.action_tx.send(Action::Exit { selection: None });
            }
            Key::Char('\n') => {
@@ -125,11 +125,10 @@ impl Render<()> for ListPage {
        let layout = tui::flux::ui::layout::default_page(area, 0u16, 1u16);

        let shortcuts = match self.props.mode {
-
            Mode::Id => vec![Shortcut::new("enter", "select"), Shortcut::new("q", "quit")],
+
            Mode::Id => vec![Shortcut::new("enter", "select")],
            Mode::Operation => vec![
                Shortcut::new("enter", "show"),
                Shortcut::new("c", "clear"),
-
                Shortcut::new("q", "quit"),
            ],
        };

@@ -216,7 +215,7 @@ impl Widget<InboxState, Action> for Notifications {

    fn handle_key_event(&mut self, key: Key) {
        match key {
-
            Key::Up => {
+
            Key::Up | Key::Char('k') => {
                self.table.prev();

                let selected = self
@@ -231,7 +230,7 @@ impl Widget<InboxState, Action> for Notifications {
                    });
                }
            }
-
            Key::Down => {
+
            Key::Down | Key::Char('j') => {
                self.table.next(self.props.notifications.len());

                let selected = self
modified bin/commands/issue/flux/select/ui.rs
@@ -85,7 +85,7 @@ impl Widget<IssuesState, Action> for ListPage {

    fn handle_key_event(&mut self, key: termion::event::Key) {
        match key {
-
            Key::Char('q') | Key::Ctrl('c') => {
+
            Key::Esc | Key::Ctrl('c') => {
                let _ = self.action_tx.send(Action::Exit { selection: None });
            }
            Key::Char('\n') => {
@@ -149,13 +149,12 @@ impl Render<()> for ListPage {
        let layout = tui::flux::ui::layout::default_page(area, 0u16, 1u16);

        let shortcuts = match self.props.mode {
-
            Mode::Id => vec![Shortcut::new("enter", "select"), Shortcut::new("q", "quit")],
+
            Mode::Id => vec![Shortcut::new("enter", "select")],
            Mode::Operation => vec![
                Shortcut::new("enter", "show"),
                Shortcut::new("c", "comment"),
                Shortcut::new("e", "edit"),
                Shortcut::new("d", "delete"),
-
                Shortcut::new("q", "quit"),
            ],
        };

@@ -241,7 +240,7 @@ impl Widget<IssuesState, Action> for Issues {

    fn handle_key_event(&mut self, key: Key) {
        match key {
-
            Key::Up => {
+
            Key::Up | Key::Char('k') => {
                self.table.prev();

                let selected = self
@@ -256,7 +255,7 @@ impl Widget<IssuesState, Action> for Issues {
                    });
                }
            }
-
            Key::Down => {
+
            Key::Down | Key::Char('j') => {
                self.table.next(self.props.issues.len());

                let selected = self
modified bin/commands/patch/flux/select/ui.rs
@@ -87,7 +87,7 @@ impl Widget<PatchesState, Action> for ListPage {

    fn handle_key_event(&mut self, key: termion::event::Key) {
        match key {
-
            Key::Char('q') | Key::Ctrl('c') => {
+
            Key::Esc | Key::Ctrl('c') => {
                let _ = self.action_tx.send(Action::Exit { selection: None });
            }
            Key::Char('\n') => {
@@ -166,14 +166,13 @@ impl Render<()> for ListPage {
        let layout = tui::flux::ui::layout::default_page(area, 0u16, 1u16);

        let shortcuts = match self.props.mode {
-
            Mode::Id => vec![Shortcut::new("enter", "select"), Shortcut::new("q", "quit")],
+
            Mode::Id => vec![Shortcut::new("enter", "select")],
            Mode::Operation => vec![
                Shortcut::new("enter", "show"),
                Shortcut::new("c", "checkout"),
                Shortcut::new("m", "comment"),
                Shortcut::new("e", "edit"),
                Shortcut::new("d", "delete"),
-
                Shortcut::new("q", "quit"),
            ],
        };

@@ -272,7 +271,7 @@ impl Widget<PatchesState, Action> for Patches {

    fn handle_key_event(&mut self, key: Key) {
        match key {
-
            Key::Up => {
+
            Key::Up | Key::Char('k') => {
                self.table.prev();

                let selected = self
@@ -287,7 +286,7 @@ impl Widget<PatchesState, Action> for Patches {
                    });
                }
            }
-
            Key::Down => {
+
            Key::Down | Key::Char('j') => {
                self.table.next(self.props.patches.len());

                let selected = self