feat(intelligent-assistant): add screenshot capture utility with sensitive data redaction - #4210
Conversation
…itive data redaction Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
PR Summary by QodoAdd screen-context screenshot capture with redaction and WebP support
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
Code Review by Qodo
1.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4210 +/- ##
==========================================
+ Coverage 58.33% 58.39% +0.05%
==========================================
Files 2432 2434 +2
Lines 96776 96913 +137
Branches 26874 26920 +46
==========================================
+ Hits 56457 56590 +133
- Misses 38862 38866 +4
Partials 1457 1457
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
- Fall back to original canvas when getContext('2d') returns null
- Add CSS.escape() to prevent selector injection in label lookup
- Remove redundant password type check (already in isSensitiveElement)
- Wrap element.matches() in try/catch for invalid selectors
- Use case-insensitive CSS attribute selectors for aria-label matching
- Convert html2canvas-pro to dynamic import for bundle size optimization
- Clear timeout timer in finally block to prevent resource leak
- Replace as-any casts with expect.objectContaining in tests
- Remove fragile index-based SECRET_PATTERNS tests
- Add JSDoc warning about stateful /g regexes
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|



Description
Adds an on-demand screenshot capture utility for the intelligent-assistant plugin's deep context awareness feature. The implementation uses html2canvas-pro to capture the current RHDH page view with WebP-first format negotiation (JPEG fallback), a sensitive data redaction layer that sanitizes passwords, tokens, and secrets from the captured DOM, and performance guardrails including tab visibility checks, idle scheduling, and a configurable timeout. The backend validation is also extended to accept WebP image attachments alongside JPEG.
Fixed
Screenshots example
S_.2026-08-09.at.11.28.32.PM.mov
Steps to Test
app-config.yaml:Then:
yarn startfrom the workspace rootVerifying Sensitive Data Redaction
[REDACTED]instead of actual secret values✔️ Checklist