Skip to content

Link agents promo banner to AI Rules instead of Workflows - #93318

Merged
Julesssss merged 2 commits into
mainfrom
claude-agentsBannerLinkToAiRules
Jun 11, 2026
Merged

Julesssss merged 2 commits into
mainfrom
claude-agentsBannerLinkToAiRules

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

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

  1. Go with a new account to workspace -> control
  2. Check that a banner shows up at the top to test AI Rules
  3. Click the CTA and see if the AI rules modal opens up
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

N/A

  • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

MacOS: Chrome / Safari
Screen.Recording.2026-06-11.at.4.21.44.PM.mov

@codecov

codecov Bot commented Jun 11, 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 Δ
src/pages/workspace/rules/PolicyRulesPage.tsx 92.85% <0.00%> (-3.44%) ⬇️
... and 25 files with indirect coverage changes

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⏱️ 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.

Run details

@NicolasBonet
NicolasBonet force-pushed the claude-agentsBannerLinkToAiRules branch from 77f3fc8 to eb66d17 Compare June 11, 2026 21:12
@NicolasBonet
NicolasBonet changed the base branch from main to puneetlath/revert-workflows-agents-93315 June 11, 2026 21:17
Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
@NicolasBonet
NicolasBonet force-pushed the claude-agentsBannerLinkToAiRules branch from 97965f4 to 6d922d1 Compare June 11, 2026 21:18
@NicolasBonet
NicolasBonet changed the base branch from puneetlath/revert-workflows-agents-93315 to main June 11, 2026 21:20
@NicolasBonet
NicolasBonet marked this pull request as ready for review June 11, 2026 21:22
@NicolasBonet
NicolasBonet requested a review from a team as a code owner June 11, 2026 21:22
@melvin-bot
melvin-bot Bot requested a review from ahmedGaber93 June 11, 2026 21:22
@NicolasBonet
NicolasBonet removed the request for review from ahmedGaber93 June 11, 2026 21:22
@melvin-bot
melvin-bot Bot removed the request for review from a team June 11, 2026 21:22
@NicolasBonet
NicolasBonet requested a review from puneetlath June 11, 2026 21:22
@melvin-bot
melvin-bot Bot requested a review from joekaufmanexpensify June 11, 2026 21:22
@melvin-bot

melvin-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

@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]

@melvin-bot
melvin-bot Bot removed the request for review from a team June 11, 2026 21:22
@NicolasBonet
NicolasBonet requested review from a team and yuwenmemon June 11, 2026 21:22
@melvin-bot
melvin-bot Bot requested review from JmillsExpensify and removed request for a team June 11, 2026 21:22
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I looked into the failing checks — there's no code issue to fix.

The only check reporting a failure is PR Author Checklist (checklist), which fails with:

You completed 0 out of 49 checklist items with 49 unfinished items

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:

  • ✅ Prettier, Knip, Check unused styles, Validate GitHub Actions, Verify Podfile, Verify signed commits, Translation Dry Run, Remote Build Android/iOS all pass.
  • ⏳ ESLint, TypeScript, Jest, React Compiler are still in progress. The diff is a one-line route swap (ROUTES.WORKSPACE_WORKFLOWS.getRoute(policyID) → ROUTES.RULES_AI_NEW.getRoute(policyID)), both with an identical getRoute(policyID: string) signature, so it's type-safe and there's nothing for me to change.

Action needed: complete the PR Author Checklist in the description to clear the only failing check.

@yuwenmemon

Copy link
Copy Markdown
Contributor

LGTM!

yuwenmemon
yuwenmemon previously approved these changes Jun 11, 2026
@sentry

sentry Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Expensify org.me.mobiexpensifyg 9.4.5-3 (509040503) Release

⚙️ app Build Distribution Settings

@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: 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))}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

@NicolasBonet this is actually a pretty good comment, but we can address it in a follow-up.

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.

@MelvinBot can you adjust that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

PolicyRulesPage.tsx:81

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.

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.

puneetlath
puneetlath previously approved these changes Jun 11, 2026
@puneetlath

puneetlath commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
CleanShot.2026-06-11.at.17.38.20.mp4

Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
@MelvinBot
MelvinBot dismissed stale reviews from puneetlath and yuwenmemon via b39ebfc June 11, 2026 22:02
@MelvinBot
MelvinBot requested a review from a team as a code owner June 11, 2026 22:02
@melvin-bot
melvin-bot Bot requested review from NicolasBonet, ahmedGaber93 and puneetlath and removed request for a team June 11, 2026 22:02
@melvin-bot

melvin-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

@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
Julesssss merged commit 27e3289 into main Jun 11, 2026
40 checks passed
@Julesssss
Julesssss deleted the claude-agentsBannerLinkToAiRules branch June 11, 2026 22:21
@github-actions

Copy link
Copy Markdown
Contributor

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

OSBotify pushed a commit that referenced this pull request Jun 11, 2026
…ules

Link agents promo banner to AI Rules instead of Workflows

(cherry picked from commit 27e3289)

(cherry-picked to staging by Julesssss)
@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Jun 11, 2026
@OSBotify

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

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.4.5-6 🚀

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

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Help site review: no doc changes required. ✅

I reviewed the full diff for this PR — it's a single-file change to PolicyRulesPage.tsx that only:

  1. Re-points the agents promo banner CTA from the Workflows page to the AI Rules page (ROUTES.RULES_AI_NEW).
  2. Gates that CTA behind canWriteRules so read-only users get the read-only modal instead of a NotFound page.
Why no App/docs/articles update is needed
  • No user-facing copy, setting, or documented workflow changed. This is an internal navigation target swap plus an access gate — the banner text, labels, and the AI Rules feature itself are unchanged.
  • The AI Rules / agents feature is not currently documented in the help site. The Rules help article, Workspace-Rules.md, covers expense rules, prohibited expenses, category/tag/report rules — it does not reference the AI Rules section or the promo banner.
  • The feature is still beta-gated (CONST.BETAS.CUSTOM_AGENT), so the banner only renders for beta-enabled accounts and isn't part of the published help-site flows.

I searched App/docs/articles for "AI rule", "AI agent", "agents", and "promo banner" — the only hits were an unrelated mention of Concierge as a "hybrid AI agent" and travel-domain uses of "agents", neither of which relates to this change.

No draft PR was created since no help site files need updating. If/when the AI Rules (agents) feature graduates from beta and becomes part of the documented Rules flow, a help article update would be worth doing then.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.5-6 🚀

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.4.6-0 🚀

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

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Help site review — no docs changes required

I reviewed this PR against the help site files under App/docs/articles and no documentation updates are needed.

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:

  • The AI Rules / agents feature is gated behind the CUSTOM_AGENT beta and is not documented anywhere in App/docs/articles. There is no help article describing the agents promo banner, the "AI Rules" section, or its CTA.
  • I searched the docs for agent, ai rule, custom agent, add an agent, and the promo copy — the only matches for "agents" are about travel agents (Central-Billing.md, Common-Travel-Terms-and-Abbreviations.md), which are unrelated.
  • The relevant published article, Workspace-Rules.md, documents Expense/Merchant/Category/Tag rules — none of which are touched by this PR.

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.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.6-4 🚀

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

@quinthar quinthar added the #ai label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CP Staging marks PRs that have been CP'd to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants