Repository navigation
Make Category GL code and Tag GL code columns inline-editable in Spend - #101670
Conversation
…Spend Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
|
To take ownership of the branch so you can push updates: Then close this PR and open a new one from your fork. |
|
🤖 Android test steps verification results: ❌ fail Setup succeeded (workspace with GL-coded categories/tags, plus a test expense) and the Spend view was reached, but steps 2–7 could not be exercised on Android at all. The "Edit columns" entry point that adds the Category/Tag GL code columns is gated to Note: the PR's
Setup performed before testing (not a verification)
|
|
🤖 Web test steps verification results: The Category GL code and Tag GL code columns render correctly in the Spend view and show the right code for the assigned category/tag. The hover-to-reveal-pencil edit flow could not be exercised: this headless session reports no fine-pointer/hover capability, and the app's shared Note: the PR's
What still needs a human. Steps 4, 5 and 7 — the actual edit behavior this PR adds — remain unverified on every platform. The Android run couldn't reach the code at all (phone widths render the narrow row, not Setup performed before testing (not a verification)
|
|
@flaviadefaria @Expensify/design, what is the expected input type for GL code? Should it be a picker or a string input? We could use a category picker with a subtitle GL code. What do you think? Screen.Recording.2026-09-24.at.2.54.17.PM.mov |
I'm honestly not sure - let's see what Flavia says. The picker you implemented looks nice, but let's verify something like that is what our customers would expect. |
|
I believe it's string since that's how you set it on a category, but @flaviadefaria can confirm CleanShot.2026-09-25.at.10.24.31.AM.mp4 |
Ahh, but this is in Workspace Settings, not the Create/Edit Expense flow on RHP. The only available field when creating/editing an expense on RHP is the category name, which is a picker, so I think we should align the GL code with it. |
|
Ahh right. I see. Yeah I guess that makes sense if you can't edit it just select it. Then I guess we just update the category on save? |
Yes, we will call the existing API to edit the category. |
|
@MelvinBot When inline editing a category GL code, the category picker should always show the GL code under each category, even when the workspace hides GL codes in the regular category picker. Do the same for the tag GL code picker. The regular category and tag pickers should still follow the workspace setting. |
…GL code cells Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
|
Done in 9599d89. The pickers opened from the Category GL code and Tag GL code cells now always show the GL code under each item. The regular Category and Tag pickers still follow the workspace setting.
Checks run
I didn't run a browser test. The earlier web run showed the headless session can't trigger the hover-to-edit affordance, so the picker can't be opened there. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| /** Optional override for whether to show GL codes under each category */ | ||
| shouldShowGLCode?: boolean; |
There was a problem hiding this comment.
@MelvinBot Wouldn't renaming it to shouldAlwaysShowGLCode be better?
There was a problem hiding this comment.
Agreed, renamed in 3e2884d.
The new name also fits the behavior better, so I changed the logic to match. true forces GL codes on. false, the default, follows the workspace setting (CategoryPicker/index.tsx:78). The old ?? override could also force them off, which nothing needed.
I left TagPicker's shouldShowGLCode as is. It existed before this PR and TagCell also uses it.
Typecheck, lint and 56 related tests pass.
|
@MelvinBot On the inline category and tag pickers that open from the expense table, show the search box once there are 8 options, instead of waiting until 12. The full-page category and tag pickers should still wait until 12. Keep the Recent and All grouping at 12. |
Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
…kers Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
|
Done in 840e8fe. The inline category and tag pickers in the expense table now show the search box at 8 options. The full-page pickers still wait until 12, and the Recent and All grouping stays at 12.
Checks run
The new tests render 8 categories. They check that the search box stays hidden at the default threshold and appears at the inline threshold. I didn't run a browser test. An earlier web run showed the headless browser can't trigger the hover-to-edit button, so it can't open these popovers. |
|
@MelvinBot When inline editing a category GL code, keep the cell read-only if the workspace has no GL codes. A blank code does not count. Do the same for the tag GL code. Editing should still require the same permission as changing the category or tag. If some categories or tags have a code and others do not, the cell stays editable, and the picker shows a code only where one exists. Leave the regular category and tag columns unchanged. |
Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
|
Done in 86026e9. The Category GL code and Tag GL code cells now stay read-only when no category or tag in the workspace has a GL code.
One choice to confirm: the check looks at every category or tag in the workspace, including disabled ones. If only a disabled item has a code, the cell stays editable, but no codes appear in the picker. Tell me if you want the check to count only enabled items. Code and checks
I didn't run a browser test. The headless browser can't trigger the hover-to-edit button these cells use. |
|
MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
|
@MelvinBot Please update TestsPrecondition:
Offline testsSame as Tests step QA StepsSame as Tests step PR Author ChecklistMark all author checklist checked |
|
Updated the PR description:
I left the "Verify that no errors appear in the JS console" boxes under Tests and QA Steps unchecked, because they are test steps rather than author checklist items. Check them after you run the tests. |
|
Not sure I understand this PR and it's coming from Flavia so I'm assigning her. |
|
@flaviadefaria bump for product review. |
|
@MelvinBot merge main. |
…iting Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com> # Conflicts: # src/components/CategoryPicker/CategoryPickerModal.tsx
|
I merged One conflict came up in
I couldn't run typecheck or lint locally because the environment blocked the dependency setup scripts. CI will run those checks on the new commit. |
|
Checking now! |
|
🚧 flaviadefaria has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
there appear to be typescript failures |
|
@MelvinBot merge main, and fix the ts error |
…iting Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
…ing main Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
f53c8bf
|
I merged Cause: Fix: Both cells now pass Checks
|
|
🚧 jasperhuangg has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.5.15-1 🚀
|
|
No help site update is needed. Editing a GL code cell just reassigns the expense's category or tag, which the articles already cover, and no existing sentence is now wrong. Details
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.5.15-3 🚀
Bundle Size Analysis (Sentry): |







Explanation of Change
Makes the Category GL code and Tag GL code columns inline-editable in the Spend table, which is what the issue asks for. They were the only two GL-code columns rendering as read-only
TextCells while the Category and Tag columns beside them already had hover-to-edit.A GL code isn't a field on the expense — it lives on the workspace category/tag and is recomputed at render time from the expense's
category/tagstring (getCategoryGLCode/getTagGLCode). So there's nothing on the transaction to write. Editing the cell therefore reassigns the expense to the category/tag that owns the picked code, which is the reading the issue's expected result asks for ("when a GL code is changed, the corresponding category/tag name should automatically update"). The displayed code then refreshes on its own because the cell re-derives it from the updatedcategory/tag.That means no new API command, no new Onyx field, and no new permission — the cells reuse the existing
CategoryPickerModal/TagPickerModaland the existingcanEditCategory/canEditTagandonEditCategory/onEditTagwiring.Two consequences of that design worth calling out in review:
canEditTagalready refuses multi-level tags, so the Tag GL code cell inherits that and stays read-only there.Both columns are also added to
EDITABLE_SEARCH_COLUMNSso the width measurement accounts for the editable cell's padding and border — without it the column measures too narrow and the hover pencil covers short codes.Deliberately not in this PR: the "Additional Columns to Consider" list from the issue. Tax Rate, Reimbursable and Billable each need their own inline-edit adapter and permission, and Report Title and Workspace mutate the report rather than the expense, which doesn't fit the
TransactionInlineEditshape at all. Those are better as follow-ups than as one large PR bundled with the GL-code work this issue is actually titled after.Fixed Issues
$ #101341
PROPOSAL: #101341 (comment)
Tests
Precondition:
Offline tests
Same as Tests step
QA Steps
Same as Tests step
AI Tests
Run by MelvinBot on this branch:
npm run typechecknpx eslinton the 4 changed filesLint done, no findings)npm run spell-changednpm test -- tests/unit/inlineEditingnpm run react-compiler-compliance-check check <changed files>Not run — browser verification. The automated web test session handed to this run was already wedged before testing began: onboarding replay failed on the "What's your work email?" modal and the page rendered blank (0 accessibility nodes) on every probe. The Spend view was never reached, so none of the UI behavior in this PR has been confirmed in a browser. Manual testing is still required.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari