Repository navigation
Conversation
|
@hungvu193 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] |
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.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b2deae500
ℹ️ 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".
| setTimeout(() => { | ||
| validateAndSubmitDraft(textRef.current ?? ''); | ||
| }, 0); |
There was a problem hiding this comment.
Use edit draft fallback when delayed submit runs
Submitting edits now always reads textRef.current after a setTimeout, but that ref is updated by setText in composer effects (useEditComposerToggle) rather than from the edit context itself. When edit mode just switched actions (or just entered edit mode), editingMessage can already hold the correct draft while textRef.current still points to the previous composer text for one render; pressing Save during that window will publish the wrong message. The previous logic avoided this by preferring non-empty editingMessage before falling back to composer text.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is exactly what we want. When autocorrection happens, it updates the actual value of the TextInput directly, and we have no way of hooking into that before we submit the edit. Therefore, we need to schedule the validateAndSubmitDraft as a later macro-task by calling setTimeout(() => validateAndSubmitDraft(textRef.current ?? ''), 0) with a timeout of 0. This does not add any "magic number" delay.
There was a problem hiding this comment.
Pull request overview
This PR updates the report composer edit-submit flow so edited messages can use the latest text after native autocorrection before publishing the edit.
Changes:
- Tracks composer text in a ref alongside state.
- Uses that ref on delayed edit submission to capture autocorrected text.
- Adds
autocorrectionto the spell-check dictionary.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts |
Defers edited-message submission and reads from the latest composer text ref. |
src/pages/inbox/report/ReportActionCompose/ComposerProvider.tsx |
Adds textRef and keeps it synchronized with composer text state. |
src/pages/inbox/report/ReportActionCompose/ComposerContext.ts |
Exposes textRef through composer metadata context. |
cspell.json |
Adds the autocorrection term to the dictionary. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@hungvu193 i've explained why we need |
Reviewer Checklist
Screenshots/VideosiOS: HybridAppScreen.Recording.2026-05-18.at.17.53.27.mov |
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
…egression-autocorrect [CP Staging] fix: Wait for autocorrection before submitting edited message (cherry picked from commit 971d061) (cherry-picked to staging by mountiny)
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.3.75-2 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is an internal bug fix that adjusts autocorrection timing when submitting an edited message (adding a The relevant help site article ( |
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.3.75-10 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. The changes are an internal bug fix to the message composer's autocorrection timing — they don't alter any user-facing features, UI labels, settings, or workflows. The existing Chat Features and Moderation Tools article's "Edit or Delete Messages" section remains accurate as-is. |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.75-14 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.3.76-0 🚀
|
|
No help site changes are required for this PR. This is an internal bug fix that makes the edit submission wait for autocorrection before submitting the edited message. It doesn't change any user-facing workflow, UI labels, feature names, or steps. The existing help site documentation for editing messages in |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.77-3 🚀
|
@mountiny @hungvu193
Explanation of Change
Fixes an issue when editing a message and autocorrection is applied, the auto-corrected message appears in the composer after editing has stopped.
This PR makes the edit process wait for autocorrection and then submit the auto-corrected value for the edit.
Fixed Issues
$ #90851
PROPOSAL:
Tests
Offline tests
None needed.
QA Steps
Same as in Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
iOS: Native
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-05-16.at.17.28.32.mov