Fix drag handler is shown in preview and expense details page#74424
Conversation
| onPress={onPress} | ||
| accessibilityLabel={translate('threads.parentNavigationSummary', {reportName, workspaceName})} | ||
| style={[pressableStyles, styles.optionAlternateText, styles.textLabelSupporting, hovered ? StyleUtils.getColorStyle(theme.linkHover) : styles.link, textStyles]} | ||
| dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} |
There was a problem hiding this comment.
❌ PERF-4 (docs)
Objects passed as props should be properly memoized to prevent unnecessary re-renders. The inline object literal {{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} creates a new object reference on every render, which forces React to treat the prop as changed even when the actual data hasn't changed.
Consider memoizing the dataSet object:
const hiddenDataSet = useMemo(() => ({[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}), []);
// Then use it in the component:
<TextLink
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
onPress={onPress}
accessibilityLabel={translate('threads.parentNavigationSummary', {reportName, workspaceName})}
style={[pressableStyles, styles.optionAlternateText, styles.textLabelSupporting, hovered ? StyleUtils.getColorStyle(theme.linkHover) : styles.link, textStyles]}
dataSet={hiddenDataSet}
>
{reportName}
</TextLink>…ndler-shown-in-preview-and-expense-detail
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppNA Android: mWeb ChromeScreen.Recording.2025-11-06.at.7.14.55.PM.moviOS: HybridAppNA iOS: mWeb SafariScreen.Recording.2025-11-06.at.7.15.51.PM.movMacOS: Chrome / SafariScreen.Recording.2025-11-06.at.7.08.48.PM.movMacOS: DesktopScreen.Recording.2025-11-06.at.7.09.16.PM.mov |
|
The failed unit test seems unrelated. @huult Can you double-check? |
…ndler-shown-in-preview-and-expense-detail
I’ve merged the main branch and hope it resolves the issue. |
JmillsExpensify
left a comment
There was a problem hiding this comment.
The improvements in this PR look good from a product perspective!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/marcaaron in version: 9.2.47-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.2.47-1 🚀
|
Details
Fixed Issues
$ #72612
PROPOSAL: #72612 (comment)
Tests
Same QA step
Offline tests
QA Steps
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
Screen.Recording.2025-11-06.at.12.23.51.mov
Android: mWeb Chrome
Screen.Recording.2025-11-06.at.12.06.50.mov
iOS: Native
Screen.Recording.2025-11-06.at.12.45.50.mov
iOS: mWeb Safari
Screen.Recording.2025-11-06.at.12.08.45.mov
MacOS: Chrome / Safari
Screen.Recording.2025-11-06.at.11.59.27.mov
MacOS: Desktop
Screen.Recording.2025-11-06.at.12.01.57.mov