-
Notifications
You must be signed in to change notification settings - Fork 293
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
Conversation
WalkthroughThe changes in this pull request involve the addition of a new SCSS variable, Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
📒 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; |
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.
🧹 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.
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; |
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.
💡 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;
inconversation-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)
inconversation-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
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.
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.
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.
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.
src/main/webapp/app/overview/course-conversations/course-conversations.component.scss
Outdated
Show resolved
Hide resolved
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.
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.
Thanks for the changes! LGTM now 😊
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.
|
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.
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:
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
Manual Tests
Test Coverage
Screenshots
BEFORE
AFTER
Summary by CodeRabbit