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

Programming exercises: Fix background color and position of problem statement preview #10325

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

PaRangger
Copy link
Contributor

@PaRangger PaRangger commented Feb 14, 2025

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

Motivation and Context

In the programming exercise editor, the problem statement preview currently has a light gray background with a small margin around the edges. This contrasts with the released (non-preview) version, which does not have a background, making the preview appear visually inconsistent.

Additionally, the "Preview" and "Edit" buttons in the preview window are not fixed in place, requiring users to scroll back to the top to switch to edit mode.

Lastly, in the fullscreen editor for modeling exercises, the background color differs from that of the non-fullscreen version.

Bildschirmfoto 2025-02-14 um 16 22 24

When you scroll you can only see the safe button:

Bildschirmfoto 2025-02-14 um 16 17 48

Modeling editor in fullscreen mode:

Bildschirmfoto 2025-02-15 um 14 04 36

Description

I changed the background color to represent the released version by changing the markdown editor background css variable. This means previews in other locations (for example in the lecture description when editing a lecture) it should also display the module background color. Additionally, I fixed the navigation buttons when scrolling. Lastly, i changed the background color of the modeling editor.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Navigate to course management
  3. Navigate to course of choice
  4. Navigate to exercises
  5. Navigate to the programming exercise (or create on if you do not have one)
  6. Click "Edit in editor"
  7. On the right side in the "Problem Statement", click "Preview"
  8. Observe that the background color is the same as the release version
  9. Scroll down a bit
  10. Observe that the "Preview" and "Edit" buttons stay visible while scrolling

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Manual Tests

  • Test 1
  • Test 2

Screenshots

Bildschirmfoto 2025-02-15 um 13 31 41 Bildschirmfoto 2025-02-15 um 13 31 45 Bildschirmfoto 2025-02-15 um 14 04 58

Summary by CodeRabbit

  • Style
    • Updated the modeling editor with a refreshed background color.
    • Enhanced the markdown instruction editor appearance with new styling rules, improved layout for navigation elements, and prioritized element visibility.
    • Unified the background color settings across themes for the markdown preview, ensuring a consistent visual experience.

@PaRangger PaRangger self-assigned this Feb 14, 2025
@PaRangger PaRangger added the programming Pull requests that affect the corresponding module label Feb 14, 2025
@github-actions github-actions bot added client Pull requests that update TypeScript code. (Added Automatically!) and removed programming Pull requests that affect the corresponding module labels Feb 14, 2025
@PaRangger PaRangger added client Pull requests that update TypeScript code. (Added Automatically!) small programming Pull requests that affect the corresponding module labels Feb 14, 2025
@github-actions github-actions bot removed the programming Pull requests that affect the corresponding module label Feb 14, 2025
@krusche krusche added this to the 7.10.1 milestone Feb 15, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test5.artemis.cit.tum.de February 15, 2025 12:25 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test5.artemis.cit.tum.de February 15, 2025 12:52 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test5.artemis.cit.tum.de February 15, 2025 13:16 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test5.artemis.cit.tum.de February 15, 2025 13:32 Inactive
@PaRangger PaRangger marked this pull request as ready for review February 15, 2025 13:37
@PaRangger PaRangger requested a review from a team as a code owner February 15, 2025 13:37
Copy link

coderabbitai bot commented Feb 15, 2025

Walkthrough

The changes update and refine several SCSS files to adjust background styling across the application. In the modeling editor, a new background color using var(--module-bg) is added. The programming exercise instruction editor now includes a new .markdown-editor-wrapper class with corresponding nested styling and z-index adjustments. Additionally, the markdown preview editor background variable in both dark and default theme files is updated to reference $module-bg instead of fixed values. No functional or API changes were made.

Changes

File(s) Change Summary
src/main/webapp/app/.../modeling-editor.component.scss Added background color (var(--module-bg)) to the .modeling-editor class.
src/main/webapp/app/.../programming-exercise-editable-instruction.scss Introduced new .markdown-editor-wrapper with background color and nested .nav styling; updated &__save class to include z-index: 2.
src/main/webapp/content/scss/themes/_dark-variables.scss, src/main/webapp/content/scss/themes/_default-variables.scss Updated $markdown-preview-editor-background to use $module-bg instead of transparent or #f8f9fa.

Possibly related PRs

Suggested labels

enhancement, bugfix

Suggested reviewers

  • Feras797
  • HawKhiem
  • krusche
  • SimonEntholzer
  • ItsaaaMeMario
  • coolchock

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. (Beta)
  • @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

🧹 Nitpick comments (1)
src/main/webapp/app/exercises/programming/manage/instructions-editor/programming-exercise-editable-instruction.scss (1)

31-34: New Markdown Editor Wrapper Styles.
The introduction of the .markdown-editor-wrapper class with a background color set to var(--markdown-preview-editor-background) !important successfully overrides any scoped styling issues. If possible, consider whether a more specific selector might eventually eliminate the need for !important.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8166c34 and 8ebadd1.

📒 Files selected for processing (4)
  • src/main/webapp/app/exercises/modeling/shared/modeling-editor.component.scss (1 hunks)
  • src/main/webapp/app/exercises/programming/manage/instructions-editor/programming-exercise-editable-instruction.scss (2 hunks)
  • src/main/webapp/content/scss/themes/_dark-variables.scss (1 hunks)
  • src/main/webapp/content/scss/themes/_default-variables.scss (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/main/webapp/app/exercises/modeling/shared/modeling-editor.component.scss
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: client-tests
🔇 Additional comments (4)
src/main/webapp/app/exercises/programming/manage/instructions-editor/programming-exercise-editable-instruction.scss (2)

36-41: Sticky Navigation for Editor Preview.
The nested .markdown-editor-wrapper .nav rule applies sticky positioning (with top: 0 and z-index: 1) and sets the same dynamic background, ensuring the navigation buttons remain visible while scrolling. This directly addresses the PR objective for improved usability.


52-59: Enhanced Z-Index for Save Button.
By assigning a z-index: 2 to the &__save element, the save button is guaranteed to appear above overlapping content. This adjustment enhances user interaction by ensuring critical controls remain accessible.

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

165-169: Dynamic Background Variable Update.
Updating $markdown-preview-editor-background to reference $module-bg ensures the markdown preview editor now derives its background from a centralized, dynamic variable. This change enhances consistency across components and themes.

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

240-248: Standardizing Dark Theme Background.
Changing $markdown-preview-editor-background to $module-bg in the dark theme aligns its styling with the default theme. This promotes a consistent visual appearance across themes and meets the PR’s design objectives.

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 small
Projects
Status: Work In Progress
Development

Successfully merging this pull request may close these issues.

2 participants