Repository navigation
refactor: inject querychat extras via shinychat's footer slot - #292
Merged
Merged
Conversation
cpsievert
added a commit
that referenced
this pull request
Sep 10, 2026
…typo Addresses Copilot review feedback on #292.
cpsievert
added a commit
that referenced
this pull request
Sep 10, 2026
Also drops the shiny >= 1.14.0 pin from DESCRIPTION -- it moves down the stack to chat-footer-extras (#292).
mod_ui() (R and Python) now delivers querychat's dependencies and the handoff panel through chat_ui()'s footer slot instead of tagList siblings, unifying extras injection with page_chat(), where the footer is the only child-injection point. This is groundwork for a forthcoming page() method. - Defer enable_cancel/allow_attachments defaults to shinychat's client-based auto-enable - Move styles.css source to js/src and collapse footer padding when it holds only the inert extras - Hide the stale duplicate code editor that shinychat's footer re-adoption creates by racing bslib-code-editor's async init; scope handoff E2E selectors to :visible
…typo Addresses Copilot review feedback on #292.
Per-output ResizeObserver/IntersectionObserver visibility tracking (replacing jQuery/Bootstrap event-driven tracking) is needed for querychat UI living in shinychat chrome -- footer extras here, and the auto-opening data drawer in the stacked drawer-app PR.
cpsievert
added a commit
that referenced
this pull request
Sep 10, 2026
Also drops the shiny >= 1.14.0 pin from DESCRIPTION -- it moves down the stack to chat-footer-extras (#292).
cpsievert
force-pushed
the
chat-footer-extras
branch
from
September 10, 2026 16:54
222b827 to
c913b01
Compare
shinychat's footer centers its own content (the message composer), which cascaded into the handoff panel and other footer-injected querychat UI once extras moved into the footer slot, center-aligning the handoff source editor and anything else rendered there.
cpsievert
added a commit
that referenced
this pull request
Sep 10, 2026
Also drops the shiny >= 1.14.0 pin from DESCRIPTION -- it moves down the stack to chat-footer-extras (#292).
cpsievert
added a commit
that referenced
this pull request
Sep 10, 2026
…293) * feat(py): prototype app() on page() layout with auto-opening data drawer Rebuild QueryChat.app()'s UI on the shinychat page_chat() layout (via .page()) instead of page_sidebar. The SQL editor and data table cards move into a chat_drawer(open=False), and a reactive effect in the generated server auto-opens the drawer (chat.drawer.show()) whenever a query lands on the active table. ServerValues gains shinychat_chat (None in stub sessions) so host apps can drive chat-level UI like the drawer controller. Prototype only: R port, mobile auto-open behavior, and drawer sizing are still open questions. * docs(py): add drawer-layout smoke-test example app * docs(py): fix run instructions to use project venv python * feat(r): port app_obj() to page() layout with auto-opening data drawer Mirror of the Python prototype: $app_obj()/$app() now build on $page() (shinychat::page_chat()) instead of bslib::page_sidebar. The SQL editor and DT cards move into shinychat::chat_drawer(open = FALSE), and a server-side observer calls chat_drawer_show() when a query lands on the active table. Busy indicators and the gadget close button ride in the page_chat() footer slot (page_chat owns the whole document). Also fixes a real bug this surfaced: R Shiny only re-scans output visibility on bindAll/unbindAll or jQuery shown/hidden events, so outputs inside an initially-closed drawer stayed suspended server-side forever. querychat.js now watches the drawer's hidden attribute and triggers the shown/hidden events Shiny listens for (jQuery-guarded; py-shiny tracks visibility itself). Worth an upstream shinychat fix. - DESCRIPTION bumps shinychat to >= 0.5.0 (page_chat/drawer API) - Adds test-QueryChat coverage for the new app UI structure - Adds inst/examples-shiny/13-app-drawer smoke-test app * require shiny >= 1.14.0 and drop drawer visibility shim Shiny 1.14.0 (on CRAN since 2026-06-21) replaced jQuery/Bootstrap event-driven output visibility tracking with per-output ResizeObserver/IntersectionObserver (rstudio/shiny#3682, #4388), which handles shinychat's drawer toggling the hidden attribute natively. The jQuery-based MutationObserver shim in querychat.js is no longer needed on either side (py-shiny tracked visibility itself already). * style(py): fix docstring formatting lint in drawer app test * docs: drop drawer smoke examples; NEWS/CHANGELOG for chat-first app() The 13-app-drawer examples were smoke-test checklists rather than instructive examples. Also drops the standalone NEWS bullet for the shiny >= 1.14.0 requirement and adds chat-first app() entries to both NEWS.md and CHANGELOG.md. * chore(py): restore querychat.js to base (shim removal left only newline diff) * refactor(r): drop redundant comment in app_obj() ui Re-applies web edit e0faf04 that was clobbered by the history-rewrite force push. * refactor(py): rename ServerValues.shinychat_chat to chat Also drops the shiny >= 1.14.0 pin from DESCRIPTION -- it moves down the stack to chat-footer-extras (#292). * fix: restore pyright ignore on namespace_context import; align shinychat skip version - The drawer branch's older _shiny.py content had clobbered page-method's pyright: ignore[reportPrivateImportUsage] on the namespace_context import, failing make py-check-types in CI. - Copilot: () tests skipped on shinychat >= 0.4.0.9000, but DESCRIPTION requires >= 0.5.0. * test(py): open data drawer in e2e fixtures for qc.app()-based apps app() now starts with the data drawer closed (it auto-opens when a query lands), so fixtures that waited for a visible table on page load timed out. Add an open_data_drawer() helper that clicks the drawer trigger before waiting for the table. * refactor: demote SQL view to a footer control, tame drawer width Makes the data table the drawer's primary content and tucks the SQL editor behind a "Show Query" toggle in its footer, mirroring the existing ggSQL show/hide pattern used by the Visualize tool. Also replaces the drawer's fixed 720px width with a clamp-based policy (matching the chat container's own width formula) so it no longer dominates mid-size viewports. * feat: give the drawer a real title and on-demand access to all tables The drawer previously just said "Drawer" and only ever showed the table the chat most recently touched, with no way to look at the others. Now it's titled "Data Sources", and when more than one table is registered, a fully static accordion below the pinned "active table" card gives on-demand access to every table's own data grid and read-only SQL query -- with a small badge marking which one the chat is currently focused on. Single-table apps are unaffected (no accordion, same pinned card as before). * test(py): reveal SQL query section before asserting on sql_editor in e2e tests The data drawer's SQL panel moved behind a "Show Query" footer toggle; Shiny suspends rendering of outputs inside hidden containers, so the sql_editor code editor never mounted in the DOM for tests that checked its value without expanding the section first. * Update pkg-r/DESCRIPTION * test(py): retry drawer-trigger click in e2e open_data_drawer On slow CI runners the first click can land before shinychat's React client has attached its handler, silently swallowing it; every app()-based e2e test then timed out waiting for the drawer's table. Retry the click until the drawer is actually open (and don't click at all if it auto-opened already). * docs(py): correct changelog -- app() is Core-only (Copilot)
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
mod_ui()(R and Python) previously delivered querychat's dependencies and the handoff panel astagList()siblings ofchat_ui(). This routes them through shinychat'sfooterslot instead — the only child-injection pointpage_chat()accepts — so extras injection works uniformly across chat entry points. This is groundwork for a forthcomingpage()/$page()method (stacked PR to follow).What changes
mod_ui()builds the extras (dependencies + handoff panel) into a.querychat-extraswrapper in the chat footer, merging any user-suppliedfooterandclass.enable_cancel/allow_attachmentsdefaults are deferred to shinychat's client-based auto-enable.styles.csssource moves tojs/src/; new rule collapses footer padding when it holds only the inert extras.<bslib-code-editor>'s async init and leaves a second, stale editor instance in the handoff panel. All but the last (live) instance are hidden via CSS; handoff E2E selectors are scoped to:visible.Test plan
Also on this branch