Closed Aleesssino closed 2 weeks ago
โฑ๏ธ Estimated effort to review [1-5] | 2 |
๐งช Relevant tests | No |
๐ Security concerns | No |
โก Key issues to review | None |
Category | Suggestion | Score |
Accessibility |
Replace with for interactive elements to improve accessibility
___
**To ensure accessibility and semantic correctness, replace the
| 10 |
Best practice |
Add a cleanup function in
___
**Consider using a cleanup function in the | 9 |
Performance |
Use
___
**It is recommended to use | 7 |
Maintainability |
Use CSS classes instead of inline styles for dynamic width adjustments___ **Avoid using inline styles for setting the width dynamically. Instead, consider using CSSclasses and modifying these classes based on the state to make the styles more maintainable and potentially enhance performance by reducing style recalculations.** [apps/web/src/components/ui/encrypt-text.tsx [62]](https://github.com/keyshade-xyz/keyshade/pull/267/files#diff-0991949f9f3df3982b1910773d024f58ddd46c49ef2121e579fadafaf4839bceR62-R62) ```diff -style={{ width: width ? `${width}px` : 'auto' }} +className={`group relative w-full overflow-hidden text-white/60 transition-colors hover:text-white ${width ? 'custom-width' : ''}`} ``` Suggestion importance[1-10]: 6Why: While using CSS classes instead of inline styles can improve maintainability and performance, the current use of inline styles is not a critical issue. The suggestion is valid but addresses a minor improvement. | 6 |
Issues
1 New issue
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
1.5% Duplication on New Code
@rajdip-b it doesn't seem like it's working after merged, can you confirm if it's an issue from the deployment end or not
For now, we don't have any staging environment. So, the pipeline is set to work only when code is pushed to main (when a release is made). That's why, it didn't work.
Later on when we will completely deploy the alpha environment, we will set up develop
with the staging environment. Hope that clears things out!
Can we merge this pr to prod
User description
Description
I added state management to store the element's width before the encryption animation begins. This ensures that when the encryption starts, the layout remains stable and doesn't break.
Fixes #249
Future Improvements
If others find that this fix doesn't work as expected or if the behavior isn't ideal, I will improve my solution accordingly.
Mentions
@kriptonian1 I am waiting for your feedback.
Screenshots of relevant screens
https://github.com/keyshade-xyz/keyshade/assets/97041873/5c5c0716-cd62-43e8-9a68-1fa0c2236d5e
Developer's checklist
If changes are made in the code:
PR Type
Bug fix
Description
motion.button
tomotion.div
to better handle the width styling.span
with aref
to measure the text width and applied this width to themotion.div
.Changes walkthrough ๐
encrypt-text.tsx
Fix encryption animation glitch by managing element width
apps/web/src/components/ui/encrypt-text.tsx
useEffect
to store the element's width before the encryptionanimation begins.
motion.button
tomotion.div
.span
withref
to measure the text width.motion.div
to maintain layoutstability.