Skip to content

[Hold E/App #104080] [Resizable columns] Reset columns button - #103353

Closed
war-in wants to merge 5 commits into
Expensify:mainfrom
software-mansion-labs:war-in/resizable-table-columns-reset
Closed

war-in wants to merge 5 commits into
Expensify:mainfrom
software-mansion-labs:war-in/resizable-table-columns-reset

Conversation

@war-in

@war-in war-in commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds a "Reset columns" action to the table Display menu, shown only once a column of that table was resized. It drops that table's entry from the tableColumnWidths Onyx key, so columns go back to content-sized widths. The Display button now also shows for resized tables with no sortable columns.

Fixed Issues

$
PROPOSAL:

Tests

  1. On web (wide layout) with the resizableTableColumns beta enabled, go to Workspaces > pick a workspace > Members
  2. Click "Display" in the table filter bar
  3. Verify that the menu shows only "Sort by" and no "Reset columns" item
  4. Close the menu, then drag the right edge of the "Member" column header right by ~150px and release
  5. Click "Display" again
  6. Verify that a "Reset columns" item with a rotate-left icon appears below "Sort by"
  7. Click "Reset columns"
  8. Verify that the menu closes, every column goes back to its default width, and "Display" no longer lists "Reset columns"
  9. Refresh the page
  10. Verify that the columns still use their default widths

  1. On web (wide layout) with the resizableTableColumns beta enabled, widen the "Member" column on a workspace's Members page
  2. Go to the same workspace's Taxes page and widen the "Name" column
  3. Go back to Members, click "Display" > "Reset columns"
  4. Verify that the Members columns go back to their default widths
  5. Go to the Taxes page
  6. Verify that the widened "Name" column keeps its dragged width and "Display" still lists "Reset columns" there

  1. Open the Members page of a workspace on a narrow layout (mWeb or a narrowed desktop browser window) and on native
  2. Click "Display" (if shown)
  3. Verify that no "Reset columns" item appears, since resizing is off on narrow layout and native
  • Verify that no errors appear in the JS console

Offline tests

  1. On web (wide layout) with the resizableTableColumns beta enabled, widen the "Member" column on a workspace's Members page
  2. Go offline
  3. Click "Display" > "Reset columns"
  4. Verify that the columns go back to their default widths right away (widths are stored locally per device, no API call is made)

QA Steps

Same as tests

  • 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.
  • 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

@codecov

codecov Bot commented Oct 7, 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/index.ts 95.90% <ø> (ø)
src/components/Table/Table.tsx 92.50% <100.00%> (+0.04%) ⬆️
src/components/Table/TableContext.tsx 63.63% <ø> (ø)
...ble/TableFilterBar/TableDisplaySettingsTrigger.tsx 95.23% <100.00%> (ø)
src/components/Table/TableFilterBar/index.tsx 96.77% <100.00%> (+0.10%) ⬆️
src/libs/actions/TableColumnWidths.ts 100.00% <100.00%> (+100.00%) ⬆️
...FilterBar/TableDisplaySettingsPopoverComponent.tsx 1.61% <0.00%> (-0.03%) ⬇️
... and 15 files with indirect coverage changes

@war-in war-in changed the title [Resizable columns] Reset columns button [HOLD #102774][Resizable columns] Reset columns button Oct 7, 2026
war-in added 2 commits October 9, 2026 16:12
…ble-columns-reset

# Conflicts:
#	src/components/Table/Table.tsx
#	src/components/Table/TableContext.tsx
@war-in war-in changed the title [HOLD #102774][Resizable columns] Reset columns button [Resizable columns] Reset columns button Oct 9, 2026
@war-in

war-in commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

@codex review
@claude review
@MelvinBot review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T11:42:42.192917Z 2483242 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MelvinBot

Copy link
Copy Markdown
Contributor

Review

The change looks correct and is ready to merge. I found no blocking bugs. CI is green except Check independent approval, which needs a reviewer approval.

What I checked

  • Onyx.merge(..., {[id]: null}) drops only that table's entry. Your new test covers this.
  • After a reset, the new resolvedColumnWidths clear any live CSS widths through useLiveColumnWidths. The columns repaint at their default widths with no leftover drag state.
  • resetColumnWidths is undefined on narrow and native layouts. The trigger can't show "Reset columns" where sorting is locked by layout.
  • search.resetColumns and the RotateLeft icon already exist. The CompactMenuContext wrapper matches the Search DisplayPopup.

Optional suggestion

  • "Reset columns" can show when no visible column is resized. Table.tsx:442 checks whether any width is stored. All workspaces share one Members ID, and the custom-field columns show only in some workspaces (WorkspaceMembersTable/index.tsx:105-128). So if you widen customField1 in workspace A, workspace B shows "Reset columns", and clicking it changes nothing on screen. To fix this, show the item only when a stored key is in resizableColumnKeys.
  • shouldShowTableDisplaySettingsTrigger has a new canResetColumnWidths branch but no test. A small test for "no sortable columns + resized → shown" would protect it.

view run

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 2483242768

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@trjExpensify

Copy link
Copy Markdown
Contributor

@Expensify/design I think this one is potentially confusing with the existing "Reset columns" button that exists in the columns menu. 🤔

If we're planning to add a "Reset" for all display options in the popover, I wonder if this is required? There will be this shortcut as well on the table: #103354

@shawnborton

Copy link
Copy Markdown
Contributor

What if we just changed the name to be "Reset column sizes"? That feels more clear to me.

I'm not exactly sure what you mean by your comment, but double-clicking to reset a column would indeed reset its size - but I guess you would have to double-click every single column you adjusted to go back to the starting point, which doesn't seem ideal.

@dannymcclain

Copy link
Copy Markdown
Contributor

What if we just changed the name to be "Reset column sizes"? That feels more clear to me.

I like this idea 🤷

@trjExpensify

Copy link
Copy Markdown
Contributor

I'm not exactly sure what you mean by your comment

We plan to add a "Reset" button in the Display menu popover to reset all display options that have been customised back to the default.

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

Do others do this. I'm aware the double-click on header which I like, and I see the point of reseting across the board but it just feels a bit weird to have this option so quickly out of the gate!?

Another option could be adding it to the freeze menu thing we're doing but that's quickly filling up

@shawnborton

shawnborton commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

We plan to add a "Reset" button in the Display menu popover to reset all display options that have been customised back to the default.

I'd be super down to just consolidate here - this button would reset the visible columns as well as their sizes. That seems like a very simple approach.

Another option could be adding it to the freeze menu thing we're doing but that's quickly filling up

Oh that's a good shout. Totally agree, it's getting long, but it does seem quite appropriate there. And I guess we'd only show the row if the column was actually resized, so maybe it won't impact a majority of the cases.

@war-in

war-in commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

the freeze menu thing

👀 Is it already a thing, or is it just being worked on at the moment? I can put the button there if you think it's the right place, but to me it feels super intuitive to have that reset in the "Display" pill
Happy to code any option you decide!

@dannymcclain

Copy link
Copy Markdown
Contributor

I'm aligned with Shawn and Jon here - happy to consolidate or eventually add that option to the Column Context Menu™

it's getting long, but it does seem quite appropriate there. And I guess we'd only show the row if the column was actually resized, so maybe it won't impact a majority of the cases

Agree with your point about conditionally showing it. Also, another point for the more compact context menu items 🙃😁

@dubielzyk-expensify

dubielzyk-expensify commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

I've put it in the Freeze mocks (E/App issue to be created soon) and I think it works quite fine tbh:

image

I don't think we need to separate resetting a single column vs all, but curious what the others think

@shawnborton

Copy link
Copy Markdown
Contributor

Nice, that works for me - down to start with the simple approach of resetting all.

@war-in

war-in commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Great! I'll leave the PR in draft until the Freeze menu is implemented then
Do you need help with the Freeze menu implementation? 👀

@JS00001

JS00001 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@war-in I'll ping you in the freeze cols issue once we get it created!

@dannymcclain

Copy link
Copy Markdown
Contributor

Agree - that looks great! I'm totally onboard starting with just a reset all since you can reset a single column size with a double-click 👍

@trjExpensify trjExpensify changed the title [Resizable columns] Reset columns button [Hold E/App #104080] [Resizable columns] Reset columns button Oct 26, 2026
@war-in

war-in commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #106711, which moves the reset into the column heading menu (Spend first, built on the shared column resize controller so other tables can reuse it).

@war-in war-in closed this Nov 12, 2026
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.

7 participants