Skip to content

fix: show edit icon for inline table cell editing#93907

Merged
MonilBhavsar merged 19 commits into
Expensify:mainfrom
x-dev90:fix/93242-inline-table-edit-icon
Jul 7, 2026
Merged

fix: show edit icon for inline table cell editing#93907
MonilBhavsar merged 19 commits into
Expensify:mainfrom
x-dev90:fix/93242-inline-table-edit-icon

Conversation

@x-dev90

@x-dev90 x-dev90 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Updates Spend table inline editable cells so hovering an editable cell shows a pencil edit button instead of the previous full-cell hover border. Editing is now triggered only from the edit button, allowing clicks on the rest of the row/cell to open the expense/report. For right-aligned fields such as amount, the edit button appears on the left side of the cell.

Fixed Issues

$#93242
PROPOSAL:#93242(comment)

Tests

  1. Open the Spend table on a wide layout.
  2. Hover over an editable left-aligned cell, such as merchant, date, category, or tag.
  3. Verify a pencil edit button appears on hover instead of a full-cell border.
  4. Click the pencil edit button.
  5. Verify the cell enters edit mode.
  6. While the cell is editing, click elsewhere in the same row outside the active edit field.
  7. Verify the active edit field blurs/exits edit mode.
  8. While no cell is editing, click elsewhere in the same cell/row outside the pencil button.
  9. Verify the expense/report opens instead of entering edit mode.
  10. Hover over the amount cell.
  11. Verify the pencil edit button appears on the left side of the right-aligned amount.
  12. Click the amount pencil edit button.
  13. Verify the amount cell enters edit mode.
  14. Use the Tab key to navigate to an editable cell’s pencil button.
  15. Verify the pencil button becomes visible/focused.
  16. Press Enter.
  17. Verify the cell enters edit mode.
  • Verify that no errors appear in the JS console

Offline tests

Same as tests.

QA Steps

Same as tests.

// TODO: These must be filled out, or the issue title must include "[No QA]."

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

N/A

Android: mWeb Chrome

N/A

iOS: Native

N/A

iOS: mWeb Safari

N/A

MacOS: Chrome / Safari
Screen.Recording.2026-06-18.at.11.01.12.AM.mov

@codecov

codecov Bot commented Jun 18, 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 Δ
...ponents/TransactionItemRow/DataCells/TotalCell.tsx 79.03% <ø> (ø)
src/styles/index.ts 60.30% <ø> (-0.41%) ⬇️
...s/TransactionItemRow/EditableCell/EditableCell.tsx 54.76% <55.55%> (+4.76%) ⬆️
...stReportView/MoneyRequestReportTransactionItem.tsx 0.00% <0.00%> (ø)
... and 124 files with indirect coverage changes

@x-dev90 x-dev90 marked this pull request as ready for review June 18, 2026 07:24
@x-dev90 x-dev90 requested review from a team as code owners June 18, 2026 07:24
@melvin-bot melvin-bot Bot requested a review from nyomanjyotisa June 18, 2026 07:24
@melvin-bot

melvin-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

@nyomanjyotisa 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 joekaufmanexpensify and removed request for a team June 18, 2026 07:24

@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: a476b4672d

ℹ️ 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/components/TransactionItemRow/EditableCell/EditableCell.tsx
>
<PressableWithFeedback
accessibilityRole={CONST.ROLE.BUTTON}
accessibilityLabel="Edit cell"

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.

❌ CONSISTENCY-7 (docs)

The accessibilityLabel="Edit cell" is a hardcoded user-facing string. Accessibility labels are surfaced to screen-reader users, so they must be localized via the translation method rather than hardcoded in English, otherwise the label cannot be translated for non-English users.

Add a translation entry (e.g. common.edit or a dedicated key) to src/languages/* and pull it through useLocalize:

const {translate} = useLocalize();
// ...
<PressableWithFeedback
    accessibilityRole={CONST.ROLE.BUTTON}
    accessibilityLabel={translate('common.edit')}
    sentryLabel={CONST.SENTRY_LABEL.TABLE.EDITABLE_CELL}
    // ...
>

Reviewed at: a476b46 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 @dubielzyk-expensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@joekaufmanexpensify joekaufmanexpensify 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.

Excited for this!

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

I manage to get the stuck button when tapping right from an editing field into another editing field:

CleanShot.2026-06-19.at.10.41.58.mp4

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

Also curious if design thinks we should go full height on the cell hover target. I think we have padding around the main content at the moment, but curious if we should change that. cc @Expensify/design for that.

CleanShot.2026-06-19.at.10.42.48.mp4

Also curious to hear what @JmillsExpensify and @trjExpensify thinks.

It's feeling a lot better to me than what we had

@x-dev90

x-dev90 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@joekaufmanexpensify could you please check this?#93907 (comment)

Thanks.

Copy link
Copy Markdown
Contributor

I could see going full height on cell hover target. Also fine though to merge as is too. I agree this is an improvement over what we currently have.

@dannymcclain

Copy link
Copy Markdown
Contributor

I manage to get the stuck button when tapping right from an editing field into another editing field:

Shouldn't clicking outside the field only blur the field? Like when you open a popover menu, any click outside the popover just closes the popover - it doesn't also perform another click action. Does that make sense? (NAB)

Also curious if design thinks we should go full height on the cell hover target.

Yeah I wouldn't mind doing this, but also feel the same as Jason here:

I could see going full height on cell hover target. Also fine though to merge as is too. I agree this is an improvement over what we currently have.

@shawnborton

Copy link
Copy Markdown
Contributor

Similar feelings on my end too, but I agree that full height makes more sense.

@x-dev90

x-dev90 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

@nyomanjyotisa, what is the next step?
Thanks.

@nyomanjyotisa

Copy link
Copy Markdown
Member

what is the next step?

@x-dev90 could you address the feedback from the design team? #93907 (comment) and #93907 (comment)

Also, regarding #93907 (comment), how should this behave on wide layouts that don't support hover? @Expensify/design

MacOS-Chrome.mov

@shawnborton

Copy link
Copy Markdown
Contributor

how should this behave on wide layouts that don't support hover?

I kinda think this feature should only work if you are on a device that supports hover. Otherwise just tap into the expense details and edit from there.

@dannymcclain

Copy link
Copy Markdown
Contributor

Agree with that Shawn.

@nyomanjyotisa

nyomanjyotisa commented Jul 2, 2026

Copy link
Copy Markdown
Member

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 proper code patterns were followed (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 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • 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 and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • 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 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 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.
  • 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-Native.mp4
Android: mWeb Chrome
Android-mWeb.Chrome.mp4
iOS: HybridApp
iOS-Native.mp4
iOS: mWeb Safari
iOS-mWeb.Safari.mp4
MacOS: Chrome / Safari
MacOS-Chrome.mp4

@nyomanjyotisa

nyomanjyotisa commented Jul 2, 2026

Copy link
Copy Markdown
Member

@x-dev90 Please update the test steps for clarity. Steps 6-7 seem off here

  1. Click the pencil edit button.
  2. Verify the cell enters edit mode.
  3. Click anywhere else in the same cell/row outside the pencil button.
  4. Verify the expense/report opens instead of entering edit mode.

After step 5, the cell is already in edit mode, so clicking elsewhere in the same row (outside the pencil button) would blur/exit edit mode, not open the expense/report

Also, please include recordings/screenshots for all platforms next time, even when we couldn't fully test on all of them

@x-dev90

x-dev90 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@nyomanjyotisa I updated the test steps.

Could you please take a look when you get a chance?

@nyomanjyotisa

Copy link
Copy Markdown
Member

@x-dev90 Could you address this comment?

@x-dev90

x-dev90 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@nyomanjyotisa Thanks! Since we removed the wasRecentlyEditingCell suppression logic, handleEditIconMouseDown is unnecessary now. I removed it.

@nyomanjyotisa nyomanjyotisa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@melvin-bot melvin-bot Bot requested a review from MonilBhavsar July 3, 2026 11:40
@x-dev90

x-dev90 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@MonilBhavsar, Gentle bump. thanks.

@MonilBhavsar

Copy link
Copy Markdown
Contributor

@x-dev90 do you mind "Pressing tab key case(accessibility) to QA and Test steps please

Comment thread src/components/TransactionItemRow/EditableCell/EditableCell.tsx
@x-dev90

x-dev90 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@MonilBhavsar Thanks for pointing that out. I updated the edit button so it is not exposed as an accessibility element while hidden, but it remains keyboard-focusable for the Tab flow.

I also updated the test steps.

Could you please check again when you get a chance?

@MonilBhavsar

Copy link
Copy Markdown
Contributor

Thanks!

@MonilBhavsar MonilBhavsar merged commit 3fa730e into Expensify:main Jul 7, 2026
34 checks passed
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Jul 7, 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 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 9.4.29-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site review complete — docs updates required.

This PR changes how inline editing is triggered on the Spend table (desktop): instead of clicking anywhere in an editable cell, users now hover to reveal an edit icon (pencil) and click that to edit inline, while clicking elsewhere in the row opens the expense. The help site still documented the old "click the cell to edit" behavior, so I opened a draft PR to correct it.

Draft help site PR: #95530

Articles updated:

  • Getting-Started-with-the-Spend-Page.md — "Edit a cell directly" table action
  • Managing-Expenses-in-a-Report.md — "How to edit expenses inline on desktop" steps
  • Edit-Expenses.md — desktop inline-editing tip

⚠️ I couldn't auto-assign the draft PR to x-dev90 — that account only has read access to Expensify/App, and GitHub won't allow read-only users to be assigned. You've been @-mentioned on the PR instead.

@x-dev90, 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 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 9.4.31-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site review — changes required

This PR changes inline table editing behavior in the Spend table: editable cells now reveal a pencil edit icon on hover/focus, and clicking that icon (rather than the cell itself) enters edit mode. Clicking elsewhere in the cell/row now opens the expense/report. Three help articles described the old "click the cell to edit inline" behavior and needed updating.

Draft help site PR: #95674

Files updated:

The HelpDot label has been applied. I was unable to assign the draft PR to x-dev90 — GitHub rejected the assignment (the account isn't an assignable collaborator on this repo), so please self-assign on the linked PR.

@x-dev90, 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 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.4.31-0 🚀

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.