Repository navigation
fix(chart): let the render path rest when idle - #105
Merged
Merged
Conversation
The chart's redraw ran through Sample(33 ms), a periodic timer that woke the UI thread every 33 ms for the chart's whole life, idle or not. The render thread read a view field the UI thread wrote, the column buffer shifted 100 000 columns on every append past its cap, and a sidebar box and the chart each wrote a pen's visibility, kept apart by a guard flag. A redraw request now schedules one emission 33 ms ahead; requests inside that span join it, nothing is scheduled while no view subscribes, and Dispose cancels a pending one. The schedule lives in ChartRedrawSchedule. RenderFinished posts every frame's width to the view model the frame was drawn for, on the UI thread, and SetTargetColumnCount drops a repeat. The buffer trims one tenth of its cap at once. TrendPenState.IsVisible has one writer, SetPenVisibility: its setter is private, the row box reads it one way and writes through its command, and the group switch takes the same route. The sidebar row binds the pen's name, colour and unit through the pen state, so a revised pen shows at once. Two tests that raced the code under load now wait for the event they assert on: the history cancellation test for the read to start, and the settings restart tests for the button to be enabled. Claude-Session: https://claude.ai/code/session_01PfZJa7neMMKPzycFR6iuhD
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
Group F of
docs/plans/20260929-window-per-process.md(Tasks 11-14):Sample(33 ms), a periodic timer that woke the UI thread every 33 ms for the chart's whole life, idle or not;RenderFinishedread a view field on the render thread that the UI thread wrote;_isSettingVisibilityFromChart.What changed
ChartRedrawSchedule: one emission 33 ms ahead, later requests join it, nothing scheduled while no view subscribes,Disposecancels a pending one.TrendChartView.ReportDataAreaWidthTo(TrendChartViewModel): each frame's width goes to the view model it was drawn for, on the UI thread;SetTargetColumnCountdrops a repeat.EnvelopeLinetrimsMaxColumns / 10at once.TrendPenState.IsVisiblehas a private setter and one writer,SetPenVisibility. The row box binds itOneWayand writes throughToggleVisibilityCommand; the group switch takes the same route. The row binds name, colour and unit throughPenState.Pen, so a revised pen shows without a rebuild.ChartHistoryRequestCancellationTests(AwaitStart), and the settings restart tests inStartupFailureWindowTests,MainWindowViewTests,SettingsViewTests(the button'sIsEffectivelyEnabled).CLAUDE.md,charting.md,trend-interaction.md,bench.md,testing-strategy.md,trend-feature-spec.mdfollow the code.Verification
dotnet build SemiPlot.slnx: 0 warnings. Unit 1591/1591, integration 138/138.AppendingPastTheCapTrimsOneChunkandAnIdleChartSchedulesNoRedrawpass. The plan's "Verify it yourself" lists every new test.Per-task commits before collapse
https://claude.ai/code/session_01PfZJa7neMMKPzycFR6iuhD