Repository navigation
feat(text): follow log files and search text pages - #899
Merged
Merged
Conversation
LogTail.snapshot keeps the last whole lines of a bounded read from a log's end: it starts one byte before the window, keeps a line longer than the window as its clipped end, holds back an unfinished UTF-8 character and refuses NUL or invalid UTF-8. HtmlOverlay carries the log request and its live state, written by host-free store setters: a follow change emits tree.changed, a tick report does not.
session.overlay.open takes tail and followFile with a text file: a tail alone shows the file's last N lines, follow-file follows its end with TextPage.defaultTail lines unless a tail is given. Either without --text, with --line or a tail outside 1...maxTail is refused before any source dispatch. session.overlay.follow on|off|toggle [--pane] sets whether a log page follows and answers following or paused. The tree reads back tail, following, lines, clipped, waiting and unreadable on htmlOverlays[].text, omitted on a plain text page. The CLI gets --tail, --follow-file and overlay follow.
BoundedFile.readTail reads the last bytes of a file of any size plus the byte before them, and returns nothing after one fstat when the file still has the stamp it was given. LogFollower checks the file by path once a second while its page follows and is shown, so a rotated, truncated or recreated log is picked up by the next check; it caches the snapshot and the paused scroll offset, builds the document from a fresh read on open and explicit reload and from the cache on a theme change, holds ticks until a rebuilt renderer reports ready, and reports to the store. A failed first read shows an empty waiting page that the next good read fills. text.js draws a sticky follow bar with no gutter, pauses on a scroll the user starts and resumes at the bottom or on Resume, and drops highlighting past the highlight cap on every update. A log page the presenting Mac would be handed is refused rather than shown without its state.
A plain click on a .log or .out file opens the log page with the last TextPage.defaultTail lines and follow on, checked from the file's end so a log of any size opens. A path:line click keeps the static page at that line, and a session the presenting Mac shows keeps the static page it is handed today.
Open.validate and overlayContent each crossed the cyclomatic complexity limit with the tail and follow-file checks; those checks now sit in Open.validateLog and textOnlyRefusal, in the same order and with the same errors.
The user guide covers a clicked .log or .out file opening as a following log page; the command reference documents --tail, --follow-file, session overlay follow and the new read-back; the bundled skill gets a trigger, a section and reference entries; the control-api rules record the log page's model, follower and remote refusal.
- check NUL bytes after the line cap, and drop the NUL hole copytruncate leaves ahead of new text - keep the file stamp for a binary end so an unchanged file is not read again - a pause from control drops an earlier scroll offset - a horizontal scroll never changes following
A key or gesture does one thing for what the user sees and never reaches a layer behind it; existing behavior next to a change that breaks this is fixed with it; a control that exists elsewhere in the app is reused or matched, and its rendered look is shown before tests are written.
… top Every text page gets a find box in its bar that matches the terminal's: case-insensitive matching over the whole text, highlights through the CSS Custom Highlight API with a 5,000-range window, a fixed counter, and page keys (/, n, N, F, G, g, Home, End). A step pauses a following log; a log update keeps the current match on its line using the snapshot's start offset. session.overlay.search sets, steps or closes it, reads back as htmlOverlays[].text.search, and is refused for other occupants and slots shown on a presenting Mac. TextPageBridge owns the page side of every local text page, with LogFollower inside it for a log page. Cmd-F now belongs to whatever is on top: a visible page or overlay over the focused pane, or the quick terminal, never the terminal behind it. The terminal find bar takes the same counter slot and field width.
The user guide covers the find box, its keys and Cmd-F going to what is on top, and drops the removed line count; the command reference documents session overlay search and its read-back; the bundled skill gets a trigger, a section and a reference entry; the control-api rules record the search model and the bridge that owns every local text page.
…k the requested tail - the page tracks queries its field sent and not yet echoed, so a control query arriving between a keystroke and its echo ends with field, model and counts on the same query; reports carry their query and a mismatch is dropped - CRLF and lone CR are line breaks on both sides: pushed text is normalized like the first document, and the follower's dropped, cut and full-eviction counts use the same rule, so a highlighted CRLF log keeps searching - opening a log page validates the tail it will show, not the default one - the docs name the real refusals: no overlay, not an html page, no text page, remote page
Deploying agterm with
|
| Latest commit: |
b7884db
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ebdd28c8.agterm.pages.dev |
| Branch Preview URL: | https://log-follow-page.agterm.pages.dev |
A sticky bar as wide as body scrolled away when a wide page scrolled sideways, and its 100vw width ran the find box under a scroll bar that takes layout width. The bar is fixed to both edges, with body padding keeping the page below it.
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.
A plain click on a
.logor.outpath now opens the themed text page in follow mode: up to the last 5,000 lines within a 2 MB read, following the file's end as it grows. Apath:lineclick stays the static page, and so does a clicked log on a session another Mac presents. Every text page also gets a find box like the terminal's, with keys for everything.Ftoggles follow,Gor End goes to the bottom,gor Home to the topTerminalSearchBar: case-insensitive, matches across highlight spans,N of Min a fixed slot, chevrons, and an X that clears./or Cmd-F focuses it,n/Nor Return/Shift-Return step and wrap, Esc clears. Search covers the shown text, counts and steps through every match, and paints a window of up to 5,000 of them where WebKit has CSS Custom Highlights. A step pauses a following log; a log update keeps the current match on its linesession overlay open --text FILE --tail N/--follow-file,session overlay follow on|off|toggleandsession overlay search TEXT | --next | --prev | --close, read back onhtmlOverlays[].text(tail,following,lines,clipped,waiting,unreadable,search). A log page and a search are refused on a slot shown on another Mac, whose page cannot carry that stateCLAUDE.mdgets the UI consistency norm: one key does one thing for what the user sees, existing behavior next to a change that breaks that is fixed with it, and an existing control is reused or matched