fix:82291: AI - Send button is unresponsive when post image in concierge RHP#82604
fix:82291: AI - Send button is unresponsive when post image in concierge RHP#82604Eskalifer1 wants to merge 2 commits intoExpensify:mainfrom
Conversation
|
@linhvovan29546 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] |
|
@carlosmiceli 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] |
src/libs/Navigation/Navigation.ts
Outdated
| function closeSidePanelOnNarrowScreen() { | ||
| function closeSidePanelOnNarrowScreen(route: Route) { | ||
| const isExtraLargeScreenWidth = Dimensions.get('window').width > variables.sidePanelResponsiveWidthBreakpoint; | ||
| const isAttachmentPreviewRoute = route && /^r\/\d+\/attachment\/add/.test(route); |
There was a problem hiding this comment.
❌ CONSISTENCY-2 (docs)
The hardcoded regex /^r\/\d+\/attachment\/add/ is a magic string that duplicates the route pattern already defined in ROUTES.REPORT_ADD_ATTACHMENT.route (r/:reportID/attachment/add). If that route definition ever changes, this regex will silently become stale.
Use the existing route constant instead. For example:
const isAttachmentPreviewRoute = new RegExp(`^${ROUTES.REPORT_ADD_ATTACHMENT.route.replace(":reportID", "\\d+")}`).test(route);Or, since the route always starts with r/<digits>/attachment/add, you could use a simpler string-based check derived from the constant:
const attachmentRoutePrefix = ROUTES.REPORT_ADD_ATTACHMENT.route.split(":")[0]; // "r/"
const isAttachmentPreviewRoute = route.includes("/attachment/add") && route.startsWith(attachmentRoutePrefix);Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
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.
|
Explanation of Change
This PR fixes a bug where users on mobile devices couldn't send photos to the Concierge chat that was open in the side panel.
Fixed Issues
$#82291
PROPOSAL:#82291 (comment)
Tests
Precondition:
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
Android: mWeb Chrome
82291-android-web.mp4
iOS: Native
iOS: mWeb Safari
82291-ios-web.mp4
MacOS: Chrome / Safari
82291-web.mp4