Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve collapsible block styles; give special treatment for collapsible "results" #94

Open
eric-schneider opened this issue Feb 6, 2024 · 4 comments
Labels

Comments

@eric-schneider
Copy link
Contributor

eric-schneider commented Feb 6, 2024

We need to give some love to the collapsible block.

Current styling:
image

The current styling doesn't match the original spec.

Original spec:

image

Collapsible results

In the past we've used tabsets to show a command and its output/results in separate tabs (example):

image

However, this presents a problem since many of our code examples span multiple API clients. If someone can switch between Python, TypeScript, and Java, we would need to provide separate results for each client and this gets messy.

The current workaround is to switch to using a collapsible section underneath the corresponding code block. In fact, the original spec actually hinted at this workaround:

image

This was a late addition to the spec that didn't get much discussion and was never implemented in the new UI. The downside of a collapsible block is that it currently presents a small clickable target that isn't as easy to notice/use as tabs are.

We should consider enhancing the UI to treat command + results as a special case that warrants its own special UI treatment. If possible, we should consider implementing this on the AsciiDoc side in such a way that doesn't require (but still allows) using the full collapsible block syntax.

@eric-schneider eric-schneider added the enhancement New feature or request label Feb 6, 2024
@colegoldsmith
Copy link
Collaborator

@eric-schneider I'm trying to find other examples of this in the wild to get some inspiration. So far I found the OpenAI Cookbook pages to have a somewhat similar design problem of showing a code block that is the "instructed input" with another code block as the ideal results. I feel like this is really specific to command line tools so I'm trying to find well designed docs sites on them. The issue I'm seeing is documentation for command line tools is typically --help... not some fancy schmancy website with code blocks 😆

@eric-schneider
Copy link
Contributor Author

@djsauble @polandll if you happen to know of any other docs sites that do a good job of showing expected command output, feel free to post them here.

@polandll
Copy link

polandll commented Feb 7, 2024

Really, in ANY command of any type, it is really helpful to users to see what they should expect. Not just for command line tools. It shorts the number of support messages/calls/whatever. I don't happen to have any results at my fingertips, frankly. I kind of like to think that this is a super-cool innovation that we did. 🤣

@eric-schneider eric-schneider changed the title Special treatment for code block "results" Better styling for collapsible block; add special treatment for collapsible "results" Mar 13, 2024
@eric-schneider eric-schneider changed the title Better styling for collapsible block; add special treatment for collapsible "results" Improve collapsible block styles; give special treatment for collapsible "results" Mar 13, 2024
@eric-schneider
Copy link
Contributor Author

I spoke with @KimberlyFields this morning, and she said that we should at least update the collapsible styles to align with the original spec.

However, we're not totally satisfied with the original design. We don't think they stand out enough and we're worried that users won't see them as something they can/should interact with.

Kim pointed out that Stripe docs use a button style for certain collapsible content. We need to consider that block titles are customizable by the writer and thus will have varying length (the button would have to scale well). However, a button style might work well for collapsible "Results".

2024-03-13_11-17-08 (1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants