-
Notifications
You must be signed in to change notification settings - Fork 5
style: smooth transition in profile tabs #1660
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
Conversation
WalkthroughThe changes in Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ProfileTab
participant Collapse
User->>ProfileTab: Toggle visibility
ProfileTab->>Collapse: Update transition properties
Collapse-->>ProfileTab: Apply width transition
ProfileTab->>ProfileTab: Check toHideAll
alt toHideAll defined
ProfileTab->>Collapse: Show or hide accounts
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/extension-polkagate/src/popup/home/ProfileTab.tsx (1)
Line range hint
28-29
: Consider extracting transition constantsFor better maintainability, consider extracting magic numbers related to transitions into named constants. This would make it easier to maintain consistent timing across different animations.
const COLLAPSED_SIZE = '20px'; const HIDDEN_PERCENT = '50%'; +const TRANSITION_DURATION = { + FAST: '0.2s', + NORMAL: '0.3s', + SLOW: '1s' +}; // Later in the code transition: visibleContent - ? 'width 0.3s, box-shadow 1s, opacity 1s' - : 'width 0.3s, box-shadow 0.2s, opacity 1s' + ? `width ${TRANSITION_DURATION.NORMAL}, box-shadow ${TRANSITION_DURATION.SLOW}, opacity ${TRANSITION_DURATION.SLOW}` + : `width ${TRANSITION_DURATION.NORMAL}, box-shadow ${TRANSITION_DURATION.FAST}, opacity ${TRANSITION_DURATION.SLOW}`Also applies to: 96-96
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
packages/extension-polkagate/src/popup/home/ProfileTab.tsx
(1 hunks)
🔇 Additional comments (1)
packages/extension-polkagate/src/popup/home/ProfileTab.tsx (1)
96-96
: LGTM! Smooth transition enhancement
The addition of the width transition property with a 0.3s duration provides a more polished animation when the tab expands/collapses. The timing is appropriate for a micro-interaction.
Summary by CodeRabbit