Link agents promo banner to AI Rules instead of Workflows - #93318
Conversation
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.
|
|
⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai. |
77f3fc8 to
eb66d17
Compare
Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
97965f4 to
6d922d1
Compare
|
@ahmedGaber93 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] |
|
I looked into the failing checks — there's no code issue to fix. The only check reporting a
That's the human author checklist — it stays red until a person ticks the boxes in the PR description. MelvinBot can't complete it on your behalf. Once you fill out the checklist in the PR body, that check will pass. Everything else is green or still running with no problem:
Action needed: complete the PR Author Checklist in the description to clear the only failing check. |
|
LGTM! |
📲 Install BuildsAndroid
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d922d19e7
ℹ️ 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".
| subtitle={translate('workspace.rules.agentsPromoBanner.subtitle')} | ||
| ctaText={translate('workspace.rules.agentsPromoBanner.cta')} | ||
| onCtaPress={() => Navigation.navigate(ROUTES.WORKSPACE_WORKFLOWS.getRoute(policyID))} | ||
| onCtaPress={() => Navigation.navigate(ROUTES.RULES_AI_NEW.getRoute(policyID))} |
There was a problem hiding this comment.
Gate the promo CTA for read-only rules users
This banner is rendered based only on the custom-agent beta and dismissal state, unlike the AI Rules section's Add button which checks canWriteRules before navigating. On paid workspaces where a user can read Rules but not write them (for example an auditor, since the Rules page is accessible via policyFeature={RULES}), pressing this CTA now navigates directly to AddAIRulePage, whose wrapper still requires admin access, so the user lands on a NotFound page instead of seeing the read-only modal or a disabled CTA. Please wrap this navigation with the same canWriteRules/read-only fallback used by the section Add action.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@NicolasBonet this is actually a pretty good comment, but we can address it in a follow-up.
There was a problem hiding this comment.
Done in b39ebfc. The banner CTA now checks canWriteRules and falls back to showReadOnlyModal() before navigating, mirroring the AI Rules section's Add button — so read-only users (e.g. auditors) get the read-only modal instead of landing on a NotFound page.
There was a problem hiding this comment.
NAB: The modal banner is a bit of a call to action, so I feel like we should just not show it at all. Again, we can do this in a follow-up.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariCleanShot.2026-06-11.at.17.38.20.mp4 |
Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
|
@ahmedGaber93 @puneetlath @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] |
|
🚧 @Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
…ules Link agents promo banner to AI Rules instead of Workflows (cherry picked from commit 27e3289) (cherry-picked to staging by Julesssss)
|
✋ 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! 🧪🧪
|
|
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.4.5-6 🚀
Bundle Size Analysis (Sentry): |
|
Help site review: no doc changes required. ✅ I reviewed the full diff for this PR — it's a single-file change to
Why no
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.5-6 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.4.6-0 🚀
Bundle Size Analysis (Sentry): |
Help site review — no docs changes requiredI reviewed this PR against the help site files under What this PR changes: It only adjusts where the AI Rules promo banner's CTA navigates (from the Workflows page to the AI Rules "add" page) on the workspace Rules page, plus a read-only access gate so members without write access get the read-only modal instead of a NotFound page. This is internal navigation/permission behavior, not a new or changed user-facing feature. Why no docs change:
Since there's nothing customer-facing to document for a beta-gated routing fix, there's no help site PR to create. @NicolasBonet, please confirm you agree no help site changes are required. If you believe the AI Rules feature now warrants a public help article, let me know and I'll draft one. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.6-4 🚀
|
Explanation of Change
The "Don't see the rule you need? Add an agent" promo banner on the workspace Rules page previously navigated to the Workflows page when its "Try it out" CTA was tapped. Since the banner is about adding AI rules/agents, sending users to Workflows was misleading.
This updates the CTA to navigate to the AI Rules page (
ROUTES.RULES_AI_NEW), which is the same destination as the "Add" action in the AI Rules section, so tapping the banner now takes users straight to adding a new AI rule.Fixed Issues
$ #93314
PROPOSAL: #93314
Tests
Offline tests
N/A
QA Steps
N/A
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-06-11.at.4.21.44.PM.mov