-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[ui] When Action output is long enough, keep a user scroll-anchored to the bottom #19452
[ui] When Action output is long enough, keep a user scroll-anchored to the bottom #19452
Conversation
pre { | ||
background-color: transparent; | ||
color: unset; | ||
overflow-anchor: none; | ||
min-height: 100%; | ||
white-space: pre-wrap; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of this was making the scrollbars appear in the correct spot. An earlier attempt had me creating a scrollable area within the <pre>
block, but that was unnecessary. Instead, we move the colo(u)r rules to the parent <code>
element and have the <pre>
always min-height to the code block's height.
@@ -71,7 +71,12 @@ | |||
<code><pre>Error: {{this.instance.error}}</pre></code> | |||
{{/if}} | |||
{{#if this.instance.messages.length}} | |||
<code><pre>{{this.instance.messages}}</pre></code> | |||
<code tabindex="0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side-effect: now you can focus in the action output and do things like pgdn
etc.
Ember Test Audit comparison
|
9c04cc0
to
90966d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor check on Safari support for overflow-anchor
pre { | ||
background-color: transparent; | ||
color: unset; | ||
overflow-anchor: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this won't work in Safari; observed behaviour there is same as pre-PR (treats this like any other scrollable element, not "sticky")
Uses overflow-anchor (shoutout to https://css-tricks.com/books/greatest-css-tricks/pin-scrolling-to-bottom/) to keep long-running or tall Actions outputs in the UI scrolled to the bottom.
Importantly, if the user scrolls AWAY from the bottom, let's say to carefully read an earlier log or copy it, the anchoring behaviour ceases (until they scroll back to the bottom again)
Resolves #19437