Skip to content
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

Added missing previous selection discard upon the new selection change #155

Merged

Conversation

oleksandr-danylchenko
Copy link
Contributor

@oleksandr-danylchenko oleksandr-danylchenko commented Oct 10, 2024

Issue

Initially reported - #151 (comment)

We need to restore the selection.clear() call if there's nothing to update. Because now the previous, "discarded selection" unexpectedly stays up until you create a brand-new one.

unselect.mp4

*in my testing env, the annotations that don't have either a highlight or a note assigned get automatically garbage collected when they get unselected

Can be reproduced in the playground:

selected_still.mp4

Comment on lines -209 to 214
} else if (!selection.isEmpty()) {
} else {
selection.clear();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isEmpty check is redundant because such a case is already handled on the a9s side. The operation will be no-op if the selection is already clear. Source

@oleksandr-danylchenko oleksandr-danylchenko marked this pull request as draft October 10, 2024 15:52
@oleksandr-danylchenko oleksandr-danylchenko marked this pull request as ready for review October 10, 2024 16:22
@rsimon
Copy link
Member

rsimon commented Oct 14, 2024

Thanks - yes, that makes sense. The previous selection should clear as soon as you start the next, not after you complete it.

@rsimon rsimon merged commit 775f612 into recogito:main Oct 14, 2024
@oleksandr-danylchenko oleksandr-danylchenko deleted the fix-previous-selection-cleanup branch October 14, 2024 10:38
@oleksandr-danylchenko

This comment was marked as off-topic.

@oleksandr-danylchenko
Copy link
Contributor Author

Another mobile quirk!
On iOS the ordering is the same as on Android - the selection comes after the pointer events. BUTT! It fluctuates depending on where and how fast you click!
When you click over an annotation quickly - only pointerdown/pointerup are dispatched. But when slowly - all 4. When I tap over the textual content - all 4.

Screen.Recording.2024-10-16.at.21.33.21.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants