Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/PrefectHQ/marvin
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed Apr 8, 2023
2 parents 2e0523b + 80650b0 commit 0eb479c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/marvin/cli/tui.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ Sidebar Button#settings {
dock: bottom;
}

Sidebar #meta-buttons-container {
height: auto;
}

Sidebar #quit {
background: $error 25%;
}

Sidebar #quit:hover {
background: $error 50%;
}

Sidebar TabbedContent {
height: 100%;
}
Expand Down
6 changes: 5 additions & 1 deletion src/marvin/cli/tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ def compose(self) -> ComposeResult:
yield Button("Bots \[b]", variant="success", id="show-bots")
yield Button("New thread \[n]", id="create-new-thread", variant="primary")
yield Button("Delete thread \[x]", id="delete-thread", variant="error")
yield Button("Settings \[s]", id="show-settings")
with Horizontal(id="meta-buttons-container"):
yield Button("Settings \[s]", id="show-settings")
yield Button("Quit \[ctrl-c]", id="quit")


class ResponseHover(Message):
Expand Down Expand Up @@ -598,6 +600,8 @@ async def on_button_pressed(self, event: Button.Pressed) -> None:
self.action_new_thread()
elif event.button.id == "delete-thread":
await self.action_delete_thread()
elif event.button.id == "quit":
self.app.exit()

async def update_last_bot_response(self, token_buffer: list[str]):
streaming_response = "".join(token_buffer)
Expand Down

0 comments on commit 0eb479c

Please sign in to comment.