-
Notifications
You must be signed in to change notification settings - Fork 303
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
: Improve visibility of pinned messages
#10117
Communication
: Improve visibility of pinned messages
#10117
Conversation
…ts and better display their pinned status
WalkthroughThe pull request implements a pin functionality for messages across different components in the communication system. The changes involve modifying how posts are grouped, sorted, and displayed based on a new Changes
Assessment against linked issues
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
|
Communication
: Improve visibility of pinned messages
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
🧹 Nitpick comments (1)
src/main/webapp/app/overview/discussion-section/discussion-section.component.ts (1)
94-105
: Simplify the sorting logic for pinned posts.The current implementation can be simplified to improve readability while maintaining the same functionality.
Consider this simpler implementation:
- this.posts = posts - .slice() - .sort((a, b) => { - if (a.displayPriority === DisplayPriority.PINNED && b.displayPriority !== DisplayPriority.PINNED) { - return 1; - } - if (a.displayPriority !== DisplayPriority.PINNED && b.displayPriority === DisplayPriority.PINNED) { - return -1; - } - return 0; - }) - .reverse(); + this.posts = posts + .slice() + .sort((a, b) => (b.displayPriority === DisplayPriority.PINNED ? 1 : 0) - (a.displayPriority === DisplayPriority.PINNED ? 1 : 0)) + .reverse();
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.ts
(3 hunks)src/main/webapp/app/overview/discussion-section/discussion-section.component.ts
(2 hunks)src/main/webapp/app/shared/metis/posting-header/post-header/post-header.component.html
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
src/main/webapp/app/shared/metis/posting-header/post-header/post-header.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/overview/discussion-section/discussion-section.component.ts (1)
src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.ts (1)
🔇 Additional comments (1)
src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.ts (1)
251-254
: LGTM! Clean separation of pinned and unpinned posts.The implementation correctly separates pinned posts and adds them at the beginning of the groups array, ensuring they appear at the top of the conversation.
Also applies to: 292-295
...verview/course-conversations/layout/conversation-messages/conversation-messages.component.ts
Show resolved
Hide resolved
src/main/webapp/app/shared/metis/posting-header/post-header/post-header.component.html
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.
Tested on TS5, 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 TS5, works 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.
Tested on TS2. Works as described! However the change is only visible upon reload of the page!
|
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 TS5]
Works 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.
This should not happen. So if you pin a post you have to reload the page in order to see the pinned post? |
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 TS1, the feature works as expected, however, sometimes reloading the page is necessary for the pinned message to be placed at the top
Checklist
General
Client
authorities
to all new routes and checked the course groups for displaying navigation elements (links, buttons).Changes affecting Programming Exercises
Motivation and Context
The "Pin" function in Communication and Exercises is currently very bare-bones. Currently, selecting the pin option only changes the color of the message to orange, but it does not fulfill other expected functionalities associated with pinning messages. This PR improves this behaviour.
Fixes #10024
Description
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
Screenshots
Summary by CodeRabbit
New Features
Improvements