Skip to content

Stop auto-scrolling task logs while the user is selecting text - #70594

Open
Andrushika wants to merge 3 commits into
apache:mainfrom
Andrushika:fix-log-viewer-autoscroll-selection
Open

Stop auto-scrolling task logs while the user is selecting text#70594
Andrushika wants to merge 3 commits into
apache:mainfrom
Andrushika:fix-log-viewer-autoscroll-selection

Conversation

@Andrushika

Copy link
Copy Markdown
Contributor

UI: Stop auto-scrolling task logs while the user is selecting text

When a task is still running, the task log view scrolls to the bottom every time new lines arrive. If the user is reading or selecting text near the bottom, the jump interrupts them.
This PR skips the auto-scroll while a pointer drag is in progress, and restores it once the drag ends.

Before:

2026-07-28.7.38.24.mov

After:

2026-07-28.7.42.15.mov
Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code Opus 4.8 following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Jul 28, 2026

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR, good idea.

Instead of stopping the auto scroll when a pointer is up / down / selecting.

We should instead stop / resume the auto scroll feature depending on if the users is at the bottom (very end of the scroll) or not.

If someone scrolled up a little bit to see something, the auto scroll should also stop.

Even after text selection, if someone scroll back down to the very end of logs, auto scroll should resume.

@pierrejeambrun pierrejeambrun changed the title UI: Stop auto-scrolling task logs while the user is selecting text Stop auto-scrolling task logs while the user is selecting text Jul 28, 2026
@pierrejeambrun pierrejeambrun added the backport-to-v3-3-test Backport to v3-3-test label Jul 28, 2026
@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.1 milestone Jul 28, 2026
When a task is running, the log view follows new lines by auto-scrolling to
the bottom. It kept following even when the user had scrolled up a little to
read something, because "at the bottom" allowed a 100px gap. Lower the gap so
scrolling up stops the follow, and returning to the end resumes it.
@Andrushika

Copy link
Copy Markdown
Contributor Author

Hi @pierrejeambrun, thanks for reviewing!

Your idea sounds great. There’s just one edge case I’d like to confirm: what if the user is already at the bottom of the log but is selecting some log text?

IIUC, the expected behavior would be to keep auto-scrolling even while the user is selecting text. But would it be better to pause auto-scrolling in this case?

While a task streams logs, the view follows new lines by scrolling to the
bottom. If the user is selecting text at the bottom, the scroll moves the
text out from under the cursor and clears the selection. Skip the follow
while a non-empty selection sits inside the log; clearing it resumes.
@Andrushika
Andrushika force-pushed the fix-log-viewer-autoscroll-selection branch from 6c9a22e to 744056e Compare July 28, 2026 14:30
@Andrushika

Andrushika commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

IIUC, the expected behavior would be to keep auto-scrolling even while the user is selecting text. But would it be better to pause auto-scrolling in this case?

I assume this is correct and have updated it into this pattern. Happy to fix if it does not meet the expectation!

After:

2026-07-28.10.28.28.mov

@Andrushika
Andrushika marked this pull request as draft July 28, 2026 14:59
@Andrushika
Andrushika marked this pull request as ready for review July 28, 2026 14:59
@Andrushika

Copy link
Copy Markdown
Contributor Author

The only failed CI is unrelated to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-3-test Backport to v3-3-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants