migrate DYNAMIC_SETTINGS_WRITE_CAPABILITY#85109
Conversation
|
@mananjadhav 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] |
| const goBack = useCallback(() => { | ||
| Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(report.reportID, route.params.backTo)); | ||
| }, [report.reportID, route.params.backTo]); | ||
| Navigation.goBack(backPath); |
There was a problem hiding this comment.
❌ CLEAN-REACT-PATTERNS-0 (docs)
React Compiler is enabled in this codebase (babel-plugin-react-compiler in babel.config.js). It automatically memoizes closures based on their captured variables, making manual useCallback wrappers redundant. The goBack and updateWriteCapability functions (lines 35 and 39) are both wrapped in useCallback, but the compiler will handle this memoization automatically.
Remove the useCallback wrappers and use plain functions instead:
const goBack = () => {
Navigation.goBack(backPath);
};
const updateWriteCapability = (newValue: ValueOf<typeof CONST.REPORT.WRITE_CAPABILITIES>) => {
updateWriteCapabilityUtil(report.reportID, newValue);
Navigation.goBack(backPath);
};Also remove useCallback from the import React, {useCallback} from 'react'; statement on line 1.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 986cf6e432
ℹ️ 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".
| title={writeCapabilityText} | ||
| description={translate('writeCapabilityPage.label')} | ||
| onPress={() => Navigation.navigate(ROUTES.REPORT_SETTINGS_WRITE_CAPABILITY.getRoute(reportID, backTo))} | ||
| onPress={() => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.REPORT_SETTINGS_WRITE_CAPABILITY.path))} |
There was a problem hiding this comment.
Pass reportID when opening dynamic write-capability route
This navigation call builds the dynamic URL with only DYNAMIC_ROUTES.REPORT_SETTINGS_WRITE_CAPABILITY.path, but getStateForDynamicRoute() only carries query params into route.params; it does not recover reportID from the base path. The target page is wrapped with withReportOrNotFound(), which reads route.params.reportID, so opening this screen from Report Settings can leave reportID undefined and send users to the NotFound/loading fallback instead of the write-capability selector.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I explicitly tested this and I didn't come across this issue.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
…T_SETTINGS_WRITE_CAPABILITY
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb Chromemweb-chrome-dynamic-swrite-capability.moviOS: HybridAppios-dynamic-write-capability.moviOS: mWeb Safarimweb-safari-dynamic-swrite-capability.movMacOS: Chrome / Safariweb-dynamic-write-capability-new-room.movweb-dynamic-write-capability.mov |
mananjadhav
left a comment
There was a problem hiding this comment.
Some issues with my Android. The rest works fine.
|
@huult conflicts need resolving |
…T_SETTINGS_WRITE_CAPABILITY
resolved |
|
🚧 @mjasikowski has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/mjasikowski in version: 9.3.42-0 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Fixed Issues
$ #83368
PROPOSAL:
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.2026-03-16.at.09.19.27.mp4
Android: mWeb Chrome
Screen.Recording.2026-03-16.at.09.19.58.mp4
iOS: Native
Screen.Recording.2026-03-16.at.09.22.29.mp4
iOS: mWeb Safari
Screen.Recording.2026-03-16.at.09.23.04.mp4
MacOS: Chrome / Safari
Screen.Recording.2026-03-16.at.09.16.00.mp4