Skip to content

Commit 64d8805

Browse files
Fix re-draw state on model swap #4
1 parent bb61ca1 commit 64d8805

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ui/app.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def clear_cards(q, ignore: Optional[List[str]] = []) -> None:
6969
async def chat(q: Q):
7070
q.page["sidebar"].value = "#chat"
7171

72-
if q.args.table_dropdown:
73-
# If a table is selected, the trigger causes refresh of the page
72+
if q.args.table_dropdown or q.args.model_choice_dropdown:
73+
# If a table/model is selected, the trigger causes refresh of the page
7474
# so we update chat history with table name selection and return
7575
# avoiding re-drawing.
7676
q.page["chat_card"].data += [q.args.chatbot, False]
@@ -136,7 +136,7 @@ async def chat(q: Q):
136136
name="chatbot",
137137
data=data(fields="content from_user", t="list", size=-50),
138138
),
139-
)
139+
),
140140
add_card(
141141
q,
142142
"additional_actions",
@@ -414,9 +414,9 @@ async def datasets(q: Q):
414414
)
415415

416416

417-
@on("#about")
417+
@on("#documentation")
418418
async def about(q: Q):
419-
q.page["sidebar"].value = "#about"
419+
q.page["sidebar"].value = "#documentation"
420420
clear_cards(q)
421421

422422

@@ -498,7 +498,7 @@ async def init(q: Q) -> None:
498498
ui.nav_group(
499499
"Help",
500500
items=[
501-
ui.nav_item(name="#about", label="About"),
501+
ui.nav_item(name="#documentation", label="Documentation"),
502502
ui.nav_item(name="#support", label="Support"),
503503
],
504504
),

0 commit comments

Comments
 (0)