Skip to content

Keep multi-level tags in spreadsheet order and disable sorting - #103541

Merged
marcochavezf merged 1 commit into
mainfrom
claude-multiLevelTagsKeepSpreadsheetOrder
Oct 12, 2026
Merged

marcochavezf merged 1 commit into
mainfrom
claude-multiLevelTagsKeepSpreadsheetOrder

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Multi-level tag levels should keep the order from the imported spreadsheet, and admins should not be able to re-sort them. The Tags table was sorting them A–Z on open and let admins re-sort them with the Name / Count headers and Display > Sort by.

Changes in src/components/Tables/WorkspaceTagsTable/index.tsx:

  • Name is sortable: !isMultiLevelTags, and Count (multi-level only) is sortable: false. With no sortable column, the existing shouldShowTableDisplaySettingsTrigger hides the Display button on wide and narrow layouts.
  • initialSortColumn is only set to name for single-level tags. With no sort column, the sorting middleware returns the rows unchanged, so multi-level levels render in the orderWeight order that getTagLists already produces. The comparator is left as-is (point 3 of the proposal was dropped per the C+ request).
  • The <Table> gets a key based on isMultiLevelTags. useSorting reads initialSortColumn only on mount, so this remount prevents a stale Name sort when a policy switches between single- and multi-level tags.

Single-level tags keep their current behavior.

Note for QA: this intentionally reverses the expected result of #94505 for multi-level tags (Name sorting on independent multi-level tags is now disabled by design).

Added UI tests in tests/ui/WorkspaceTagsTest.tsx for independent multi-level tags imported as Charlie, Bravo, Alpha: rows stay in that order, Name/Count headers are disabled, and Display is hidden on wide and narrow layouts. The new tests fail on main (rows come back alphabetical) and pass with this change.

Fixed Issues

$ #103082
PROPOSAL: #103082 (comment)

Tests

Same as QA Steps

  • Verify that no errors appear in the JS console

Offline tests

Same as QA Steps

QA Steps

Prerequisite:

  • have a non-sorted multi-level tags CSV
  • workspace Tag feature is enabled
  1. Go to the workspace Tags page and import the CSV
  2. Verify the parent tag list is not sorted alphabetically (the order stays the same as in the CSV)
  3. Verify the Name and Count columns are not sortable
  • 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 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
web.mp4

Co-authored-by: Bernhard Owen Josephus <bernhardoj@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team October 8, 2026 23:26
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Oct 8, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I created this PR from an upstream branch since I don't have push access to your fork.

To take ownership of this branch and be able to push updates, run:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-multiLevelTagsKeepSpreadsheetOrder
git checkout -b claude-multiLevelTagsKeepSpreadsheetOrder upstream/claude-multiLevelTagsKeepSpreadsheetOrder
git push -u origin claude-multiLevelTagsKeepSpreadsheetOrder

Then you can close this PR and open a new one from your fork.

@MelvinBot

MelvinBot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ✅ pass

Multi-level tag levels keep spreadsheet import order (Charlie, Bravo, Alpha) and are not sortable in Workspace > Tags on narrow Android layout; the Display/sort control is correctly hidden there, while a regression check confirms single-level tags still sort alphabetically with Display available.
Display popover showing Sort by Name Ascending

Step Status
Imported CSV levels show in spreadsheet order (Charlie, Bravo, Alpha), not alphabetical (Alpha, Bravo, Charlie)The Tags page listed Charlie, Bravo, Alpha right after import, and kept that order after a full app restart.
Tags page showing Charlie, Bravo, Alpha in import order
Same order persisted after app restart
✅
Tapping the Name column header does not re-sort the list (narrow layout)On the phone-width layout, the header row shows only the table title ("Tags"), so there is no Name header to tap. The order stayed Charlie, Bravo, Alpha throughout.
No Name/Count column headers visible in narrow layout, order unchanged
✅
Tapping the Count column header does not re-sort the list (narrow layout)The Count column does not render on narrow layouts. The tag count shows only as non-interactive "3 Tags" subtitle text, and the order stayed Charlie, Bravo, Alpha.
Count shown only as subtitle text, not a sortable column
✅
Display (Sort by) button is hidden on the multi-level Tags pageNo Display button appeared. The More menu showed only Settings, Import spreadsheet, and Download CSV, with no sort option.
More dropdown has no Display/sort option
✅
Regression: single-level tags still sort by name (A–Z) and Display/sort control remains availableIn a second workspace with single-level tags, tags added as Zebra, Mango, Apple were listed as Apple, Mango, Zebra. The Display button was present and opened "Sort by: Name • Ascending".
Single-level tags sorted A-Z with Display button
Display popover showing Sort by Name Ascending
✅

view run · view recording

@MelvinBot

MelvinBot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

I could not import the multi-level tags CSV on Web because the web test tool cannot upload files, so steps 1–4 are untested (blocked, not failed). The single-level regression check passed: Name still sorts A–Z, the Name header is sortable, and Display is available.
Single-level tags sorted Z-A after clicking the Name header, with Display button visible

Step Status
After multi-level tags CSV import, Tags table shows levels in spreadsheet order (Charlie, Bravo, Alpha)Not tested. Setup reached Workspace > Tags > Import > Multi-level tags > Import spreadsheet (after upgrading to Control), but the web test tool cannot set a file on the "Choose file" input, so no CSV was imported.
⚠️
Clicking Name column header does not re-sort multi-level tags; header not sortableNot tested. This step depends on the blocked CSV import.
⚠️
Clicking Count column header does not re-sort multi-level tags; header not sortableNot tested. This step depends on the blocked CSV import.
⚠️
Display button is hidden on the Tags page for multi-level tagsNot tested. This step depends on the blocked CSV import.
⚠️
Regression: single-level tags still sort A-Z by Name, Name header still sortable, Display button availableTags added as Zebra, Apple, Mango were listed as Apple, Mango, Zebra. Clicking the Name header reversed them to Zebra, Mango, Apple and showed a sort arrow. The Display button stayed visible.
Single-level tags sorted Z-A after clicking the Name header, with Display button visible
✅
No errors in the JS console during the flowNot confirmed. The web test tool cannot read the JS console. No error banners, crash screens, or broken renders appeared during sign-in, onboarding, plan upgrade, or tag changes.
⚠️

view run · view recording

@bernhardoj

Copy link
Copy Markdown
Contributor

@MelvinBot Add this to QA Steps
Prerequisite:

  • have a non-sorted multi-level tags CSV
  • workspace Tag feature is enabled
  1. Go to the workspace Tags page and import the CSV
  2. Verify the parent tag list is not sorted alphabetically (the order stays the same as in the CSV)
  3. Verify the Name and Count columns are not sortable

Add "Same as QA Steps" for Tests and Offline Tests

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I updated the PR description:

  • QA Steps: added your prerequisites and steps 1–3.
  • Tests and Offline tests: set to "Same as QA Steps".

I removed the TODO placeholders and kept the "Verify that no errors appear in the JS console" checkboxes from the template.


view run

@bernhardoj

Copy link
Copy Markdown
Contributor

@MelvinBot Replace the PR Author Checklist section with below

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.

and Screenshots/Videos section with below

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mp4

Then, check all Verify that no errors appear in the JS console.

Last, mark this PR as ready for review. You can do it!!

@MelvinBot
MelvinBot marked this pull request as ready for review October 9, 2026 00:46
@MelvinBot
MelvinBot requested a review from a team as a code owner October 9, 2026 00:47
@melvin-bot
melvin-bot Bot requested a review from bernhardoj October 9, 2026 00:47
@melvin-bot

melvin-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

@bernhardoj 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]

@melvin-bot
melvin-bot Bot requested review from trjExpensify and removed request for a team October 9, 2026 00:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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-09T00:49:57.498835Z 91bcd82 Draft marked ready
ℹ️ 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 Author

Done. I updated the PR description and marked this PR ready for review:

  • Replaced the PR Author Checklist with your checked version.
  • Replaced Screenshots/Videos and added your video under MacOS: Chrome / Safari.
  • Checked both "Verify that no errors appear in the JS console" boxes (Tests and QA Steps).

No unchecked boxes are left in the description.


view run

@bernhardoj

bernhardoj commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • 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 verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • 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).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mp4

@melvin-bot
melvin-bot Bot requested a review from marcochavezf October 9, 2026 00:51

@trjExpensify trjExpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks for taking care of it! 👍

@marcochavezf
marcochavezf merged commit db32364 into main Oct 12, 2026
54 of 56 checks passed
@marcochavezf
marcochavezf deleted the claude-multiLevelTagsKeepSpreadsheetOrder branch October 12, 2026 16:26
@github-actions

Copy link
Copy Markdown
Contributor

🚧 marcochavezf has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/marcochavezf in version: 9.5.8-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.8-5 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants