Don't disable AI prompt Save button when offline#92102
Conversation
Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@Krishna2323 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] |
|
@Ollyws @NicolasBonet One of you needs to 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] |
|
@Ollyws I am the author, so will leave this one for you |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee8a77d1ec
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Explanation of Change
When the agent's AI prompt Save button was tapped while offline,
updateAgentPrompt's optimistic data setpendingAction = UPDATE, which madeisSavingpermanentlytrue(the API call could not resolve while offline) — leaving the button stuck in its loading/disabled state until reconnect.This PR adopts the optimistic, "assume it's done" UX requested by
NicolasBonet:isOfflineviauseNetwork().isSavingwhile offline:isLoading={isSaving && !isOffline}andisDisabled={hasHtmlTag || (isSaving && !isOffline)}. The online flow is unchanged.Buttoninside the existingOfflineWithFeedbackwrapper so the queued-state styling and theonCloseerror dismiss apply to the whole interaction (no duplicate error row).handleSaveruns while offline, immediately fires the existing "Saved" confirmation. The shared logic was extracted into a smalltriggerSavedConfirmationcallback used by both the offline path and the existing online effect.Fixed Issues
$ #92032
PROPOSAL: #92032 (comment)
Tests
Offline tests
OfflineWithFeedback) is shown around the prompt area while the action is pending.QA Steps
Same s 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
MacOS: Chrome / Safari
Screen.Recording.2026-05-29.at.12.23.42.PM.mov
iOS Native
Screen.Recording.2026-05-29.at.12.32.59.PM.mov