[$250] Report list components do not parse HTML entities (ExpenseReportListItemRowWide / ExpenseReportListItemRowNarrow / MoneyRequestReportPreviewBody)
Problem
The report list components do not parse HTML entities, so entity-encoded characters (e.g. &, ', ") are displayed as raw text instead of being rendered as their intended characters.
Affected components:
ExpenseReportListItemRowWideExpenseReportListItemRowNarrowMoneyRequestReportPreviewBody
Expected behavior
Text containing HTML entities should be decoded and displayed as the intended characters (e.g. & → &).
Actual behavior
HTML entities are shown verbatim as raw text.
Notes
Discovered by jmgraa while debugging Expensify/App#95335 (iOS Share Extension performance). It is unrelated to that issue and is being tracked separately here per mjasikowski's request.
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022075559845485706910
- Upwork Job ID: 2075559845485706910
- Last Price Increase: 2026-07-10
Proposal
What is the root cause of that problem?
Report names are stored HTML/markdown-encoded (e.g. Bob & Co). Everywhere the app displays a report name it must first decode it with Parser.htmlToText(...) — see the established precedent at ReportUtils.ts:6916 and the task list path at SearchUIUtils.ts:2592.
The three affected components render the name raw, skipping that decode step, so entities show verbatim:
- Wide row —
item.reportNamepassed straight toTextCellatExpenseReportListItemRowWide.tsx:152 - Narrow row —
{item.reportName ?? ''}rendered directly atExpenseReportListItemRowNarrow.tsx:62 - Report preview —
MoneyRequestReportPreviewBodyrenders its title viaReportPreviewHeader, which prints{reportName || action.childReportName}raw atReportPreviewHeader.tsx:105
The value fed to the search rows is set from the raw report (...reportItem) at SearchUIUtils.ts:2925 and is never decoded (the isIOUReport branch just below only overrides it with a translated "owes/paid" string).
Reference: the correct pattern already used elsewhere
MerchantCell decodes before display at MerchantCell.tsx:37:
StringUtils.lineBreaksToSpaces(Parser.htmlToText(merchantOrDescription))
Note: even the derived/attribute report name still needs decoding — ReportUtils.ts:6916 wraps getReportName(...) in Parser.htmlToText, so ReportPreviewHeader (which reads the derived reportNameSelector) is affected too, not just the search rows.
What changes do you think we should make in order to solve the problem?
Decode the report name with Parser.htmlToText before it reaches these components. Two clean options:
- At the data layer (covers both search rows in one place): decode
reportNamewhere the expense-report group item is built inSearchUIUtils.ts(~line 2925), matching how the task path already does it at line 2592. Wide + narrow rows then render the correct value with no per-component change. - At the render layer: decode in each component — wrap
item.reportNamein the wide/narrow rows andreportName || action.childReportNameinReportPreviewHeaderwithParser.htmlToText(...).
ReportPreviewHeader needs the render-layer fix regardless, since its name comes from the derived report attributes rather than the search data pipeline.
Recommended: option 1 for the two search rows + the render-layer fix for ReportPreviewHeader.
What alternative solutions did you explore? (Optional)
Using Str.htmlDecode instead of Parser.htmlToText — rejected. Parser.htmlToText is the app-wide convention for report/merchant names (it both strips markup and decodes entities); Str.htmlDecode is used for simpler cases like category names.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/95808) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Proposal
What is the root cause of that problem?
When report names or other descriptive text containing HTML entities (e.g., &, ', ") are displayed in ExpenseReportListItemRowWide, ExpenseReportListItemRowNarrow, and MoneyRequestReportPreviewBody (via its children), the raw entity codes are shown. This occurs because these components render the text directly into React Native Text components without prior decoding. The Text component does not automatically parse HTML entities, leading to their verbatim display instead of the intended characters.
For example, in ExpenseReportListItemRowNarrow, the item.reportName is rendered directly into a Text component:
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowNarrow.tsx#L68-L70
Similarly, other text fields in the affected components are displayed without decoding, causing the HTML entities to appear as raw text.
What changes do you think we should make in order to solve the problem?
We should introduce a utility function to decode HTML entities and apply it to the relevant text fields in the affected components before they are rendered.
-
Create a new utility file
src/libs/HtmlUtils.tsand add a functionhtmlDecodeto decode common HTML entities.// src/libs/HtmlUtils.ts function htmlDecode(text: string): string { return text .replaceAll('&', '&') .replaceAll(''', "'") .replaceAll('"', '"'); } export default htmlDecode; -
In
ExpenseReportListItemRowNarrow.tsx, importhtmlDecodeand apply it toitem.reportNameanditem.textbefore they are rendered inTextcomponents or used for accessibility labels.https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowNarrow.tsx#L68-L70
<Text numberOfLines={2} style={[styles.lh20, styles.flex1]} > {htmlDecode(item.reportName ?? '')} </Text>https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowNarrow.tsx#L59
accessibilityLabel={htmlDecode(item.text ?? '')} -
In
ExpenseReportListItemRowWide.tsx, importhtmlDecodeand apply it toitem.reportNamewherever it is displayed within the component or its child components. This ensures that any report name text is correctly decoded.https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowWide.tsx#L32-L111
// Example: Assuming item.reportName is rendered in a Text component <Text> {htmlDecode(item.reportName ?? '')} </Text> -
In
MoneyRequestReportPreviewContent.tsx(which is rendered byMoneyRequestReportPreviewBody.tsx), importhtmlDecodeand apply it toiouReport.reportNameandchatReport.reportNamewhen these values are accessed from theiouReportandchatReportobjects before they are used for display in anyTextcomponents.https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx#L13-L72
// Example: Decode report names before passing to child components or rendering const decodedIouReportName = htmlDecode(iouReport?.reportName ?? ''); const decodedChatReportName = htmlDecode(chatReport?.reportName ?? ''); // Use decodedIouReportName and decodedChatReportName in the UI
These changes will ensure that HTML entities are properly decoded and displayed as their intended characters across all affected report list components.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-10 12:39:37 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense-report names containing HTML entities (&, ', ") are shown verbatim in the Reports list rows (ExpenseReportListItemRowWide/ExpenseReportListItemRowNarrow) and in the report preview card in chat (MoneyRequestReportPreviewBody), instead of the decoded characters (&, ', ").
What is the root cause of that problem?
The backend stores and returns report names HTML-entity-encoded, and the app's convention is to decode at the display layer with Parser.htmlToText. That is why the same name renders correctly in the report header and LHN — DisplayNames decodes before rendering:
https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/components/DisplayNames/index.tsx#L28 (native mirror: https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/components/DisplayNames/index.native.tsx#L20)
The three reported components sit on two data paths that both skip this decode:
Path 1 — Search/Reports rows. getReportSections builds each expense-report row by spreading the raw snapshot report — {...reportItem} — so item.reportName keeps the encoded string:
https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/libs/SearchUIUtils.ts#L2925-L2931
The task path in the same file already decodes (StringUtils.lineBreaksToSpaces(Parser.htmlToText(...))) — the expense-report path just never got the same treatment:
https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/libs/SearchUIUtils.ts#L2592
The encoded value then hits plain-text render sinks with no decode:
- Wide row, TITLE column
TextCell: https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowWide.tsx#L149-L156 - Narrow row title
Text: https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowNarrow.tsx#L58-L63 - Narrow row screen-reader label (announces
&aloud): https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowNarrow.tsx#L34 - TITLE-column sorting compares encoded strings, so "A & B" sorts as "A & B": https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/libs/SearchUIUtils.ts#L3951-L3957
Path 2 — report preview card. MoneyRequestReportPreviewBody composes ReportPreviewHeader (https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewBody.tsx#L137), which reads the derived report name — for expense reports computeReportName returns report.reportName raw (https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/libs/ReportNameUtils.ts#L981-L983) — and renders it in a plain Text with no decode:
https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L101-L106
The structural cause: the encoded-in-storage / decode-at-display contract is enforced by DisplayNames, but these surfaces render the name through plain Text/TextCell, so the decode step is silently skipped. This explains all three named components and why the identical name is correct in the report header.
What changes do you think we should make in order to solve the problem?
1. Decode at the single convergence point for the Search rows — in getReportSections, mirror the existing task-path transform right after the spread (SearchUIUtils already imports Parser and StringUtils):
reportIDToTransactions[reportKey] = {
...reportItem,
reportName: StringUtils.lineBreaksToSpaces(Parser.htmlToText(reportItem.reportName ?? '')),
...
One line fixes the wide row, the narrow row, the narrow row's accessibility label, and TITLE sorting at once. The IOU-report override at https://github.com/Expensify/App/blob/5b52fc0257a95a7c39aab272f95e869936b00c79/src/libs/SearchUIUtils.ts#L2961-L2963 runs after this assignment and builds a locale string with no entities, so it is unaffected.
2. Decode at render in ReportPreviewHeader (add import Parser from '@libs/Parser';), matching the DisplayNames/TaskPreview precedent:
{Parser.htmlToText(reportName || action.childReportName || '')}
This also covers the action.childReportName fallback, which is backend-provided and equally encoded.
Regression safety: the task path already applies this exact transform in the same function family, and no consumer of these values needs the encoded shape — getIOUReportName never reads reportItem.reportName, and the derived reportAttributes value itself stays untouched.
Why the obvious spot-fix fails: wrapping just the two visible <Text> sinks in the row components misses the narrow row's groupAccessibilityLabel (screen readers keep announcing &), leaves TITLE sorting comparing encoded strings, and does nothing for the preview card, which is fed by a different data path (derived reportAttributes, not the search snapshot). Equally, the other "central" candidate — decoding inside computeReportName — is unsafe: DisplayNames applies Parser.htmlToText to that same derived value at render, so decoding upstream would double-decode names that legitimately contain entity text (a report literally named A & B is stored as A &amp; B and would corrupt to A & B); every DisplayNames consumer depends on the current encoded shape.
What alternative solutions did you explore? (Optional)
- Decode in each of the three components — works, but leaves the decode duplicated across sinks, is easy to miss on the accessibility label, and doesn't fix TITLE sorting; the data-source fix matches the in-file task precedent.
- Decode in
computeReportName/derived attributes — rejected above: double-decodes for everyDisplayNamesconsumer (report header, LHN). - Render the name via
RenderHTML— heavyweight for a one-line plain-text field and would change layout insideFlashListrows; names are plain text, only entity-decoding is needed.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-10 12:54:07 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When an expense report has a title containing characters like &, ', or ", that title shows up as raw HTML entities (&, ', ") instead of the real characters. It happens in the Search report list (both the wide and narrow rows) and in the money request report preview header. So a report named Q3 R&D reads as Q3 R&D on screen.
What is the root cause of that problem?
Report titles are stored HTML-entity-encoded on purpose, and decoding them back to plain text is a client render-time job that this repo already does everywhere else. These three surfaces just skip that one hop. There are two separate data paths.
For the Search rows, the name comes from getReportSections() in SearchUIUtils.ts. At line 2925 it spreads the raw Onyx report object (...reportItem) straight into the row, so item.reportName stays encoded. ExpenseReportListItemRowWide.tsx and ExpenseReportListItemRowNarrow.tsx:62 render that value as-is. The interesting part is that the same builder already decodes the sibling task rows one block up at SearchUIUtils.ts:2591 with StringUtils.lineBreaksToSpaces(Parser.htmlToText(taskItem.reportName)) — expense reports just never got the same treatment. Worth noting: IOU reports aren't affected, because line 2962 overrides their name with the synthesized getIOUReportName(...) string. Only user-typed expense-report titles hit this.
The preview header is a different path. MoneyRequestReportPreviewBody renders no title itself; it composes ReportPreviewHeader. There, reportName = derivedReportName ?? iouReport?.reportName ?? '' (line 50), where derivedReportName traces back through reportNameSelector to computeReportName, which returns report.reportName verbatim. The header then renders {reportName || action.childReportName} at line 105 — and both operands are raw, so the fallback path is broken too.
This is an original flaw, not a regression. The Search rows shipped encoded when they were first added, and no PR on any of these files has ever added the decode. So the fix is to add Parser.htmlToText, not restore anything.
What changes do you think we should make in order to solve the problem?
Fix it at the two data sources rather than at each render site.
For the Search rows, decode once in getReportSections() after the ...reportItem spread, mirroring the task branch:
reportName: StringUtils.lineBreaksToSpaces(Parser.htmlToText(reportItem.reportName ?? '')),
Parser and StringUtils are already imported in that file, and the IOU override at line 2962 still runs afterward so IOU names stay correct. Doing it here (not at the render sites) also fixes the narrow row's accessibility label at ExpenseReportListItemRowNarrow.tsx:34, which builds a screen-reader string from the same raw item.reportName — a render-only patch on line 62 would leave & being read aloud to screen-reader users.
For the preview header, decode both operands at ReportPreviewHeader.tsx:105 (add import Parser from '@libs/Parser'):
{Parser.htmlToText(reportName || action.childReportName || '')}
I'd also add test coverage, since neither path has a decode assertion today. In tests/unit/Search/SearchUIUtilsTest.ts, an expense-report fixture with reportName "A & B 'C'" should assert the built section's reportName comes out as "A & B 'C'", plus a ReportPreviewHeader render test checking the title renders decoded characters.
This affects all platforms (Web, iOS, Android, mWeb, MacOS) since it's pure render logic.
What alternative solutions did you explore? (Optional)
Decoding inside computeReportName / the derived REPORT_ATTRIBUTES looked tempting since it's the shared name source, but it doesn't work here: the Search rows read the raw ...reportItem spread, not the derived attribute, so they'd stay broken. It would also double-decode the existing consumers that already wrap the name in Parser.htmlToText (e.g. ReportUtils.ts:6916/6930), and risk changing LHN and sort-key behavior. Decoding at each render site works but takes three edits and still has to catch the narrow a11y label, which is easy to miss.
One adjacent thing I noticed while tracing this: the task search rows' parentReportName (SearchUIUtils.ts:2610) also isn't decoded and renders raw through TaskListItemRow. Same class of bug, not in this issue's scope, but easy to fold into the same source-level fix if we want the Search lists to decode consistently.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @daledah (External)
Job added to Upwork: https://www.upwork.com/jobs/~022075559845485706910
Proposal
What is the root cause of that problem?
The report names are HTML-encoded strings, but the affected components render them through plain React Native text without decoding them. The wide report row passes item.reportName directly to TextCell ([source](https://github.com/Expensify/App/blob/main/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowWide.tsx#L149-L155)), while the narrow row uses the same raw value for both its accessibility label and visible text ([source](https://github.com/Expensify/App/blob/main/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowNarrow.tsx#L33-L40), [source](https://github.com/Expensify/App/blob/main/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowNarrow.tsx#L56-L64)). The money-request preview has the same problem in ReportPreviewHeader, which now owns the report-name rendering extracted from MoneyRequestReportPreviewBody: it selects the derived/raw report name and interpolates it directly into Text ([source](https://github.com/Expensify/App/blob/main/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L48-L50), [source](https://github.com/Expensify/App/blob/main/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L95-L106)). React Native Text treats entities as literal characters, so values such as &, ', and " remain visible.
What changes do you think we should make in order to solve the problem?
In ExpenseReportListItemRowWide, ExpenseReportListItemRowNarrow, and ReportPreviewHeader, derive one display-safe report name before rendering it. Use the existing Parser.isHTML() guard and call Parser.htmlToText() only when the name contains markup or an HTML entity; these helpers already detect encoded entities and convert HTML to plain text ([source](https://github.com/Expensify/App/blob/main/src/libs/Parser.ts#L61-L70)). Continue rendering ordinary report names unchanged to avoid unnecessary parsing.
The narrow row should reuse the decoded value in both its visible title and groupAccessibilityLabel. The preview should decode whichever value wins its existing derived report name, raw IOU report name, or action.childReportName fallback chain.
Add focused UI coverage for the wide row, narrow row, and money-request preview to verify that common named and numeric entities are decoded while plain-text report names remain unchanged.
What alternative solutions did you explore? (Optional)
I considered rendering report names through the full HTML renderer, but these components only need plain text and that would add unnecessary rendering overhead. I also considered decoding the shared derived report-name value globally, but that would change its semantics for unrelated consumers and would not reliably cover every raw fallback path used by these components.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Report titles that contain HTML entities (for example &, ', ") are rendered verbatim as raw escaped text instead of being decoded to the characters they represent (&, ', "). This affects the report title shown in the Search expense-report list (both the wide/table layout and the narrow/mobile layout) and the report title shown in the money request report preview card in chat.
What is the root cause of that problem?
Report names arrive from the back end HTML-encoded. Throughout the app, a report name is expected to be run through Parser.htmlToText() before it is displayed as plain text. There are two independent places where that decoding step is missing.
1. The Search expense-report list items never decode reportName.
The list item objects for expense-report search results are built by spreading the raw search snapshot report straight into the list item, so reportName carries the encoded string through untouched:
https://github.com/Expensify/App/blob/242f0cd48f63d336a2deb5a39553213ec3c20996/src/libs/SearchUIUtils.ts#L2925-L2931
Both row components then render that value directly as plain text. The wide layout passes it into the title TextCell:
https://github.com/Expensify/App/blob/242f0cd48f63d336a2deb5a39553213ec3c20996/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowWide.tsx#L149-L156
and the narrow layout renders it inside a Text:
https://github.com/Expensify/App/blob/242f0cd48f63d336a2deb5a39553213ec3c20996/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowNarrow.tsx#L58-L63
Neither TextCell nor Text decodes entities, so the escaped sequence reaches the screen as-is.
This is a gap rather than an intentional choice: the sibling branch of the very same builder, which produces the task search list items, does decode its reportName before handing it to the row component:
https://github.com/Expensify/App/blob/242f0cd48f63d336a2deb5a39553213ec3c20996/src/libs/SearchUIUtils.ts#L2592-L2593
The expense-report branch simply never received the equivalent treatment.
2. The money request report preview header never decodes reportName.
MoneyRequestReportPreviewBody is a pure layout component and owns no text of its own — it composes ReportPreviewHeader, which is the component that actually resolves and renders the report title. It picks the derived report name, falling back to the report's own reportName:
https://github.com/Expensify/App/blob/242f0cd48f63d336a2deb5a39553213ec3c20996/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L48-L50
and renders the result as plain text without decoding:
https://github.com/Expensify/App/blob/242f0cd48f63d336a2deb5a39553213ec3c20996/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L100-L106
Both branches of that fallback are encoded. The derived value comes from computeReportName, and the fallback is the raw report.reportName — and elsewhere in the codebase, exactly that pair is explicitly wrapped in Parser.htmlToText before being surfaced as text:
https://github.com/Expensify/App/blob/242f0cd48f63d336a2deb5a39553213ec3c20996/src/libs/ReportUtils.ts#L6916-L6916
So the root cause is that these three components sit on two display paths where the established "decode the report name before showing it as plain text" step was never applied.
What changes do you think we should make in order to solve the problem?
Apply the decoding at the two points where the encoded value is produced, so that every consumer of it benefits and the row components stay presentational.
For the Search expense-report list items, decode reportName in the expense-report branch of the search sections builder in src/libs/SearchUIUtils.ts, at the point where the list item is assembled from the snapshot report. Pass the report name through the parser's HTML-to-text conversion (and collapse line breaks to spaces) before it is placed on the list item, mirroring exactly what the task branch of the same builder already does a few hundred lines above. Do this after the existing IOU report-name override runs, so a generated IOU name and a user-supplied name are both normalised the same way.
Decoding here rather than inside the row components is the better fix for three reasons: it fixes the wide layout and the narrow layout with one change; it also fixes the narrow layout's accessibility label, which is composed from the same reportName and would otherwise still announce the raw entity to screen readers; and it makes title sorting in the table compare decoded names, which is what a user visually sorting by title expects.
For the money request report preview, decode the resolved title in ReportPreviewHeader, which is the component MoneyRequestReportPreviewBody delegates the title to. Run the already-resolved name — after the derived-name/reportName/childReportName fallback chain has settled on a value — through the same HTML-to-text conversion before it is rendered into the Text element. Decoding after the fallback chain resolves means the encoded form cannot slip through on any of the three branches.
Both changes reuse the same src/libs/Parser wrapper that the codebase already relies on for report names — it is already imported in SearchUIUtils, and ReportPreviewHeader only needs to import it — so no new dependency or utility is introduced, and the decoding stays idempotent for names that contain no entities.
Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/95808-decode-html-entities-report-name?expand=1
What alternative solutions did you explore? (Optional)
I considered decoding inside the leaf presentational components — TextCell and the narrow row's Text — but rejected it. TextCell is a generic cell reused for report IDs, payroll IDs, order/deal numbers and paid status, none of which are HTML-encoded, so decoding there would apply an unrelated transformation to unrelated data and would silently mangle any legitimately literal ampersand-hash sequence in an ID field. It would also leave the narrow row's accessibility label and the table's title sort still operating on the encoded string.
I also considered normalising reportName once at the Onyx/derived-attributes layer so that every consumer receives a decoded name. That is arguably the cleanest long-term shape, but the derived report name is consumed in places that expect the HTML form (it is fed to renderers that parse markup), so changing it centrally risks double-decoding and regressions well outside the scope of this issue. Decoding at the two display-path boundaries keeps the blast radius proportionate to the bug.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Report names stored HTML-entity-encoded (&, ', ", …) render verbatim as raw text in the Search expense-report rows (ExpenseReportListItemRowWide / …Narrow) and in the money-request report preview title, instead of as the decoded characters.
What is the root cause of that problem?
Report names come from the backend HTML-encoded, and the app decodes them at the point where the display name is resolved. The bug is not that three leaf components "forgot to decode" — it's that the two source functions that produce the name for these components each decode every report type except the one on screen here. This is the classic "sibling branch decodes, its counterpart doesn't" gap, and it exists in two independent places.
Preview path — the derived-name resolver skips the expense branch. The preview title is not owned by MoneyRequestReportPreviewBody (a pure layout component); it's rendered by ReportPreviewHeader, which reads the derived report name via reportNameSelector and only falls back to the raw report as a last resort:
https://github.com/Expensify/App/blob/89a5c2d4d28d414e51c969fc701b90a496e58f98/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L48-L50
That derived value is produced by computeReportName, the single resolver behind reportAttributes.reportName (OnyxDerived/configs/reportAttributes.ts:383). Every branch of computeReportName returns display-ready text — the task branch even runs the value through the parser explicitly:
https://github.com/Expensify/App/blob/89a5c2d4d28d414e51c969fc701b90a496e58f98/src/libs/ReportNameUtils.ts#L1009
…but the expense branch returns report.reportName raw, with no decode:
https://github.com/Expensify/App/blob/89a5c2d4d28d414e51c969fc701b90a496e58f98/src/libs/ReportNameUtils.ts#L981-L982
So the derived name handed to ReportPreviewHeader — and to every other consumer of the derived report name — is undecoded for expense reports. That is the true source of the preview bug.
Search-rows path — the section builder never routes through the resolver at all. getReportSections builds the expense-report list item by spreading the raw snapshot report, so item.reportName carries the encoded string straight through, and the isIOUReport branch just below only overrides it with getIOUReportName (whose payer display name is itself undecoded):
https://github.com/Expensify/App/blob/89a5c2d4d28d414e51c969fc701b90a496e58f98/src/libs/SearchUIUtils.ts#L2925-L2963
Both rows then read that raw value — the wide row at ExpenseReportListItemRowWide.tsx:152, and the narrow row twice — in the visible <Text> at line 62 and in the screen-reader groupAccessibilityLabel at line 34. And the exact sibling of this builder — the task section — already decodes its own reportName at SearchUIUtils.ts:2592. The expense-report branch simply never received the equivalent treatment.
So there are two source-level gaps, each mirroring a decoding sibling that already exists a few lines away in the same function. Fixing them there — rather than at the render sites — is both the smaller change and the more correct one.
What changes do you think we should make in order to solve the problem?
1. computeReportName (src/libs/ReportNameUtils.ts) — decode the expense branch exactly the way its own task branch already does, so the derived report name is display-ready for the preview and every other consumer:
if (report?.reportName && report.type === CONST.REPORT.TYPE.EXPENSE) {
- return report?.reportName;
+ return Parser.isHTML(report.reportName) ? Parser.htmlToText(report.reportName) : report.reportName;
}
No change is needed in ReportPreviewHeader or MoneyRequestReportPreviewBody — they consume the resolved value.
2. getReportSections (src/libs/SearchUIUtils.ts) — normalize the assembled name the same way the task section does at :2592, placed after the isIOUReport override so both a user-supplied expense name and the generated IOU name are covered by one line:
if (isIOUReport) {
reportIDToTransactions[reportKey].reportName = getIOUReportName(translate, convertToDisplayString, data, reportIDToTransactions[reportKey]);
}
+ reportIDToTransactions[reportKey].reportName = StringUtils.lineBreaksToSpaces(Parser.htmlToText(reportIDToTransactions[reportKey].reportName ?? ''));
This single line fixes ExpenseReportListItemRowWide, the narrow row's visible title and its groupAccessibilityLabel, and makes the TITLE column sort on decoded text. Parser and StringUtils are already imported here.
This is safe because:
- Both edits reuse the exact helper the same function/builder already applies to a sibling report type —
computeReportName's task branch atReportNameUtils.ts:1009andgetReportSections's task-section sibling atSearchUIUtils.ts:2592— so I'm removing an inconsistency, not introducing a new transform. Parser.htmlToTextis idempotent on already-plain text (decoding the already-translated IOU "owes/paid" string is a no-op), so placing change #2 after the IOU override cannot double-mangle it.- Decoding at the resolver/builder is safe for downstream consumers because they already receive decoded text for every other report type from these same code paths — the expense branch was the lone exception.
- The
Parser.isHTML(...) ? … : …guard matches the task branch and skips the parser entirely when there's no markup/entity, so plain names are untouched and there's no per-render cost.
Note: ReportPreviewHeader also has a raw iouReport?.reportName fallback (line 50) that is only hit transiently before reportAttributes is computed. Change #1 covers the steady state; if we want belt-and-suspenders we can additionally wrap that fallback with the same guard, but it's not required for the reported repro.
Result: report names containing &, ', ", etc. render decoded in the wide row, the narrow row (visible title and screen-reader label), and the money-request report preview — and, because the fix sits at the two shared sources, in every other consumer of the derived report name as well.
What alternative solutions did you explore? (Optional)
- Decode at the three render sites (the render-site proposals above). Works, but it patches three components while leaving the derived
reportAttributes.reportNameand the raw search item still encoded for every other current/future consumer, and it runs a decode on every list-row render. Fixing the two sources is fewer touch-points and self-consistent with the task branches that already decode. - Decode the preview in
ReportPreviewHeaderrather than incomputeReportName(the data-layer-in-header variant). Also correct, but it re-patches, at the display layer, a value thatcomputeReportNameis specifically responsible for resolving, and leaves the derived name encoded for its other readers. Decoding the single undecoded branch of the resolver is the smaller, more consistent change. One such variant also decodes the search item before the IOU override, which misses the IOU payer-name case; placing change #2 after the override covers both. - Decode the persisted/selector
reportName. Rejected: some consumers render the report name as HTML / parse markup, and search matches on the encoded form, so changing the stored value risks double-decoding and regressions beyond this issue.
⚠️ @nabi-ebrahimi Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
🚨 Edited by proposal-police: This proposal was edited at 2026-07-10 12:41:55 UTC.
Note: This proposal is not a duplicate. It identifies a deeper root cause rather than the surface symptom.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Report names containing HTML entities (&, ', ") are displayed as raw escaped text in the Search expense-report list (both wide and narrow layouts) and in the money-request report preview header. Three components render reportName without decoding it: ExpenseReportListItemRowWide, ExpenseReportListItemRowNarrow, and ReportPreviewHeader (rendered inside MoneyRequestReportPreviewBody).
What is the root cause of that problem?
The bug is caused by two independent data paths that each skip HTML decoding:
Path 1 — Search list rows
The expense-report group item is built by spreading the raw search-result object:
// SearchUIUtils.ts:2925
reportIDToTransactions[reportKey] = {
...reportItem, // ← reportName arrives HTML-encoded and is never decoded
...
};
Both ExpenseReportListItemRowWide.tsx:152 and ExpenseReportListItemRowNarrow.tsx:62 then render item.reportName directly.
The sibling task-list path at the same file, line 2592, already applies the correct treatment:
// SearchUIUtils.ts:2592 — task path (working analog)
const reportName = StringUtils.lineBreaksToSpaces(Parser.htmlToText(taskItem.reportName));
The expense-report branch simply never received the equivalent treatment.
Path 2 — Money-request report preview header
ReportPreviewHeader resolves its title from the derived REPORT_ATTRIBUTES Onyx key:
// ReportPreviewHeader.tsx:50
const reportName = derivedReportName ?? iouReport?.reportName ?? '';
and renders it raw at line 105:
{reportName || action.childReportName}
The derived reportName is produced by computeReportName in ReportNameUtils.ts. That function already applies Parser.htmlToText for task reports (line 1010), but for expense reports (type EXPENSE) it returns report.reportName directly without decoding (line 982). Both derivedReportName and the action.childReportName fallback are therefore encoded.
ReportUtils.ts:6916 shows the established precedent — calling Parser.htmlToText before surfacing a report name as plain text.
What changes do you think we should make in order to solve the problem?
Fix 1 — SearchUIUtils.ts (covers both search row components in one place)
At line 2925, decode reportName before it enters the list-item object, matching the task-path analog at line 2592:
reportIDToTransactions[reportKey] = {
...reportItem,
reportName: StringUtils.lineBreaksToSpaces(Parser.htmlToText(reportItem.reportName ?? '')),
// ... rest of overrides
};
This single change fixes both ExpenseReportListItemRowWide and ExpenseReportListItemRowNarrow without touching either component. item.text (used in checkbox accessibility labels) should be decoded the same way if it carries the same encoded value.
Fix 2 — ReportPreviewHeader.tsx (render-layer, required for the preview path)
Decode at the point where reportName is derived (line 50), and wrap the fallback separately:
const reportName = Parser.htmlToText(derivedReportName ?? iouReport?.reportName ?? '');
And at line 105, wrap the action.childReportName fallback:
{reportName || Parser.htmlToText(action.childReportName ?? '')}
A render-layer fix is correct here because derivedReportName is read from the Onyx-derived attributes pipeline (not the search pipeline), and mutating that pipeline's stored value would risk double-decoding at other consumers.
Fix 3 — Tests
Add a jest test that builds a mock expense-report search item with reportName: 'Bob & Co' and asserts that ExpenseReportListItemRowWide and ExpenseReportListItemRowNarrow render Bob & Co. Add a second test for ReportPreviewHeader with derivedReportName: 'Bob & Co' asserting the same.
What alternative solutions did you explore? (Optional)
Render-layer decode in each search row component — also valid and follows the MerchantCell.tsx precedent (Parser.htmlToText at line 37). Rejected here because the task-path analog in SearchUIUtils.ts:2592 shows this class of bug is already fixed at the data layer for tasks, so the expense-report branch should be consistent. One fix at the builder covers both row variants; two per-component fixes leave item.reportName encoded in the object for any future consumer.
Decoding in reportNameSelector or the Onyx-derived attributes — risky; reportNameSelector is shared across all report consumers, and decoding there would double-decode any site that already calls Parser.htmlToText on the derived value. Correctly rejected. The SearchUIUtils.ts fix is distinct: it touches only the search list-item builder, not any Onyx state.
Fixing computeReportName for the EXPENSE branch — would make the derived reportName decoded for all consumers of REPORT_ATTRIBUTES. Viable but a broader change than needed; the ReportPreviewHeader render-layer fix is narrower and safer for this surface.
Using Str.htmlDecode instead of Parser.htmlToText — Str.htmlDecode handles only a subset of entities; Parser.htmlToText strips markup and decodes the full entity set, which is the app-wide convention for report names (see MerchantCell.tsx:37, ReportUtils.ts:6916).
⚠️ @yusufdeveloper2903 Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
⚠️ @lorretheboy Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
⚠️ @aswin-s Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Proposal
What is the root cause of that problem?
The expense-report search list builds each report row by spreading the raw reportItem into reportIDToTransactions[reportKey]. That means reportName comes from reportItem.reportName as stored, with no display-time HTML entity decoding. The only later name override in this section is for IOU reports, so normal expense/invoice reports keep the raw encoded title.
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/libs/SearchUIUtils.ts#L2925-L2963
Both report-list row layouts render that raw value directly. The wide row passes item.reportName to the title TextCell, while the narrow row includes the same value in both its accessibility label and visible Text, so values like Financial Summary £ 2026 stay encoded.
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowWide.tsx#L149-L155
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowNarrow.tsx#L34-L64
MoneyRequestReportPreviewBody composes ReportPreviewHeader, and the header has the same display-normalization gap: it reads derivedReportName ?? iouReport?.reportName ?? '', falls back to action.childReportName, and renders the chosen string directly in Text.
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewBody.tsx#L135-L160
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L48-L50
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L101-L106
This is not a missing primitive. Other App surfaces already decode entity-encoded display strings with Str.htmlDecode(), including the workspace report-title settings path that shows the same kind of custom report title value.
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/pages/workspace/reports/WorkspaceReportsPage.tsx#L258-L258
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/pages/workspace/reports/ReportsDefaultTitle.tsx#L56-L57
What changes do you think we should make in order to solve the problem?
Decode report-name display values at the affected display boundaries using the existing Str.htmlDecode() helper.
In SearchUIUtils.getReportSections(), import Str from expensify-common and decode the final reportIDToTransactions[reportKey].reportName after the section item is assembled and after the existing IOU-report override has had a chance to set its generated name. That keeps the fix in the single data path consumed by both wide and narrow report-list rows, while ensuring the raw ...reportItem.reportName value is not what the UI renders.
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/libs/SearchUIUtils.ts#L2925-L2963
In ReportPreviewHeader, import Str, decode both the primary report-name candidate and the action.childReportName fallback, and render the decoded primary value or decoded fallback. This fixes the title shown inside MoneyRequestReportPreviewBody without changing carousel, amount, status, or action-button behavior.
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L48-L50
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L101-L106
I would keep the decode local to these report-name display paths instead of changing generic text components like TextCell, because those components render many unrelated columns and strings. This also avoids globally changing getReportName(), whose current responsibility is to select the derived/raw report name rather than normalize every consumer.
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/libs/ReportNameUtils.ts#L1109-L1114
Test coverage:
- Add a
tests/unit/Search/SearchUIUtilsTest.tscase for an expense report name containing entities such as&,',", and£, and assert the resulting expense-report section item'sreportNameis decoded. - Add/update
tests/ui/MoneyRequestReportPreview.test.tsxso the preview report name or fallback contains HTML entities, then assert the decoded title is visible and the raw encoded string is not rendered. - Manually verify the Reports page and money-request report preview with custom report titles containing
&,',",<...>,©, and numeric entities.
What alternative solutions did you explore? (Optional)
I considered decoding in getReportName() or the derived report-name selector, but that would affect many unrelated consumers that expect the helper/selector to only choose a name source. A local display-boundary decode is enough for the reported components and has a smaller blast radius.
I also considered decoding in TextCell or directly inside both row components, but that would either affect non-title table columns or duplicate the same title formatting across wide and narrow layouts. Decoding the report-name value where the expense-report section item is assembled keeps both row layouts fixed through one path, while the preview header still handles its separate title source.
[Updated] I refined the proposal above with a deeper root-cause analysis and the full set of affected call sites.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Report names that contain HTML entities (&, ', ", …) render verbatim as raw escaped text instead of the characters they represent (&, ', "). This affects the Search expense-report list — both the wide/table row and the narrow/mobile row — and the report title in the money request report preview card.
What is the root cause of that problem?
Report names are persisted HTML-encoded, and the app's convention is to decode them with Parser.htmlToText(...) at the moment they're rendered as plain text (e.g. ReportUtils.ts#L6916). These three components sit on two display paths where that step is missing.
1. The Search expense-report rows never decode reportName.
getReportSections builds the expense-report list item by spreading the raw snapshot report, so the encoded reportName passes straight through:
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/libs/SearchUIUtils.ts#L2925-L2926
Both rows then render it as plain text — the wide row into the title TextCell:
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowWide.tsx#L149-L156
and the narrow row into a Text, which also folds the same raw value into its accessibility label at line 34:
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowNarrow.tsx#L58-L63
This is clearly a gap and not a choice: the task branch of the very same builder already decodes its reportName before handing it off — the expense-report branch just never got the same treatment:
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/libs/SearchUIUtils.ts#L2592
2. The preview title is encoded on all three of its fallback branches.
MoneyRequestReportPreviewBody owns no text of its own — it delegates the title to ReportPreviewHeader, which resolves it as derivedReportName ?? iouReport?.reportName ?? '' and renders reportName || action.childReportName:
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L48-L50
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewHeader.tsx#L101-L106
It's worth confirming the derived name isn't already decoded — it isn't. derivedReportName comes from computeReportName, and for an expense/IOU report that function returns the report's own reportName untouched (only report-action–derived names are run through Parser.htmlToText):
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/libs/ReportNameUtils.ts#L1113
So derivedReportName, iouReport?.reportName, and the action.childReportName fallback are all encoded — which is why the entities survive to the screen, and why the fix has to cover the whole displayed expression, not just reportName.
What changes do you think we should make in order to solve the problem?
Decode at the two points where the encoded value converges, so the presentational components stay untouched and every consumer benefits.
Search rows — decode once in getReportSections. After the list item is assembled, and after the IOU-name override runs (so a generated IOU name and a user-supplied name normalise the same way):
https://github.com/Expensify/App/blob/c08357c28df65dc97e10baa17b3bf022058b47a8/src/libs/SearchUIUtils.ts#L2961-L2963
set the name through the same helper the task branch uses:
reportIDToTransactions[reportKey].reportName = StringUtils.lineBreaksToSpaces(Parser.htmlToText(reportIDToTransactions[reportKey].reportName ?? ''));
Parser and StringUtils are already imported in this file. This one change fixes the wide row, the narrow row, the narrow accessibility label, and title-column sorting (which compares the same value) — none of which a render-site patch fully covers.
Preview — decode the resolved title in ReportPreviewHeader. Because all three branches are encoded, decode the final displayed expression rather than a single branch:
{
Parser.htmlToText(reportName || action.childReportName || '');
}
ReportPreviewHeader only needs to import Parser from @libs/Parser. Parser.htmlToText('') returns '', so the existing empty-string fallbacks are preserved, and the call is idempotent on names with no entities, so nothing already-plain regresses.
What specific automated tests would you use to prevent this bug from reappearing in the future?
Render each component with a reportName of Bob & Co and assert the visible text is Bob & Co:
ExpenseReportListItemRowWide— the title cell.ExpenseReportListItemRowNarrow— both the visibleTextand theaccessibilityLabel.ReportPreviewHeader— including a case wherereportNameis empty so the title falls through to an encodedaction.childReportName, to lock in that the fallback branch is decoded too.
What alternative solutions did you explore? (Optional)
- Decode inside the leaf components (
TextCell, the narrowText). Rejected:TextCellis a generic cell reused for report IDs and paid-status text that are not HTML-encoded, so decoding there applies an unrelated transform to unrelated data, and it would still leave the narrow accessibility label and the title sort operating on the encoded string. - Normalise
reportNamecentrally at the Onyx / derived-attributes layer. Cleaner in theory, but the derived name is also consumed by paths that expect the HTML form (markup renderers), so decoding it centrally risks double-decoding and regressions well outside this issue. Decoding at the two display-path boundaries keeps the blast radius proportionate to the bug.
⚠️ @KJ21-ENG Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
⚠️ @dilshodmackbook-sketch Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.