-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: TaskItem display and copy issues with HTML tags in task messages. #4444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Display issue: HTML tags not displaying in HistoryView. * Copy issue: HTML tags in message are removed when clicking the copy button in TaskItem.
- Add LRU cache with 500 item limit for escapeHtml results - Improves performance by caching frequently escaped strings - Reduces redundant HTML escaping operations
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @forestyoo, thank you for working on this fix.
It looks good, I added LRU cache to the escapeHtml since this function is called on every render for every single task, this should help with performance.
Other than that this looks like a good fix!
|
Hi @daniel-lxs , Thanks for the review and for adding the LRU cache optimization—great improvement! Glad the fix looks good. Appreciate your time! |
|
Hey @daniel-lxs , |
|
Thank you !! |
Closes: #3866
Description
This PR fixes TaskItem display and copy issues with HTML tags in task messages.
Display issue: HTML tags not displaying in HistoryView.
dangerouslySetInnerHTML.dangerouslySetInnerHTMLwith the escaped string.Copy issue: HTML tags in message are removed when clicking the copy button in TaskItem.
highlightfield instead of modifying thetaskfield.Test Procedure
Send Roo the message
explain this html code <div>Test</div>to create a task.<div>tags are not displayed; the message appears asexplain this html code Test.explain this html code Test(HTML tags are lost).Type of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
record.mov
Documentation Updates
Additional Notes
Get in Touch
Discord: forestyoo
Important
Fixes display and copy issues with HTML tags in task messages by adjusting HTML handling in
TaskItemandCopyButton, and adding HTML escaping inhighlight.ts.TaskItem.tsx, usedangerouslySetInnerHTMLonly whenhighlightis present, ensuring HTML tags are displayed correctly.highlightfield inDisplayHistoryItemto store processed message.CopyButton.tsx, remove logic stripping HTML tags, allowing full message copy.escapeHtml()inhighlight.tsto escape HTML characters inhighlightFzfMatch().useTaskSearch.tsto usehighlightfield for storing highlighted messages.This description was created by
for 4322529. You can customize this summary. It will automatically update as commits are pushed.