feat(ui): stick-to-bottom autoscroll on the run page#98
Merged
Conversation
469c6b4 to
6476b2c
Compare
Follow the live log tail while the user is at the bottom; stop on scroll-up or wheel-up; resume at the bottom. Built on @vueuse/core useScroll (no manual threshold), targeting document.scrollingElement so it works standalone and inside data-fair's d-frame iframe. While following, only the latest step panel stays open; otherwise the user's panel selection is left untouched.
6476b2c to
91098c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add stick-to-bottom autoscroll to the run page log view: while the user is at the
bottom of a running run, the view follows new log lines as they stream in; any
upward scroll (or wheel-up) stops following, and scrolling back to the bottom
resumes it.
What changed
ui/src/composables/use-follow-bottom.ts—useFollowBottom(logCount, isActive)pins the document to the bottom on each new log while following and the run is
still streaming. Uses VueUse
useScroll(1px bottom tolerance, no manualthreshold) plus a
wheellistener to catch wheel-up when the page itself can'tscroll.
runs/[runId].vue: replaces the one-way:model-value="[steps.length - 1]"expansion-panel binding with a
v-model="openPanels"recomputed by a watch onthe step count (latest panel only while following, otherwise the user's
selection minus removed steps), so panels no longer slam shut on every streamed
log and manual toggles persist.
Why: the run log view didn't follow the live tail, and the previous panel
binding recomputed on every log line, collapsing panels mid-read.
Regression risks:
on every render; now state is recomputed only when the step count changes.
While following, non-latest panels collapse on each new step; when not
following, user toggles persist. Confirm this is the intended UX.
data-iframe-height(auto-height d-frame embed).pinToBottomsets the inner
windowscroll position, which is a no-op when the parentframe scrolls — so tail-following may not visually work inside an auto-height
embed (the wheel-up "stop following" still works). Confirm whether the run page
is embedded in that mode and whether following is expected to work there.
followinginitializes totrueeven for completed runs; benign becausepinning is gated by
isActive()and the initial panel state (last open)matches prior behavior.