Skip to content

Commit 82f73d4

Browse files
committed
Directory tree reload.
Directory/file tree is now updated on toggle. New files were not showing up in the tree view.
1 parent 33fdd41 commit 82f73d4

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

openai-assistant

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ openai-assistant v2
44
Copyright 2025 J Adams jfa63[at]duck[dot]com
55
Released under the 2-Clause BSD license.
66
"""
7-
__version__ = 'v2.2.0'
7+
__version__ = 'v2.2.1'
88
__author__ = 'J. Adams jfa63[at]duck[dot]com'
99

1010
# Builtin imports
@@ -37,8 +37,7 @@ from rich import print
3737
from textual import events, on
3838
from textual.app import App, ComposeResult
3939
from textual.binding import Binding
40-
from textual.containers import Center, Container, Grid, Middle, VerticalScroll
41-
from textual.highlight import highlight
40+
from textual.containers import Container, Grid, VerticalScroll
4241
from textual.reactive import reactive, var
4342
from textual.screen import ModalScreen
4443
from textual.widgets import (Button,
@@ -47,7 +46,6 @@ from textual.widgets import (Button,
4746
Header,
4847
Label,
4948
Markdown,
50-
ProgressBar,
5149
TextArea,
5250
)
5351

@@ -911,7 +909,10 @@ class OpenaiAssistant(App):
911909

912910

913911
def action_toggle_file_view(self) -> None:
914-
"""Called in response to key binding."""
912+
"""
913+
Called in response to key binding.
914+
"""
915+
self.query_one("#tree-view", DirectoryTree).reload()
915916
self.show_tree = not self.show_tree
916917
# End action_toggle_file_view()
917918

@@ -1033,18 +1034,17 @@ if __name__ == "__main__":
10331034

10341035

10351036
print("[green]Loading configuration and uploading chat log[/]")
1036-
with c.status(""):
1037-
# Set up configuration and upload chat_log.txt
1038-
upload = api.setup(upload_log=(not args.no_upload)) # All CLI prompts and setup happen here
1039-
status = upload.status.strip()
1040-
if status == "cancelled":
1041-
print("\n[yellow]Skipping chat log upload.[/]\n")
1042-
elif status == "completed":
1043-
print(f"\nUploaded [#d5d676]{logfile}[/]\n")
1044-
elif status == "failed":
1045-
print(f"\nUpload of [red]{logfile}[/] failed!\n")
1046-
# a little time to read msg
1047-
sleep(3)
1037+
# Set up configuration and upload chat_log.txt
1038+
upload = api.setup(upload_log=(not args.no_upload)) # All CLI prompts and setup happen here
1039+
status = upload.status.strip()
1040+
if status == "cancelled":
1041+
print("\n[yellow]Skipping chat log upload.[/]\n")
1042+
elif status == "completed":
1043+
print(f"\nUploaded [#d5d676]{logfile}[/]\n")
1044+
elif status == "failed":
1045+
print(f"\nUpload of [red]{logfile}[/] failed!\n")
1046+
# a little time to read msg
1047+
sleep(3)
10481048

10491049
# Now launch the TUI, passing the API and settings objects
10501050
app = OpenaiAssistant(api, settings)

0 commit comments

Comments
 (0)