-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delay sending of chat UI messages until reactive graph is flushed (#1593
- Loading branch information
Showing
5 changed files
with
47 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from shiny.express import render, ui | ||
|
||
chat = ui.Chat(id="chat", messages=["A starting message"]) | ||
|
||
|
||
@render.ui | ||
def chat_output(): | ||
return chat.ui() |
15 changes: 15 additions & 0 deletions
15
tests/playwright/shiny/components/chat/dynamic_ui/test_chat_dynamic_ui.py
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,15 @@ | ||
from playwright.sync_api import Page, expect | ||
from utils.deploy_utils import skip_on_webkit | ||
|
||
from shiny.playwright import controller | ||
from shiny.run import ShinyAppProc | ||
|
||
|
||
@skip_on_webkit | ||
def test_validate_chat_basic(page: Page, local_app: ShinyAppProc) -> None: | ||
page.goto(local_app.url) | ||
|
||
chat = controller.Chat(page, "chat") | ||
|
||
expect(chat.loc).to_be_visible(timeout=30 * 1000) | ||
chat.expect_latest_message("A starting message", timeout=30 * 1000) |
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