-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Clear selection on navigation #60258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear selection on navigation #60258
Conversation
@srikarparsi 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] |
// eslint-disable-next-line react-compiler/react-compiler | ||
// eslint-disable-next-line react-hooks/exhaustive-deps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For each of the eslint disable we are trying to add a comment explaining why it has to be done - can you add it here? Can you also add it the eslint disable on one line only please
🚧 @mountiny has triggered a test app build. You can view the workflow run here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, although 2 effects that do similar things and both need to disable eslint rules, are kinda confusing 😅
@@ -82,6 +86,23 @@ function MoneyRequestReportTransactionList({report, transactions, reportActions, | |||
|
|||
const {selectedTransactionsID, setSelectedTransactionsID, toggleTransaction, isTransactionSelected} = useMoneyRequestReportContext(report.reportID); | |||
|
|||
const focusedRoot = useRootNavigationState((state) => findFocusedRoute(state)); | |||
|
|||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd drop a simple 1-line comment describing what this does.
Something like
// we clear selected state in cases of X,Y but don't want to clean it when Z
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
At this point I wonder if the idea that we want to implement here is not too confusing. Is it possible to somehow simplify? IE always clean them or never clean them? any thoughts @mountiny ? |
With great help from @WojtekBoman I found a better solution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and seems simpler 👍 very nice
bump @mountiny |
Asking if @DylanDylann or @allgandalf will take it |
Reviewer Checklist
Screenshots/VideosAndroid: NativeCannot test on small screensAndroid: mWeb ChromeCannot test on small screensiOS: NativeCannot test on small screensiOS: mWeb SafariCannot test on small screensMacOS: Chrome / SafariScreen.Recording.2025-04-17.at.7.14.21.PM.movMacOS: DesktopScreen.Recording.2025-04-17.at.7.35.08.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice simplification! thanks!
✋ 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/mountiny in version: 9.1.30-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.1.30-4 🚀
|
cc @mountiny @WojtekBoman @adamgrzybowski
Explanation of Change
Fixed Issues
$ #59833
PROPOSAL: N/A
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov