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(ui): cleanup animation states #325

Merged
merged 9 commits into from
Sep 9, 2024

Conversation

shanimal08
Copy link
Collaborator

@shanimal08 shanimal08 commented Sep 6, 2024

Description

  • updated initial animation tower rotation
  • used framer LayoutGroup and layout prop to prevent janky re-renders on animations that affect the layout (majority of file changes)
  • use useShallow when grabbing data from zustand stores which are updated every second in useGetStatus (majority of file changes)
  • refactored the block height components:
    • split out the ruler and accent
    • added BlockHeightAccent component which handles the big number resizing in isolation
    • new ruler components with better centering just focusing on the marks and main block height number
  • remove canvas hiding in telementary mode toggle implementation
  • renamed useBalanceInfo to useBalanceChanges and updated logic a bit:
    • make sure to check if mining or not (if not mining just update the display block height immediately)
    • check for block_height and balance changes separately
  • split out animation states setting (so we don't need to keep referencing the same hook, useVisualisation, in different places):
    • only use useCallback for success and fail animations since they depend on the widow being in view + fail animation has the timing deps
    • split success and fail so we can call either func more specifically
    • use setAnimationState directly for start, stop, and pause
  • update zustand stores:
    • removed session storage for persist (so defaults to localStorage)
    • added create helper so we can reset to initial states on shut down

Motivation and Context

  • there was a weird screen flicker when the block height changed (due to my hanky accent implementation)
  • ruler and accent weren't always vertically centered
  • display block height wasn't set if not mining

How Has This Been Tested?

  • locally:
start.fail.and.success.mp4
accent.resize.mp4

- use useShallow
- refactor block height accent
- update animation rotation
- refactor useBalance logic a little and renamed
@shanimal08 shanimal08 changed the base branch from release to main September 9, 2024 08:00
@shanimal08 shanimal08 marked this pull request as ready for review September 9, 2024 10:20
@shanimal08 shanimal08 requested review from stringhandler, NovaT82 and mmrrnn and removed request for stringhandler September 9, 2024 10:21
'no-console': ['warn', { allow: ['info', 'warn', 'debug', 'error'] }],
'no-console': [
'warn',
{ allow: ['info', 'warn', 'debug', 'error', 'group', 'groupCollapsed', 'groupEnd'] },
Copy link
Contributor

Choose a reason for hiding this comment

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

seems wrong

@stringhandler stringhandler merged commit 5469a24 into tari-project:main Sep 9, 2024
7 checks passed
@shanimal08 shanimal08 deleted the shanimal/sync-states branch September 9, 2024 11:34
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