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

Communication: Fix content overflow in expanded thread view #9474

Merged
merged 8 commits into from
Oct 27, 2024

Conversation

asliayk
Copy link
Contributor

@asliayk asliayk commented Oct 13, 2024

Checklist

General

Client

Motivation and Context

When the thread view is expanded by the user, the content overflows, making it difficult to fully read messages and preventing the user from seeing the close button in the top-right corner.

Description

The thread view has been updated to prevent overflow, and horizontal scrolling has been disabled.

Steps for Testing

Prerequisites:

  • 1 Instructor/Student
  1. Log in to Artemis
  2. Navigate to Communication section of a course
  3. Find a thread or create one thread by replying a message.
  4. Open the thread view and expand it.
  5. Notice that the content does not overflow

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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
conversation-thread-sidebar.component.ts 82.14% ✅ ❌

Screenshots

BEFORE
image

AFTER
image

Summary by CodeRabbit

  • New Features
    • Introduced a new variable to set a maximum width for conversation thread cards, enhancing layout consistency.
  • Style
    • Updated styles for the conversation thread sidebar to improve visual presentation.

@asliayk asliayk added client Pull requests that update TypeScript code. (Added Automatically!) small bugfix component:Communication labels Oct 13, 2024
@asliayk asliayk self-assigned this Oct 13, 2024
@asliayk asliayk requested a review from a team as a code owner October 13, 2024 19:55
Copy link

coderabbitai bot commented Oct 13, 2024

Walkthrough

The changes in this pull request involve the addition of a new SCSS variable, $thread-section-card-max-width, set to 540px, which is applied to the .card class within the .expanded-thread class. This new variable establishes a maximum width for the card component, complementing an existing minimum width variable. The overall structure and media queries of the layout remain unchanged, ensuring consistent responsive behavior.

Changes

File Change Summary
src/main/webapp/app/overview/course-conversations/layout/conversation-thread-sidebar/conversation-thread-sidebar.component.scss Added variable $thread-section-card-max-width: 540px; applied to .card in .expanded-thread.

Possibly related PRs

Suggested labels

ready for review

Suggested reviewers

  • edkaya
  • krusche
  • JohannesStoehr
  • Jan-Thurner

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: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between 6549075 and cb4f73d.

📒 Files selected for processing (1)
  • src/main/webapp/app/overview/course-conversations/layout/conversation-thread-sidebar/conversation-thread-sidebar.component.scss (2 hunks)
🧰 Additional context used
🔇 Additional comments (1)
src/main/webapp/app/overview/course-conversations/layout/conversation-thread-sidebar/conversation-thread-sidebar.component.scss (1)

5-5: LGTM: New variable declaration is appropriate.

The new variable $thread-section-card-max-width is well-named, consistent with existing conventions, and its value seems reasonable for the intended purpose.

@@ -37,6 +38,7 @@ $thread-section-card-min-width: 420px;
.card {
width: inherit;
min-width: $thread-section-card-min-width;
max-width: $thread-section-card-max-width;
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

LGTM: Appropriate use of the new variable. Consider a minor improvement.

The new max-width property using $thread-section-card-max-width is correctly implemented and should effectively prevent content overflow as intended. This change, combined with the existing min-width, creates a constrained range for the card width, which is a good approach.

For consistency, consider moving the max-width property right after the min-width property. This would group related properties together, improving code readability.

Here's a suggested minor refactor for improved readability:

 .card {
     width: inherit;
     min-width: $thread-section-card-min-width;
+    max-width: $thread-section-card-max-width;
-
-    max-width: $thread-section-card-max-width;

     .card-header {
         justify-content: space-between;
         align-items: center;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
max-width: $thread-section-card-max-width;
min-width: $thread-section-card-min-width;
max-width: $thread-section-card-max-width;

@@ -2,6 +2,7 @@

$draggable-width: 15px;
$thread-section-card-min-width: 420px;
$thread-section-card-max-width: 540px;
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Potential Conflicts Detected.
Several hardcoded widths and media queries were found that may conflict with the new $thread-section-card-max-width. Please review these instances to ensure consistent and conflict-free styling across the codebase.

  • Hardcoded Widths:

    • width: 38px; in conversation-thread-sidebar.component.scss
    • Other instances in related .scss files
  • Media Queries:

    • @media (max-width: 768px) in multiple components
    • @media screen and (max-width: 992px) in conversation-thread-sidebar.component.scss
🔗 Analysis chain

Summary: Changes look good. Consider verifying across different screen sizes.

The implementation of $thread-section-card-max-width and its application to the .card element should effectively address the content overflow issue in the expanded thread view. The changes are minimal and focused, maintaining the existing responsive design.

To ensure the effectiveness of these changes:

Please run the following script to check if there are any potential conflicts with the new max-width in other parts of the codebase:

Additionally, it would be beneficial to manually test the changes across various screen sizes to ensure the layout remains consistent and functional.

Also applies to: 41-41

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential conflicts with the new max-width

# Test 1: Search for other occurrences of max-width in related files
echo "Searching for other max-width occurrences in related files:"
rg --type scss "max-width" src/main/webapp/app/overview/course-conversations

# Test 2: Check for any hardcoded widths that might conflict
echo "Checking for hardcoded widths that might conflict:"
rg --type scss "width:\s*\d+px" src/main/webapp/app/overview/course-conversations

# Test 3: Look for any media queries that might affect the new max-width
echo "Searching for media queries that might affect the new max-width:"
rg --type scss "@media" src/main/webapp/app/overview/course-conversations

Length of output: 700


Script:

#!/bin/bash
# Description: Check for potential conflicts with the new max-width using file patterns

# Test 1: Search for other occurrences of max-width in related .scss files
echo "Searching for other max-width occurrences in related files:"
rg --glob "*.scss" "max-width" src/main/webapp/app/overview/course-conversations

# Test 2: Check for any hardcoded widths that might conflict in .scss files
echo "Checking for hardcoded widths that might conflict:"
rg --glob "*.scss" "width:\s*\d+px" src/main/webapp/app/overview/course-conversations

# Test 3: Look for any media queries that might affect the new max-width in .scss files
echo "Searching for media queries that might affect the new max-width:"
rg --glob "*.scss" "@media" src/main/webapp/app/overview/course-conversations

Length of output: 3431

Copy link
Contributor

@SimonEntholzer SimonEntholzer left a comment

Choose a reason for hiding this comment

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

I think the issue lies somewhere else and can't be fixed by just setting a max-width.
The problem is, that it's possible to extend the Thread panel outside of the screen with the slider, when the screen is zoomed in to a certain degree:
image
vs. this where I moved the slider more to the right:
image

Copy link
Contributor

@PaRangger PaRangger left a comment

Choose a reason for hiding this comment

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

I still have the clipping issue of the answer thread. I think this is due to the .card element having a min width and the parent element having the inline max-width set.

I made a similar fix, but only for mobile phones. Maybe it could be helpful to check it out. I set the parent element here(.communication-answer-message-wrap) and the .card element here.

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.

image
I zoomed in 200%. The thread bar content then overflows. Should one add a zoom in factor and scale the thread section accordingly?

@asliayk asliayk marked this pull request as draft October 19, 2024 08:41
Copy link
Contributor

@PaRangger PaRangger left a comment

Choose a reason for hiding this comment

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

Hey I tested the changes on TS4. Everything works great now and doesn't overflow anymore 👍🏼 The only thing i noticed is that now the thread opens up really big and kind of "squishes" the main tab. Everytime I open a thread it looks like this:

Bildschirmfoto 2024-10-27 um 10 56 37

Copy link
Contributor

@PaRangger PaRangger left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! LGTM now 😊

Copy link

@SindiBuklaji SindiBuklaji 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 Ts5. It works great! 👍
image

Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test2.artemis.cit.tum.de" is already in use by PR #9595.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Oct 27, 2024
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 TS5. Everything works great, it doesn't overflow anymore even when I zoom in

image

@krusche krusche added this to the 7.6.4 milestone Oct 27, 2024
@krusche krusche merged commit 981fe87 into develop Oct 27, 2024
62 of 66 checks passed
@krusche krusche deleted the bugfix/communication/fix-expand-thread-view branch October 27, 2024 19:58
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!) component:Communication deployment-error Added by deployment workflows if an error occured ready for review small tests
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

10 participants