generated from lucas/rust-webserver-template
Make the log list the scroll container #43
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat/Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Tag/Good First Issue
Tag/Help Wanted
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/logview#43
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The log view currently scrolls the window.
assets/scss/main.scss:18-25states this as adeliberate decision — "Both bars stay visible while the log scrolls; the window remains the
scroller" — and implements it by pinning
.navbarand.view-barwithposition: sticky(
main.scss:21-25,:48-51). The list itself setsoverflow-x: auto(main.scss:81-85) so thatnowrap mode can scroll sideways.
That arrangement blocks the next step, and it carries a latent rendering bug.
It cannot host a sticky column header
Planned work (#39) adds a column header row, which is the prerequisite for the resize handles in
#41. Two things are required of it: it must sit inside the horizontal scroller, or it desyncs
from the columns as soon as nowrap mode scrolls sideways; and it must stay visible while the log
scrolls.
Both cannot hold today. Per the CSS overflow rules, when one axis is not
visiblethe othercomputes from
visibletoauto— sooverflow-x: automakes.log-lista scroll container onboth axes. A
position: stickyheader inside it therefore sticks relative to the list's ownscrollport rather than the viewport, and because the list's height equals its content height there
is no vertical scrolling inside it for the header to stick against. The header simply rides along
and scrolls off the top of the page.
The three requirements — header inside the scroller, header sticky, window as scroller — are
mutually unsatisfiable. Giving up window-as-scroller is the one that costs least: the sticky
positioning on the navbar and view-bar exists only to compensate for the window scrolling, so
removing it is a net simplification rather than a trade.
Row backgrounds do not span the scroll width
In nowrap mode each row is sized
width: max-content; min-width: 100%(main.scss:176-179), sorows are only as wide as their own content. Once the list is scrolled right, a row shorter than the
scroll width has no background under the scrolled-to region — the hover highlight stops at ragged
horizontal positions.
This is invisible enough to miss today, because hover affects one row at a time. It stops being
subtle the moment #42 adds alternating row backgrounds, where every row is painted and the ragged
edges become a visible staircase. Fixing it here keeps #42 from inheriting it.
Why now
This change alters existing behaviour and reverses a documented decision, but adds no feature
surface. Separating it from #39 keeps that issue to the layout and model work, and means the
scroller behaviour can be judged on its own.
Plan
1. Make
.log-listthe scroll containerIn
assets/scss/main.scss:.log-lista bounded height so it scrolls internally: the viewport height minus the chromeabove it. Use
dvhrather thanvh— mobile browser chrome resizes, and a wrong value hereproduces either a double scrollbar or a clipped final row.
overflow-x: auto; the computedoverflow-y: autothat previously had nothing to do nowbecomes the vertical scroller, which is the point of the change.
2. Unpin the chrome
Still in
main.scss:position: sticky/top/border-bottompositioning concerns from.navbar(
:21-25) and.view-bar(:48-51), keeping the hairline rules that bound the chrome visually.With a bounded-height list below them, both are simply in normal flow and stay put.
:36-45. Their stated justification is that no sticky layermay stop short of the viewport edge, because Firefox flashes any strip an opaque background does
not cover while it scrolls. With nothing sticky, that reason is gone; the edge-to-edge density
argument in the same comment still stands, so the rules likely remain but the comments must stop
citing a hazard that no longer applies.
z-indexon.view-barif nothing else needs it.Update the comment block at
:18-20: it currently documents "the window remains the scroller" asthe governing decision. It must state the new arrangement and why — the sticky header a column
header row needs cannot work inside a horizontally scrolling list while the window owns vertical
scrolling.
3. Fix nowrap row width
Move the
max-contentsizing from the row up to the list (main.scss:171-184), so the list is aswide as its widest row and rows fill it. Every row then paints across the full scroll width and
backgrounds no longer stop at ragged positions.
Re-examine the
padding-bottom: 0.75remat:172-174. It compensates for Firefox's overlayhorizontal scrollbar covering the newest row when the window scrolled the list; with the list
scrolling itself, verify whether it is still needed rather than carrying it over unexamined.
4. Scroll to the newest row against the new scroller
In
assets/js/view-all.js:4-8,window.scrollTo(0, document.body.scrollHeight)no longer targetsthe right element. Replace it with
scrollIntoViewon the last row rather than assigninglist.scrollTop = list.scrollHeight: the two are equivalent today, butscrollIntoViewforces thetarget to render and so stays correct if
content-visibilityis adopted later and makesscrollHeightan estimate.The
.is-readyopacity gate (main.scss:87-103) stays as is — it still hides the initial jump, andstill needs its
visibility: hiddencompanion so a pre-scroll list is neither hit-testable norfindable by find-in-page.
5. Verify
just test—tests/views.rsasserts rendered HTML only (.log-list.is-nowrap, cell text percolumn) and is unaffected by scroller geometry. No test changes are expected; if any assertion
moves, that is a signal something rendered differently and should be understood rather than
re-pinned.
just check— clippy and fmt.just lint— stylelint over the changed SCSS.wrap mode scrolls vertically with the chrome staying put; nowrap scrolls horizontally with the
hover highlight spanning the full width at any horizontal offset; the list opens scrolled to the
newest row with no visible jump; no double scrollbar and no clipped last row.
Out of scope
The column header itself, the grid layout and the cell model (#39); column state in the query (#40);
resize and fit (#41); zebra and severity colouring (#42).
content-visibility, a tail DOM cap, andthe narrow-viewport reflow are deferred entirely.
Noted, not fixed here
docs/STATUS.mdis stale: it states thatsrc/views/,templates/views/andtemplates/partials/log_row.htmldo not exist and that there is no VictoriaLogs integration, whileall of them are present. Pre-existing drift, unrelated to this change, and worth correcting
separately rather than silently inside it.