refactor(tui): one render path for text and image plots #328
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 384 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #328"
general
weight: 0.35
henryiii
:robot: _AI text below_ :robot:
Items 19, 9, part of 12, and
App._exitfrom 23 of the review issue.PlotextandMPLPlotsubclass one frozenPlotItemdataclass with the shared fields andwith_*methods. The caches havecompare=Falseand copies share them. The item compares by value, so "already rendered" isitem == self._renderedand the key tuples are gone. The size goes into a copy of the item (dataclasses.replace), which the handler puts inview_widget.itemwithout the watcher.RequestRendermessage, oneon_request_renderhandler, one threaded exclusiverender_itemworker. The worker catches the errors and postsRenderFailed(source, error, render_id).on_render_failedbranches on the error type and keeps the stale-report drop and the failed-expression retry guard. The item does not holdappnow, andrun_posting_errors,EmptyMessage,ErrorMessage,ExpressionErrorMessage,RequestPlotandRequestImageare removed._render_faileduses the publicreturn_code is not Noneinstead of_exit.exit()sets both.render_canvasandMPLPlot.renderbuild the histogram outside_PLOTEXT_LOCKandRENDER_LOCK. Only the draw holds a lock. The worker installsprogress.cancel_when(...), so a progress report in a cancelled worker raisesprogress.CancelledError(aBaseException, likeasyncio.CancelledError) and the chunked read stops. The worker ignores this exception. New tests check both modes with a slow fake read.warnings.catch_warningsaround the histogram build now. The filters are global for the process, so the build can only change them while it holds the lock. The text path did not suppress these warnings before this change, and the tests run withfilterwarnings = error.ViewWidgethandles the Plot button and the entry box with@on(Button.Pressed,Input.Submitted,Input.Changed).PlotButtonis removed, andPlotInputkeeps only its binding.on_render_faileddrops a report with an old ID. Thus after A → B → A, the error of the cancelled first A render does not replace the new plot. An equal selection uses the running render and keeps its ID, so A → A still shows the error.PlotCanvas) postsResized, andViewWidgetrenders again (debounced). Before, the plot did not render in the smaller pane when the request after the entry box toggle came before the layout (a CI failure oftest_entry_box_rerenders_plot).browser.pyand the__package__workaround are removed.The tests that kept a reference to an item and then read its
sizenow read the item from the view again.Refs #322