Repository navigation
feat(logs): inspect entries inline while following live updates - #2136
Merged
Merged
Conversation
|
|
dawsontoth
approved these changes
Nov 20, 2026
This branch was successfully deployed
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.
⊙ Problem
Inspecting a Studio log opens a modal that hides neighboring events. The filter panel also consumes space needed to scan messages.
💡 Solution
Dark desktop sample-data capture at the timestamp-layout revision. Final refinements add timestamp spacing, bottom padding and directional neighboring-row reveal.
⚖️ Alternatives
🤔 Accept retained-context rendering cost at the maximum limit?
The table remains unvirtualized. Reduce shifted-poll and retained-view work after stable log-row IDs tracks the remaining optimization. At 1,000 current plus 1,000 retained rows, warm sampled stream batches used 71–72ms React work and 112–115ms long tasks in development Chromium. This keeps dynamic inline expansion within the existing table. Virtualization remains a possible redesign if production evidence warrants it.
🔧 Changes
Product and architecture tour
Product and architecture tour
Reading and navigation
index.tsxcoordinates filters, errors, deep-link selection, expansions and live controls.LogsDataTable.tsxrenders inline details, preserves independent expansions, navigates visible rows with arrow keys and reveals expanded content with a neighboring row in the movement direction. Long messages adapt their inner scroll height to leave that context visible. ↑/↓ navigates logs while the message has focus; PageUp/Down and the wheel scroll its content.LogDetails.tsxrenders metadata and the original message without JSON number conversion.LogTimestamp.tsxshows local dates with milliseconds, a minute-updating relative age and UTC hover text. The wrapping message area scrolls within a viewport-aware cap of at most 32rem. RemovesViewLogModal.tsxand its unusedlogEditorLanguage.tshelper and itslogEditorLanguage.test.tstests.badgeLogLevel.tsxandbadgeNode.tsx; levels use colored text.table.tsxadds optional container focus, custom header content and text-based auto-fit measurement.localStorageKeys.tsadds saved column sizing/visibility.Live intake and filters
useLogViewport.tsseparates intake from viewport following. While reading, it retains the initial batch, current batch and individually expanded/anchored entries. Incoming batches preserve the visible row’s offset; jumping releases the held batch. Query/facet/order changes reset following.mergeReadLogs.tsreconciles snapshot/tail duplicate counts and tags using compact exact identities with weak ownership.useInstanceLogs.tsretains SSE with polling fallback, exposes fetch errors, applies relative cutoffs and disables automatic refresh for fixed linked context.logView.tsvalidates targets and constructs relative/context filters;routes.tsvalidates log search parameters.LogsFiltersForm.tsxsupports a collapsible sidebar, validates date order and delegates canonical UTC handling.logFiltersFormSchema.tsadds relative presets and preserves valid generated dates under clock skew.getReadLog.tskeeps unbounded tail reads for relative polling and disables focus/reconnect refetches; Live uses the SSE/polling loop. Bookmark targets use bounded context reads: at most eight pages before the target and one request after it. Dense windows fail with a Filters recovery message rather than silently presenting a distant prefix.MAP.mdindexes the implementation; rootDESIGN.mdlinks it.🤔 Keep reading context beyond the selected window?
Yes. The initial reading batch and expanded/anchored entries survive incoming time/limit eviction until Jump. Intermediate batches can rotate out; the UI labels retained context and possible missing intervening logs. Download exports the loaded visible rows, including retained context. Refresh fetches current data while preserving the reading position.
🤔 Re-review the final UI edits?
Post-review changes (93 lines in 6 files) were not re-reviewed: viewport-aware neighboring-row reveal, wheel offset fixes, requested bottom padding and timestamp spacing. These tested, reversible edits stay in previously reviewed functions. Six full model passes are complete. A one-line test fixture correction makes partial DST-bound edits valid on UTC and New York runners; it reproduced the CI failure before the correction, then passed all 29 interactions in both timezones.
✅ Verification
pnpm test(760 files, 9,332 passed), lint, staged format, TypeScript and production build passed locally. End-to-end route: Chromium against the local app with intercepted sample APIs.Changed regression coverage
LogTimestamp.test.tsx: local timestamp precision, relative-age refresh, future values and invalid-input cleanup.test/logLinks.ts: generates bookmark fixtures outside the production API.e2e/tests/logs.anon.spec.ts: actual browser scrolling/focus, live arrivals, buffer rotation, navigation, links, sizing and viewport/theme cases.Logs.test.tsx: filter/expansion interactions, independent keyboard expansions, focus/native-control boundaries, date handling and live controls.LogsFiltersForm.test.tsx: preserves millisecond precision in native date controls.mergeReadLogs.test.ts: duplicate occurrences, tags and snapshot/tail overlap.useInstanceLogs.test.tsx: duplicate occurrences, polling, malformed timestamps, unchanged-result identity and moving relative cutoffs.useLogViewport.test.tsx: bounded retention, expanded eviction, query/facet reset and loading gestures.logView.test.ts: presets, target validation, exact raw values and context bounds.getReadLog.test.ts: query bodies, bounded context pagination, cancellation and scan-budget failure.logFiltersFormSchema.test.ts: unchanged generated future bounds and validation of edited dates.Performance: Merge/filter work scales with loaded rows; unchanged polls preserve array identity and produced zero table mutations in the sampled run. Reading retains two bounded batches plus individually protected records. Default limit is 100; UI maximum is 1,000. Payload sizes remain uncapped. Explicit bookmark context adds bounded file scans and cluster fanout outside tail polling.
Local performance measurements
Full explorer in development Chromium, 1440×1000, 5KB messages, no CPU isolation. Fake HTTP parses prepared JSON inside the timed request; fixture preparation is excluded. Streaming invokes the real intake/reducer and 250ms flush through a transport shim.
At 2,001 rendered rows (1,000 incoming, 1,000 held, one expanded detail), ten-entry stream batches after cell memoization measured 71–72ms warm React work and 112–115ms long tasks; first batch was 136ms / 180ms. Stream wall timing includes an intentional 270ms delivery wait and two animation frames. Heap deltas varied with garbage collection; retained heap and row-model rebuild counts were not measured. The 10,000-row stress case is above the UI limit and takes over a second per stream batch.
🤖 Generated by DAIvid / OpenAI Codex; posted via @DavidCockerill.
Related PRs: none found
Complexity: complicated
Deferred findings
00430c4fd5ef5adaminor performance —src/features/instance/log/hooks/useInstanceLogs.ts— Residual changed-batch rendering and default-path work — filed Reduce shifted-poll and retained-view work after stable log-row IDs #2134ba93a279c098c88bnone maintainability —src/features/instance/log/routes.ts— Bookmark route has no production link generator — filed Document the inbound log bookmark URL contract and intended callers #2135Accepted behavior
Behavior the owner ruled intended, so there is nothing to file.
1 minor or nit
59651559550517dcminor correctness —src/features/instance/log/hooks/useLogViewport.ts— Held history survives Refresh and relative cutoff — accepted: David requested continuous logs without moving what he is reading, in this session; retain reading context until Jump rather than evict or jump on Refresh. Incoming time/limit still bound new data; visible download includes held context. ThReady-For-Promotion: a35a572 urgency=normal late=none
Review-Coverage: authored=codex; ran=claude,gemini; adjudicated=domain; declined=cursor-grok,cursor-composer,muse; rounds=7; full=6 @ a35a572
Review-Attention: study ~20m (critical: logFiltersFormSchema.ts, localStorageKeys.ts; decisions: do-less-alternative, requirement-shift, retained-context, message-keyboard, perf-cost) @ a35a572