Skip to content

Conversation

@dariakoko
Copy link
Contributor

@dariakoko dariakoko commented Dec 16, 2025

This PR resolves ONYX-1967

Description

This PR:

  • adds tracking for paste events in search
  • fixes contextScreenOwnerType
iOS Android

PR Checklist

  • I have tested my changes on the following platforms:
    • Android.
    • iOS.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos at least on Android, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • add tracking for paste events in search, fix contextScreenOwnerType

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

* If text length changes by more than 1 character in a single change event,
* it's likely a paste (multiple characters added at once) rather than typing
*/
const detectPasteEvent = (newQuery: string, previousQuery: string): boolean => {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can place this function below the component and have a more specific name, like detectInputPasteEvent.

return lengthDifference > 1
}

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this useEffect is doing more than it should. We have now:

  • query length event and reset
  • on mount setting refs
  • check if a paste occurred and track it

I'd think of splitting this into 3 different useEffects, each one with its specific context, for a better separation of concerns.

@artsy artsy deleted a comment from ArtsyOpenSource Dec 16, 2025
@ArtsyOpenSource
Copy link
Contributor

This PR contains the following changes:

  • Cross-platform user-facing changes (add tracking for paste events in search, fix contextScreenOwnerType - dariakoko)

Generated by 🚫 dangerJS against 8109685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants