[DRAFT PR] : Pass Page HTML Context to Concierge from Side Panel#78625
Draft
ChinmayKarnik wants to merge 1 commit intoExpensify:mainfrom
Draft
[DRAFT PR] : Pass Page HTML Context to Concierge from Side Panel#78625ChinmayKarnik wants to merge 1 commit intoExpensify:mainfrom
ChinmayKarnik wants to merge 1 commit intoExpensify:mainfrom
Conversation
- Created PageContextUtils with HTML sanitization to capture semantic page structure - Added pageHTML parameter to AddCommentOrAttachmentParams - Modified Report.addActions to capture page context when in side panel and talking to Concierge/admin rooms - Updated ReportScreen and ReportFooter to pass isInSidePanel prop - Captures only semantic HTML (buttons, links, forms, headings, etc.) - Excludes sensitive data, side panel content, and visual noise - Implements 50KB size limit with automatic truncation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
CLABotify
added a commit
to Expensify/CLA
that referenced
this pull request
Dec 31, 2025
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.
Pass Page HTML Context to Concierge from Side Panel
Summary
Implements HTML context capture for Concierge when accessed via side panel, enabling better contextual assistance by providing sanitized page structure.
Fixes #78564
Implementation
Core Files
src/libs/PageContextUtils.ts- New utility for capturing and sanitizing page HTMLsrc/libs/API/parameters/AddCommentOrAttachmentParams.ts- AddedpageHTMLparametersrc/libs/actions/Report.ts- Capture logic inaddActions()functionsrc/pages/home/ReportScreen.tsx- PassisInSidePanelpropsrc/pages/home/report/ReportFooter.tsx- WireisInSidePaneltoaddCommentKey Features
✅ Platform-specific: Only captures on web (
Platform.OS === 'web')✅ Context-aware: Only when sending from side panel to Concierge or admin rooms
✅ Secure: Excludes passwords, hidden elements, side panel content, and modals
✅ Optimized: Whitelist approach - keeps only semantic elements (
button,a,h1-h6,nav,input, etc.)✅ Lightweight: Strips classes, styles, data-*, SVG content - only essential attributes (href, aria-label, placeholder, type, for)
✅ Size-limited: Maximum 50KB payload with automatic truncation
How It Works
document.bodypageHTMLparameter to APITesting
Tested on web platform:
pageHTMLparameter in network request contains sanitized HTMLScreenshot:

Code Quality