generated from lucas/rust-webserver-template
Log rows: CSS grid layout, generic cell model, column header #39
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#39
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?
Part of the dynamic-columns work. Depends on the log-list scroller change (the list becoming the scroll container in both axes, plus the nowrap row-width fix), which is planned separately and must land first — the column header cannot be sticky until then.
Why
LogRowis a fixed five-field struct (src/views/mod.rs) andtemplates/partials/log_row.htmlis five hardcoded spans in a flex row with four fixed-width classes. Hiding, reordering or resizing a column is not expressible against that shape: the geometry lives in four separate SCSS rules rather than in one list, and the cells are addressed by name rather than iterated.This issue establishes the structure. It adds no user-visible feature beyond the header row; the same five columns render at the same widths.
Scope
Layout. Each row becomes
display: gridwithgrid-template-columns: var(--log-cols), the variable set once on the list. The column header consumes the same variable, so header/body alignment is structural rather than two sets of widths kept in sync.The message column is not part of
--log-cols. It is implicit and always last, so the two wrap modes are two static rules:A floor on the message track is required, not optional: a
minmax(0, 1fr)track that resolves to zero width does not clippre-wraptext, it wraps one character per line and makes every row hundreds of lines tall.Units. Widths are expressed in
chas text capacity, with padding added in CSS. The log is monospace, so a character count computed in Rust is directly commensurable with a CSS track width — this is what later lets the server computefitexactly. Note this inverts the current border-box convention documented inassets/scss/main.scss.Model.
LogRowbecomes an ordered sequence of cells. A column is declared per view with its source (entry field / stream label / flattened field), its formatter, its fallback, its default width and a declared maximum. The closed set stays as it is today; the representation should be chosen so an arbitrary-field passthrough column can be added later without reshaping it.A cell is an enum rather than a string, distinguishing:
app,node,levelwhen present)time)levelfalling back toinfo, whichsrc/views/mod.rsdocuments as a substantive claim rather than a placeholder)Cells carry a stable name so the partial can compose
log-{name}class names. Template-side logic is fine — the constraint recorded insrc/views/mod.rsis really no client-side render logic, so that the buffered and SSE paths produce identical markup; the comment should be corrected to say so.Header. A column header row with per-column cells, inside the scroll container so it stays aligned under horizontal scroll. Needs explicit ARIA roles (
row,columnheader) — a<table>would have given column association for free and divs do not.Remove
title.log_row.htmlemitstitleunconditionally onnodeandapp, so it fires on every cell including ones that fit and including the em-dash placeholder. Column resize (separate issue) supersedes it, and row detail expansion will later supersede it again.titleis weak for accessibility regardless.Acceptance
allview renders identically to today apart from the new header row.tests/views.rspasses unchanged — it selects.log-time,.log-node,.log-app,.log-level,.log-msgand asserts the em-dash fallback, theleveldefault and the time format. Those assertions surviving is the signal that the generic model preserved behaviour.Out of scope
URL-driven column state, resize,
fit, zebra and severity colouring, the narrow-viewport reflow, row detail expansion, passthrough columns.Note on verification
The model half is covered by the existing harness. The layout half is not observable to
axum_test+scraperat all, and there is no browser in CI. Prefer designing hazards out (the message floor, explicit parity) over relying on review to catch them.