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 user interface reload on channel selection #9464

Merged

Conversation

PaRangger
Copy link
Contributor

@PaRangger PaRangger commented Oct 13, 2024

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

Addresses #9413

Within the communication module, when you select a channel, and then change the channel to another it causes the entire UI to reload. This causes a jumpy UI which looks irritating.

Description

The module is loaded within a jhi-loading-indicator-container, which triggers the loading state whenever the Metis service begins fetching posts, causing the loading indicator to appear and the UI to disappear. I removed the loading subscription to the Metis service and instead set the loading state to true when the module is initially loaded. Each component within the module has its own loading indicators, which should be sufficient.

Steps for Testing

Prerequisites:

  • 1 Student/Instructor/Tutor
  • 1 Course with communication enabled
  1. Log in to Artemis
  2. Navigate to the course
  3. Select a channel
  4. Select another channel
  5. Verify that the UI (sidebar, search bar) does not fully reload, only the messages.
  6. Verify that everything is loaded correctly and the corresponding messages are displayed.

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

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

Bildschirmaufnahme 2024-10-13 um 12 06 19

Summary by CodeRabbit

  • New Features

    • Enhanced visual feedback during data fetching in the conversation messages component.
    • Introduced new CSS classes for improved styling and user experience.
  • Bug Fixes

    • Simplified loading state management by removing unnecessary subscription methods, improving initialization.

@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Oct 13, 2024
@PaRangger PaRangger temporarily deployed to artemis-test6.artemis.cit.tum.de October 13, 2024 13:42 — with GitHub Actions Inactive
@PaRangger PaRangger marked this pull request as ready for review October 13, 2024 13:51
@PaRangger PaRangger requested a review from a team as a code owner October 13, 2024 13:51
Copy link

coderabbitai bot commented Oct 13, 2024

Walkthrough

The changes in this pull request involve modifications to the CourseConversationsComponent and its associated HTML and SCSS files. The subscribeToLoading method has been removed for improved management of the loading state, which is now directly handled in the subscription. The HTML template has been updated with a new CSS class for visual feedback during data fetching, and the SCSS file has been adjusted to hide the message list when posts are being fetched.

Changes

File Change Summary
src/main/webapp/app/overview/course-conversations/course-conversations.component.ts Removed the subscribeToLoading method to simplify loading state management. Updated initialization in ngOnInit.
src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.html Added a new CSS class is-fetching-posts for visual feedback during data fetching. No changes to core functionality.
src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.scss Introduced a new CSS class .conversation-messages-message-list.is-fetching-posts to hide the message list when fetching posts.

Possibly related PRs

Suggested labels

bugfix, user interface, component:Communication

Suggested reviewers

  • edkaya
  • JohannesStoehr
  • sarpsahinalp
  • pzdr7

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between 330a677 and 07a710d.

📒 Files selected for processing (3)
  • src/main/webapp/app/overview/course-conversations/course-conversations.component.ts (1 hunks)
  • src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.html (1 hunks)
  • src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.scss (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/main/webapp/app/overview/course-conversations/course-conversations.component.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.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 (4)
src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.html (2)

70-70: LGTM: Enhanced visual feedback for fetching posts

The addition of the 'is-fetching-posts' class to the ngClass directive aligns well with the PR objective of improving UI feedback during post fetching. This change enhances the user experience by providing visual indication when new posts are being loaded, addressing the issue of disruptive UI reloads mentioned in the PR summary.


70-72: Summary: Changes align well with PR objectives

The modifications to the conversation-messages component template effectively address the PR's main objective of improving UI feedback during post fetching. The addition of the 'is-fetching-posts' class and the new 'conversation-messages-message-list' class contribute to a more responsive and less disruptive user experience when switching between communication channels.

These changes:

  1. Provide visual feedback during post fetching, reducing the perception of UI reloads.
  2. Maintain the overall structure and functionality of the component.
  3. Adhere to performance and design guidelines as mentioned in the PR checklist.

The implementation appears to be a solid solution to the issue described in #9413.

src/main/webapp/app/overview/course-conversations/course-conversations.component.ts (2)

Line range hint 1-424: Monitor the impact of removing subscribeToLoading

The removal of the subscribeToLoading method simplifies the component by reducing the number of subscriptions. However, this change also removes the ability to react to loading state changes from the MetisConversationService.

To ensure this change doesn't negatively impact the user experience:

  1. Monitor the application's behavior in scenarios where the MetisConversationService might have prolonged loading states.
  2. Verify that all necessary loading indicators are still functioning correctly throughout the application.

If issues arise, consider reintroducing a more targeted subscription to loading states or implementing a service-wide loading state that components can observe.

🧰 Tools
🪛 Biome

[error] 161-161: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)


Line range hint 1-424: Overall, changes align well with PR objectives

The modifications in this file successfully address the issue of UI reloading on channel selection, as outlined in the PR objectives. The removal of the subscribeToLoading method and the simplified loading state management in ngOnInit contribute to a more streamlined approach, potentially reducing unnecessary UI updates.

Key points:

  1. The changes maintain good Angular practices and coding standards.
  2. The use of observables and Angular's change detection mechanism remains appropriate.
  3. The code structure continues to exhibit a clear separation of concerns.

While the changes appear to meet the PR objectives, consider the following to ensure a smooth transition:

  1. Thoroughly test the application to verify that loading indicators behave as expected across different scenarios.
  2. Monitor performance metrics to confirm that the changes indeed result in a less disruptive user experience, especially when dealing with large datasets.
  3. Update any relevant documentation or comments to reflect the new loading state management approach.
🧰 Tools
🪛 Biome

[error] 161-161: Forbidden non-null assertion.

(lint/style/noNonNullAssertion)

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
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants