Skip to content

Add Tag GL code column to expense tables#93146

Merged
deetergp merged 20 commits into
Expensify:mainfrom
mukhrr:fix/92692
Jul 1, 2026
Merged

Add Tag GL code column to expense tables#93146
deetergp merged 20 commits into
Expensify:mainfrom
mukhrr:fix/92692

Conversation

@mukhrr

@mukhrr mukhrr commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Added Tag GL code column into Spend Expenses table and also fixed 3 bugs: missing Posted column even if selected, not proper aligning of table columns when all columns are enabled and keep selected columns visible in Expenses, Report and Report layout tables even if there are no related data.

Fixed Issues

$ #92692
PROPOSAL: #92692 (comment)

Tests

  1. On Web with wide layout, sign in with a workspace whose tags have GL codes (Workspace > Tags > tag > GL code).
  2. Go to Spend > Expenses, open Display > Edit columns, select Tag GL code, and save.
  3. Verify the column appears and shows the GL code for expenses whose tag has one, e.g. Engineering -> 1234.
  4. Tag an expense with multi-level tags and verify all levels' GL codes render in one comma-separated cell in tag list order, e.g. 1234, 5678 (levels without a GL code are skipped).
  5. Verify the column stays visible when selected even if no visible row has a tag GL code.
  6. Open an expense report's details > Columns, select Tag GL code, and verify it renders in the report table.
  7. Click the Tag GL code header in the report view and verify rows sort by it.
  8. On the Expenses page, verify the Tag GL code header is also sortable

Bug 1:
1.Enable all columns in Spend Expenses page

  • Verify that all columns are correctly aligned under their respective header cells, with no misaligned values.

Bug 2:
Precondition:
• Have an expense with a card and posted data

  1. Go to Spend Expenses page
  2. Click Edit columns
  3. Enable Posted column
  • Verify you see Posted column

Bug 3:

  1. Enable all columns in Expenses, Reports and Report layout
  • Verify all selected columns are visible

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

The 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

web specific

Android: mWeb Chrome

web specific

iOS: Native

web specific

iOS: mWeb Safari web specific
MacOS: Chrome / Safari
web.mp4
image

@mukhrr mukhrr requested review from a team as code owners June 10, 2026 04:39
@melvin-bot

melvin-bot Bot commented Jun 10, 2026

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 ts-node ./scripts/generateTranslations.ts --help

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

@melvin-bot melvin-bot Bot requested a review from ahmedGaber93 June 10, 2026 04:39
@melvin-bot

melvin-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

@ahmedGaber93 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 flaviadefaria and removed request for a team June 10, 2026 04:39
@mukhrr

mukhrr commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@flaviadefaria can you psl help translations here? thanks!

2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf369fb7d2

ℹ️ 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".

Comment thread src/libs/PolicyUtils.ts Outdated
@mukhrr mukhrr marked this pull request as draft June 10, 2026 10:16
@OSBotify

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index 004db83ddbf..b78a32ea526 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -510,6 +510,7 @@ const translations: TranslationDeepObject<typeof en> = {
         avatar: 'Avatar',
         editor: 'Editor',
         restrictions: 'Beschränkungen',
+        tagGLCode: 'GL-Code taggen',
     },
     socials: {
         podcast: 'Folgen Sie uns auf Podcast',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index e4a328f60f1..63405a6b0ec 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -461,6 +461,7 @@ const translations: TranslationDeepObject<typeof en> = {
         enterDigitLabel: ({digitIndex, totalDigits}: {digitIndex: number; totalDigits: number}) => `introducir dígito ${digitIndex} de ${totalDigits}`,
         editor: 'Editor',
         restrictions: 'Restricciones',
+        tagGLCode: 'Etiquetar código GL',
     },
     socials: {
         podcast: 'Síguenos en Podcast',
@@ -1753,7 +1754,6 @@ const translations: TranslationDeepObject<typeof en> = {
                 }
             },
             [CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_MARK_AS_DONE]: (actor, actorType, _eta, _etaType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que <strong>tú</strong> lo marques como listo.`;
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index e0730417322..ed47c95f768 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1,6 +1,7 @@
 /**
  *   _____                      __         __
  *  / ___/__ ___  ___ _______ _/ /____ ___/ /
+ * / (_ / -_) _ \/ -_) __/ _ \`/ __/ -_) _  /
  * \___/\__/_//_/\__/_/  \_,_/\__/\__/\_,_/
  *
  * This file was automatically generated. Please consider these alternatives before manually editing it:
@@ -509,6 +510,7 @@ const translations: TranslationDeepObject<typeof en> = {
         avatar: 'Avatar',
         editor: 'Éditeur',
         restrictions: 'Restrictions',
+        tagGLCode: 'Taguer le code GL',
     },
     socials: {
         podcast: 'Suivez-nous sur Podcast',
@@ -862,7 +864,7 @@ const translations: TranslationDeepObject<typeof en> = {
         beginningOfChatHistory: (users: string) => `Cette discussion est avec ${users}.`,
         beginningOfChatHistoryPolicyExpenseChat: (workspaceName: string, submitterDisplayName: string) =>
             `C’est ici que <strong>${submitterDisplayName}</strong> soumettra des dépenses à <strong>${workspaceName}</strong>. Utilisez simplement le bouton +.`,
-        beginningOfChatHistoryPolicyExpenseChatTrack: 'C\u2019est ici que vous suivrez vos dépenses',
+        beginningOfChatHistoryPolicyExpenseChatTrack: 'C’est ici que vous suivrez vos dépenses',
         beginningOfChatHistorySelfDM: 'Ceci est votre espace personnel. Utilisez-le pour vos notes, tâches, brouillons et rappels.',
         beginningOfChatHistorySystemDM: 'Bienvenue ! Procédons à la configuration.',
         chatWithAccountManager: 'Discutez avec votre gestionnaire de compte ici',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 0bcfe100b1a..cb997878077 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -510,6 +510,7 @@ const translations: TranslationDeepObject<typeof en> = {
         avatar: 'Avatar',
         editor: 'Editor',
         restrictions: 'Restrizioni',
+        tagGLCode: 'Tag codice GL',
     },
     socials: {
         podcast: 'Seguici su Podcast',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index a8aa877efee..f7a69da39c9 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -509,6 +509,7 @@ const translations: TranslationDeepObject<typeof en> = {
         avatar: 'アバター',
         editor: '編集者',
         restrictions: '制限',
+        tagGLCode: 'GL コードにタグを付ける',
     },
     socials: {
         podcast: 'ポッドキャストでフォロー',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 03489a7baa6..a83e6a82d9c 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -509,6 +509,7 @@ const translations: TranslationDeepObject<typeof en> = {
         avatar: 'Avatar',
         editor: 'Editor',
         restrictions: 'Beperkingen',
+        tagGLCode: 'GL-code labelen',
     },
     socials: {
         podcast: 'Volg ons op Podcast',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 4a435537338..37bab197aed 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -509,6 +509,7 @@ const translations: TranslationDeepObject<typeof en> = {
         avatar: 'Avatar',
         editor: 'Edytor',
         restrictions: 'Ograniczenia',
+        tagGLCode: 'Oznacz kod GL',
     },
     socials: {
         podcast: 'Śledź nas na Podcast',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index efbc57066e8..5a14ce3edc2 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -508,6 +508,7 @@ const translations: TranslationDeepObject<typeof en> = {
         avatar: 'Avatar',
         editor: 'Editor',
         restrictions: 'Restrições',
+        tagGLCode: 'Marcar código GL',
     },
     socials: {
         podcast: 'Siga-nos no Podcast',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 277fba54252..99454c103db 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -505,6 +505,7 @@ const translations: TranslationDeepObject<typeof en> = {
         avatar: '头像',
         editor: '编辑',
         restrictions: '限制',
+        tagGLCode: '标记总账代码',
     },
     socials: {
         podcast: '在播客上关注我们',

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

@mukhrr mukhrr marked this pull request as ready for review June 21, 2026 08:09
@mukhrr

mukhrr commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

@ahmedGaber93 PR is ready to review. Though we need BE help asked here so that sorting for new Tag QL code works

@mukhrr

mukhrr commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@ahmedGaber93 I think we are good to preceed. BE is deployed

@mukhrr

mukhrr commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

To be more precise, here is RCA:

Symptom: Sorting by a column where every row is empty (Posted / Approved / Withdrawal ID) changes the row order, and ascending vs descending produce different orders. Expected: no effect, identical for both.

Root cause: the transaction sort adds a secondary tie-breaker that re-sorts tied rows by created, then transactionIDpassing the user's sortOrder:

App/src/libs/SearchUIUtils.ts

Lines 3975 to 3986 in 241d30f

if (primaryComparison !== 0) {
return primaryComparison;
}
// If we have a tie in the primary comparison, we add a tie breaker on date and/or transactionID as a last resort to make the sort deterministic
const createdComparison = compareValues(a.created, b.created, sortOrder, 'created', localeCompare);
if (createdComparison !== 0) {
return createdComparison;
}
return compareValues(a.transactionID, b.transactionID, sortOrder, 'transactionID', localeCompare);

compareValues returns 0 when both values are empty, so for an all-empty column every primary comparison ties → the whole order is decided by that tie-breaker. Because it honors sortOrder, ascending orders the rows by date-ascending and descending by date-descending — hence the table reorders and flips between directions.

Why the report view is unaffected: its sort has no tie-breaker — it returns the primary compareValues directly and lets the stable Array.sort keep ties in place:

return compareValues(
getTransactionSortValue(a, sortBy, report, policy, policyCategories),
getTransactionSortValue(b, sortBy, report, policy, policyCategories),
sortOrder,
sortBy,
localeCompare,
true,
);
});

Introduced by: commit fac3dcefab9 "add tie breaker" in PR #77800 (Reimbursable/Billable columns) — added so low-cardinality (boolean) columns get a deterministic within-group order:

fac3dce

Fix (FE): drop the sortOrder-dependent tie-breaker and return the primary comparison — the stable sort preserves ties, so an all-empty column becomes a true no-op, identical for asc/desc, and consistent with the report view.

@ahmedGaber93

ahmedGaber93 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@mukhrr Let's ignore this for now since it also reproduces on staging (#93146 (comment)), and the scope has become much bigger (we fix 3 issues on th PR)

@ahmedGaber93

Copy link
Copy Markdown
Contributor

Bug: Sort by Tag GL code not work on expense report

@mukhrr Not fixed yet, I am still able to reproduce

Screen.Recording.2026-06-29.at.4.34.25.AM.mov

@mukhrr

mukhrr commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@mukhrr Let's ignore this for now since it also reproduces on staging (#93146 (comment)), and the scope has become much bigger (we fix 3 issues on th PR)

@trjExpensify in that case, can you pls create another issue on this #93146 (comment) and assign me and @ahmedGaber93 ?! thanks!

@mukhrr

mukhrr commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Bug: Sort by Tag GL code not work on expense report

@mukhrr Not fixed yet, I am still able to reproduce

Screen.Recording.2026-06-29.at.4.34.25.AM.mov

@ahmedGaber93 ah that's expected. You enabled "Group by Category" and sorting works inside each category
image

@melvin-bot melvin-bot Bot requested review from JS00001 and deetergp June 29, 2026 05:41
JS00001
JS00001 previously approved these changes Jun 29, 2026
@trjExpensify

Copy link
Copy Markdown
Contributor

@MelvinBot create an issue based on this comment, assign it to @mukhrr @ahmedGaber93 @JS00001 and @trjExpensify.

@deetergp

Copy link
Copy Markdown
Contributor

@mukhrr You've got some merge conflicts

@mukhrr

mukhrr commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@mukhrr You've got some merge conflicts

@deetergp resolved

@mukhrr

mukhrr commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Hmm.. the failing tests aren't related.

@deetergp deetergp merged commit e548372 into Expensify:main Jul 1, 2026
41 of 43 checks passed
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

OSBotify commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/deetergp in version: 9.4.26-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

📝 Help site docs review

Yes — a help site update is needed. This PR adds a new Tag GL code column to the Spend Expenses and Reports tables (selectable via Display > Edit columns / the Columns icon). The help article Using Spend in New Expensify lists the available columns and already documents Category GL code, but not the new Tag GL code.

I created a draft PR adding Tag GL code to that column list, using the exact UI label:

📄 Draft PR: #95084

What changed

In docs/articles/new-expensify/reports-and-expenses/Using-Reports-in-New-Expensify.md, added right after the existing Category GL code entry:

  • Tag GL code – The general ledger (GL) code from the expense's tag

Also added Tag GL code / Category GL code to the article keywords for discoverability.

The other changes in this PR (Bug 1–3 column-alignment/visibility fixes, the Posted column fix) are UI-behavior bug fixes that don't change any documented steps, so no additional docs updates are required for them.

The HelpDot label is applied. I attempted to assign the draft PR to mukhrr but GitHub rejected it (not an assignable collaborator) — please self-assign on #95084.


@mukhrr, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

@OSBotify

OSBotify commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.4.27-2 🚀

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants