-
Notifications
You must be signed in to change notification settings - Fork 294
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
: Reduce height of channel and chat item card
#9480
Communication
: Reduce height of channel and chat item card
#9480
Conversation
WalkthroughThe pull request includes several modifications to the sidebar components within the web application. Key changes involve adjustments to CSS classes for buttons, refined rendering logic based on the 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: 1
🧹 Outside diff range comments (2)
src/main/webapp/app/shared/sidebar/sidebar-card-small/sidebar-card-small.component.html (1)
Line range hint
1-2
: Approve the explanatory comment and suggest creating a tracking issue.The comment provides valuable context for the current implementation and acknowledges the temporary nature of the workaround. This is good practice for maintaining code clarity.
To ensure this follow-up work isn't forgotten, would you like me to create a GitHub issue to track the adjustment of routing in the messages module?
src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.html (1)
Line range hint
49-62
: LGTM: Improved compact layout for non-exam sidebar items.The changes effectively reduce the height of channel and chat item cards by using the
small
class and adjusting font weights. The conditionalmuted
class for conversations is a nice touch for visual feedback.One minor suggestion:
Consider using a more semantic class name instead of
muted
for better clarity. For example:- [class.muted]="sidebarItem.conversation?.isMuted" + [class.conversation-muted]="sidebarItem.conversation?.isMuted"This change would make the purpose of the class more explicit and improve code readability.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
📒 Files selected for processing (4)
- src/main/webapp/app/shared/sidebar/conversation-options/conversation-options.component.html (1 hunks)
- src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.html (3 hunks)
- src/main/webapp/app/shared/sidebar/sidebar-card-medium/sidebar-card-medium.component.html (1 hunks)
- src/main/webapp/app/shared/sidebar/sidebar-card-small/sidebar-card-small.component.html (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
src/main/webapp/app/shared/sidebar/conversation-options/conversation-options.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-card-item/sidebar-card-item.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 (13)
src/main/webapp/app/shared/sidebar/sidebar-card-small/sidebar-card-small.component.html (3)
Line range hint
3-11
: Approve the main<div>
element implementation.The main
<div>
element is well-structured with appropriate use of Angular directives and event bindings. The conditional styling and routing enhance the component's flexibility and reusability.
12-12
: Approve the addition ofalign-self-center
class.The addition of the
align-self-center
class to the inner<div>
improves the vertical alignment of the content. This change contributes to the PR's objective of refining the layout and reducing the height of the card.
Line range hint
13-19
: Approve the usage of nested elements and adherence to coding guidelines.The template effectively uses custom components (
jhi-sidebar-card-item
andjhi-conversation-options
) to promote modularity. The conditional rendering using the@if
directive follows the new Angular syntax as specified in the coding guidelines. This implementation ensures that conversation options are only displayed when a conversation exists.src/main/webapp/app/shared/sidebar/sidebar-card-medium/sidebar-card-medium.component.html (4)
Line range hint
1-12
: LGTM! Correct use of @if directive.The changes introduce a new condition for 'inExam' sidebarType, which is correctly implemented using the @if directive as per the coding guidelines. The structure and event handling for this new case appear appropriate.
13-13
: Padding adjustment aligns with PR objectives.The change from
pb-1
topy-2
modifies the vertical padding of the element. This adjustment contributes to the PR's goal of reducing the height of channel and chat item cards, potentially allowing more items to fit on the screen simultaneously.
Line range hint
1-24
: Summary: Changes align well with PR objectivesThe modifications in this file successfully address the PR's main objective of reducing the height of channel and chat item cards. Key improvements include:
- Proper use of the @if directive for conditional rendering.
- Adjustment of padding to reduce card height.
- Enhanced interactivity and navigation through updated event handling and routing.
These changes should contribute to improved visibility and reduced scrolling in the communication sidebar, as intended. The implementation adheres to Angular best practices and the provided coding guidelines.
Line range hint
14-24
: Enhanced interactivity and navigation.The changes improve the sidebar's functionality by:
- Updating the click event handler to
emitStoreAndRefresh(sidebarItem.id)
.- Adding
routerLink
for navigation.- Using
routerLinkActive
for proper active item styling.These modifications enhance the overall user experience and align with the PR objectives.
To ensure these changes work as intended, please verify the following:
src/main/webapp/app/shared/sidebar/conversation-options/conversation-options.component.html (4)
2-2
: Approved: Padding adjustment contributes to height reductionThe change from
px-0
top-0
on the favorite button removes any vertical padding, which aligns with the PR's objective of reducing the height of channel and chat item cards. This minor adjustment contributes to allowing more items to fit on the screen simultaneously.
6-6
: Approved: Consistent padding adjustment on dropdown toggleAdding the
py-0
class to the dropdown toggle button removes its vertical padding, which is consistent with the change made to the favorite button. This modification further contributes to reducing the overall height of the components, aligning well with the PR's objective of allowing more items to fit on the screen.
2-6
: Summary: Changes effectively contribute to PR objectivesThe modifications to reduce vertical padding on both the favorite button and the dropdown toggle are consistent and well-aligned with the PR's goal of reducing the height of channel and chat item cards. These minimal, focused changes effectively contribute to allowing more items to fit on the screen simultaneously without altering functionality or introducing new features. The implementation appears to be sound and carries minimal risk of unintended side effects.
Line range hint
10-10
: Approved: Correct usage of new Angular syntaxThe use of
@if
directives on lines 10 and 15 aligns with the provided coding guidelines, which state that "@if and @for are new and valid Angular syntax replacing *ngIf and *ngFor". This demonstrates adherence to the latest Angular best practices and coding standards.Also applies to: 15-15
src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.html (2)
3-3
: LGTM: Improved layout with consistent margins.The addition of the
mx-1
class provides a consistent horizontal margin, which aligns with the PR objective of refining the sidebar item layout.
Line range hint
1-80
: Overall assessment: Changes effectively address PR objectives.The modifications to this template successfully reduce the height of channel and chat item cards, improving the sidebar's compact layout. The changes align well with the PR objectives and generally follow good Angular practices.
Key points:
- Consistent margins have been added to improve layout.
- The non-exam sidebar items now have a more compact design.
- Conditional styling has been implemented for muted conversations.
Minor suggestions have been made to improve code clarity and adhere to the latest Angular syntax. Once these are addressed, the changes will be ready for merging.
src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.html
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.
I tested on TS2 but could not reproduce the small change. I compared the card margin size on TS2 with my personal account in production but could not notice any difference. (issue fixed - forgot to deploy, sorry :D)
|
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.
Tested on TS6 and TS2, card margins in the communication tab are smaller as described.
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.
Code LGTM 👍
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.
The code looks good to me 👍
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.
tested on ts2, works as expected
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.
Tested on ts2, works as expected
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
The cards for the channels and chats had a lot of margin. As a result, only a few fit on one page, and there was a lot of scrolling. The height/padding has been reduced.
Description
The margin for the communication sidebar items has been reduced.
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
Performance Review
Code Review
Manual Tests
Exam Mode Test
Performance Tests
Screenshots
Before:
After:
Summary by CodeRabbit
Style
New Features