Open
Conversation
b4cb6cc to
a37b1ac
Compare
781bd7a to
8c6204a
Compare
4e7be71 to
973e57a
Compare
After running a speed test, results are now displayed in a lightweight Canvas-based chart (4.5KB JS) instead of raw JSON. The webview shows throughput over time with hover tooltips, a summary header, and a "View JSON" button for the raw data. - Add `packages/speedtest/` webview (vanilla TS, no framework) - Extract `createBaseWebviewConfig` from the React-specific variant so lightweight webviews can reuse the shared Vite config - Add typed IPC via `SpeedtestApi` in `@repo/shared` - Accept duration as seconds, show real-time progress bar - Expose `extensionUri` through `ServiceContainer`
- Time-proportional x-axis with dashed leader line from t=0 - Uniform tick labels with smart unit selection (s/m/h) that scale from seconds to hours - Dynamic y-axis padding based on measured label width - Binary search hit-test with crosshair-snap for dense data - ResizeObserver debounced via requestAnimationFrame - Tooltip clamped to container bounds - General cleanup: named constants, single-pass data prep, responsive layout, safer error handling, input validation, missing dependency
- Plumb workspaceName from the command through to the panel title and the in-chart heading; drop the generic "Speed Test Results" label. - Read chart accent from the theme's button color so it tracks the active theme instead of being stuck on blue. - Re-send data on active-theme change so canvas pixels repaint against the new theme (DOM CSS vars update live, canvas doesn't). - Restructure chart.ts into readTheme/layoutChart/drawAxes/drawSeries, export niceStep/formatTick for testing. - Rename the panel viewType to coder.speedtestPanel to match the tasks/chat conventions. - Clean up the duration prompt and tests.
973e57a to
83a1ca1
Compare
Validate CLI output with Zod on the extension side so the webview trusts typed data and stops hand-parsing JSON. Share SpeedtestResult types via @repo/shared and flatten the message payload. Webview cleanup: newspaper-ordered index.ts with a main() entrypoint, em-scaled chart layout, named constants in place of magic numbers, empty samples handled with a message, and a subscribeNotification helper that useIpc now delegates to. Pure helpers (niceStep, formatTick, findNearest*, toChartSamples) live in chartUtils.ts for easy unit testing. Panel: extract webview panel logic into SpeedtestPanelFactory, a ServiceContainer-owned class that takes extensionUri + logger in its constructor and exposes show(payload). Surfaces webview handler errors through the logger and tracks every subscription in a disposables array. Drops the now-unused isGoDuration helper. Tests: cover SpeedtestPanelFactory end-to-end with a reusable createMockWebviewPanel harness in testHelpers, plus chartUtils and renderLineChart unit tests. Canvas 2D is stubbed globally in test/webview/setup.ts so chart tests don't need per-test plumbing. Protocol: buildApiHook and useIpc now take RequestDef, CommandDef, and NotificationDef directly in both overloads, no casts needed. Platform: move toError into shared with a serialize hook so the extension keeps util.inspect output, rename createBaseWebviewConfig to createWebviewConfig, add createReactWebviewConfig, extract reportElapsedProgress for reuse by other long running commands, and drop the createWebviewConfig eslint ignore.
83a1ca1 to
1ce0401
Compare
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.
Renders speed test results in a Canvas line chart with throughput over time, a summary header, hover tooltips, and a View JSON action. Duration input drives a real-time progress bar while the CLI runs.
Extension
SpeedtestResult/SpeedtestData/SpeedtestIntervalin@repo/sharedSpeedtestPanelFactoryowned byServiceContainerencapsulates panel creation, message handling, and error surfacing via the loggerreportElapsedProgressextracted intoprogress.tsfor reuse by other long-running commandsWebview
chart.tsdoes canvas drawing; pure helpers (niceStep,formatTick,findNearest*,toChartSamples) live inchartUtils.tsfor direct unit testingsubscribeNotificationhelper in@repo/webview-shared;useIpcdelegates to itProtocol
buildApiHookanduseIpctakeRequestDef/CommandDef/NotificationDefdirectly in both overloads, no castsShared
toErrormoved into@repo/sharedwith a serialize hook so the extension keepsutil.inspectformattingcreateBaseWebviewConfigsplit intocreateWebviewConfigandcreateReactWebviewConfigCloses #888