feat(sr): add high-fidelity text capture mode #1290
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 · 356 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.352
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1290"
general
weight: 0.35
fuzzybinary
What and why?
In Session Replay, Flutter text is sent as text wireframes, and the web player draws it with fonts installed in the viewer's browser. Custom fonts, font weights, letter spacing and mixed styles get lost, and paragraphs often wrap onto a different number of lines than on the device. The native SDKs have the same limitation: they send a fixed font list, and the player draws text 1px smaller than recorded, with a tight line height.
This PR adds an opt-in high-fidelity text capture mode that sends each paragraph as an image of exactly what Flutter drew on the device:
How?
TextElementRecorderpaints the already laid-outRenderParagraphoffscreen during the capture walk and reads the pixels back inprocess(), one paragraph at a time, then uploads them through the existing image pipeline. InlineWidgetSpanchildren are skipped and recorded as their own nodes. If painting or uploading fails, the paragraph is sent as text.TextOverflow.visible, shadows, and a glyph margin for text that isn't upright Latin in a platform default font. Clipped overflow keeps the layout box.maskAlltext and text fields (EditableText) are always sent as text.- an LRU cache keyed by what was drawn, including the current selection and inline widget layout; cleared when the available fonts change (e.g. a runtime-loaded font)
- images reused during transform animations
-
maxImagePixelBudget/imageDownscalingfollowed like images: over budget, text falls back to text and icons show "Large Icon", or both are drawn smaller with downscaling enabledraster_resources.dart. Image caching is unchanged.- each new or changed paragraph is uploaded as an image, so screens with fast-changing text upload more
- Related fixes:
-
computeDiffreplaces a wireframe whose type changes (e.g. image to masked text) instead of skipping it, which also fixes images and icons ondevelop-
maxImagePixelBudgetvalues below 1 are replaced by the default with a warningReview checklist