Skip to content

[$175] Spend- From column Is missing when filtering by From is owner account #104247

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.13-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #102379
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 10 / Chrome
App Component: Search

Action Performed:

Precondition: Owner has some expenses submitted in his workspace. Has some expenses from other users.

  1. Go to Spend > Filter
  2. Open From filter> Select only Owner account
  3. Verify the options are displayed correctly
    Result: The From column is missing from the results when filtering by the owner account.
  4. Open From filter> Select another user account
    Result: The column from appears with Owner account and the selected user.

Expected Result:

The results should display the From column with the corresponding expense information when filtering by the owner account.

Actual Result:

The From column is missing from the results when filtering by the owner account, but when adding another user account in From filter, column From appears correctly.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7288122_1792155763126.bandicam_2026-10-16_07-45-31-442.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7288122

Upwork Automation - Do Not Edit

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 16, 2026
  2. applause-bot commented on Oct 16, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/a7637f48b01e44c6416ccd00f2e203b26564312bee705c7716b357811bb3b8da

  3. MelvinBot commented on Oct 16, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    On Spend > Expenses, the From column disappears when the From filter is set to only your own account.

    What is the root cause of that problem?

    The default column logic shows From only when at least one row has an actor other than you (SearchUIUtils.ts:6887-6892). Filtering from: to yourself makes every row yours, so From stays hidden. Adding another user brings in a row that isn't yours, so From comes back.

    This rule is intentional. It came from Auto show/hide columns depending on available data, but it does not consider an explicit from: filter.

    What changes do you think we should make in order to solve the problem?

    Always show From when the query has a from: filter. This follows the existing pattern for the Violations column (queryHasViolationFilter).

    1. In SearchQueryUtils.ts, add queryHasFromFilter(queryJSON). It returns true when flatFilters has a from key.
    2. Add a shouldShowFromColumn parameter to getColumnsToShow. Show From when it is true or when the existing other-actor check passes.
    3. Pass queryHasFromFilter(queryJSON) from useSearchColumnsToShow. For consistency, also pass it from useSearchOverlay, SortByPopup, and useSearchBulkActions.
    4. Add a unit test: all rows belong to the current user, From is hidden by default and shown with a from: filter.

    What alternative solutions did you explore? (Optional)

    Removing the "is it me" check would show From on every personal default view. That works against the intent of the auto-hide feature.

    Code references

    Note: This changes intended behavior. Product should confirm that an explicit from: filter should always show the From column.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/104247) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 16, 2026
  5. melvin-bot commented on Oct 16, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @linhvovan29546 (External)

  6. changed the title [-]Spend- From column Is missing when filtering by From is owner account[/-] [+][$175] Spend- From column Is missing when filtering by From is owner account[/+] on Oct 16, 2026
  7. melvin-bot commented on Oct 16, 2026

    @melvin-bot
  8. camesenin commented on Oct 16, 2026

    @camesenin
  9. melvin-bot commented on Oct 16, 2026

    @melvin-bot

    ⚠️ Unable to store contributor details

    Details
    Auth SetContributorDetails returned an error
    401 Contributor details already exist
    
  10. janiya2 commented on Oct 16, 2026

    @janiya2

    Contributor details
    Your Expensify account email: janithad2@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/janithad

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    In Spend > Search results, when a user explicitly filters by From and selects only their own account (or owner account), the From column disappears from the search results table. When another user account is added to the From filter, the From column reappears.

    What is the root cause of that problem?

    In src/libs/SearchUIUtils.ts (lines 6805–6808), the default dynamic column auto-hide logic determines whether to display the From column based on whether the transaction rows contain actors other than the current signed-in user:

    const accountID = reportAction?.actorAccountID;
    if (accountID && accountID !== currentAccountID) {
        columns[CONST.SEARCH.TABLE_COLUMNS.FROM] = true;
    }
    • By default, columns[CONST.SEARCH.TABLE_COLUMNS.FROM] is initialized to false (line 6590).
    • When a user filters by their own account (from:owner), every row in the result belongs to currentAccountID. As a result, the condition accountID !== currentAccountID is never satisfied, and the From column remains hidden (false).
    • While auto-hiding the From column makes sense on personal default views (where all expenses are implicitly yours), it fails to respect when a user has explicitly specified an active from: search filter.
    • There is already an established canonical pattern for this in the codebase: the Violations column uses queryHasViolationFilter(queryJSON) to guarantee that an explicit violation filter always keeps the Violations column visible (useSearchColumnsToShow.ts:48). However, no corresponding check exists for the From filter.

    What changes do you think we should make in order to solve the problem?

    Following the established pattern for queryHasViolationFilter:

    1. Add queryHasFromFilter in src/libs/SearchQueryUtils.ts:
    --- a/src/libs/SearchQueryUtils.ts
    +++ b/src/libs/SearchQueryUtils.ts
    @@ -700,6 +700,13 @@ function queryHasViolationFilter(queryJSON: SearchQueryJSON | undefined): boole
         );
     }
     
    +function queryHasFromFilter(queryJSON: SearchQueryJSON | undefined): boolean {
    +    if (!queryJSON?.flatFilters) {
    +        return false;
    +    }
    +    return queryJSON.flatFilters.some((filter) => filter.key === CONST.SEARCH.SYNTAX_FILTER_KEYS.FROM);
    +}
    +
     /**
      * Same meaning as queryHasViolationFilter, for the advanced-filters form `has` array rather than parsed query JSON.
      */
    @@ -3044,6 +3051,7 @@ export {
         doesQueryMatchDefaultFilterKeysAndType,
         queryHasViolationFilter,
    +    queryHasFromFilter,
         hasValuesIncludeViolationFilter,
     };
    1. Add shouldShowFromColumn parameter in src/libs/SearchUIUtils.ts (getColumnsToShow):
    --- a/src/libs/SearchUIUtils.ts
    +++ b/src/libs/SearchUIUtils.ts
    @@ -6380,6 +6380,7 @@ function getColumnsToShow({
         fallbackPolicyID,
         sortBy,
         shouldShowViolationsColumn = false,
    +    shouldShowFromColumn = false,
         isVendorColumnAvailable = true,
     }: {
    @@ -6399,6 +6400,7 @@ function getColumnsToShow({
         sortBy?: SearchSortBy;
         shouldShowViolationsColumn?: boolean;
    +    shouldShowFromColumn?: boolean;
         isVendorColumnAvailable?: boolean;
     }): SearchColumnType[] {
    @@ -6805,7 +6807,7 @@ function getColumnsToShow({
                 // Handle From&To columns that are only shown in the Reports page
                 // if From or To differ from current user in any transaction, show the columns
                 const accountID = reportAction?.actorAccountID;
    -            if (accountID && accountID !== currentAccountID) {
    +            if (shouldShowFromColumn || (accountID && accountID !== currentAccountID)) {
                     columns[CONST.SEARCH.TABLE_COLUMNS.FROM] = true;
                 }
    1. Pass shouldShowFromColumn from useSearchColumnsToShow.ts (and relevant Search callers):
    --- a/src/components/Search/hooks/useSearchColumnsToShow.ts
    +++ b/src/components/Search/hooks/useSearchColumnsToShow.ts
    @@ -9,7 +9,7 @@ import usePolicyForMovingExpenses from '@hooks/usePolicyForMovingExpenses';
    -import {isDefaultExpensesQuery, queryHasViolationFilter} from '@libs/SearchQueryUtils';
    +import {isDefaultExpensesQuery, queryHasFromFilter, queryHasViolationFilter} from '@libs/SearchQueryUtils';
     import {getColumnsToShow, getValidGroupBy} from '@libs/SearchUIUtils';
    @@ -48,6 +48,7 @@ function useSearchColumnsToShow(queryJSON: Readonly<SearchQueryJSON> | undefined
             fallbackPolicyID: policyForMovingExpensesID,
             sortBy: queryJSON?.sortBy,
             shouldShowViolationsColumn: queryHasViolationFilter(queryJSON),
    +        shouldShowFromColumn: queryHasFromFilter(queryJSON),
             isVendorColumnAvailable,
         });
     }

    (For complete consistency across the Search domain, also forward shouldShowFromColumn: queryHasFromFilter(queryJSON) in SortByPopup.tsx, useSearchOverlay.ts, and useSearchBulkActions.ts wherever shouldShowViolationsColumn is provided).

    What alternative solutions did you explore? (Optional)

    We explored unconditionally enabling the From column in default views even when all expenses belong to the signed-in user. However, that defeats the purpose of the auto-hide column optimization introduced in PR #68561 (which reduces visual noise when all displayed expenses belong to the user). Tying column visibility to shouldShowFromColumn: queryHasFromFilter(queryJSON) respects both user intent (when explicitly filtering) and clean default views.

    (Bonus architectural note: The To column has the mirror logic at line 6820. If product desires parity for recipient filtering as well, queryHasToFilter can be incorporated cleanly in the same manner).

    Tests

    Automated Tests:

    1. In tests/unit/Search/SearchQueryUtilsTest.ts:
      • Verify queryHasFromFilter(queryJSON) returns true when flatFilters contains key: CONST.SEARCH.SYNTAX_FILTER_KEYS.FROM.
      • Verify it returns false when no from filter is present.
    2. In tests/unit/Search/SearchUIUtilsTest.ts:
      • Verify that when mock data contains only transactions authored by currentAccountID:
        • With shouldShowFromColumn: false, the returned columns array does NOT include CONST.SEARCH.TABLE_COLUMNS.FROM.
        • With shouldShowFromColumn: true, the returned columns array DOES include CONST.SEARCH.TABLE_COLUMNS.FROM.

    Manual Verification:

    1. Sign in as a workspace owner who has submitted expenses in their workspace, alongside expenses from other members.
    2. Navigate to Search / Spend.
    3. Open Filters > From.
    4. Select ONLY the current user's (owner) account and apply.
    5. Verify: The From column is displayed in the search results table showing the owner's avatar/name.
    6. Open Filters > From and add another user account.
    7. Verify: The From column continues to be displayed correctly with both accounts.
    8. Clear the From filter and navigate back to the default "Expenses" search.
    9. Verify: Default auto-hide behavior remains intact when viewing only personal expenses without an explicit from: filter.
    10. Verify on Web, Desktop, iOS, and Android.
  11. melvin-bot commented on Oct 16, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  12. taieddie commented on Oct 16, 2026

    @taieddie

    Contributor details
    Your Expensify account email: taieddie8@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/~01e51b3f9ff738cf94

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    On Spend > Expenses, when filtering by the workspace owner or current user account in the From filter, the From column disappears from the search results table.

    What is the root cause of that problem?

    In src/libs/SearchUIUtils.ts:6889-6892, inside getColumnsToShow, the condition if (accountID && accountID !== currentAccountID) sets columns[CONST.SEARCH.TABLE_COLUMNS.FROM] = true.

    The auto-hide column logic (introduced in PR #68561) only displays the From column if at least one row belongs to an actor differing from currentAccountID. When a user explicitly filters by their own account (from: owner), every returned transaction matches accountID === currentAccountID. Because no differing actor exists, columns[CONST.SEARCH.TABLE_COLUMNS.FROM] remains false. It fails silently. The table suppresses the From column even though the user explicitly filtered on it.

    What changes do you think we should make in order to solve the problem?

    1. In src/libs/SearchQueryUtils.ts, add a helper queryHasUserFromFilter(queryJSON: SearchQueryJSON | undefined): boolean following the queryHasViolationFilter pattern:

      • Check that the query is not a default view (!isDefaultExpensesQuery(queryJSON)).
      • Inspect queryJSON?.flatFilters for groups matching group.key === CONST.SEARCH.SYNTAX_FILTER_KEYS.FROM.
      • Verify group.filters.some((filter) => filter.operator === CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO) to ensure the user has set an explicit positive equality filter.
      • This cleanly identifies explicit user from: filters while strictly ignoring default presets and negated filters (such as -from:).
    2. In src/libs/SearchUIUtils.ts, update getColumnsToShow:

      • Add an optional parameter shouldShowFromColumn: boolean = false to the parameters object, defaulting to false so callers without user search filters maintain backwards compatibility (useMoneyRequestReportColumns.ts, ReportDetailsColumnsPage.tsx).
      • At lines 6889-6892, update the From check to show the column when shouldShowFromColumn is true or when an actor differs:
        if (shouldShowFromColumn || (accountID && accountID !== currentAccountID)) { columns[CONST.SEARCH.TABLE_COLUMNS.FROM] = true; }
      • Explicit user custom column selections returning customResult take precedence and ignore shouldShowFromColumn, preserving user-configured columns.
    3. Thread shouldShowFromColumn to search callers:

    4. Unit Tests:

      • In tests/unit/Search/useSearchSnapshotTest.ts:71-74, update the @libs/SearchQueryUtils jest mock to include queryHasUserFromFilter: () => false so useSearchColumnsToShow invocations inside useSearchSnapshot tests pass without undefined function errors.
      • In tests/unit/Search/SearchUIUtilsTest.ts, add test cases verifying:
        • When all transactions belong to currentAccountID and shouldShowFromColumn is false, the From column is hidden (preserving auto-hide for default expense views).
        • When all transactions belong to currentAccountID and shouldShowFromColumn is true, the From column is shown.
        • Custom column selections returning customResult ignore shouldShowFromColumn and preserve the user's custom columns.
      • In tests/unit/Search/SearchQueryUtilsTest.ts, verify that queryHasUserFromFilter returns true for positive user-entered from:, and false for default queries (isDefaultExpensesQuery) or negated -from:.

    What alternative solutions did you explore? (Optional)

    Earlier proposals by @MelvinBot suggest simply checking flatFilters.from without checking filter operators or default provenance. MelvinBot misses negative filters like -from: and risks showing the From column on default views that inject from under the hood. MelvinBot also evaluates transactionsQueryJSON in grouped tables, causing member-grouped sub-tables to incorrectly force the From column. Deriving shouldShowFromColumn strictly from the parent currentSearchQueryJSON and validating positive equality in SearchQueryUtils resolves the issue cleanly across all search surfaces without regressions.

  13. 29 remaining items

  14. melvin-bot commented on Nov 4, 2026

    @melvin-bot

    @linhvovan29546 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  15. melvin-bot commented on Nov 4, 2026

    @melvin-bot

    @linhvovan29546 Still overdue 6 days?! Let's take care of this!

  16. sam5235 commented on Nov 4, 2026

    @sam5235
    Contributor

    @linhvovan29546 @trjExpensify I can reproduce this on staging, and I think I know why it doesn't show up for everyone.

    It only happens when the search has no saved column list, meaning there's no columns: in the URL. Once a column list is in the query, From shows even when you filter to yourself. Any account that has edited columns gets that list, and the app keeps reopening the last query, so it hides the bug.

    To see it on any account (needs at least one expense from another member):

    1. Open https://staging.new.expensify.com/search?q=type%3Aexpense directly. The From column shows.
    2. Filters > From > select only yourself > Apply. The From column disappears.
    3. Add the other member to the From filter. The From column is back.
    104247-repro-github.mp4

    I built the Paid column (#103956) and the expanded-group date column fix (#105307) in this code. I have the root cause and a small fix for this, and I'm happy to take it if it's opened up.

  17. melvin-bot commented on Nov 5, 2026

    @melvin-bot

    @linhvovan29546 Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  18. jeffrey-graham commented on Nov 7, 2026

    @jeffrey-graham
  19. melvin-bot commented on Nov 7, 2026

    @melvin-bot
  20. jeffrey-graham commented on Nov 7, 2026

    @jeffrey-graham
  21. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    @linhvovan29546 12 days overdue. Walking. Toward. The. Light...

  22. linhvovan29546 commented on Nov 10, 2026

    @linhvovan29546
    Contributor

    @MelvinBot Based on the discussion in this issue, would you like to update the proposal?

  23. MelvinBot commented on Nov 10, 2026

    @MelvinBot
    Contributor

    Updated proposal

    The product clarification changes the recommendation: keep dynamic column hiding; make the Columns selector reflect what the table actually displays. My earlier proposal to force From whenever a from: filter exists should be withdrawn.

    What is the root cause of that problem?

    Without an explicit columns: selection, the table intentionally hides From when every expense belongs to the signed-in user. Explicit column selections override that behavior, explaining why account history appeared to affect reproduction.

    The actionable problem is From being checked in the selector while hidden in the table, not dynamic hiding itself.

    However, current main already contains selector-seeding logic for loaded, ungrouped searches. Code inspection alone therefore does not establish a remaining bug in that path.

    Code evidence

    What changes do you think we should make in order to solve the problem?

    Preserve these behaviors:

    • Without saved columns, hidden From is unchecked but available to select.
    • Checking From and saving explicitly shows it, including for self-only results.
    • Saved column selections remain authoritative.

    Before proposing additional production changes, verify whether the reported mismatch persists with the existing implementation. Add regression coverage for self-only results, results containing another member, explicitly selecting From, and resetting columns. Keep grouped searches separate rather than copying their summary columns into the expense-column selector.

    What alternative solutions did you explore? (Optional)

    Forcing From for every from: filter would change behavior product explicitly accepted, so it is no longer recommended.

    Verification: Source inspection only; current browser behavior has not been verified. I would not recommend implementing the original proposal.


    view run

  24. linhvovan29546 commented on Nov 10, 2026

    @linhvovan29546
    Contributor

    @trjExpensify I re-tested on latest main with a fresh account. With From filtered to only the current user, the table hides From and the Columns page shows it unchecked. Adding another account to the filter brings the column back, and the Columns page shows it checked. So the selector already matches the table in both cases, and the mismatch I saw earlier doesn't reproduce anymore. What's left is the intentional auto-hide (#68561). Can we close this?

  25. trjExpensify commented on Nov 11, 2026

    @trjExpensify
    Contributor

    Yep, thanks!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions