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

fix(llm): add tracking on pull to refresh #7025

Merged
merged 1 commit into from
Jun 6, 2024
Merged

Conversation

LucasWerey
Copy link
Contributor

@LucasWerey LucasWerey commented Jun 6, 2024

βœ… Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

πŸ“ Description

add track on pull to refresh where a sync is triggered or not so we can quantify the amount of Sync requested to the backend

Screen.Recording.2024-06-06.at.12.02.27.mov

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@LucasWerey LucasWerey requested review from a team as code owners June 6, 2024 10:54
Copy link

vercel bot commented Jun 6, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2024 11:36am
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2024 11:36am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2024 11:36am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2024 11:36am
web-tools ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2024 11:36am

@live-github-bot live-github-bot bot added the mobile Has changes in LLM label Jun 6, 2024
@LucasWerey LucasWerey marked this pull request as draft June 6, 2024 11:15
@LucasWerey LucasWerey marked this pull request as ready for review June 6, 2024 11:37
@@ -24,6 +25,7 @@ export default <P,>(ScrollListLike: React.ComponentType<P>) => {
const [refreshing, setRefreshing] = useState(false);

function onPress() {
track("buttonClicked", { button: "pull to refresh" });
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to add this as a const to the analytics file, and then import it, as it is repeated many times, and allows us to be consistent at naming technics ie. prefix / suffix etc.

However, saying that it seems there is no analytics const file in ll, so may be overkill.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about it but as there's no dedicated file I didn't do it.
But it might be a good thing to have a file that groups all the track event hooks, as we often use track(β€œbutton_clicked”) and others.

Copy link
Contributor

Choose a reason for hiding this comment

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

exactly, this makes it confusing to have multiple selectors that semantically have the same meaning but just a different syntax.

However, agree this may be outside the scope of your PR.

const [refreshControlVisible, setRefreshControlVisible] = useState(false);
const handlePullToRefresh = useCallback(() => {
refresh();
setRefreshControlVisible(true);
}, [refresh]);
trackPullToRefresh();
}, [refresh, trackPullToRefresh]);
Copy link
Contributor

Choose a reason for hiding this comment

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

does this list need to be exhausted? given trackPullToRefresh is static?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it to avoid lint error but yes it might not be useful

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 add this comment above the line to ignore the lint requirement.

Suggested change
}, [refresh, trackPullToRefresh]);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[refresh]
);

@LucasWerey LucasWerey merged commit a0914fc into develop Jun 6, 2024
37 of 39 checks passed
@LucasWerey LucasWerey deleted the fix/LIVE-12572 branch June 6, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants