Skip to content

Commit

Permalink
Fix retry and undo reactivity in gr.Chatbot (#9614)
Browse files Browse the repository at this point in the history
* fix reactive params

* add changeset

* fix type check

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
hannahblair and gradio-pr-bot authored Oct 9, 2024
1 parent f57b985 commit 5d98550
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .changeset/puny-lines-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@gradio/chatbot": minor
"@gradio/dataframe": minor
"gradio": minor
---

feat:Fix `retry` and `undo` reactivity in gr.Chatbot
6 changes: 3 additions & 3 deletions js/chatbot/shared/ButtonPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
export let message: NormalisedMessage | NormalisedMessage[];
export let position: "right" | "left";
export let avatar: FileData | null;
export let disable: boolean;
export let generating: boolean;
export let handle_action: (selected: string | null) => void;
export let layout: "bubble" | "panel";
Expand Down Expand Up @@ -69,14 +69,14 @@
<IconButton
Icon={Retry}
on:click={() => handle_action("retry")}
disabled={disable}
disabled={generating}
/>
{/if}
{#if show_undo}
<IconButton
Icon={Undo}
on:click={() => handle_action("undo")}
disabled={disable}
disabled={generating}
/>
{/if}
{#if likeable}
Expand Down
4 changes: 2 additions & 2 deletions js/chatbot/shared/Message.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
likeable: boolean;
show_retry: boolean;
show_undo: boolean;
disable: boolean;
generating: boolean;
show_copy_button: boolean;
message: NormalisedMessage[] | NormalisedMessage;
position: "left" | "right";
Expand All @@ -91,7 +91,7 @@
likeable: show_like,
show_retry,
show_undo,
disable: generating,
generating,
show_copy_button,
message: msg_format === "tuples" ? messages[0] : messages,
position: role === "user" ? "right" : "left",
Expand Down
2 changes: 0 additions & 2 deletions js/dataframe/shared/Table.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,6 @@
{i18n}
x={active_cell_menu.x}
y={active_cell_menu.y}
col={active_cell_menu.col}
row={active_cell_menu?.row ?? -1}
on_add_row_above={() => add_row_at(active_cell_menu?.row ?? -1, "above")}
on_add_row_below={() => add_row_at(active_cell_menu?.row ?? -1, "below")}
Expand All @@ -1005,7 +1004,6 @@
{i18n}
x={active_header_menu.x}
y={active_header_menu.y}
col={active_header_menu.col}
row={-1}
on_add_column_left={() => add_col_at(active_header_menu?.col ?? -1, "left")}
on_add_column_right={() =>
Expand Down

0 comments on commit 5d98550

Please sign in to comment.