fix(csm-portal-microapp): cap inline-image extraction from comment/description HTML - #1376
Conversation
Expanded TimeSheetCard rows had no visual separation from each other or from the accordion body — just a Stack gap, no border or fill — so in dark mode the whole expanded list read as one flat block. Gives each card row its own action.hover tinted background.
action.hover is a low-opacity overlay, and this theme's Card surfaces are themselves semi-transparent (Acrylic) — stacking one translucent layer on another made the previous fix's separation unnoticeable in practice. Switched to a solid 1px divider-colored border, the same pattern already used for AttachmentsTab/CaseActivityFeed/UpdatesPage rows elsewhere in this app.
A tap on a touch screen registers as "hover" first, leaving recharts' tooltip stuck open over the center total (confirmed via screenshot: "Open: 1085" overlapping "1368 / Total") until something else is tapped. There's no real hover state on a mobile WebView, and tapping a slice or legend row already navigates directly via onSliceClick — matches customer-portal microapp's PieChartWidget, which disables its tooltip the same way.
The action.hover fill was visible after all — keep it together with the border rather than replacing it.
extractIixAttachmentIds had no upper bound and deduped via an O(n) ids.includes() scan per match. useResolvedInlineImageHtml fires one parallel authenticated Blob fetch per id it returns, so a comment/description with an unreasonable number of distinct .iix images would fire an unbounded number of concurrent fetches. Caps collection at 20 unique ids (via a Set, also fixing the O(n) scan) — ids past the cap are simply never extracted, so they fall through existing "unresolved reference" handling in replaceInlineImageSrcs (stripped, not left pointing at an auth-gated URL).
|
Warning Review limit reached
Next review available in: 35 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Follow-up to #1374 (already merged) — two CodeRabbit findings were re-verified against current upstream code:
<img>HTML detection (UpdatesPage.tsx): already fixed upstream as part of feat(csm-portal-microapp): resolve inline .iix images in comments and update descriptions #1374 (commit 4c3e733). No change needed.inlineImages.ts): still valid.extractIixAttachmentIdshad no upper bound and deduped via an O(n)ids.includes()scan per match.useResolvedInlineImageHtmlfires one parallel authenticated Blob fetch per id it returns, so a comment/description with an unreasonable number of distinct.iiximages would fire an unbounded number of concurrent fetches. This PR caps collection at 20 unique ids (via aSet, also fixing the O(n) scan) — ids past the cap are simply never extracted, so they fall through the existing "unresolved reference" handling inreplaceInlineImageSrcs(stripped, not left pointing at an auth-gated URL).useResolvedInlineImageHtml.tsneeded no changes — it already derives its queries, retries, and data-URL map entirely fromextractIixAttachmentIds's return value, so capping it there is sufficient.Test plan
npx tsc --noEmitnpx eslint .npm run build