Open kbecciv opened 3 months ago
Job added to Upwork: https://www.upwork.com/jobs/~010e869b36a20a1985
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (External
)
Triggered auto assignment to @jliexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
We think that this bug might be related to #wave5-free-submitters CC @dylanexpensify
Tapping split button & selecting 2nd contact are not highlighted like 1st contact
We only highlight/ Focus the top index element.
Update the function to highlight all the selected participants
N/A
Some Thoughts:
I think this is intended and not a bug, when on laptop, if we use keyboard down button then the same focus moves down the list.
Anyway, if this feels like a bug would like to solve this
@GandalfGwaihir regarding your comment:
I think this is intended and not a bug, when on laptop, if we use keyboard down button then the same focus moves down the list.
I think the bug is that when you select a second person, the first person is still highlighted. I agree that the focus should move down the list, but it should then highlight the 2nd person instead, as it's the most recently selected.
@kbecciv is this essentially what you are saying?
I think this should actually go in #vip-split: https://expensify.slack.com/archives/C05RECHFBEW/p1707097628668729
I think this is intended and not a bug, when on laptop, if we use keyboard down button then the same focus moves down the list.
cc: @Expensify/design can you confirm whether this issue is bug or not?
🤔 I do not know. I guess it's not a bug since we keep the first item of a list focused... but why do we keep the first item of a list focused? I think in this situation I would expect none of the list items to have focus. Anyone else?
I think the bug is that when you select a second person, the first person is still highlighted. I agree that the focus should move down the list, but it should then highlight the 2nd person instead, as it's the most recently selected.
I guess if we definitely want to maintain focus inside the list (which I would still love to hear why we want to do that—could be something very obvious that I'm not understanding) then I would agree with Jason that the most recent person selected should be the one that gets focus.
The behavior same in the other places too, I think this is designed this way, maybe @shawnborton help here as he was part of the selection list refactor
https://github.com/Expensify/App/assets/85645967/ee9ca338-3418-4a1f-bd66-7a7c33eb8344
but why do we keep the first item of a list focused?
This is exactly the question I asked myself, and why I assumed it was a bug.
Here's my thought:
The focus should move down the list, but it should then highlight the 2nd person instead, as it's the most recently selected.
Yeah I guess this is technically not a bug but I do tend to agree with this one:
but why do we keep the first item of a list focused? I think in this situation I would expect none of the list items to have focus. Anyone else?
It seems like maybe we have competing styles for list selection where selected items typically have a different BG color, but your keyboard focus also gets a darker BG color.
So I wonder if it makes sense to not have the keyboard focus on any of the list items until you explicitly start using the down arrow/tab button to go down from the input? And then we might consider using an outline style for the focus style as opposed to a BG color?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@shawnborton I think you (and the Design Team) probably have the final say here! What do you recommend the solution should be?
Tapping split button & selecting 2nd contact are not highlighted like 1st contact
To remove focus and scroll to top we need to follow few steps:
usePrevious
for flattenedSections.selectedOptions.length
updateAndScrollToFocusedIndex
to also accept second parameter for scrollIndex
and if not provided use the newFocusedIndex
. We need to do that because we want to scroll even if any options is removed and -1
won't scroll the list.useEffect
which resets focus.Check for
prevSelectedOptionsLength === flattenedSections.selectedOptions.length
before returning.
Update condition for determining
newSelectedIndex
value, ifprevSelectedOptionsLength !== flattenedSections.selectedOptions.length
return-1
.
Create a new const named
newScrollIndex
which will be used return0
if the selected options are changed else it will returnnewSelectedIndex
const prevSelectedOptionsLength = usePrevious(flattenedSections.selectedOptions.length);
useEffect(() => {
// Avoid changing focus if the textInputValue remains unchanged.
if ((prevTextInputValue === textInputValue && prevSelectedOptionsLength === flattenedSections.selectedOptions.length) || flattenedSections.allOptions.length === 0) {
return;
}
// Remove the focus if the search input is empty else focus on the first non disabled item
const newSelectedIndex = textInputValue === '' || prevSelectedOptionsLength !== flattenedSections.selectedOptions.length ? -1 : 0;
const newScrollIndex = prevSelectedOptionsLength !== flattenedSections.selectedOptions.length ? 0 : newSelectedIndex;
updateAndScrollToFocusedIndex(newSelectedIndex, newScrollIndex);
}, [
canSelectMultiple,
flattenedSections.allOptions.length,
prevTextInputValue,
textInputValue,
updateAndScrollToFocusedIndex,
prevSelectedOptionsLength,
flattenedSections.selectedOptions.length,
]);
https://github.com/Expensify/App/assets/85894871/907bfe9d-7ef3-4738-ba89-35299b471549
Hmm that result video actually feels pretty good to me. But I think I'm still debating between that solution and not focusing any items in the list at all.
The main reason I'm not sure we should focus the list at all is because you can't really add someone to a split with your keyboard anyways. If you try to, it seems like what ends up happening is you're just advanced to regular manual request confirmation screen with a single participant (the person who you keyboarded to). So I'm not totally sure what value the focus is providing here. Would love to get @Expensify/design thoughts on each of these approaches.
Oh that's a really valid point that keyboard controls basically don't really work in the split flow, so I would be down with getting rid of the keyboard focus as soon as you have selected one split.
Nice, ty everyone! @Santhosh-Sellavel - could I get you to review the updated proposals? Thanks!
@Krishna2323 If we are no longer focusing on anything I think we might need some cleanup as well. @jliexpensify Unassigning as am planning for OOO, please assign a new C+ here
I can take over.
When user taps split button and select 2nd contact, it must be highlighted & green tick must be shown, just how it is shown for first contact after selection.
The expected result should be updated like this:
When user taps split button (no matter first or second selection), the row isn't always highlighted but only green tick is shown
📣 @situchan 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
Assigned @situchan and updated expected result
Not able to reproduce anymore on staging. Looks like this was fixed in #34196
so I would be down with getting rid of the keyboard focus as soon as you have selected one split.
@situchan, we also need to remove focus if we have any selected option, so we need to check for flattenedSections.selectedOptions.length
also.
@Krishna2323 can you please share video of that "bug" and share with design team if we wanna fix that behavior?
@situchan, here the first option is focused even if we have multiple selected options and since keyboard controls don't work with split flow, so we shouldn't highlight any option.
https://github.com/Expensify/App/assets/85894871/56786781-b39e-4f7a-9b95-445f1b7cea77
@shawnborton, can you pls provide some feedback on the comment above.
That makes sense to me, in terms of not highlighting anything given that the keyboard controls don't work for split.
@jliexpensify @situchan this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@situchan are you able to review? Thanks!
@Krishna2323 mind sharing test branch?
@situchan, any updates on this?
I will provide feedback by tomorrow
@jliexpensify @situchan this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
Bumping @situchan for feedback
So the expected behavior is to clear highlight when any item is selected (by clicking Split button) / deselected (by clicking ✅ button).
@Krishna2323 what about this case?
When deselected the last remaining selected item, keeps highlight
https://github.com/Expensify/App/assets/108292595/d45fb5e2-e3c0-45c1-8fc8-7b4c9dc094e0
@situchan, I missed that case. We can do const newSelectedIndex = textInputValue === '' || flattenedSections.selectedOptions.length !== prevSelectedOptionsLength ? -1 : 0;
instead of textInputValue === '' || flattenedSections.selectedOptions.length ? -1 : 0;
to update to -1
whenever selected options length gets changed. We need to also update the if check.
const prevTextInputValue = usePrevious(textInputValue);
const prevSelectedOptionsLength = usePrevious(flattenedSections.selectedOptions.length);
useEffect(() => {
// Avoid changing focus if the textInputValue remains unchanged and selected options also doesn't change
if (prevTextInputValue === textInputValue && flattenedSections.selectedOptions.length === prevSelectedOptionsLength) {
return;
}
// Remove the focus if the search input is empty or selected options get s changed else focus on the first non disabled item
const newSelectedIndex = textInputValue === '' || flattenedSections.selectedOptions.length !== prevSelectedOptionsLength ? -1 : 0;
updateAndScrollToFocusedIndex(newSelectedIndex);
ok please update proposal accordingly
Bump @Krishna2323 do you have an updated proposal? Thanks!
Sorry, I don't know why I haven't got notified about the proposal update comment. Updating...
@situchan, proposal updated.
@jliexpensify @situchan this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks!
Current assignee @situchan is eligible for the Internal assigner, not assigning anyone new.
Bump @situchan for a proposal review! Thanks.
DM-ed Situ in Slack
@jliexpensify, @situchan Huh... This is 4 days overdue. Who can take care of this?
sorry missed this. @Krishna2323 can you please update testing branch which covers that?
@situchan updated branch here: https://github.com/Krishna2323/App/tree/krishna2323/test2/35665
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.35.0 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4263802 Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Expected Result:
When user taps split button (no matter first or second selection), the row isn't always highlighted but only green tick is shown
Actual Result:
When user taps split button and select 2nd contact, only green tick shown, it is not highlighted like first contact after selection.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/93399543/e848edfc-7fdb-4d41-b40b-43c2a2b2ad3b
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @jliexpensify