Skip to content

Commit

Permalink
Merge pull request #209 from PrefectHQ/vim-scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin authored Apr 12, 2023
2 parents 6ab4d1d + a29f072 commit 82184eb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/marvin/cli/tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,10 @@ class MainScreen(Screen):
("n", "new_thread", "New Thread"),
("s", "show_settings_screen", "Show Settings"),
("x", "delete_thread", "Delete Thread"),
("k", "scroll_up_messages", "Scroll Up"),
("j", "scroll_down_messages", "Scroll Down"),
("u", "page_up_messages", "Page Up"),
("d", "page_down_messages", "Page Down"),
]

def action_focus_threads(self) -> None:
Expand All @@ -592,6 +596,22 @@ def action_show_bots_screen(self) -> None:
def action_show_settings_screen(self) -> None:
self.app.push_screen(SettingsScreen())

def action_scroll_up_messages(self) -> None:
messages = self.query_one("Conversation #messages", VerticalScroll)
messages.scroll_up(duration=0.1)

def action_scroll_down_messages(self) -> None:
messages = self.query_one("Conversation #messages", VerticalScroll)
messages.scroll_down(duration=0.1)

def action_page_up_messages(self) -> None:
messages = self.query_one("Conversation #messages", VerticalScroll)
messages.scroll_page_up(duration=0.1)

def action_page_down_messages(self) -> None:
messages = self.query_one("Conversation #messages", VerticalScroll)
messages.scroll_page_down(duration=0.1)

def compose(self) -> ComposeResult:
yield Sidebar(id="sidebar")
yield Conversation(id="conversation")
Expand Down

0 comments on commit 82184eb

Please sign in to comment.