You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-10-14] [$175] Web - Search Preview - Angle brackets "<>" enclosed in backticks fail to display #102388
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Please re-state the problem that we are trying to solve in this issue.
The "Search in" suggestion drops < > from a group chat name. A group named `< >` shows as "Search in ``".
What is the root cause of that problem?
The "Search in" label runs the report name through Parser.htmlToText whenever the report has no parent action (SearchRouter.tsx:231). A group chat has no parent action, so undefined !== ADD_COMMENT is true. htmlToText then treats < > as an HTML tag and deletes it (SearchRouter.tsx:285-291).
What changes do you think we should make in order to solve the problem?
In SearchRouter.tsx, add the same !!reportAction && guard that SearchAutocompleteList.tsx uses. Only threads whose parent action is not a user comment will be parsed.
Look up reportAction from contextualReport directly. Today it comes from reportForContextualSearchReport, which is undefined when the report isn't in recent reports. Without this change, the new guard would leave raw HTML for system-message threads that aren't in recent reports.
Apply the same guard in DynamicRoomMembersPage.tsx:75. It has the same unguarded check, so the Members page subtitle likely drops < > too. I haven't tested this.
Add tests modeled on the "should (not) call Parser.htmlToText" cases in tests/ui/components/SearchAutocompleteListTest.tsx.
What alternative solutions did you explore? (Optional)
Pull the check into one shared helper, for example shouldParseReportNameAsHTML(report), and call it from all three places so they can't drift apart again.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/102388) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Web - Search Preview - Angle brackets "<>" enclosed in backticks fail to display[/-][+][$175] Web - Search Preview - Angle brackets "<>" enclosed in backticks fail to display[/+]on Sep 28, 2026
Please re-state the problem that we are trying to solve in this issue.
On Web/Desktop, when a user creates or navigates to a group chat whose name contains angle brackets enclosed in backticks (e.g. `< >`) and opens the Search popover, the "Search in" contextual suggestion row renders only the empty backticks (), stripping the angle brackets < >. Meanwhile, the "Recent chats" section directly beneath it correctly displays `< >`.
What is the root cause of that problem?
In src/components/Search/SearchRouter/SearchRouter.tsx (lines 228–231):
Unguarded reportAction check:
For standard chat reports (such as group chats, 1:1 DMs, or general rooms) that do not originate from a thread parent action, reportAction is undefined. Because reportAction?.actionName evaluates to undefined, the check reportAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT evaluates to true (undefined !== 'ADD_COMMENT').
This sets shouldParserToHTML = true, causing plain-text group titles to be processed through Parser.htmlToText(...) on lines 287–290:
Parser.htmlToText strips any text inside <...>, treating < > as an HTML tag, leaving only the surrounding backticks .
Fragile reportForContextualSearchReport dependency: reportForContextualSearchReport is only defined if reportForContextualSearch is found in recentReports. If contextualReport is not in recentReports (e.g., newly navigated report or opened directly via URL), lines 232–255 create reportForContextualSearch from contextualReport, but reportAction was already computed with undefined.
In contrast, src/components/Search/SearchAutocompleteList.tsx (line 532) already contains the correct guard introduced in PR #82451:
which strips < > from room titles in the room members page subtitle.
What changes do you think we should make in order to solve the problem?
In src/components/Search/SearchRouter/SearchRouter.tsx:
Look up reportAction directly from contextualReport, and guard shouldParserToHTML with !!reportAction:
Remove the intermediate reportForContextualSearchReport variable so that reportAction is consistently resolved whether or not contextualReport was already present in recentReports.
In src/pages/DynamicRoomMembersPage.tsx:
Update line 75 to guard against undefined reportAction:
(Or alternatively, extract a shared helper shouldParseReportNameAsHTML(reportAction?: ReportAction | null): boolean in src/libs/ReportUtils.ts and use it across SearchRouter.tsx, SearchAutocompleteList.tsx, and DynamicRoomMembersPage.tsx to prevent future drift).
Automated Unit Tests:
Add test coverage in tests/ui/components/SearchAutocompleteListTest.tsx and/or a new SearchRouter test asserting that for contextual reports without a parent report action whose title contains < >, Parser.htmlToText is not called and angle brackets are preserved verbatim.
What alternative solutions did you explore? (Optional)
Escaping HTML characters via escapeHTML: Inappropriate because the chat title is already raw plain text, not HTML; passing plain text into Parser.htmlToText when there is no HTML parent action is the architectural flaw.
Root causeThe recent-chats path already handles this correctly by checking that a parent action exists before applying HTML-to-text ### Validation
Add a test for a normal group chat name containing angle brackets and verify the contextual Search in suggestion preserves the complete name. Also keep coverage for action-backed labels so the existing parser behavior does not regress.conversion.
Fix
Mirror that logic in SearchRouter and resolve the parent action from the contextual report itself so newly opened reports behave the same way.
The contextual Search in suggestion in SearchRouter.tsx runs the room label through Parser.htmlToText when the resolved parent action is not ADD_COMMENT. For a normal group chat there is no parent action, so the condition is still true and plain text is incorrectly treated as HTML.
Since @naufalfx805-source withdrew their proposal, my earlier proposal (#5870054251) was the first valid human proposal that identified this exact root cause and fix implemented in PR #102840.
Could you please assign and hire me for the contributor bounty before the payment milestone on October 14? My contributor details and Upwork profile are already on file. Thank you!
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
applause-bot commentedon Sep 28, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/cacfdfcf70b65fda34cd4d688dd4571ab4c6a4d23bd4dea37b4f2909ffd72af3
https://platform.applause.com/services/links/v1/external/7268b4169731889d66f11697b3a8bbd01d1435eefd9f4fb7fc8ff2930e897afd
MelvinBot commentedon Sep 28, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The "Search in" suggestion drops
< >from a group chat name. A group named`< >`shows as "Search in ``".What is the root cause of that problem?
The "Search in" label runs the report name through
Parser.htmlToTextwhenever the report has no parent action (SearchRouter.tsx:231). A group chat has no parent action, soundefined !== ADD_COMMENTistrue.htmlToTextthen treats< >as an HTML tag and deletes it (SearchRouter.tsx:285-291).The "Recent chats" list in the same popover shows the name correctly. It already guards with
!!reportAction &&(SearchAutocompleteList.tsx:532). Fix search preview stripping of some special characters from user-typed messages when characters are misinterpreted as html added that guard but didn't updateSearchRouter.tsx.Supporting evidence
`< >`, so the stored name is raw. It is not HTML-encoded or decoded twice.stripTagrule is/(<([^>]+)>)/gi → '', and< >matches it.SearchQueryListItem→TextWithTooltip. No HTML renderer is involved.What changes do you think we should make in order to solve the problem?
SearchRouter.tsx, add the same!!reportAction &&guard thatSearchAutocompleteList.tsxuses. Only threads whose parent action is not a user comment will be parsed.reportActionfromcontextualReportdirectly. Today it comes fromreportForContextualSearchReport, which isundefinedwhen the report isn't in recent reports. Without this change, the new guard would leave raw HTML for system-message threads that aren't in recent reports.< >too. I haven't tested this.tests/ui/components/SearchAutocompleteListTest.tsx.What alternative solutions did you explore? (Optional)
Pull the check into one shared helper, for example
shouldParseReportNameAsHTML(report), and call it from all three places so they can't drift apart again.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/102388)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Sep 28, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)[-]Web - Search Preview - Angle brackets "<>" enclosed in backticks fail to display[/-][+][$175] Web - Search Preview - Angle brackets "<>" enclosed in backticks fail to display[/+]melvin-bot commentedon Sep 28, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022104455860934281781
naufalfx805-source commentedon Sep 28, 2026
melvin-bot commentedon Sep 28, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
ashusatyarthi-wq commentedon Sep 28, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Web/Desktop, when a user creates or navigates to a group chat whose name contains angle brackets enclosed in backticks (e.g.
`< >`) and opens the Search popover, the "Search in" contextual suggestion row renders only the empty backticks (), stripping the angle brackets< >. Meanwhile, the "Recent chats" section directly beneath it correctly displays`< >`.What is the root cause of that problem?
In
src/components/Search/SearchRouter/SearchRouter.tsx(lines 228–231):There are two distinct bugs here:
Unguarded
reportActioncheck:For standard chat reports (such as group chats, 1:1 DMs, or general rooms) that do not originate from a thread parent action,
reportActionisundefined. BecausereportAction?.actionNameevaluates toundefined, the checkreportAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.ADD_COMMENTevaluates totrue(undefined !== 'ADD_COMMENT').This sets
shouldParserToHTML = true, causing plain-text group titles to be processed throughParser.htmlToText(...)on lines 287–290:Parser.htmlToTextstrips any text inside<...>, treating< >as an HTML tag, leaving only the surrounding backticks.Fragile
reportForContextualSearchReportdependency:reportForContextualSearchReportis only defined ifreportForContextualSearchis found inrecentReports. IfcontextualReportis not inrecentReports(e.g., newly navigated report or opened directly via URL), lines 232–255 createreportForContextualSearchfromcontextualReport, butreportActionwas already computed withundefined.In contrast,
src/components/Search/SearchAutocompleteList.tsx(line 532) already contains the correct guard introduced in PR #82451:Furthermore,
src/pages/DynamicRoomMembersPage.tsx(line 75) suffers from the exact same unguarded check:which strips
< >from room titles in the room members page subtitle.What changes do you think we should make in order to solve the problem?
In
src/components/Search/SearchRouter/SearchRouter.tsx:Look up
reportActiondirectly fromcontextualReport, and guardshouldParserToHTMLwith!!reportAction:Remove the intermediate
reportForContextualSearchReportvariable so thatreportActionis consistently resolved whether or notcontextualReportwas already present inrecentReports.In
src/pages/DynamicRoomMembersPage.tsx:Update line 75 to guard against undefined
reportAction:(Or alternatively, extract a shared helper
shouldParseReportNameAsHTML(reportAction?: ReportAction | null): booleaninsrc/libs/ReportUtils.tsand use it acrossSearchRouter.tsx,SearchAutocompleteList.tsx, andDynamicRoomMembersPage.tsxto prevent future drift).Automated Unit Tests:
Add test coverage in
tests/ui/components/SearchAutocompleteListTest.tsxand/or a newSearchRoutertest asserting that for contextual reports without a parent report action whose title contains< >,Parser.htmlToTextis not called and angle brackets are preserved verbatim.What alternative solutions did you explore? (Optional)
escapeHTML: Inappropriate because the chat title is already raw plain text, not HTML; passing plain text intoParser.htmlToTextwhen there is no HTML parent action is the architectural flaw.Contributor details:
Your Expensify account email: ashusatyarthi@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~010e53044b5828fe60
ashusatyarthi-wq commentedon Sep 28, 2026
Compare branch: https://github.com/ashusatyarthi-wq/App/compare/fix/search-preview-angle-brackets-102388
franklincg commentedon Sep 28, 2026
Proposal
Root causeThe recent-chats path already handles this correctly by checking that a parent action exists before applying HTML-to-text ### Validation
Add a test for a normal group chat name containing angle brackets and verify the contextual Search in suggestion preserves the complete name. Also keep coverage for action-backed labels so the existing parser behavior does not regress.conversion.
Fix
Mirror that logic in SearchRouter and resolve the parent action from the contextual report itself so newly opened reports behave the same way.
The contextual Search in suggestion in SearchRouter.tsx runs the room label through Parser.htmlToText when the resolved parent action is not ADD_COMMENT. For a normal group chat there is no parent action, so the condition is still true and plain text is incorrectly treated as HTML.
20 remaining items
ashusatyarthi-wq commentedon Oct 8, 2026
Hi @DylanDylann @Gonals,
Since @naufalfx805-source withdrew their proposal, my earlier proposal (#5870054251) was the first valid human proposal that identified this exact root cause and fix implemented in PR #102840.
Could you please assign and hire me for the contributor bounty before the payment milestone on October 14? My contributor details and Upwork profile are already on file. Thank you!
melvin-bot commentedon Oct 13, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Oct 13, 2026
Payment Summary
Resolving PRs:
Keep angle brackets in the Search in label for reports with no parent action #102840
Reviewer: @DylanDylann owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
melvin-bot commentedon Oct 16, 2026
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
mallenexpensify commentedon Oct 16, 2026
Payment Summary
Contributor+: @DylanDylann due $175 via NewDot
quinthar commentedon Oct 27, 2026
Approved $175 to @DylanDylann