Skip to content

[NoQA][Insights] Add a Handled by table to the Efficiency dashboard - #107409

Draft
OlGierd03 wants to merge 10 commits into
Expensify:mainfrom
software-mansion-labs:@OlGierd03/Insights-Efficiency-Handled-By-Table
Draft

OlGierd03 wants to merge 10 commits into
Expensify:mainfrom
software-mansion-labs:@OlGierd03/Insights-Efficiency-Handled-By-Table

Conversation

@OlGierd03

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #106935

Tests

Offline tests

QA Steps

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 verified any copy / text that was added to the app 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 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 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

@expensify-chore-bot

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@github-actions

Copy link
Copy Markdown
Contributor

It looks like this PR adds a search filter or column. Please double check the following:

  • The filter is available in the Search filters dropdown and returns the expected results.
  • The filter has a matching column that can be shown through Display > Edit columns.
  • The column can be sorted by clicking its header.
  • Export > Current view includes the column in the exported CSV.

…03/Insights-Efficiency-Handled-By-Table

# Conflicts:
#	src/CONST/index.ts
#	src/libs/DateUtils.ts
#	src/libs/SearchQueryUtils.ts
#	src/pages/Insights/charts/InsightsChartWidget.tsx
#	src/pages/Insights/charts/InsightsRankingTable.tsx
#	src/pages/Insights/charts/InsightsRankingTableRow.tsx
#	src/types/onyx/SearchResults.ts
@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

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 Δ
src/CONST/SENTRY_LABEL.ts 100.00% <ø> (ø)
src/CONST/index.ts 96.37% <ø> (ø)
...h/SearchList/ListItem/TransactionGroupListItem.tsx 84.50% <ø> (ø)
src/components/Search/SearchList/ListItem/types.ts 20.00% <ø> (-80.00%) ⬇️
src/components/Search/hooks/useGroupedItems.ts 92.30% <100.00%> (ø)
src/libs/DateUtils.ts 92.77% <100.00%> (-1.60%) ⬇️
src/libs/PolicyUtils/approvals.ts 96.81% <100.00%> (+0.02%) ⬆️
src/libs/SearchParser/searchParser.js 89.35% <ø> (-0.13%) ⬇️
src/libs/SearchQueryUtils.ts 92.95% <100.00%> (-0.06%) ⬇️
src/pages/Insights/InsightsChangeBadge.tsx 100.00% <100.00%> (ø)
... and 18 more
... and 7495 files with indirect coverage changes

@OlGierd03

OlGierd03 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@dannymcclain @JmillsExpensify I've got two small UI questions about this PR.

  1. For Compare: Previous period, the issue description says: "It follows Top violations, with one difference: chips are gray in both directions, because more automation isn't good or bad on its own." However, the Figma mocks (and the ones in the issue description) show colored chips that follow the Top violations colors. Which way should we go here? Here's a comparison to make the choice easier (using mocked data, as the BE isn't ready yet):
Screenshot 2026-11-27 at 17 35 23 Screenshot 2026-11-27 at 17 26 41
  1. Neither the mocks nor the issue description covers how the Setup rows should behave when Compare is set to Previous period. The issue says the Setup button should be in the Average time column and the text should be visible in the Share and Report columns. With Previous period selected, there is one more column at the right end of the table. Should everything shift one column to the right, should the Change column stay empty or is some other behavior expected? Comparison (mocked data):
Screenshot 2026-11-27 at 17 22 58 Screenshot 2026-11-27 at 17 22 05 Screenshot 2026-11-27 at 17 18 22

@OlGierd03

Copy link
Copy Markdown
Contributor Author

@JmillsExpensify @dannymcclain One more question actually 😄 For rows with no value in the % change column, should we show the dash placeholder like the Top Violations chart does or leave the cell empty as in the mocks?

Comparison:

Screenshot 2026-11-27 at 17 56 45 Screenshot 2026-11-27 at 17 56 19

@dannymcclain

Copy link
Copy Markdown
Contributor

For Compare: Previous period, the issue description says: "It follows Top violations, with one difference: chips are gray in both directions, because more automation isn't good or bad on its own." However, the Figma mocks (and the ones in the issue description) show colored chips that follow the Top violations colors. Which way should we go here?

This might be my bad for mocking it up with the colored badges. Happy to lean on @JmillsExpensify for this one. If we do stick with the colored badges, I would think that more automation is positive/green, and less automation is negative/orange (currently it looks like it's opposite that). But again, if Jason thinks we should remove the opinionated colors from these that's totally good with me.

Neither the mocks nor the issue description covers how the Setup rows should behave when Compare is set to Previous period. The issue says the Setup button should be in the Average time column and the text should be visible in the Share and Report columns.

For these, I don't even really think of the setup rows as having columns—so your very last screenshot:

image

looks right to me. Basically I think we want the Source to line up properly at the beginning, then have the middle section just span the whole entire table, with the Create button to the far right. I would love to avoid wrapping that text as much as we possibly can. Does that make sense?

One more question actually 😄 For rows with no value in the % change column, should we show the dash placeholder like the Top Violations chart does or leave the cell empty as in the mocks?

Happy to defer to Jason on this one as well—it looks a little cleaner without anything there, but it also kinda makes sense to follow the convention we've established elsewhere for this. I'm happy to go either way TBH.

…fficiency-Handled-By-Table

# Conflicts:
#	src/CONST/index.ts
#	src/pages/Insights/charts/InsightsRankingTable.tsx
#	src/pages/Insights/charts/InsightsRankingTableRow.tsx
#	src/pages/Insights/dashboardSpecs.ts
#	src/pages/Insights/insightsQueries.ts
@OlGierd03

Copy link
Copy Markdown
Contributor Author

This might be my bad for mocking it up with the colored badges. Happy to lean on @JmillsExpensify for this one.

Happy to defer to Jason on this one as well—it looks a little cleaner without anything there, but it also kinda makes sense to follow the convention we've established elsewhere for this.

@JmillsExpensify what's your take on the chip colors and the empty % change cells?

…fficiency-Handled-By-Table

# Conflicts:
#	src/pages/Insights/InsightsDashboard.tsx
#	src/pages/Insights/charts/InsightsChartWidget.tsx
…fficiency-Handled-By-Table

# Conflicts:
#	src/CONST/index.ts
#	src/languages/en.ts
#	src/pages/Insights/InsightsDashboard.tsx
#	src/pages/Insights/charts/InsightsChartWidget.tsx
#	src/pages/Insights/dashboardSpecs.ts
#	src/pages/Insights/insightsQueries.ts

This branch has not been deployed

No deployments
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