Repository navigation
feat(settings): show the server log in This instance / Logs - #36
Merged
Merged
Conversation
A new admin section between Storage and Updates reads GET /api/logs, drawn from a recorte mockup the same day. - Lines: local HH:MM:SS, level as a short label (only ERROR and WARN get colour), message in ink, fields as key=value, stack behind Show details. Mono 12px, wrapping inside the message column, day separators when the date turns. - All / Warnings / Errors live in the URL (?level=) and are cumulative. Filtering to nothing offers Show all. - Copy takes the lines on screen as readable text and says Copied in place; Download is an <a href download> to the JSON Lines file. - Follows new lines only while scrolled to the end; otherwise a glass 'N new lines' piece jumps back. Load older prepends and keeps the reading position anchored to the end. - SettingsShell gets `fill`, so the viewer takes the height that is left and only it scrolls. Other sections do not pass it. - domain/log-view.ts holds the pure rules, with specs; the section has a component spec cut at services/.
Load older prepends lines, and a row key that shifts with that remounts the whole list, closing any open stack. Two keys got it wrong, both caught only in the running app: - the list index as tiebreaker: every row's index shifts when lines enter before it; - time + level + message with the occurrence as tiebreaker: a burst has hundreds of "Request completed" in one millisecond, and older ones entering first shift the count of the rest. The key now includes the fields, which is where burst lines differ (reqId, req.path); the occurrence only separates lines identical field by field. rowKeys moved to domain/log-view.ts with a spec for the burst case (it fails without the fields, checked), and the component spec expects an open stack to survive Load older. Verified in the browser against the new build: the anchor row node survives Load older. An earlier check that looked like a failure was the page still running the cached previous bundle.
Logs joins the section list, and a new section records the URL filter, SettingsShell fill, follow-at-end, the single layout effect, row keys with fields, the clipboard secure-context gap and checking which build is on screen.
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.
Contraparte: Digit4w/watchpile-server#25 — mergear aquele primeiro.
The admin can now read what the server has been doing and hand it to whoever is helping: a new
THIS INSTANCE / Logssection between Storage and Updates, drawn from a recorte mockup and checked in the running app.All · Warnings · Errorsin the URL, cumulative. Copy takes the visible lines as text; Download takes every file as JSON Lines.SettingsShellgetsfillso only the viewer scrolls.Needs the server PR first — the section calls
/api/logs.Known gap: Copy uses
navigator.clipboard, which only exists in a secure context. Onhttp://hermes.local(plain HTTP on the LAN) it falls into "Couldn't copy"; Download works everywhere. Registered in the handoff as a decision to make.🤖 Generated with Claude Code