Skip to content

Comments

chore: Move tool request hiding logic out of result class#163

Merged
gadenbuie merged 4 commits intomainfrom
js/hide-request-id
Dec 2, 2025
Merged

chore: Move tool request hiding logic out of result class#163
gadenbuie merged 4 commits intomainfrom
js/hide-request-id

Conversation

@gadenbuie
Copy link
Collaborator

Move the logic for hiding tool requests to a dedicated event listener, which previously depended on a combination of the request being added to the page and logic in the tool request class. We also add a .shiny-tool-request and .shiny-tool-result class to the output elements.

With this change, custom tool request and result elements don't need to replicate the shiny-tool-request-hide logic. To be clear, custom tool request elements aren't currently possible with ellmer (and maybe chatlas?). But custom tool results are possible and without this PR they would need to replicate internal shinychat logic for request hiding to work as expected. The new classes aren't used for styling, but future-proof this code against custom tool request elements (that would use an element other than <shiny-tool-request>).

@gadenbuie gadenbuie requested a review from cpsievert December 2, 2025 14:16
@gadenbuie gadenbuie merged commit cf9d098 into main Dec 2, 2025
16 checks passed
@gadenbuie gadenbuie deleted the js/hide-request-id branch December 17, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants