Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Crop long definition docs #237

Merged
merged 2 commits into from
Oct 5, 2021
Merged

Crop long definition docs #237

merged 2 commits into from
Oct 5, 2021

Conversation

hojberg
Copy link
Member

@hojberg hojberg commented Oct 5, 2021

Overview

When definition docs are very long (and the definition isn't a doc itself), crop the doc and provide an affordance to show the full doc.

Closes #187

Screen Shot 2021-10-05 at 15 45 54

Implementation notes

To determine if the doc is very long, render it in an overflow: hidden
container and query the dom to see if that container has content that is
cropped.

@hojberg hojberg requested review from pchiusano and aryairani October 5, 2021 19:53
When definition docs are very long (and the term isn't a doc itself),
crop the doc and provide an affordance to show the full doc.

To determine if the doc is very long, render it in an `overflow: hidden`
container and query the dom to see if that container has content that is
cropped.
@pchiusano
Copy link
Member

Somehow I'm not loving the visual treatment. The button part looks good, but the line and gradient doesn't quite give me a sense of "this continues on".

I think this treatment is better, from Slack's snippet preview. On hover it has a "click to expand".

image

Copy link
Member

@pchiusano pchiusano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving but I think the visual treatment could use more work.

@hojberg
Copy link
Member Author

hojberg commented Oct 5, 2021

@pchiusano my example isn't great, but there is an overlapping gradient like in slacks example, the way this example is cut doesn't show that. It would be like if slack cut at line 4.

I don't like the "hover to show button bit that much, but I can probably extend the gradient to make it more obvious though.

@pchiusano
Copy link
Member

Yeah, I dunno about the hover either. One note - in the Slack treatment, the gradient is white, giving me an impression that the content of the snippet is fading away toward the bottom.

@hojberg
Copy link
Member Author

hojberg commented Oct 5, 2021

@pchiusano how's this?
Screen Shot 2021-10-05 at 16 31 58

@hojberg hojberg merged commit 16d9a8d into main Oct 5, 2021
@hojberg hojberg deleted the crop-docs branch October 5, 2021 21:11
@pchiusano
Copy link
Member

Amazing! This is much better.

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

Successfully merging this pull request may close these issues.

have a way to collapse associated docs, or only partially reveal longer associated docs when a definition is opened?
2 participants