Repository navigation
Move selected distance rate to the top of the rate list - #97631
Conversation
…k and improve type assertions
|
@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] |
| } as unknown as Transaction; | ||
|
|
||
| function renderPage() { | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- test-only route stub; the page only reads route.params |
There was a problem hiding this comment.
❌ CONSISTENCY-16 (docs)
The justification in this eslint-disable comment joins two independent clauses with a semicolon (test-only route stub; the page only reads route.params). Comments should read as plain sentences rather than semicolon-joined clauses.
Split it into two sentences, e.g.:
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- test-only route stub. The page only reads route.paramsReviewed at: da11f18 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
|
@linhvovan29546 The PR is ready for review, thanks |
| ListItem={SingleSelectListItem} | ||
| onSelectRow={({value}) => selectDistanceRate(value ?? '')} | ||
| shouldSingleExecuteRowSelect | ||
| initiallyFocusedItemKey={initiallyFocusedOption} |
There was a problem hiding this comment.
Why don't we update this to initiallyFocusedItemKey={initiallySelectedRateID}?
There was a problem hiding this comment.
Thanks for mentioning it! We should actually use pinnedRateID instead of initiallySelectedRateIDb it's the frozen value fed to moveInitialSelectionToTop, which keeps it consistent with the previous pin-to-top PRs. What do you think?
Reviewer Checklist
Screenshots/VideosAndroid: HybridApptelegram-cloud-document-5-6068699148985572389.mp4Android: mWeb Chrometelegram-cloud-document-5-6068699148985572390.mp4iOS: HybridAppScreen.Recording.2026-08-20.at.11.50.40.moviOS: mWeb SafariScreen.Recording.2026-08-20.at.10.45.44.movMacOS: Chrome / SafariScreen.Recording.2026-08-20.at.09.54.44.mov |
|
🚧 robertjchen 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/robertjchen in version: 9.4.58-0 🚀
|
|
🤖 No help site changes are required for this PR. This change is a pure UX refinement to the distance Rate picker: when the picker opens, the currently-selected rate is now pinned to the top of the list (matching the "pre-selected items to the top" behavior used elsewhere in the app). It doesn't add, remove, or rename any feature, setting, tab, or button, and it doesn't change any documented workflow. I reviewed the two articles that cover distance rates:
The list sort order of a picker is an implementation-level UX detail that the help site intentionally doesn't document, so no article edit is warranted and no draft docs PR is needed. @marufsharifi, since no help site PR was created, there's nothing to review — but let me know if you'd like me to document any part of the distance rate picker behavior anyway. |
|
Deploy Blocker #99194 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.58-4 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Fixes the distance rate picker so the currently-selected rate is shown at the top of the list when the picker opens, matching the "pre-selected items to the top" behavior we've rolled out across the app (country, category, tax rate, etc.).
Fixed Issues
$ #69184
PROPOSAL: #69184 (comment)
Tests
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
Screen.Recording.2026-08-03.at.10.25.59.AM.mov
Android: mWeb Chrome
Screen_Recording_20260803_102326_Chrome.mp4
iOS: Native
Screen.Recording.2026-08-03.at.10.43.05.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-08-03.at.10.44.40.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-08-03.at.10.14.13.AM.mov