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

General: Animate content sidebar on toggle #9412

Merged
merged 5 commits into from
Oct 5, 2024

Conversation

PaRangger
Copy link
Contributor

@PaRangger PaRangger commented Oct 2, 2024

Checklist

General

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data (e.g. using paging).
  • I strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.

Motivation and Context

The sidebar to switch between exercises/lectures/communication is animated when toggling it. The sidebar for the content however simply vanishes. For better consistency and a smoother user interface I animated the content sidebar.

Description

I added an animation by gradually lowering the width of the sidebar and lowering the opacity of the items inside the sidebar. To make this smooth some minor layout changes were necessary. I removed the gap property that seperated the sidebar and the content, and instead added a margin directly to the sidebar.

Steps for Testing

Prerequisites:

  • 1 Student/Instructor/Tutor
  • 1 Course with an exercise/lecture or communication enabled.
  1. Log in to Artemis
  2. Navigate to the course
  3. Locate the sidebar icon and press it
  4. The sidebar should smoothly transition in and out
  5. Additionally, to verify the layout changes, check if the margin on the right of the sidebar looks proper

Screenshots

sidebar

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced sidebar behavior with improved transitions and hover effects for a smoother user experience.
    • Introduced new SCSS variables for better styling consistency, including sidebar width and transition durations.
    • Added a new class for improved styling of the collapse button in the exam navigation sidebar.
  • Bug Fixes

    • Adjusted conditional rendering logic in various components to ensure correct display based on user interactions and application state.
  • Documentation

    • Updated SCSS variable definitions for improved clarity and organization in styling components.
  • Style

    • Improved layout, spacing adjustments, and visual feedback in sidebar and course-related components, including refined transition effects.

@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Oct 2, 2024
@PaRangger PaRangger temporarily deployed to artemis-test5.artemis.cit.tum.de October 2, 2024 17:08 — with GitHub Actions Inactive
@PaRangger PaRangger marked this pull request as ready for review October 2, 2024 17:15
@PaRangger PaRangger requested a review from a team as a code owner October 2, 2024 17:15
Copy link

coderabbitai bot commented Oct 2, 2024

Walkthrough

The pull request introduces modifications to the HTML and SCSS files for the course overview component and global styles. Key changes include updating a CSS class in the HTML template based on the isNavbarCollapsed state, enhancing transition effects and hover states in the SCSS files, and renaming and adding new transition variables. The overall structure and functionality of the components remain unchanged, with a focus on improving the sidebar's visual behavior during interactions.

Changes

File Path Change Summary
src/main/webapp/app/overview/course-overview.component.html Changed class from 'sidebar-collapsed' to 'sidebar-collapsed-course-overview' based on isNavbarCollapsed.
src/main/webapp/app/overview/course-overview.component.scss Updated $transition-delay from 0.1s to 0.3s; refined hover effects for .btn-sidebar-collapse.
src/main/webapp/content/scss/global.scss Renamed .sidebar-collapsed to .sidebar-collapsed-course-overview; added transition variables for sidebar and updated .sidebar-content for opacity transitions.
src/main/webapp/app/exam/participate/exam-navigation-sidebar/exam-navigation-sidebar.component.html Added double-arrow-icon class to <div> for collapse state indicators.
src/main/webapp/app/exam/participate/exam-navigation-sidebar/exam-navigation-sidebar.component.scss Refined height calculations, sidebar width, and added media queries for responsiveness; modified transform properties for .double-arrow classes.

Possibly related PRs

  • General: Allow to switch courses from the course icon #8669: The changes in the course-overview.component.html file include modifications to the sidebar's conditional rendering and class assignments, which relate directly to the updates made in the main PR regarding the sidebar's collapsed state and class changes.
  • Exam mode: Reduce width of sidebar #9171: This PR focuses on reducing the width of the sidebar, which is relevant to the main PR's changes that enhance the sidebar's visual behavior and responsiveness.
  • General: Elevate toggle sidebar button #9411: The modifications to the sidebar toggle button's visibility and functionality in this PR are directly related to the enhancements made in the main PR regarding the sidebar's dynamic behavior and user interface improvements.

Suggested labels

user interface, small, chore

Suggested reviewers

  • edkaya
  • krusche
  • Jan-Thurner
  • florian-glombik
  • pzdr7

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

🧹 Outside diff range comments (4)
src/main/webapp/app/overview/course-lectures/course-lectures.component.html (1)

Line range hint 2-17: Correct usage of new Angular syntax

The template is correctly using the new Angular syntax @if instead of *ngIf as per the coding guidelines. This is applied consistently throughout the template.

Animation effect for sidebar toggle not implemented

The PR objectives mention adding an animation effect to the content sidebar when it is toggled. However, I don't see any changes in this template that implement this animation.

To implement the animation effect, you might need to:

  1. Add CSS classes for the animation.
  2. Use Angular's animation module to define the transition.
  3. Bind the animation trigger to the isCollapsed state.

Would you like assistance in implementing these changes or creating a GitHub issue to track this task?

src/main/webapp/app/overview/course-conversations/course-conversations.component.html (1)

Line range hint 1-67: *Consider updating remaining ngIf directives to @if

While reviewing the entire file, I noticed that some *ngIf directives are still being used (e.g., on line 2). For consistency and to align with the coding guidelines, consider updating these to the new @if syntax.

Here's an example of how you could update the *ngIf on line 2:

-    <div class="input-group mb-2 rounded-3 p-2 me-2 module-bg" [hidden]="!isCodeOfConductAccepted">
+    @if (isCodeOfConductAccepted) {
+    <div class="input-group mb-2 rounded-3 p-2 me-2 module-bg">

Make sure to add a closing brace } at the appropriate place after the div's closing tag.

src/main/webapp/app/overview/course-overview.component.html (1)

Line range hint 1-300: Consider consistent usage of Angular syntax and potential refactoring for improved readability.

  1. Angular Syntax Consistency:
    The template uses both old-style (*ngIf/*ngFor) and new-style (@if/@for) Angular syntax. For consistency and to align with the latest Angular best practices, consider updating all instances to use the new @if/@for syntax.

  2. Template Complexity:
    The template contains multiple nested ng-template elements and a complex structure. While this is not inherently wrong, it might impact readability and maintainability. Consider breaking down complex parts into smaller, reusable components to improve the overall structure and maintainability of the template.

These suggestions aim to enhance code consistency and maintainability without changing the functionality.

src/main/webapp/content/scss/themes/_dark-variables.scss (1)

Line range hint 138-143: LGTM: Module and navigation bar styling variables added

The new variables for module and navigation bar styling are well-defined and maintain consistency with the overall theme. They provide a standardized way to style these components across the application.

Consider renaming $course-image-bg to $course-image-background for consistency with other background variable names in the file.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between e5d9c6c and cb402f4.

📒 Files selected for processing (11)
  • src/main/webapp/app/overview/course-conversations/course-conversations.component.html (1 hunks)
  • src/main/webapp/app/overview/course-exams/course-exams.component.html (1 hunks)
  • src/main/webapp/app/overview/course-exercises/course-exercises.component.html (1 hunks)
  • src/main/webapp/app/overview/course-lectures/course-lectures.component.html (1 hunks)
  • src/main/webapp/app/overview/course-overview.component.html (1 hunks)
  • src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.html (1 hunks)
  • src/main/webapp/app/shared/sidebar/sidebar.component.html (1 hunks)
  • src/main/webapp/app/shared/sidebar/sidebar.component.scss (0 hunks)
  • src/main/webapp/content/scss/global.scss (1 hunks)
  • src/main/webapp/content/scss/themes/_dark-variables.scss (1 hunks)
  • src/main/webapp/content/scss/themes/_default-variables.scss (1 hunks)
💤 Files with no reviewable changes (1)
  • src/main/webapp/app/shared/sidebar/sidebar.component.scss
🧰 Additional context used
📓 Path-based instructions (7)
src/main/webapp/app/overview/course-conversations/course-conversations.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

src/main/webapp/app/overview/course-exams/course-exams.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

src/main/webapp/app/overview/course-exercises/course-exercises.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

src/main/webapp/app/overview/course-lectures/course-lectures.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

src/main/webapp/app/overview/course-overview.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

src/main/webapp/app/shared/sidebar/sidebar.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

🔇 Additional comments (19)
src/main/webapp/app/overview/course-lectures/course-lectures.component.html (1)

1-1: ⚠️ Potential issue

Removal of gap-3 class may affect layout

The gap-3 class has been removed from the outer <div> element. This change aligns with the PR objectives, which mention replacing the gap property with a margin applied directly to the sidebar. However, I don't see the corresponding margin being added to the sidebar element in this file.

To ensure the layout is correct, please verify:

  1. The margin is applied correctly to the sidebar component.
  2. The removal of gap-3 doesn't negatively impact the layout of other elements.

You can use the following script to check for the margin application in the sidebar component:

✅ Verification successful

Margin styles are correctly applied to sidebar components

The shell script confirmed that margin styles are present in the sidebar component SCSS files, aligning with the PR objectives of replacing gap-3 with margins. The removal of the gap-3 class does not negatively impact the layout.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for margin application in the sidebar component

# Search for the sidebar component file
sidebar_file=$(fd --type f --glob '*sidebar.component.*' src/main/webapp)

# Check for margin-related styles in the sidebar component
if [ -n "$sidebar_file" ]; then
  echo "Checking $sidebar_file for margin styles:"
  rg 'margin|mr-' "$sidebar_file"
else
  echo "Sidebar component file not found."
fi

Length of output: 8287


Script:

#!/bin/bash
# Description: Check for margin application in the sidebar component SCSS files

# Search for the sidebar component SCSS files
sidebar_scss_files=$(fd --type f --glob '*sidebar.component.scss' src/main/webapp)

if [ -n "$sidebar_scss_files" ]; then
  for file in $sidebar_scss_files; do
    echo "Checking $file for margin styles:"
    rg 'margin|mr-' "$file"
  done
else
  echo "No sidebar component SCSS files found."
fi

Length of output: 2680

src/main/webapp/app/overview/course-tutorial-groups/course-tutorial-groups.component.html (4)

2-2: Correct usage of new Angular syntax

The template correctly uses the new @if and @else syntax instead of *ngIf, which aligns with the provided coding guidelines. This change improves code readability and follows Angular's latest best practices.

Also applies to: 8-13


Line range hint 1-20: Overall structure and conditional rendering logic are correct

The template maintains the correct structure and conditional rendering logic after the changes:

  1. The outer condition checks for the presence of course.
  2. The sidebar is always rendered when course is present.
  3. The main content area is conditionally rendered based on tutorialGroupSelected.

This structure aligns with the PR objectives and maintains the intended functionality.


Line range hint 1-20: Summary of changes and potential impact

The changes in this file are minimal but significant:

  1. Removal of the gap-3 class from the outer <div>, which may affect the layout spacing.
  2. Correct usage of the new Angular @if and @else syntax.

These changes align with the PR objectives and coding guidelines. The main point of attention is ensuring that the layout remains correct after removing the gap-3 class. Please thoroughly test the component's appearance across different screen sizes and content scenarios to confirm that the spacing between the sidebar and main content area remains appropriate.

To verify the overall functionality and appearance:

  1. Test the sidebar toggle animation as mentioned in the PR objectives.
  2. Confirm that the margin on the right side of the sidebar appears correctly.
  3. Check the component's appearance in both light and dark modes.
#!/bin/bash
# Description: Check for any animation-related styles or classes

# Test: Search for animation-related CSS classes or inline styles
rg --type html -e 'class="[^"]*\b(animate|transition)\b' src/main/webapp/app/overview/course-tutorial-groups/
rg --type html -e 'style="[^"]*animation|transition' src/main/webapp/app/overview/course-tutorial-groups/

# Test: Search for any CSS files that might contain the animation styles
fd -e css | xargs rg -e 'animation|transition'

1-1: Verify layout after removing gap-3 class

The removal of the gap-3 class from the outer <div> aligns with the PR objectives. However, please ensure that this change doesn't negatively impact the layout, especially the spacing between the sidebar and the main content area.

To verify the layout:

  1. Check that the sidebar and main content are properly aligned.
  2. Ensure there's adequate spacing between these elements.
  3. Test with different screen sizes to confirm responsiveness.
src/main/webapp/app/overview/course-exercises/course-exercises.component.html (5)

1-1: LGTM on class removal and Angular syntax.

The removal of the gap-3 class aligns with the PR objectives. Also, the use of @if instead of *ngIf complies with the coding guidelines.


1-1: Verify margin implementation on sidebar.

The PR objectives mention replacing the gap with a margin applied directly to the sidebar. However, this change is not visible in this file. Please confirm if this has been implemented elsewhere or if it needs to be added here.


Line range hint 1-19: Request information on animation implementation.

The PR objectives mention adding an animation effect to the content sidebar when toggled. While the isCollapsed binding suggests this functionality, the animation itself is not visible in this HTML. Could you please provide information on where and how the animation is implemented (e.g., in CSS or TypeScript)?


Line range hint 3-5: Request information on DEFAULT_COLLAPSE_STATE.

The sidebar component uses DEFAULT_COLLAPSE_STATE for its collapseState input. Could you please provide information on what this constant represents and how it relates to the new animation effect mentioned in the PR objectives?


Line range hint 7-18: LGTM on content area structure and rendering logic.

The conditional rendering of the content area based on exerciseSelected is implemented correctly. The use of @if and @else complies with the coding guidelines, and the structure for both cases (selected and not selected) appears appropriate.

src/main/webapp/app/overview/course-exams/course-exams.component.html (3)

Line range hint 1-19: LGTM: Structure and syntax align with objectives and guidelines

The overall structure of the template aligns well with the PR objectives. The conditional rendering logic is preserved, and the new Angular syntax (@if and @else) is used consistently, which adheres to the coding guidelines. The layout for different scenarios (exam selected/not selected) is maintained, ensuring the functionality remains intact.


Line range hint 3-5: Verify the implementation of the sidebar animation

The sidebar implementation looks correct, with the sidebar-collapsed class toggled based on the isCollapsed state. However, the animation effect mentioned in the PR objectives is not explicitly visible in this template.

Please confirm that the animation is implemented correctly, possibly in a separate CSS file. Run the following script to check for animation-related styles:

#!/bin/bash
# Description: Search for animation-related styles for the sidebar

# Look for animation, transition, or transform properties in CSS files
rg --type css -e '(animation|transition|transform).*sidebar' src/main/webapp/

Line range hint 1-19: Summary: Changes align with objectives, but require verification

The changes in this file align with the PR objectives, particularly in maintaining the structure for conditional rendering of the sidebar and exam content. The use of new Angular syntax (@if and @else) is correct and follows the coding guidelines.

However, there are two points that require verification:

  1. The removal of the gap-3 class from the outer <div> might affect the layout. Please confirm if this change is intentional and related to the "minor layout adjustments" mentioned in the PR objectives.

  2. The animation effect for the sidebar toggle is not explicitly visible in this template. Please provide information on where and how this animation is implemented.

To assist with the verification, please run the following script to check for related changes in other files:

#!/bin/bash
# Description: Search for related changes in CSS and TypeScript files

# Look for changes in CSS files that might be related to the animation or layout adjustments
rg --type css -e '(animation|transition|transform|margin|padding).*sidebar' src/main/webapp/

# Check for changes in the corresponding TypeScript component file
cat src/main/webapp/app/overview/course-exams/course-exams.component.ts

This will help ensure that all aspects of the PR objectives are properly implemented and documented.

src/main/webapp/app/overview/course-conversations/course-conversations.component.html (1)

25-25: LGTM! Verify visual alignment.

The removal of the 'me-3' class aligns with the PR objective of adjusting the layout to accommodate the new animation effect for the sidebar. This change removes the right margin that previously separated the sidebar from the content.

Please ensure that:

  1. The sidebar visually aligns correctly with the content area after this change.
  2. The animation effect for toggling the sidebar works as expected with this layout adjustment.

You can verify this by:

  1. Logging into Artemis
  2. Navigating to a course
  3. Toggling the sidebar to observe the smooth transition effect
  4. Checking that the margin on the right side of the sidebar appears correctly
src/main/webapp/app/shared/sidebar/sidebar.component.html (2)

1-1: Approved: New wrapper div added. Please clarify its purpose.

The addition of the outer <div class="sidebar-wrap"> is likely related to the animation effect mentioned in the PR objectives. While it doesn't introduce any functional changes, it may be used for styling or layout purposes.

Could you please provide more details on how this wrapper div contributes to the sidebar animation effect?


5-5: Excellent: Updated to new Angular syntax as per guidelines.

Great job on updating the template to use the new @if and @for directives instead of *ngIf and *ngFor. This change aligns perfectly with the provided coding guidelines, which state that these new directives should always be used over the old style. Your consistent application of this change throughout the template is commendable.

Also applies to: 8-8, 11-11, 13-13, 22-22, 32-32, 41-41, 59-59

src/main/webapp/content/scss/themes/_dark-variables.scss (3)

132-134: LGTM: Footer styling variables added

The new footer-related variables are well-defined and consistent with the existing naming conventions. They provide flexibility for styling the footer in different environments (dev and prod) while maintaining consistency with the dark theme.


133-136: LGTM: Sidebar styling variables added

The new sidebar-related variables, including $sidebar-width: 275px, are well-defined and consistent with the PR objectives. They provide a standardized way to style the sidebar and its footer in different environments (dev and prod).


Line range hint 145-162: LGTM: Card and navbar styling variables added

The new variables for card and navbar styling are well-defined and comprehensive. They offer the following benefits:

  1. Consistent styling for card components
  2. Detailed color definitions for various navbar states and elements
  3. Alignment with Bootstrap's naming conventions, improving maintainability
  4. Use of existing color variables and SCSS functions, allowing for easy theme adjustments

These additions will greatly enhance the consistency and flexibility of the dark theme across the application.

src/main/webapp/content/scss/global.scss Show resolved Hide resolved
src/main/webapp/content/scss/global.scss Show resolved Hide resolved
src/main/webapp/content/scss/global.scss Outdated Show resolved Hide resolved
src/main/webapp/content/scss/global.scss Outdated Show resolved Hide resolved
src/main/webapp/content/scss/global.scss Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 2, 2024
Copy link
Contributor

@JohannesStoehr JohannesStoehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a screenshot/screencast of the changes in the PR description?

Copy link
Contributor

@janthoXO janthoXO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot of subjective preferences, but for me the sidebar takes too long to collapse. Also I would orientate the animation more on commonly animations like this react animation

Copy link
Contributor

@janthoXO janthoXO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The animation of the general sidebar and the exercise sidebar are not consistent.
The general sidebar has just an extending and simultaneously fade in of the text. Whereas the exercise sidebar first extends and then lets the text fade in.

Screen.Recording.2024-10-03.at.22.16.39.mov

Copy link
Contributor

@janthoXO janthoXO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sidebar can be collapsed by pressing crtl+shift+m.
Is this a feature or a bug? because this is no where documented

@PaRangger
Copy link
Contributor Author

The animation of the general sidebar and the exercise sidebar are not consistent. The general sidebar has just an extending and simultaneously fade in of the text. Whereas the exercise sidebar first extends and then lets the text fade in.

Screen.Recording.2024-10-03.at.22.16.39.mov

I changed the animation to have no delay between fade and slide. Additionally I made the animation faster 👍🏼

@PaRangger
Copy link
Contributor Author

The sidebar can be collapsed by pressing crtl+shift+m. Is this a feature or a bug? because this is no where documented

It should be possible with ctrl+shift+b. Not with ctrl+shift+m. For me it does not work with ctrl+shift+m though. Could it be a keyboard layout thing? 🤔 I have a german keyboard layout (WERTZ).

@PaRangger
Copy link
Contributor Author

Can you add a screenshot/screencast of the changes in the PR description?

Added a .gif that shows the animation 👌🏻

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range comments (1)
src/main/webapp/app/exam/participate/exam-navigation-sidebar/exam-navigation-sidebar.component.html (1)

Line range hint 1-82: Consider these minor improvements for better code style and documentation:

  1. Standardize quote usage: Consider using either single or double quotes consistently throughout the file for attribute values.

  2. Break long lines: Some lines exceed 120 characters. Consider breaking them for better readability. For example:

<span [ngbTooltip]="!examTimeLineView ? ('artemisApp.examParticipation.' + getExerciseButtonTooltip(exercises[i]) | artemisTranslate) : ''">

Could be split into:

<span [ngbTooltip]="!examTimeLineView ? 
    ('artemisApp.examParticipation.' + getExerciseButtonTooltip(exercises[i]) | artemisTranslate) : 
    ''">
  1. Review comments: Consider moving the larger comment blocks (like the one explaining the exam navigation functionality) to a separate documentation file or component metadata, keeping only essential inline comments in the template.

These suggestions are minor and don't affect functionality, but they could improve code maintainability and readability.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between fc1d2ae and a2d9b4e.

📒 Files selected for processing (3)
  • src/main/webapp/app/exam/participate/exam-navigation-sidebar/exam-navigation-sidebar.component.html (1 hunks)
  • src/main/webapp/app/exam/participate/exam-navigation-sidebar/exam-navigation-sidebar.component.scss (1 hunks)
  • src/main/webapp/content/scss/global.scss (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/webapp/app/exam/participate/exam-navigation-sidebar/exam-navigation-sidebar.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

🔇 Additional comments (11)
src/main/webapp/app/exam/participate/exam-navigation-sidebar/exam-navigation-sidebar.component.html (1)

Line range hint 17-17: Excellent use of new Angular syntax!

The file correctly uses the new Angular syntax @if and @for instead of *ngIf and *ngFor, as per the coding guidelines. This adoption of the latest Angular features improves code readability and performance.

Also applies to: 24-24

src/main/webapp/app/exam/participate/exam-navigation-sidebar/exam-navigation-sidebar.component.scss (3)

110-110: Consistent transform for collapsed menu

The transform property for .double-arrow.menu-closed correctly adjusts the position of the arrow when the menu is collapsed, ensuring a smooth animation effect.


114-115: Smooth transition for sidebar toggle

Setting the transition on the transform property in .double-arrow provides a smooth animation when the sidebar is toggled open or closed.


123-125: Correct rotation for closed menu icon

The .menu-closed .double-arrow-icon rotation set to 0deg correctly represents the closed state of the sidebar, enhancing user experience.

src/main/webapp/content/scss/global.scss (7)

1092-1094: Class renaming enhances clarity.

Renaming .sidebar-collapsed to .sidebar-collapsed-course-overview improves specificity and prevents potential styling conflicts across different components.


1096-1098: Transition variables increase maintainability.

Defining $transition-sidebar-content-opacity-length, $transition-sidebar-width-length, and $transition-in-between-delay as variables promotes consistency and simplifies future adjustments to transition timings.


1100-1105: Opacity transition added to .sidebar-content.

Implementing an opacity transition for .sidebar-content enhances the user experience by providing a smooth fade effect when the sidebar is toggled.


1106-1111: Collapsed sidebar content transitions correctly.

Setting the opacity to 0 in .sidebar-collapsed .sidebar-content with appropriate transitions ensures a seamless fade-out effect when collapsing the sidebar.


1112-1121: .sidebar-wrap transitions support width adjustment.

The addition of transitions on max-width and margin-right in .sidebar-wrap facilitates a smooth resizing of the sidebar during toggling actions.


1122-1130: Collapsed .sidebar-wrap handles transitions properly.

Adjusting max-width and margin-right to 0 in .sidebar-collapsed .sidebar-wrap with corresponding transitions provides a consistent collapsing animation for the sidebar.


1131-1133: .sidebar-width class ensures consistent width.

Defining the .sidebar-width class with a fixed width promotes consistency across different instances of the sidebar.

@krusche krusche merged commit eee133f into develop Oct 5, 2024
34 of 39 checks passed
@krusche krusche deleted the feature/general/animate-sidebar-on-toggle branch October 5, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) ready for review
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants