Parse markdown in agent custom instructions on the profile page - #98380
Open
roryabraham wants to merge 4 commits into
Open
Parse markdown in agent custom instructions on the profile page#98380roryabraham wants to merge 4 commits into
roryabraham wants to merge 4 commits into
Conversation
roryabraham
marked this pull request as ready for review
August 12, 2026 00:31
melvin-bot
Bot
requested review from
joekaufmanexpensify
and removed request for
a team
August 12, 2026 00:31
Contributor
Author
|
@Pujan92 can you please do C+ review? |
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-08-12.at.10.24.07.mov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
The agent prompt is stored as HTML-encoded Markdown source. On the agent chat details page, the "Custom instructions" field passed that raw source straight to
MenuItemWithTopDescription, which renders a plain<Text>unlessshouldParseTitleis set, so the user saw*bold*and'verbatim.This makes the field match the equivalent field on the Agents settings page (
EditAgentPage): decode the stored prompt withStr.htmlDecode, parse it as Markdown withshouldParseTitle, and bound its length withshouldTruncateTitle/characterLimit={CONST.AGENT_PROMPT_LIMIT}.numberOfLinesTitle={2}was dropped becauseMenuItemignores it once the title is parsed as HTML — the 300 character limit now bounds the row instead, exactly as it does on the settings page.Fixed Issues
$ #98325
PROPOSAL: N/A
Tests
Reject *gambling* and Bob's _personal_ expenses.'and not as an HTML entity.Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Android: Native
Not tested yet.
Android: mWeb Chrome
Not tested yet.
iOS: Native
Not tested yet.
iOS: mWeb Safari
Not tested yet.
MacOS: Chrome / Safari