log panes: lines wrap under their start instead of scrolling sideways
The owner, 2026-10-16, a phone screenshot of a message's Delivery log:
"На телефоне при просмотре лога, появляются две полосы. Мы это можем
поправить?" - the horizontal scroll bars Chrome on Android drew over a
pre whose mail.log lines were wider than it. As the mockup of 216f366:
sp-log wraps (pre-wrap, overflow-wrap: anywhere) and no longer scrolls;
log_pane writes each line as a block, sp-ll, with a 4ch hanging indent and
its newline inside it, so copied text keeps one line per line. One
partial: the Delivery log of a message, System log, the outbound queue's
listing.
Tests: TestLogPaneIsAPreWithEscapedLines reads the new shape; the page
tests' substrings stand; TestPanelCSSIsTheMockupStylesheet holds panel.css
to the mockup. go vet + go test (26 packages) and make e2e on the test
server for this tree. CHANGELOG [Unreleased] § Fixed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -190,8 +190,8 @@
|
||||
{{/* log_pane is a dark block of log lines (input: []LogLine). The time is
|
||||
dimmed, a warning amber, an error red. The newline between lines is part of
|
||||
the text: the pane is a pre. */}}
|
||||
{{define "log_pane"}}<pre class="sp-log">{{range $i, $l := .}}{{if $i}}
|
||||
{{end}}{{if $l.Time}}<span class="sp-d">{{$l.Time}}</span> {{end}}{{if eq $l.Level "warn"}}<span class="sp-w">{{$l.Text}}</span>{{else if eq $l.Level "error"}}<span class="sp-e">{{$l.Text}}</span>{{else}}{{$l.Text}}{{end}}{{end}}</pre>{{end}}
|
||||
{{define "log_pane"}}<pre class="sp-log">{{range .}}<span class="sp-ll">{{if .Time}}<span class="sp-d">{{.Time}}</span> {{end}}{{if eq .Level "warn"}}<span class="sp-w">{{.Text}}</span>{{else if eq .Level "error"}}<span class="sp-e">{{.Text}}</span>{{else}}{{.Text}}{{end}}
|
||||
</span>{{end}}</pre>{{end}}
|
||||
|
||||
{{/* empty_state says what is absent and why that is fine (input: EmptyState). */}}
|
||||
{{define "empty_state"}}<div class="sp-empty"><i class="ti {{.Icon}}"></i>{{template "inline" .Text}}</div>{{end}}
|
||||
|
||||
Reference in New Issue
Block a user