Skip to content

[Phase 2 of #66427, sub-pr 3/5] Migrate deprecatedGetReportName → getReportName in libs files - #97068

Open
hoangzinh wants to merge 2 commits into
Expensify:mainfrom
hoangzinh:refactor/66427-phase2-sub3-libs
Open

[Phase 2 of #66427, sub-pr 3/5] Migrate deprecatedGetReportName → getReportName in libs files#97068
hoangzinh wants to merge 2 commits into
Expensify:mainfrom
hoangzinh:refactor/66427-phase2-sub3-libs

Conversation

@hoangzinh

@hoangzinh hoangzinh commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Part of #66427. Phase 2, Sub-PR 3 of 5 Sub-PR 3 — migrate deprecatedGetReportName → getReportName per directory src/libs/**

Next step:

  • Sub-PR 4 — migrate deprecatedGetReportName → getReportName per directory src/pages/** + tests.
  • Final Sub-PR 5 — delete deprecatedGetReportName; the compiler proves zero callers remain and its baseline rows go to zero.

Fixed Issues

$ #66427
PROPOSAL: #66427 (comment)

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

1. Create New Task - Share destination

  1. Open any report
  2. Assign new task
  3. Verify "Share" destination shows the correct name

2. Copy report preview message

  1. Open a workspace expense chat.
  2. Select any expense and open it.
  3. Copy the report preview message.
  4. Paste it and verify the text matches the copied content.

3. Search

  1. Open the search box
  2. Add filters such as type:chat, type:task, and in:.
  3. Verify the report name is correct for each filter.

4. LHN

  1. Open a 1:1 DM, a group chat, a workspace room (#room), and a workspace expense chat.
  2. Verify the report name shown in LHN is correct.
  • 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.
  • 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

Recording.2026-07-27.232226.mp4

…ame across libs

Migrate call sites off deprecatedGetReportName to the new getReportName
signature, which takes the precomputed report name string directly
instead of the full reportAttributes map.
@hoangzinh hoangzinh changed the title refactor(reportName): replace deprecatedGetReportName with getReportN… [Phase 3 of #66427, sub-pr 3/5] Migrate deprecatedGetReportName → getReportName in libs files Jul 27, 2026
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
src/libs/ModifiedExpenseMessage.ts 90.63% <100.00%> (ø)
src/libs/OptionsListUtils/index.ts 86.84% <100.00%> (ø)
src/libs/ReportUtils.ts 86.20% <100.00%> (+0.01%) ⬆️
src/libs/SearchQueryUtils.ts 87.24% <100.00%> (+0.01%) ⬆️
src/libs/SearchUIUtils.ts 64.51% <100.00%> (+0.25%) ⬆️
src/libs/SidebarUtils.ts 80.41% <100.00%> (+0.02%) ⬆️
src/libs/actions/Task.ts 64.36% <100.00%> (+0.10%) ⬆️
...fication/LocalNotification/BrowserNotifications.ts 0.00% <0.00%> (ø)
... and 197 files with indirect coverage changes

@hoangzinh hoangzinh changed the title [Phase 3 of #66427, sub-pr 3/5] Migrate deprecatedGetReportName → getReportName in libs files [Phase 2 of #66427, sub-pr 3/5] Migrate deprecatedGetReportName → getReportName in libs files Jul 27, 2026
@hoangzinh
hoangzinh force-pushed the refactor/66427-phase2-sub3-libs branch from 7eeeb71 to 81edfb5 Compare July 27, 2026 15:56
@hoangzinh
hoangzinh marked this pull request as ready for review July 27, 2026 16:59
@hoangzinh
hoangzinh requested review from a team as code owners July 27, 2026 16:59
@melvin-bot
melvin-bot Bot requested review from DylanDylann and JmillsExpensify and removed request for a team and JmillsExpensify July 27, 2026 16:59
@melvin-bot

melvin-bot Bot commented Jul 27, 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 removed the request for review from a team July 27, 2026 16:59
Comment thread src/libs/actions/Task.ts
return {
icons: ReportUtils.getIcons(report, formatPhoneNumber, translate, personalDetails, FallbackAvatar),
displayName: deprecatedGetReportName(report, reportAttributes),
displayName: getReportName(report, report?.reportID ? reportAttributes?.[report.reportID]?.reportName : undefined),

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.

We shouldn't pass reportAttributes in getShareDestination anymore; passing a reportName should be enough. With this reafctor, we need to avoid subscribing to the entire reportAttributes at the component level

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants