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: smooth the loader animation #4167

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Conversation

louis-jan
Copy link
Contributor

@louis-jan louis-jan commented Nov 30, 2024

Describe Your Changes

This pull request aims to improve the progress bar animation for model loading and chat generation. waiting for the model to load is already frustrating, and the glitchy effects make it even worse

Before:
CleanShot 2024-12-01 at 15 08 34

After:
CleanShot 2024-12-01 at 15 07 43

Future update:
Pull progress from the engine and update accordingly.

Changes made

The changes made in this git diff involve two components — GenerateResponse.tsx and ModelStart.tsx — both of which add animation to progress loaders using the framer-motion library.

  1. Import Framer Motion:

    • Both files added the import statement: import { motion as m } from 'framer-motion'.
  2. Modify Progress Bar:

    • In both components, the <div> used for displaying the progress bar is replaced with <m.div>, indicating the use of a framer-motion div to add animations.
    • Added an initial prop with a width of 0 to start the animation from zero width.
    • The style for the width is hardcoded to 250 before the animation so it starts from a set size.
    • Added an animate prop to both loaders, which animates the width to ${loader}% over a 0.25 second duration using the transition property.

These changes enhance the user interface with smooth animated transitions for loader width changes.

@louis-jan louis-jan requested a review from a team November 30, 2024 10:10
@github-actions github-actions bot added the type: bug Something isn't working label Nov 30, 2024
Copy link
Contributor

Barecheck - Code coverage report

Total: 69.28%

Your code coverage diff: -0.26% ▾

Uncovered files and lines
FileLines
web/containers/Loader/GenerateResponse.tsx5-6, 9-12, 14-16, 18-20, 22-23, 25
web/containers/Loader/ModelStart.tsx16, 19-20, 23-24, 27

@louis-jan louis-jan merged commit 23cd298 into dev Dec 2, 2024
9 checks passed
@louis-jan louis-jan deleted the fix/smooth-the-loader-animation branch December 2, 2024 02:35
@github-actions github-actions bot added this to the v0.5.10 milestone Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants