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: Fix header position in exercise and course summaries #9996

Merged

Conversation

PaRangger
Copy link
Contributor

@PaRangger PaRangger commented Dec 10, 2024

Checklist

General

Client

  • 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.
  • I added multiple screenshots/screencasts of my UI changes.

Motivation and Context

Currently there is an issue with the header in exercise and course detail views, which makes the position look off when scrolling:

Bildschirmfoto 2024-12-10 um 23 46 11

Also in the programming exercises:

Bildschirmfoto 2024-12-11 um 00 02 32

Description

I set the sticky position to 0, so that the navbar is correctly positioned.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Navigate to Course Administration
  3. Scroll down and see if the navbar for the detail component properly attaches to the top
  4. Go to a Manage Exercises
  5. Edit a programming exercise
  6. Check if the header is correctly positioned when scrolling down

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

Performance Review

Manual Tests

  • Test 1
  • Test 2

Screenshots

Bildschirmfoto 2024-12-10 um 23 59 26 Bildschirmfoto 2024-12-11 um 00 02 47

Summary by CodeRabbit

  • Style
    • Updated the vertical positioning of the form status bar to stick to the top with a fixed value.
    • Adjusted the navigation bar's vertical positioning to stick to the top with a fixed value.

@PaRangger PaRangger self-assigned this Dec 10, 2024
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Dec 10, 2024
@PaRangger PaRangger temporarily deployed to artemis-test5.artemis.cit.tum.de December 10, 2024 23:27 — with GitHub Actions Inactive
@PaRangger PaRangger marked this pull request as ready for review December 10, 2024 23:31
@PaRangger PaRangger requested a review from a team as a code owner December 10, 2024 23:31
Copy link

coderabbitai bot commented Dec 10, 2024

Walkthrough

The changes in this pull request involve modifications to the CSS styling of two components: form-status-bar and detail-overview-navigation-bar. Both components have had their top property adjusted from a variable value (var(--header-height)) to a fixed value of 0, affecting their vertical positioning to stick to the top of their respective containing elements. No other styles or public entity declarations were altered in this update.

Changes

File Change Summary
src/main/webapp/app/forms/form-status-bar/form-status-bar.component.scss Changed .form-status-bar-container top property from var(--header-height) to 0.
src/main/webapp/app/shared/detail-overview-navigation-bar/detail-overview-navigation-bar.scss Changed nav element top property from var(--header-height) to 0.

Possibly related PRs

Suggested labels

user interface, ready to merge

Suggested reviewers

  • krusche
  • az108
  • HawKhiem
  • florian-glombik
  • edkaya

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 generate docstrings to generate docstrings for this PR. (Experiment)
  • @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: 0

🧹 Outside diff range and nitpick comments (1)
src/main/webapp/app/shared/detail-overview-navigation-bar/detail-overview-navigation-bar.scss (1)

3-3: Consider maintaining CSS variable usage for consistency

Removing the usage of var(--header-height) in favor of a hard-coded 0 value reduces maintainability. Could you explain why the variable-based approach wasn't working? This might indicate a deeper issue with how the header height is being calculated or applied.

Consider keeping the variable if possible:

-    top: 0;
+    top: var(--header-height, 0);

This maintains flexibility while providing a fallback value.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 037d35d and 0c2f254.

📒 Files selected for processing (2)
  • src/main/webapp/app/forms/form-status-bar/form-status-bar.component.scss (1 hunks)
  • src/main/webapp/app/shared/detail-overview-navigation-bar/detail-overview-navigation-bar.scss (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/main/webapp/app/forms/form-status-bar/form-status-bar.component.scss
🔇 Additional comments (1)
src/main/webapp/app/shared/detail-overview-navigation-bar/detail-overview-navigation-bar.scss (1)

3-3: Verify potential header overlap issues

While setting top: 0 fixes the scrolling misalignment, we should verify that this doesn't cause the navigation bar to overlap with other fixed/sticky elements at the top of the page.

Let's check for other fixed/sticky positioned elements that might conflict:

✅ Verification successful

Setting top: 0 is consistent with other sticky components

The change from var(--header-height) to top: 0 aligns with the application's layout pattern. Both the main navigation (.sticky-top-navar) and form status bar use top: 0 with appropriate z-index values to handle stacking. The removal of the CSS variable is justified as it follows the established pattern in the codebase for sticky positioning.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for fixed/sticky positioned elements in SCSS files
rg -t scss "position:\s*(fixed|sticky)" src/main/webapp/app/

Length of output: 91


Script:

#!/bin/bash
# Search for fixed/sticky positioned elements using ripgrep without file type restriction
rg "position:\s*(fixed|sticky)" src/main/webapp/app/ --type-add 'scss:*.scss' -t scss

Length of output: 3514


Script:

#!/bin/bash
# Let's check the content of the main layout file and header to understand the vertical stacking
rg -A 5 -B 5 "position:\s*(fixed|sticky)" src/main/webapp/app/shared/layouts/main/main.component.scss

# Also check the form-status-bar since it was mentioned in the AI summary
cat src/main/webapp/app/forms/form-status-bar/form-status-bar.component.scss

Length of output: 794

Copy link

@HawKhiem HawKhiem left a comment

Choose a reason for hiding this comment

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

Tested on TS4. Header works fine when scrolling down now

image

@krusche krusche added this to the 7.7.5 milestone Dec 11, 2024
@krusche krusche merged commit da468e2 into develop Dec 11, 2024
61 of 70 checks passed
@krusche krusche deleted the bugfix/programming-exercises/fix-header-sticky-position branch December 11, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix client Pull requests that update TypeScript code. (Added Automatically!) ready for review
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

3 participants