Fix retry and undo reactivity in gr.Chatbot (#9614)

* fix reactive params

* add changeset

* fix type check

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Hannah 2024-10-09 17:33:10 +01:00 committed by GitHub
parent f57b9850d4
commit 5d985509b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 7 deletions

View File

@ -0,0 +1,7 @@
---
"@gradio/chatbot": minor
"@gradio/dataframe": minor
"gradio": minor
---
feat:Fix `retry` and `undo` reactivity in gr.Chatbot

View File

@ -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";
@ -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}

View File

@ -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";
@ -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",

View File

@ -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")}
@ -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={() =>