-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from darrenburns/rename-chats
Progress renaming chats
- Loading branch information
Showing
12 changed files
with
192 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from textual import on | ||
from textual.app import ComposeResult | ||
from textual.binding import Binding | ||
from textual.containers import Vertical | ||
from textual.screen import ModalScreen | ||
from textual.widgets import Input | ||
|
||
|
||
class RenameChat(ModalScreen[str]): | ||
BINDINGS = [ | ||
Binding("escape", "app.pop_screen", "Cancel", key_display="esc"), | ||
Binding("enter", "app.pop_screen", "Save"), | ||
] | ||
|
||
def compose(self) -> ComposeResult: | ||
with Vertical(): | ||
title_input = Input(placeholder="Enter a title...") | ||
title_input.border_subtitle = ( | ||
"[[white]enter[/]] Save [[white]esc[/]] Cancel" | ||
) | ||
yield title_input | ||
|
||
@on(Input.Submitted) | ||
def close_screen(self, event: Input.Submitted) -> None: | ||
self.dismiss(event.value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.