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

[ui] When Action output is long enough, keep a user scroll-anchored to the bottom #19452

Conversation

philrenaud
Copy link
Contributor

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)

image

Resolves #19437

@philrenaud philrenaud requested review from jgwhite and lgfa29 December 12, 2023 19:13
@philrenaud philrenaud self-assigned this Dec 12, 2023
@philrenaud philrenaud linked an issue Dec 12, 2023 that may be closed by this pull request
Comment on lines +131 to +137
pre {
background-color: transparent;
color: unset;
overflow-anchor: none;
min-height: 100%;
white-space: pre-wrap;
}
Copy link
Contributor Author

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">
Copy link
Contributor Author

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.

Copy link

github-actions bot commented Dec 12, 2023

Ember Test Audit comparison

main 90966d3 change
passes 1540 1540 0
failures 0 0 0
flaky 0 0 0
duration 11m 04s 584ms 10m 53s 158ms -11s 426ms

@philrenaud philrenaud added the backport/1.7.x backport to 1.7.x release line label Dec 12, 2023
@philrenaud philrenaud force-pushed the 19437-ui-actions-should-keep-me-scrolled-to-the-bottom-in-the-web-ui branch from 9c04cc0 to 90966d3 Compare December 12, 2023 20:24
Copy link
Contributor

@lgfa29 lgfa29 left a 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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you have a chance to test on Safari, where overflow-anchor doesn't seem to be supported?
image

Copy link
Contributor Author

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")

@philrenaud philrenaud merged commit 49b4996 into main Dec 13, 2023
15 checks passed
@philrenaud philrenaud deleted the 19437-ui-actions-should-keep-me-scrolled-to-the-bottom-in-the-web-ui branch December 13, 2023 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.7.x backport to 1.7.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ui] Actions should keep me scrolled to the bottom in the web UI
2 participants