Skip to content

Keep angle brackets in the Search in label for reports with no parent action - #102840

Merged
Gonals merged 2 commits into
mainfrom
claude-searchInLabelAngleBrackets
Oct 6, 2026
Merged

Gonals merged 2 commits into
mainfrom
claude-searchInLabelAngleBrackets

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

The "Search in" suggestion ran the report name through Parser.htmlToText whenever the report's parent action was not a comment. A report with no parent action (for example, a group chat) also matched that check, so a user-typed name like `< >` had < > stripped as if it were an HTML tag.

This PR:

  • Adds the same !!reportAction && guard that SearchAutocompleteList.tsx already uses, so only threads whose parent is a system message get HTML-parsed.
  • Looks up the parent action from contextualReport directly. Before, it came from a variable that was undefined when the report wasn't in recent reports, so system-message threads outside recent reports would have shown raw HTML once the new guard was in place.
  • Applies the same guard to the Members page subtitle in DynamicRoomMembersPage.tsx, which had the identical unguarded check.
  • Adds tests/ui/SearchRouterContextualSuggestionTest.tsx covering a report with no parent action, a comment-thread, and a system-message thread.

Fixed Issues

$ #102388
PROPOSAL: #102388 (comment)

Tests

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  1. Open the New Dot app.
  2. Create a new group chat via FAB (+) > Start chat, and add at least 2 participants.
  3. Set the group name to `< >` and create the group.
  4. Inside that group chat, click the Search button.
  5. Verify the "Search in" suggestion shows `< >` with the angle brackets, not just the backticks.
  6. Click the "Search in" suggestion and verify the search query keeps `< >`.
  7. Open any 1:1 chat, click the Search button, and verify the "Search in" suggestion shows the chat name correctly.
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Co-authored-by: DylanDylann <DylanDylann@users.noreply.github.com>
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Oct 2, 2026
@MelvinBot
MelvinBot requested a review from a team October 2, 2026 07:43
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I created this PR from an upstream branch since I don't have push access to your fork.

To take ownership of this branch and be able to push updates, run:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-searchInLabelAngleBrackets
git checkout -b claude-searchInLabelAngleBrackets upstream/claude-searchInLabelAngleBrackets
git push -u origin claude-searchInLabelAngleBrackets

Then you can close this PR and open a new one from your fork.

AI tests run locally: npm run typecheck ✅, npm run lint-changed ✅, npm run spell-changed ✅, npm run fmt ✅, React Compiler check on the two changed source files ✅, and the new tests/ui/SearchRouterContextualSuggestionTest.tsx plus both existing SearchAutocompleteListTest suites ✅ (25/25). The new "no parent action" test fails without the fix. I couldn't verify in the browser because the test session loaded a blank page.

@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
...rc/components/Search/SearchRouter/SearchRouter.tsx 72.83% <100.00%> (+0.41%) ⬆️
src/pages/DynamicRoomMembersPage.tsx 0.00% <0.00%> (ø)
... and 67 files with indirect coverage changes

@MelvinBot

MelvinBot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ✅ pass

The "Search in" suggestion for a group chat named &lt; &gt; now shows the full name with the angle brackets. Clicking it keeps &lt; &gt; in the search query. The PR's Tests section is still a TODO, so I ran the reproduction steps from the linked issue.
Search query field after clicking the suggestion

Step Status
1. Open New Dot and sign inFinished onboarding (skipped work email, chose "Something else", set a name) and landed on the signed-in Home screen.
✅
2. Create a group chat via FAB (+) > Start chatOpened the FAB, chose Start chat, added melvintestuser1@gmail.com and melvintestuser2@gmail.com, then went to the group creation screen.
✅
3. Set the group name to &lt; &gt; and create the groupEntered &lt; &gt; as the group name, confirmed the field held that exact value, and created the group. The chat header and inbox row both show &lt; &gt;.
Group chat header and inbox list showing the group name
✅
4. Click the Search button inside the groupThe Search router opened with "Search in &lt; &gt;" as the top suggestion.
✅
5. Check and click the "Search in" suggestionThe suggestion reads "Search in &lt; &gt;" with the angle brackets intact, not just the backticks. After clicking it, the search input shows type:chat in:"&lt; &gt;".
Search in suggestion with angle brackets intact
Search query field after clicking the suggestion
✅

view run · view recording

@DylanDylann

Copy link
Copy Markdown
Contributor

@MelvinBot Please fill the QA steps

@DylanDylann

Copy link
Copy Markdown
Contributor

@MelvinBot Mark this PR as ready for review

@MelvinBot

MelvinBot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ✅ pass

On Android, the "Search in" suggestion for a group chat named &lt; &gt; shows the full name with the angle brackets. Tapping it keeps &lt; &gt; in the search query. The PR's Tests section is still a TODO, so I ran the reproduction steps from the linked issue.
Search query field after tapping the suggestion

Step Status
1. Open New Dot and sign inSigned in, finished onboarding (name and "Something else" intent), and landed on the Home screen.
✅
2. Create a group chat via FAB (+) > Start chatOpened the FAB, tapped Start chat, selected melvintestuser1@gmail.com and melvintestuser2@gmail.com, then tapped Next to reach the group screen.
✅
3. Set the group name to &lt; &gt; and create the groupEntered &lt; &gt; as the group name, saved it, and tapped Start group. The chat header shows &lt; &gt;.
Group chat header showing the group name with angle brackets
✅
4. Tap the Search button inside the groupThe Search router opened with a "Search in" suggestion above Recent searches and Recent chats.
✅
5. Check and tap the "Search in" suggestionThe suggestion reads "Search in &lt; &gt;" with the angle brackets intact, not just the backticks. After tapping it, the search input shows type:chat in:"&lt; &gt;".
Search in suggestion with angle brackets intact
Search query field after tapping the suggestion
✅

view run · view recording

@DylanDylann

DylanDylann commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp Screenshot 2026-10-02 at 15 06 30
Android: mWeb Chrome Screenshot 2026-10-02 at 14 59 20
iOS: HybridApp Screenshot 2026-10-02 at 15 04 02
iOS: mWeb Safari Screenshot 2026-10-02 at 14 58 44
MacOS: Chrome / Safari Screenshot 2026-10-02 at 14 54 32

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I couldn't mark this PR as ready for review. This run doesn't have permission to change a PR's draft status, so the request was blocked.

To mark it ready yourself, click Ready for review at the bottom of the PR page.


view run

@melvin-bot

melvin-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

We did not find an internal engineer to review this PR, trying to assign a random engineer to #102388 as well as to this PR... Please reach out for help on Slack if no one gets assigned!

@melvin-bot
melvin-bot Bot requested a review from Gonals October 2, 2026 08:07
@DylanDylann

Copy link
Copy Markdown
Contributor

@MelvinBot Please fill the QA steps

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I filled in the QA Steps section of the PR description. Steps 1–6 are the reproduction steps from the linked issue. They passed on Web and Android in my earlier test runs. Step 7 is a regression check on a 1:1 chat.

I left the Tests section and the author checklist for you to complete.


view run

@DylanDylann

Copy link
Copy Markdown
Contributor

@Gonals All good to go. I can't ask Melvin to mark this PR as ready, and I'm also not able to do it myself. Could you please help mark it as ready and take a look? Thanks

@mountiny
mountiny marked this pull request as ready for review October 2, 2026 11:41
@mountiny
mountiny requested a review from a team as a code owner October 2, 2026 11:41
@melvin-bot
melvin-bot Bot requested review from DylanDylann and removed request for a team October 2, 2026 11:41
@melvin-bot

melvin-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot requested review from JmillsExpensify and removed request for a team October 2, 2026 11:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd311c5002

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

const icons = useMemoizedLazyExpensifyIcons(['Plus', 'RemoveMembers']);
const reportAction = useMemo(() => getReportAction(report?.parentReportID, report?.parentReportActionID), [report?.parentReportID, report?.parentReportActionID]);
const shouldParserToHTML = reportAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT;
const shouldParserToHTML = !!reportAction && reportAction.actionName !== CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Subscribe to the parent action before choosing title parsing

When a system-message thread is opened after its parent action is absent (the REPORT_ACTIONS collection is evictable in src/setup/index.ts:45-50), getReportAction() returns undefined. This useMemo is keyed only by the parent IDs, so it preserves that undefined value even if the action later arrives; the new guard then permanently renders the Members subtitle with raw HTML instead of the parsed system-message title. Read the parent action through useParentReportAction/useOnyx so the parsing decision updates when that collection hydrates.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MelvinBot Please fix this comment to use useOnyx

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in d8b02cf. The Members page now reads the parent action with useParentReportAction(report). That hook wraps useOnyx on the parent report's actions, so the subtitle re-parses when that collection loads. I also removed the unused getReportAction import: src/pages/DynamicRoomMembersPage.tsx:74.

Checks: the React Compiler check passes. Typecheck shows no errors in this file; the only errors are in react-native-gesture-handler files from this local environment. ESLint shows only 2 errors that were already on lines this change didn't touch.


view run

…tes when it loads

Co-authored-by: DylanDylann <DylanDylann@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner October 2, 2026 14:51
@melvin-bot
melvin-bot Bot requested review from stitesExpensify and removed request for a team October 2, 2026 14:52
@melvin-bot

melvin-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

@stitesExpensify Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@Gonals
Gonals merged commit 2aab445 into main Oct 6, 2026
44 of 46 checks passed
@Gonals
Gonals deleted the claude-searchInLabelAngleBrackets branch October 6, 2026 11:23
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚧 Gonals has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

OSBotify commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify OSBotify mentioned this pull request Oct 6, 2026
100 tasks done
@OSBotify

OSBotify commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/Gonals in version: 9.5.4-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site update is needed. This bug fix stops chat names with angle brackets (for example, `< >`) from losing characters in the "Search in" suggestion and the Members page subtitle. That's how users already expect it to work, and no help article describes the old behavior.


view run

@OSBotify

OSBotify commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.4-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants