feat: frame visualization tool results with Shiny Chat - #274
Merged
cpsievert merged 19 commits intoAug 27, 2026
Conversation
cpsievert
commented
Aug 21, 2026
This comment was marked as resolved.
This comment was marked as resolved.
cpsievert
marked this pull request as ready for review
August 25, 2026 21:50
This was referenced Aug 25, 2026
cpsievert
force-pushed
the
fix/visualize-tool-borders
branch
from
August 26, 2026 20:57
2fe9c58 to
c0acec9
Compare
The previous test read R/querychat_viz.R from the package source tree, which does not exist when tests run under R CMD check. Exercise the visualize tool with mocked ggsql/session and assert on result@extra instead.
shinychat renamed the tool-result display field presentation -> open_style (with values minimal/framed); request the framed open style for visualization results.
- Wait for .shiny-tool-card:has(.querychat-viz-container); framed results no longer render a .shiny-tool-result element - Select the viz tool group structurally, not by LLM-chosen chart title - Re-resolve the group after collapse (shinychat unmounts the card) - Undim the framed viz group header and restore compact footer padding against shinychat main's framed-group CSS
ToolResultDisplay on shinychat main gained a markdown field defaulting to None, so the hasattr() check in format_tool_result() started returning None for every tool result, crashing format_chunk() with a TypeError on every chat turn in Streamlit/Gradio/Dash.
cpsievert
force-pushed
the
fix/visualize-tool-borders
branch
from
August 26, 2026 20:59
c0acec9 to
5cfe70e
Compare
These were extracted failing-test snippets from a local run, committed by mistake in 7916959.
cpsievert
commented
Aug 26, 2026
cpsievert
added a commit
that referenced
this pull request
Aug 27, 2026
…ssue) (#279) * build: install shinychat from git main Demonstrates that shinychat main alone breaks the Shiny sidebar E2E tests (test_03_sidebar_apps.py title tests) due to a timing regression introduced in posit-dev/shinychat#280 interacting with the in-process app servers used by the Playwright fixtures. * test(e2e): run Shiny apps as subprocesses via shiny.pytest.create_app_fixture The threaded in-process uvicorn fixtures shared Shiny's process-global, loop-bound reactive lock across apps. When two apps on different event loops contended for the lock, the session's message handler crashed with 'bound to a different event loop' and the chat message was dropped, hanging the sidebar title tests. shinychat main (posit-dev/shinychat#280) widened that race window enough to fail CI reliably. create_app_fixture runs each app in its own subprocess (as Shiny's own test suite does), giving each app its own loop and lock. This matches how the Streamlit fixtures already work. * test(e2e): update cancel button selectors for shinychat #350 shinychat main (176a8fc) replaced the conditional send/cancel/spinner button classes with a single button using data-state. The .shiny-chat-btn-cancel class no longer exists. * test(e2e): update viz test selectors for shinychat main's tool DOM shinychat main (#283) renders routed tool results as .shiny-tool-card inside .shiny-chat-tool-group; the .shiny-tool-result wrapper is now fallback-only. Update the viz Playwright suites to match. Moved from #274, where these changes were mixed with the framed presentation feature. * test(e2e): fix test_13 to use ShinyAppProc.url app_01_hello is now a create_app_fixture (ShinyAppProc), so page.goto needs .url. Missed in 89caac3.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this matters
Visualization tool results now use Shiny Chat's native framed presentation, so QueryChat no longer reaches into its condensed tool-display structure to create the surrounding frame.
Builds on posit-dev/shinychat#331 (merged; Python and R dependencies now track shinychat main).
What changes
presentation="framed"for visualization results in Python and R..shiny-tool-cardinside.shiny-chat-tool-group, not.shiny-tool-result), and keep the framed viz header/footer undimmed and compact against shinychat main's framed-group CSS.Verification
uv run pytest pkg-py/tests/test_viz_footer.py -quv run pytest pkg-py/tests/playwright/test_10_viz_inline.py pkg-py/tests/playwright/test_11_viz_footer.py pkg-py/tests/playwright/test_12_viz_bookmark.py— 22 passedRscript -e ...test-viz-tool.RStacked on #279 (which now carries the viz Playwright DOM-selector updates for shinychat main; this PR keeps only the framed-presentation feature and its tests).