Skip to content

fix(csm-portal-microapp): cap inline-image extraction from comment/description HTML - #1376

Merged
Rashmika998 merged 9 commits into
wso2-open-operations:mainfrom
2003dinijay:fix/cap-inline-image-extraction
Aug 5, 2026
Merged

Rashmika998 merged 9 commits into
wso2-open-operations:mainfrom
2003dinijay:fix/cap-inline-image-extraction

Conversation

@2003dinijay

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1374 (already merged) — two CodeRabbit findings were re-verified against current upstream code:

  • Standalone <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.
  • Unbounded inline-image extraction (inlineImages.ts): still valid. 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. This PR 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 the existing "unresolved reference" handling in replaceInlineImageSrcs (stripped, not left pointing at an auth-gated URL).

useResolvedInlineImageHtml.ts needed no changes — it already derives its queries, retries, and data-URL map entirely from extractIixAttachmentIds's return value, so capping it there is sufficient.

Test plan

  • npx tsc --noEmit
  • npx eslint .
  • npm run build

2003dinijay and others added 9 commits August 5, 2026 19:46
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).
Copilot AI lite review requested due to automatic review settings August 5, 2026 15:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@2003dinijay, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cc0081da-3dc7-4182-bcaf-9cb3097c0638

📥 Commits

Reviewing files that changed from the base of the PR and between 6ddf80a and 7dfd8cb.

📒 Files selected for processing (3)
  • apps/csm-portal/microapp/src/components/home/CompositionDonut.tsx
  • apps/csm-portal/microapp/src/components/timecards/TimeSheetCard.tsx
  • apps/csm-portal/microapp/src/utils/inlineImages.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added App/CSM Portal Platform/Microapp Type/Bug Identifies a bug in the project labels Aug 5, 2026
@Rashmika998
Rashmika998 merged commit 7dfd8cb into wso2-open-operations:main Aug 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

App/CSM Portal Platform/Microapp Type/Bug Identifies a bug in the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants