Skip to content

fix: differentiate icons for custom and standard export formats#88157

Open
samranahm wants to merge 5 commits intoExpensify:mainfrom
samranahm:88096/update-custom-export-template-icon
Open

fix: differentiate icons for custom and standard export formats#88157
samranahm wants to merge 5 commits intoExpensify:mainfrom
samranahm:88096/update-custom-export-template-icon

Conversation

@samranahm
Copy link
Copy Markdown
Contributor

@samranahm samranahm commented Apr 16, 2026

Explanation of Change

Fixed Issues

$ #88096

Tests

  1. Add custom export templates and include IS export template
  2. Open Reports page > FIlters > "Exported to"
  3. Verify any custom export template has table-pencil icon and standard export templates has simple table icon
  4. Select any template > Save > View Results and press Exported to: Valuebutton next to search input
  5. Verify the icons for Custom and Standard export templates
  6. Press Display > Edit columns > Select "Exported to" > Save
  7. Check icon cell in "Exported to" column and verify Custom export templates and Standard templates have different icon
  8. Open the expense report > Press "More" in report header > Export
  9. Verify the icons based on step 3
  • Verify that no errors appear in the JS console

Offline tests

Same as test

QA Steps

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

  • 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 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • 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 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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.Native.mp4
Android: mWeb Chrome
Android.mWeb.Chrome.mp4
iOS: Native
IOS.Native.mp4
iOS: mWeb Safari
IOS.mWeb.Safari.mp4
MacOS: Chrome / Safari
macOS.Chrome.mp4

@samranahm samranahm requested review from a team as code owners April 16, 2026 21:49
Copilot AI review requested due to automatic review settings April 16, 2026 21:49
@melvin-bot
Copy link
Copy Markdown

melvin-bot bot commented Apr 16, 2026

@aimane-chnaif 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]

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates export-related UI to visually distinguish standard export templates from custom templates by using a dedicated “table-pencil” icon for custom templates across search filters, bulk actions, and report export menus.

Changes:

  • Added a new TablePencil SVG asset and wired it into the lazy expensify icon chunk.
  • Updated export template pickers/menus (search filters, bulk actions, report header) to choose Table vs TablePencil based on whether the template is standard.
  • Updated the “Exported to” search list cell to render the new icon for template-based exports.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersExportedToPage.tsx Chooses Table vs TablePencil for export template filter items.
src/hooks/useSelectedTransactionsActions.ts Differentiates icon per export template in selected-transactions export options.
src/hooks/useSearchBulkActions.ts Differentiates icon per export template in bulk export options.
src/components/Search/SearchList/ListItem/ExportedIconCell.tsx Adds rendering for custom-template export icon in the “Exported to” column.
src/components/Search/FilterDropdowns/ExportedToSelectPopup.tsx Chooses Table vs TablePencil in exported-to multi-select popup items.
src/components/MoneyReportHeader.tsx Differentiates icon per export template in report header export menu.
src/components/Icon/chunks/expensify-icons.chunk.ts Registers TablePencil in the expensify icon bundle.
assets/images/table-pencil.svg New icon asset used for custom export templates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 23 to +24
let isExportedToCsv = false;
let isExportedToCustomTemplate = false;
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

isExportedToCsv is no longer updated from report actions, which can break any later logic that depends on it (including displaying the standard "table" icon). Also, isExportedToCustomTemplate is set for any CONST.EXPORT_TEMPLATE action, but doesn’t distinguish standard vs custom templates, so standard exports may be misclassified. Consider deriving standard-vs-custom from a stable field on the original message (e.g., template name/id) and set separate flags (e.g., isExportedToStandardTemplate vs isExportedToCustomTemplate), or restore updating isExportedToCsv if that’s the intended “standard export” signal.

Copilot uses AI. Check for mistakes.
Comment on lines 40 to +45
const message = getOriginalMessage(action);
const label = message?.label;
const type = message?.type;
isExportedToCsv = isExportedToCsv || type === CONST.EXPORT_TEMPLATE;
if (type === CONST.EXPORT_TEMPLATE) {
isExportedToCustomTemplate = true;
}
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

isExportedToCsv is no longer updated from report actions, which can break any later logic that depends on it (including displaying the standard "table" icon). Also, isExportedToCustomTemplate is set for any CONST.EXPORT_TEMPLATE action, but doesn’t distinguish standard vs custom templates, so standard exports may be misclassified. Consider deriving standard-vs-custom from a stable field on the original message (e.g., template name/id) and set separate flags (e.g., isExportedToStandardTemplate vs isExportedToCustomTemplate), or restore updating isExportedToCsv if that’s the intended “standard export” signal.

Copilot uses AI. Check for mistakes.
Comment on lines +1023 to +1027
const isStandardTemplate =
template.templateName === CONST.REPORT.EXPORT_OPTIONS.EXPENSE_LEVEL_EXPORT || template.templateName === CONST.REPORT.EXPORT_OPTIONS.REPORT_LEVEL_EXPORT;
exportOptions.push({
text: template.name,
icon: expensifyIcons.Table,
icon: isStandardTemplate ? expensifyIcons.Table : expensifyIcons.TablePencil,
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

Standard-template detection logic is now duplicated (and implemented slightly differently) across multiple call sites (here, MoneyReportHeader, and useSelectedTransactionsActions, while the search filter pages use STANDARD_EXPORT_TEMPLATE_ID_TO_DISPLAY_LABEL). To reduce drift and ensure new “standard” templates don’t get missed, consider centralizing this into a shared helper (e.g., isStandardExportTemplate(templateName)), or reusing a single source of truth consistently.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
...rc/components/Icon/chunks/expensify-icons.chunk.ts 0.00% <ø> (ø)
src/components/MoneyReportHeader.tsx 0.00% <0.00%> (ø)
...ts/Search/SearchList/ListItem/ExportedIconCell.tsx 57.69% <50.00%> (-0.65%) ⬇️
src/hooks/useSearchBulkActions.ts 41.09% <0.00%> (-0.14%) ⬇️
src/hooks/useSelectedTransactionsActions.ts 76.14% <33.33%> (-0.60%) ⬇️
...s/Search/FilterDropdowns/ExportedToSelectPopup.tsx 3.70% <0.00%> (-0.15%) ⬇️
...dvancedFiltersPage/SearchFiltersExportedToPage.tsx 0.00% <0.00%> (ø)
... and 24 files with indirect coverage changes

@dannymcclain
Copy link
Copy Markdown
Contributor

Videos are looking good to me 👍

@flaviadefaria
Copy link
Copy Markdown
Contributor

Is there a reason why we're not making this change in the Export menu in other parts of the product -- such as the bulk actions menu? Am I missing something?

image

@trjExpensify
Copy link
Copy Markdown
Contributor

Are all of those default templates?

@dannymcclain
Copy link
Copy Markdown
Contributor

We should be updating it everywhere any of these options show up.

@samranahm
Copy link
Copy Markdown
Contributor Author

Is there a reason why we're not making this change in the Export menu in other parts of the product -- such as the bulk actions menu?

@flaviadefaria we implemented this change in bulk action as well.

screen_1776444830931.mp4

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.

5 participants