Repository navigation
Fix - Add react-native-live-markdown to the Custom Agent Instructions input - #97876
Conversation
|
@shawnborton @roryabraham I see that we are missing the submit via bang.mp4 |
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.
|
|
Makes sense to me 👍 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-08-06.at.23.21.32.movScreen.Recording.2026-08-06.at.23.17.33.mov |
Added it here |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product.
|
🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.4.52-0 🚀
|
Help site review: no changes requiredI reviewed this PR against the AI agents help articles under Why: This is a presentation-layer UX change. It adds Importantly, per the PR description, agent instructions were already "stored and rendered as Markdown everywhere they're displayed." Markdown support in instructions already existed at the render layer — this PR only makes the authoring input show the live preview. So a user's ability to accomplish anything is unchanged; only the input's visual feedback is. Articles checked
None describe the live-preview behavior of the input field, and none make a statement this change invalidates. No draft docs PR was created since there is nothing to document. @FitseTLT, if you'd still like a help article to explicitly mention that instructions/rules support Markdown formatting (now that the input previews it live), let me know and I'll draft the docs PR. |
|
Deploy Blocker #98325 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.52-11 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Agent instructions are stored and rendered as Markdown everywhere they're displayed, but the inputs used to author them rendered as plain text with no live formatting. All five prompt inputs pass
InputComponent={TextInput}without atype, soBaseTextInputfalls back to its default implementation instead ofRNMarkdownTextInput— the@expensify/react-native-live-markdowncomponent the chat composer already uses.This adds
type="markdown"to the prompt input on all five surfaces (create agent, edit agent instructions, Profile → AI Prompt, add agent rule, edit agent rule), along withexcludedMarkdownStyles={['mentionReport']}— on these surfaces@emailrenders as a mention but#roomdoes not, since a room mention can't resolve outside a report context, so without the exclusion the input would live-style#roomas a mention that never renders once saved. The two rule pages and the AI Prompt section submit on Cmd/Ctrl+Enter throughonKeyPress, and the markdown input inserts a line break for any Enter keydown that isn't already default-prevented, so those handlers now callevent.preventDefault()before submitting. The agent-name field and the rule suggestions search box are left as plain inputs.Fixed Issues
$ #96902
PROPOSAL: #96902 (comment)
Tests
Pre-requisite: a workspace with Rules enabled (Workspace > More features).
Two checks are reused across the inputs below:
Markdown check — type
*bold*,_italic_,# heading,`code`and~ strike-through~, and verify the formatting renders live as you type, matching the chat composer. Then type#roomand verify it stays plain text, and type@user@example.comand verify it is styled as a mention.Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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
2026-08-05.15-59-02.mp4
Android: mWeb Chrome
2026-08-05.15-42-27.mp4
iOS: Native
2026-08-05.17-21-19.mp4
iOS: mWeb Safari
2026-08-05.15-39-43.mp4
MacOS: Chrome / Safari
2026-08-05.15-35-50.mp4