-
Notifications
You must be signed in to change notification settings - Fork 158
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 Side Navigation issues (toggle and on refresh) #1335
Fix Side Navigation issues (toggle and on refresh) #1335
Conversation
@coderabbitai review |
WalkthroughThe changes involve updates to the Angular application's side navigation behavior. A new method Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
package.json
is excluded by:!**/*.json
Files selected for processing (2)
- src/app/app.component.html (1 hunks)
- src/app/app.component.ts (2 hunks)
Additional comments: 5
src/app/app.component.html (2)
- 22-22: Added
(backdropClick)="backdropClicked()"
event handler tomat-sidenav-container
for improved user interaction with the sidenav.- 30-30: Corrected the closing tag of
mat-sidenav-content
by removing an extra>
.src/app/app.component.ts (3)
- 162-164: The
flgSideNavOpened
flag is now being toggled inngAfterViewInit
. Ensure that this change does not introduce any unintended behavior, especially since the flag is being toggled before the call tothis.sideNavigation.close()
.- 176-178: The
flgSideNavOpened
flag is now being toggled inonNavigationClicked
. This change is consistent with the PR objectives to improve the sidenav toggle functionality.- 182-183: The
flgSideNavOpened
flag is now being toggled inbackdropClicked
. This change is consistent with the PR objectives to improve the sidenav toggle functionality.
53ba83e
to
22fdf64
Compare
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.
Why do we need this script? We already have start
script for development environment? But it can be added, if it helps other users.
@@ -159,7 +159,10 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy { | |||
} | |||
|
|||
ngAfterViewInit() { | |||
if (this.smallScreen || !this.flgLoggedIn) { this.sideNavigation.close(); } | |||
if (this.smallScreen || !this.flgLoggedIn) { | |||
this.flgSideNavOpened = !this.flgSideNavOpened; |
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.
This flag toggling hides the side navigation on non-small screens on initial page load. So, had to delete it from here.
Toggling the sidenav had some issues (on mobile and desktop view), which I believe these changes will fix.
For example:
I also took the liberty to add a watch command (
npm run watchfrontenddev
) for the frontend to thepackage.json
This PR does not include the associated production build for clarity of code changes.
Summary by CodeRabbit