-
-
Notifications
You must be signed in to change notification settings - Fork 849
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
Fixed Initial Left Drawer Visibility #3223
Fixed Initial Left Drawer Visibility #3223
Conversation
WalkthroughThe pull request addresses the initial visibility issue of the Left Drawer component by introducing a new Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Finishing Touches
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
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
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
🧹 Nitpick comments (2)
src/components/LeftDrawer/LeftDrawer.tsx (2)
34-38
: LGTM! Consider adding a clarifying comment.The useEffect implementation correctly handles the initial drawer visibility. Consider adding a comment to explain why we're using an empty dependency array, as it's an intentional choice for initialization.
useEffect(() => { if (hideDrawer === null) { setHideDrawer(false); } - }, []); + }, []); // Empty deps array as this should only run once for initialization
Line range hint
52-58
: Consider optimizing the visibility logic.While the current implementation works, it could be improved to prevent potential flash of hidden content:
- Consider moving the null check logic to a separate function for better readability
- The initial hidden state could be handled via CSS instead of React state
- className={`${styles.leftDrawer} ${ - hideDrawer === null - ? styles.hideElemByDefault - : hideDrawer - ? styles.inactiveDrawer - : styles.activeDrawer - }`} + className={`${styles.leftDrawer} ${ + hideDrawer ? styles.inactiveDrawer : styles.activeDrawer + }`}And in your CSS:
.leftDrawer { visibility: hidden; /* Initial state */ animation: showDrawer 0ms 100ms forwards; /* Delay showing until after first render */ } @keyframes showDrawer { to { visibility: visible; } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/LeftDrawer/LeftDrawer.tsx
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (2)
src/components/LeftDrawer/LeftDrawer.tsx (2)
1-1
: LGTM! Clean import addition.The useEffect hook is correctly imported from React.
Line range hint
34-58
: Verify the fix resolves the reported issue.The implementation looks solid and focused on fixing the initial drawer visibility issue. Please ensure to test the following scenarios:
- Initial page load
- Page refresh
- Navigation between different routes
✅ Verification successful
Implementation is well-tested and maintains consistency
The changes are properly covered by existing test cases, including:
- Initial drawer state
- Visibility transitions
- Responsive behavior
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for any similar drawer visibility issues reported in the past gh issue list --state all --search "drawer visibility initial" # Look for any related test files fd -e test.tsx -e spec.tsx drawerLength of output: 284
Script:
#!/bin/bash # Check test coverage for visibility behavior cat src/components/LeftDrawer/LeftDrawer.spec.tsx # Check if LeftDrawerOrg has similar implementation ast-grep --pattern 'useEffect(() => { if ($CONDITION) { $ACTION } }, []);' src/components/LeftDrawerOrg/LeftDrawerOrg.tsx # View LeftDrawerOrg implementation for comparison cat src/components/LeftDrawerOrg/LeftDrawerOrg.tsxLength of output: 13456
Please add a new video that shows you accessing this screen from a fresh login |
LeftdrawerLogin.mp4 |
3314e4e
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
BugFix
Issue Number:
Fixes #3210
Did you add tests for your changes?
No, only visible changes
Snapshots/Videos:
LeftDrawerVisibility.mp4
Does this PR introduce a breaking change?
No
Have you read the contributing guide?
Yes
Summary by CodeRabbit