feat: add option to "frame" open tool results - #331
Merged
Conversation
The attribute only takes effect while a tool result is open, so name it after what it styles. Values are now "minimal" (default) and "framed"; the wire attribute becomes open-style="framed".
Two fixes to multi-call tool group rendering: - Draw a vertical rule under the group header's glyph running the full height of the call list down through the final tool result, matching the drill-in rule leaf cards already get under their rows. - A framed call row no longer shifts left and widens when opened: the row indent moves from the summary onto the frame itself, so the frame's border box is exactly the box the collapsed row occupied.
…lt-presentation # Conflicts: # js/dist/shinychat.css # js/dist/shinychat.css.map # js/dist/shinychat.js # js/dist/shinychat.js.map # pkg-py/src/shinychat/www/GIT_VERSION # pkg-py/src/shinychat/www/shinychat.css # pkg-py/src/shinychat/www/shinychat.css.map # pkg-py/src/shinychat/www/shinychat.js # pkg-py/src/shinychat/www/shinychat.js.map # pkg-r/inst/lib/shiny/GIT_VERSION # pkg-r/inst/lib/shiny/shinychat.css # pkg-r/inst/lib/shiny/shinychat.css.map # pkg-r/inst/lib/shiny/shinychat.js # pkg-r/inst/lib/shiny/shinychat.js.map
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.
This PR adds a new alternative way to style tool results when they are open:
tool_result_display(open_style="framed").The basic idea is to draw a border around the tool result header and contents (when open). This is consistent with how Posit Assistant styles tool results and looks much better for things like querychat where a footer (and full screen button) is involved. Here is a before and after for querychat (posit-dev/querychat#274):
Before
After
Open question
I think the current default styling probably works best when tool results are code block heavy, which is the case for the default display, I believe. That said, maybe this is a better default when a footer is involved, and maybe even more generally for a larger class of custom tool displays? Any thoughts on this @gadenbuie?