Trends/Signals scans off the UI thread + Signals chart UX fixes#28
Merged
Conversation
Trends/Signals off-thread: - All five trend scans (discover fields, value-over-time, signal series, flips, correlate) ran synchronously on the Electron main process, blocking the event loop on large files so the panel appeared frozen. Move them into a worker thread. - New src/main/trendWorker.ts runs the trend engine in a worker_thread with its own fd, reading the same bytes via a byte-offset index handed over from the main process (zero-copy ArrayBuffer transfer). - New src/main/trendWorkerClient.ts (runTrendJob) builds the index snapshot and spawns the worker; FileHandler.getScanContext() exports the index as typed arrays. - src/main/timestampParse.ts: extract parseTimestampFast into a shared module so main and the worker parse identically. - Both the IPC handlers and the agent/MCP ApiContext methods now await the worker, keeping the main/UI loop responsive. Signals chart UX: - SI-suffix axis/label formatter (formatAxisNum) so big timestamps read as "57.3G" instead of "5.73e+10"; applied to x ticks, band min/max, overlay y-axis, and the hover readout. - Clearer x-axis: 5 ticks with tick marks + faint vertical gridlines, edge-aligned end labels. - Click pins a sample: a floating value box (x + every signal value with color swatches) stays after the mouse leaves; solid line = pinned, dashed = live hover. - Robust click-to-line: nearestViewerLine() searches outward across all signals so downsampled empty buckets still navigate to the log. Build green; 319 tests pass; compiled worker verified end-to-end on a fixture. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Trends/Signals run off the main thread
All five trend scans (discover fields, value-over-time, signal series, flips, correlate) ran synchronously on the Electron main process, blocking the event loop on big files → the panel looked frozen. Moved them into a worker thread (mirrors the existing MF4 worker fix).
src/main/trendWorker.ts— runs the trend engine in aworker_threadwith its own fd, reading the same bytes via a byte-offset index from the main process.src/main/trendWorkerClient.ts—runTrendJob()builds the index snapshot and transfers it zero-copy (ArrayBuffer transfer) to the worker.FileHandler.getScanContext()— exports the line-offset index as typed arrays.src/main/timestampParse.ts—parseTimestampFastextracted to a shared module so main and the worker parse identically.ApiContextmethods nowawaitthe worker → main/UI loop stays responsive.Signals chart UX fixes
formatAxisNumSI-suffix formatter → big timestamps read as57.3G, not5.73e+10(x ticks, band min/max, overlay y-axis, hover readout).nearestViewerLine()searches outward across all signals so downsampled empty buckets still navigate to the log.Build green; 319/319 tests pass; compiled worker verified end-to-end on a fixture.
.mcp.jsonintentionally excluded.🤖 Generated with Claude Code