Skip to content

[Insights polish] [R6] Add a Handled by table to the Efficiency dashboard #106935

Open

Description

@JmillsExpensify

Background

The Efficiency dashboard shows how long reports take, but not who or what moves them along. Today a report can be submitted by a person, by an AI agent, or on a schedule by the workspace's Submissions setting, and approved by a person, by an agent, or by Auto-approve compliant reports. #645498 keeps agents and rules out of the ranking graphs, so those graphs rank people only.

Admins can't see how much of their workflow is already automatic, or how much faster it is. Agents in particular are invisible on the dashboard, even when they handle a large share of reports.

This issue adds a Handled by table to the Efficiency dashboard, above the ranking graphs. It splits the reports in a stage between people, each AI agent, and rules, with each one's share, reports, and average time. A selector switches between the approve and submit stages. On a workspace without an agent, it offers to set one up.

Product and design details

Desktop, Approve, a workspace with agents, Compare: Previous period

image

Mobile Example:

image

Desktop, Submit, Compare: Previous period

image

Desktop, Approve, a workspace without agents, Compare off

image

Mobile Example

image

Desktop, Approve, a workspace without agents OR rules, Compare off

image

Layout

  • The table is a full-width card after Workflow efficiency and Average processing time, and before the ranking graphs (Time to submit, Time to approve, Time to pay). The page reads from overall time, to time by stage, to who handles each stage, to time by person.
  • On mobile, the graphs stack in the same order.
  • The card header has the Handled by title, a stage selector, and Explain. Like the other Efficiency graphs, it has no ⋮ menu.
  • The table follows Top violations ([Due for payment 2026-11-25] [Insights polish] [R4] Replace the Top violations donut with a table of up to 15 violations #106841): it runs edge to edge in the card, has a fixed sort, and has no tooltips.

Stage selector

  • The selector reuses the control from the ranking graphs (#). The options are Approve (the default) and Submit.
  • When no workspace in the Date range has Approvals on, Approve isn't offered and the card shows Submit.
  • Agents can't pay reports yet, so there's no Pay option.

Rows

Row Name Line beneath
People People, with the Users icon none
Each AI agent The agent's name and avatar AI agent
Rules Rules, with the Bolt (lightning) icon, as on the workspace Rules page The setting: Auto-approve compliant reports for Approve, Submissions for Submit

Each report counts once, in one row. An AI agent is an account with an @expensify.ai login.

Stage People An agent Rules
Approve A person approved at least one of its steps No person approved it, and its final approval came from that agent No person or agent approved it
Submit A person submitted it That agent submitted it on the employee's behalf The Submissions setting submitted it on its schedule
  • Rows are sorted by Reports, most first, and the Reports header shows a down arrow. Headers aren't clickable.
  • A row with no reports in the Date range is hidden, apart from the setup rows below.

Columns

Column Contents
Source The row's name and line beneath
Share A green400 bar, then the row's reports as a share of all reports that finished the stage in the Date range, to one decimal place, e.g. 40.8%. The bar works the same as in Top violations. Rows add up to 100%.
Reports Reports that finished the stage in the Date range
% change Only with Compare: Previous period.
Average time The stage's average time: submission to final approval for Approve, creation to submission for Submit. Under 1 day it's in hours, e.g. 2.4 hours, and below 0.1 hours it reads <0.1 hours. Otherwise it's in days, e.g. 4.2 days.

Setup rows

These rows only show when the Workspace filter is one workspace and the person is an admin of it. They always sit at the bottom of the table, with — in Share and Reports, and a button in Average time.

Row Shows when Line beneath Button
AI agent, with the Bot icon The workspace has no agent Approve reports in minutes, not days for Approve, Submit reports as soon as they're ready for Submit Set up, which opens the workspace's Agents page (/workspaces/<policyID>/agents)
Rules The stage's setting is off The setting's name Turn on, which opens Auto-approve compliant reports on the Rules page, or the Submissions tab of the Workflows page

Comparing

  • Compare: Previous period adds the % change column right after Reports, showing the change in Reports from the previous period, e.g. ↑ 40%. It follows Top violations, with one difference: chips are gray in both directions, because more automation isn't good or bad on its own.
  • Compare: Average adds nothing, because an average across people, agents, and rules doesn't mean anything.
  • Average time always shows, whatever Compare is set to. It's the row's time in the Date range, not a comparison.

Clicking and states

  • Rows aren't clickable for now. # makes agent rows open that agent's Details panel.
  • While loading, the table shows the existing skeleton table rows.
  • With no reports in the stage in the Date range, and no setup rows to show, the card shows the existing empty state.

Mobile

The table becomes a list, following Top violations on mobile:

  • Each row shows the name with <N> reports · <Share> beneath it, e.g. 168 reports · 40.8%. Under Compare: Previous period, the change chip sits right after the count, e.g. 168 reports ↑ 40% · 40.8%. On Rules and agent rows, the row's line beneath (from Rows) comes first, so these rows have two lines.
  • Average time is on the right.
  • A full-width Share bar with a gray track sits beneath each row.
  • Setup rows show their line beneath and their button on the right, with no bar.
Issue OwnerCurrent Issue Owner: @OlGierd03

Activity

  1. added
    Weekly
    Improvement
    Internal
    on Nov 14, 2026
  2. daledah commented on Nov 17, 2026

    @daledah
    Contributor

    Assigning myself to review all [R6] issues, as discussed with truph

  3. self-assigned this
    on Nov 17, 2026
  4. OlGierd03 commented on Nov 19, 2026

    @OlGierd03
    Contributor

    I'm working on this one

  5. JmillsExpensify commented on Nov 19, 2026

    @JmillsExpensify
    ContributorAuthor

    Sounds good. You're assigned.

  6. dannymcclain commented on Nov 19, 2026

    @dannymcclain
    Contributor

    Just updated the mocks in the issue description with where Jason and I landed. (Figma)

  7. OlGierd03 commented on Nov 26, 2026

    @OlGierd03
    Contributor

    @luacmartins I'm working on the Handled by table in #107409 and it needs new data from GetInsights.

    For the request, in the draft PR FE already send:

    • a new handledBy graph in insightsHashes, with the same three hashes as the other graphs. The table doesn't show an average, so FE doesn't read the averageSnapshotHash snapshot
    • a new handledByStages next to insightsHashes, the same way as violationStages:
    "handledByStages": {"handledBy": "approve"}

    For the handledBy graph, we need a new handled-by group by over the reports that finished the stage from handledByStages, with the Date range on anyApproval for approve and on anySubmission for submit.

    For the response, we need one group per source, with a handledBy field (plus accountID for agents):

    "group_people": {"handledBy": "people", "count": 168, "percentOfTotal": 57.9, "averageDuration": 216000, "total": 420000, "currency": "USD"},
    "group_12345": {"handledBy": "agent", "accountID": 12345, "count": 87, "percentOfTotal": 30, "averageDuration": 240, "total": 150000, "currency": "USD"},
    "group_rules": {"handledBy": "rules", "count": 35, "percentOfTotal": 12.1, "averageDuration": 2, "total": 40000, "currency": "USD"}

    The table relies on:

    • count as reports, with each report in one group following the Rows table in the issue
    • a separate group for each agent and the agents in personalDetailsList for the name
    • the same group keys in every period, so % change can match each group with its previous value

    For the Share column, we need a share of reports, but percentOfTotal follows the amount. I'd lean towards basing it on count for this group-by, but working it out on the FE from the counts is also an option. What would you prefer?

    For Explain, I believe it should know which stage the table shows, so I'd add handledByStage to insightsScope, like we already do with violationStage for Compliance.

    Let me know if I missed anything here

  8. OlGierd03 commented on Nov 26, 2026

    @OlGierd03
    Contributor

    One more thing on the request: I tried sending the handledBy graph without averageSnapshotHash, since the table doesn't use the average and GetInsights returned an error for the whole dashboard. Would it make sense to make that hash optional for this graph or should FE keep sending it and ignore the snapshot?

  9. JmillsExpensify commented on Nov 26, 2026

    @JmillsExpensify
    ContributorAuthor

    @luacmartins for when you're next online ^^

  10. mhawryluk commented on Nov 27, 2026

    @mhawryluk
    Member

    One more thing on the request: I tried sending the handledBy graph without averageSnapshotHash, since the table doesn't use the average and GetInsights returned an error for the whole dashboard. Would it make sense to make that hash optional for this graph or should FE keep sending it and ignore the snapshot?

    while we're at it, I think we could drop the required averageSnapshotHash across the board. the only chart that uses it is Top tags (btw is it on purpose that Top tags shows the average different than all the other charts?)

  11. luacmartins commented on Nov 30, 2026

    @luacmartins
    Contributor

    I have a draft BE PR for this https://github.com/Expensify/Auth/pull/27379

  12. luacmartins commented on Nov 30, 2026

    @luacmartins
    Contributor

    while we're at it, I think we could drop the required averageSnapshotHash across the board. the only chart that uses it is Top tags (btw is it on purpose that Top tags shows the average different than all the other charts?)

    @mhawryluk Yes, that’s intentional. In Compare: Average, Top tags compares each tag with its own historical average. For example, Travel is compared with average Travel spend across prior periods. The other Spend rankings use one shared average across all groups in the selected period. That’s why Top tags still needs to send averageSnapshotHash. The other charts can omit it once the Auth change is deployed.

  13. luacmartins commented on Dec 1, 2026

    @luacmartins
    Contributor

    @JmillsExpensify We can build Handled by from existing report history, but some Instant Submit reports are recorded the same way as manual submissions. Are we ok counting those under People for now? Counting them under Rules will require additional data storage in the DB.

  14. JmillsExpensify commented on Dec 1, 2026

    @JmillsExpensify
    ContributorAuthor

    Yeah, that's fine. In fact, it's even technically right too. I would count Instant Submit as a manual submission and then just sit on this consideration until we get pulled in a different direction by customers.

  15. added
    Reviewing
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ImprovementInternalReviewingWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions