Repository navigation
Make Use suggestion the main button when the AI rules builder refuses a rule - #104942
yuwenmemon wants to merge 6 commits into
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97068b76d3
ℹ️ 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".
| size={CONST.BUTTON_SIZE.LARGE} | ||
| onPress={() => describeSuggestedRule(refusalSuggestedPrompt)} | ||
| isDisabled={isOffline} | ||
| style={styles.flex1} |
There was a problem hiding this comment.
Let the translated primary action use enough width
On narrow mobile screens, especially in locales with longer shipped labels such as German or Japanese, this flex1 combines with the submit button's flex1 to give each action only half of the row. Because Button.Text defaults to a single line, “Try this instead” is then ellipsized even though the much shorter Next button has unused space. Allow the buttons to size according to their labels or stack/wrap them at narrow widths.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
(Yuwen's Agent) Fixed in fc22789. The two buttons now size to their labels and share the row, and they wrap onto two full-width rows when a translated label doesn't fit beside the other one.
|
Totally agree with that Danny, I really like what you are proposing above. |
|
@dannymcclain @shawnborton updated! Check out the new screenhots in the PR description |
|
Really like that suggestion, Danny. |
|
@dannymcclain can you confirm? Remove the "Rules can't do that." header altogether? |
|
Might be moot if we're removing, but I was thinking of updating to 'Rules can't do that yet' and capturing the request somewhere to review? Could be a really great way to figure out what rules we don't support that people are asking for. Regardless of the copy, can we store these unsupported requests somewhere? |
|
Yeah I was suggesting removing the "Rules can't do that" header altogether. It feels a little... crude? Unrefined? I dunno how to say it haha, it just feels like we're REALLY calling attention to the limitation when I don't think we need to be so overt about it. I don't feel super duper strongly if others disagree - I just think it stands out in a negative way and we don't really need it. |
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.
|
|
Okay updated! |
|
LGTM! |
|
@JS00001 / @rushatgabhane bump here! |
|
@yuwenmemon do I need to review this? |


@JS00001 @rushatgabhane
Explanation of Change
When the AI rules builder refuses a description, the small Try this instead button didn't read as related to the suggestion. Following Danny's proposal, the refusal drops its "Rules can't do that." header, the explanation ends with "Try the suggestion below instead:", the suggestion shows in quotes, and a green Use suggestion button sits beside a neutral second button.
On New rule, the second button reads Create anyway and drafts the admin's own description as an agent rule, instead of sending it back to Concierge to be refused again. The editors' Describe modal has no agent rule to fall back to, so it keeps Next.
The form's submit button only comes in green or red, so
FormProvidergets an opt-inisSubmitButtonNeutralprop. The backend sendsimpossibleanswers only after Web-Expensify#56886 merges, so the test steps swap in an answer locally.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/683438
PROPOSAL: N/A
Tests
Precondition: Paste the snippet below into the dev console after each page load.
answer = {state: 'impossible', reason: 'noCapability', explanation: "Agents can't send text messages.", suggestedPrompt: 'When a report is submitted, send the approver a direct message that notifies them.'}.Console snippet that swaps the GenerateRule answer locally
Offline tests
QA Steps
Refusals reach staging only after Web-Expensify#56886 is live. Then:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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