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: Refactor unread messages count view on sidebar #9522

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

asliayk
Copy link
Contributor

@asliayk asliayk commented Oct 19, 2024

Checklist

General

Client

  • 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 integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added multiple screenshots/screencasts of my UI changes.

Motivation and Context

Previously, the sidebar did not display the unread message count for the relevant conversations. This update refactors the view to show the number of unread messages next to each conversation in the sidebar.

Description

The unread count is now displayed next to the conversation title, with a special format (99+) for counts exceeding 99. Additionally, the conversation title is now displayed in bold when there are unread messages, enhancing the visibility of conversations that require attention.

Steps for Testing

Prerequisites:

  • 2 Instructors/Students
  • 1 Course with communication enabled
  1. Log in to Artemis
  2. Navigate to Communication section of a course
  3. Send arbitrary number of messages to different channels
  4. Log in to Artemis with another account, navigate to the communication section of the same course
  5. Notice the new view of unread messages count next to the related conversation titles

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

Performance Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

image
image

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced sidebar components to display unread message counts.
    • Conditional rendering for sidebar items based on their type (exam, exercise).
  • Bug Fixes

    • Improved visual indicators for unread items with new styles and classes.
  • Tests

    • Added unit tests for formatting unread message counts in the sidebar item component.

@asliayk asliayk added client Pull requests that update TypeScript code. (Added Automatically!) small component:Communication labels Oct 19, 2024
@asliayk asliayk self-assigned this Oct 19, 2024
@asliayk asliayk requested a review from a team as a code owner October 19, 2024 10:12
@github-actions github-actions bot added the tests label Oct 19, 2024
Copy link

coderabbitai bot commented Oct 19, 2024

Walkthrough

The pull request introduces significant updates to the sidebar card components, specifically enhancing the sidebar-card-item with new visual indicators for unread messages and modifying the layout based on the sidebar type. Key changes include the addition of an unreadCount property, conditional rendering of components, and new CSS classes for styling. The updates also extend to related components, ensuring they can display unread message counts. Additionally, unit tests are added to verify the functionality of the unread count formatting.

Changes

File Change Summary
src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.html Modified HTML template to conditionally render unread message indicators and adjust layout based on sidebarType.
src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.scss Added new CSS classes .unread-count and .bold-text for styling unread messages and enhancing text prominence.
src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.ts Implemented OnInit, added unreadCount input, and created getFormattedUnreadCount method for formatting.
src/main/webapp/app/shared/sidebar/sidebar-card-large/sidebar-card-large.component.html Added unreadCount input to jhi-sidebar-card-item component to display unread messages count.
src/main/webapp/app/shared/sidebar/sidebar-card-medium/sidebar-card-medium.component.html Updated jhi-sidebar-card-item to include unreadCount when not in exam mode.
src/main/webapp/app/shared/sidebar/sidebar-card-small/sidebar-card-small.component.html Added unreadCount input to jhi-sidebar-card-item for displaying unread messages.
src/test/javascript/spec/component/shared/sidebar/sidebar-card-item.component.spec.ts Introduced unit tests for formattedUnreadCount to validate its functionality under various conditions.

Possibly related PRs

Suggested labels

tests, user interface, ready to merge

Suggested reviewers

  • edkaya
  • rabeatwork
  • pzdr7
  • krusche
  • JohannesStoehr

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

🧹 Outside diff range and nitpick comments (8)
src/main/webapp/app/shared/sidebar/sidebar-card-large/sidebar-card-large.component.html (1)

8-8: LGTM! Consider a minor improvement.

The addition of the unreadCount input to the jhi-sidebar-card-item component aligns well with the PR objectives. The use of optional chaining for conversation?.unreadMessagesCount is a good practice to prevent potential errors.

Consider removing the this keyword from the template expression. In Angular templates, this is implicit and unnecessary. Here's the suggested change:

-    <jhi-sidebar-card-item [unreadCount]="this.sidebarItem.conversation?.unreadMessagesCount" [sidebarType]="sidebarType" [sidebarItem]="sidebarItem" />
+    <jhi-sidebar-card-item [unreadCount]="sidebarItem.conversation?.unreadMessagesCount" [sidebarType]="sidebarType" [sidebarItem]="sidebarItem" />

This change would make the code slightly cleaner and more idiomatic Angular.

src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.scss (1)

9-23: LGTM! Well-implemented unread count badge.

The .unread-count class is well-designed for displaying unread message counts. It uses appropriate styling for visibility, responsiveness, and layout. The use of CSS variables and the clamp() function for font sizing are particularly commendable.

Consider adding a min-width property to ensure the badge maintains its circular shape even with single-digit numbers:

 .unread-count {
     /* ... existing properties ... */
+    min-width: 1.5rem;
 }

This will ensure consistency in the badge's appearance across different count values.

src/main/webapp/app/shared/sidebar/sidebar-card-small/sidebar-card-small.component.html (2)

Line range hint 1-2: Consider adding more specific information about the follow-up PR.

The comment provides good context for the temporary workaround. To improve traceability, consider adding a reference to a specific issue or ticket number for the follow-up PR that will address this workaround.


Line range hint 17-21: Update to new Angular control flow syntax.

As per the coding guidelines, please update the *ngIf directive to the new @if syntax. This change will align the code with the latest Angular best practices and the project's coding standards.

Apply this change:

-    @if (sidebarItem.conversation) {
-        <div>
-            <jhi-conversation-options [conversation]="sidebarItem.conversation!" (onUpdateSidebar)="onUpdateSidebar.emit()" />
-        </div>
-    }
+    @if (sidebarItem.conversation) {
+        <div>
+            <jhi-conversation-options [conversation]="sidebarItem.conversation!" (onUpdateSidebar)="onUpdateSidebar.emit()" />
+        </div>
+    }
src/main/webapp/app/shared/sidebar/sidebar-card-medium/sidebar-card-medium.component.html (1)

Line range hint 10-24: LGTM with a minor suggestion: Non-exam mode section is correctly updated

The non-exam mode section has been correctly updated to include the unreadCount property in the jhi-sidebar-card-item component, which aligns with the PR objectives to display unread message counts. The use of @else also adheres to the new Angular syntax guidelines.

Consider removing this. from the template expression:

- <jhi-sidebar-card-item [unreadCount]="this.sidebarItem.conversation?.unreadMessagesCount" [sidebarType]="sidebarType" [sidebarItem]="sidebarItem" />
+ <jhi-sidebar-card-item [unreadCount]="sidebarItem.conversation?.unreadMessagesCount" [sidebarType]="sidebarType" [sidebarItem]="sidebarItem" />

This change improves readability and follows Angular best practices for template expressions.

src/test/javascript/spec/component/shared/sidebar/sidebar-card-item.component.spec.ts (2)

53-57: LGTM with a minor suggestion: Consider testing initial state.

This test case effectively verifies the behavior of formattedUnreadCount when unreadCount is undefined. It follows the jest syntax and uses appropriate expectations.

However, consider testing the initial state of the component before calling ngOnInit(). This would ensure that the formattedUnreadCount is correctly initialized.

Here's a suggested improvement:

it('should return an empty string if unreadCount is undefined', () => {
    component.unreadCount = undefined;
    expect(component.formattedUnreadCount).toBe('');  // Test initial state
    component.ngOnInit();
    expect(component.formattedUnreadCount).toBe('');  // Test after initialization
});

Line range hint 1-57: Consider enhancing test coverage with additional scenarios.

The new test cases significantly improve the coverage for the formattedUnreadCount property. To further enhance the test suite, consider the following suggestions:

  1. Test edge cases: Add tests for unreadCount values of 0, 1, 98, 99, and 100 to ensure correct behavior at boundary conditions.
  2. Test reactivity: Verify that changes to unreadCount after initialization are reflected in formattedUnreadCount.
  3. Test integration: Add a test to ensure the formatted count is correctly displayed in the component's template.

Here's an example of how you might implement the first suggestion:

it('should handle edge cases for unreadCount', () => {
    const testCases = [
        { input: 0, expected: '0' },
        { input: 1, expected: '1' },
        { input: 98, expected: '98' },
        { input: 99, expected: '99' },
        { input: 100, expected: '99+' },
    ];

    testCases.forEach(({ input, expected }) => {
        component.unreadCount = input;
        component.ngOnInit();
        expect(component.formattedUnreadCount).toBe(expected);
    });
});
src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.html (1)

Line range hint 63-63: Simplify the condition in @if statement

In line 63, the condition @if (unreadCount && unreadCount > 0) can be simplified by removing the redundant unreadCount check. Since unreadCount > 0 effectively handles the desired condition, you can simplify it to:

@if (unreadCount > 0) {
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 22b206e and ea36718.

📒 Files selected for processing (7)
  • src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.html (2 hunks)
  • src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.scss (1 hunks)
  • src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.ts (1 hunks)
  • src/main/webapp/app/shared/sidebar/sidebar-card-large/sidebar-card-large.component.html (1 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)
  • src/test/javascript/spec/component/shared/sidebar/sidebar-card-item.component.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
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.

src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.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/shared/sidebar/sidebar-card-large/sidebar-card-large.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-medium/sidebar-card-medium.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-small/sidebar-card-small.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/test/javascript/spec/component/shared/sidebar/sidebar-card-item.component.spec.ts (1)

Pattern src/test/javascript/spec/**/*.ts: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}

🔇 Additional comments (12)
src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.scss (2)

Line range hint 1-27: Changes align well with PR objectives and enhance UI functionality.

The addition of the .unread-count and .bold-text classes effectively supports the PR's goal of enhancing the visibility of unread messages in the sidebar. These styles provide the necessary visual cues to draw users' attention to conversations with unread messages.

The implementation appears to meet the requirements outlined in the PR objectives. However, to ensure full compliance with the design specifications:

  1. Can you confirm that the .unread-count class handles counts exceeding 99 with the special format (99+) as mentioned in the PR objectives?
  2. Are there any accessibility considerations (e.g., color contrast) that need to be addressed for the unread count badge?
#!/bin/bash
# Check for handling of large unread counts and accessibility considerations
rg --type typescript "unreadCount" src/
rg --type html "unreadCount" src/
rg --type scss "color contrast|a11y|accessibility" src/

This will help us verify the implementation of the count formatting and any existing accessibility measures.


25-27: Consider using a more standard font-weight value.

The .bold-text class uses a font-weight of 850, which is unusually high. Standard bold typically uses a value of 700, and many fonts don't support weights above 900.

Consider adjusting the font-weight to a more standard value:

 .bold-text {
-    font-weight: 850;
+    font-weight: 700; // or 800 if extra emphasis is needed
 }

Could you clarify the design decision behind using such a high font-weight? If this level of emphasis is crucial for the UI, we should ensure it renders consistently across different system fonts and browsers.

This will help us understand if this is a one-off decision or part of a broader design pattern.

src/main/webapp/app/shared/sidebar/sidebar-card-item/sidebar-card-item.component.ts (4)

1-1: LGTM: Import statement updated correctly.

The addition of OnInit to the import statement is appropriate given the class now implements this interface. The use of single quotes for the import path adheres to the coding guidelines.


9-9: LGTM: Class correctly implements OnInit.

The SidebarCardItemComponent now implements OnInit, which is a good practice for handling initialization logic. The class name follows PascalCase, adhering to the coding guidelines.


16-18: LGTM: ngOnInit implemented correctly.

The ngOnInit method is correctly implemented, initializing the formattedUnreadCount property. This follows Angular lifecycle hooks best practices and the method name adheres to camelCase convention as per guidelines.


1-25: Overall, the changes improve the component's functionality and mostly adhere to guidelines.

The SidebarCardItemComponent has been successfully updated to handle and display unread message counts. The changes generally follow Angular best practices and project-specific guidelines. A few suggestions have been made to further improve the code:

  1. Consider a safer approach for the unreadCount input property to prevent potential runtime errors.
  2. The getFormattedUnreadCount method could be made more concise.

These minor adjustments would enhance the robustness and readability of the component. Great job on implementing this new feature!

src/main/webapp/app/shared/sidebar/sidebar-card-small/sidebar-card-small.component.html (2)

Line range hint 8-9: Verify relative routing paths.

The template uses relative paths for routing ('../communication' and './communication'). While this might be correct, it's important to ensure these paths resolve correctly in all scenarios.

Please run the following verification script to check the routing configuration:

#!/bin/bash
# Description: Verify the routing configuration for the communication module

# Test: Check the routing configuration in the module file
rg --type typescript -A 10 "RouterModule.forChild" src/main/webapp/app/communication

# Test: Verify the parent route configuration
rg --type typescript -A 10 "{ path: 'communication'" src/main/webapp/app/layouts

13-13: LGTM! Verify unread count implementation.

The addition of the unreadCount property to the jhi-sidebar-card-item component is well-implemented and aligns with the PR objectives. The use of optional chaining for this.sidebarItem.conversation?.unreadMessagesCount is a good practice for safe property access.

To ensure the unreadCount property is correctly implemented in the sidebar-card-item component, please run the following verification script:

src/main/webapp/app/shared/sidebar/sidebar-card-medium/sidebar-card-medium.component.html (1)

Line range hint 1-9: LGTM: Exam mode section is correctly implemented

The 'inExam' mode section is correctly implemented using the new Angular syntax @if, which aligns with the provided coding guidelines. The structure and functionality remain unchanged and appropriate for exam mode.

src/test/javascript/spec/component/shared/sidebar/sidebar-card-item.component.spec.ts (3)

41-45: LGTM: Well-structured test case for unreadCount formatting.

This test case effectively verifies the behavior of formattedUnreadCount for values less than 99. It follows the jest syntax and uses appropriate expectations.


47-51: LGTM: Effective test for unreadCount exceeding 99.

This test case properly verifies the behavior of formattedUnreadCount for values greater than 99. It adheres to the jest syntax and uses appropriate expectations.


Line range hint 1-57: Overall, good additions to the test suite with room for further enhancements.

The new test cases for formattedUnreadCount are well-structured and improve the overall coverage of the SidebarCardItemComponent. They follow jest syntax and adhere to the provided coding guidelines. The suggestions provided in the previous comments, if implemented, would further strengthen the test suite and ensure more comprehensive coverage of the component's behavior.

@Input() sidebarItem: SidebarCardElement;
@Input() sidebarType?: SidebarTypes;
@Input() unreadCount!: number | undefined;
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider a safer approach for handling the unreadCount input.

While the unreadCount property follows the camelCase naming convention as per guidelines, the use of the non-null assertion operator (!) might lead to runtime errors if the parent component doesn't provide a value.

Consider one of these alternatives:

  1. Make the property nullable and handle the undefined case in the component logic:
    @Input() unreadCount?: number;
  2. Provide a default value:
    @Input() unreadCount: number = 0;

This would make the component more robust and prevent potential runtime errors.

Comment on lines +20 to +25
private getFormattedUnreadCount(): string {
if (this.unreadCount !== undefined && this.unreadCount > 99) {
return '99+';
}
return this.unreadCount?.toString() || '';
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider a more concise implementation for getFormattedUnreadCount.

The method correctly formats the unread count and follows the camelCase naming convention. However, it could be more concise using a ternary operator:

private getFormattedUnreadCount(): string {
    return this.unreadCount === undefined ? '' : this.unreadCount > 99 ? '99+' : this.unreadCount.toString();
}

This maintains the same logic while reducing the number of lines and potential for errors.

class="small text-truncate me-2"
[title]="sidebarItem.title"
[class.muted]="sidebarItem.conversation?.isMuted"
[ngClass]="unreadCount && unreadCount > 0 ? 'bold-text' : 'fw-semibold'"
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Simplify the condition in [ngClass] binding

In line 55, the condition [ngClass]="unreadCount && unreadCount > 0 ? 'bold-text' : 'fw-semibold'" can be simplified. Since unreadCount > 0 already checks for a positive number, the additional unreadCount check is redundant. You can simplify the condition to:

[ngClass]="unreadCount > 0 ? 'bold-text' : 'fw-semibold'"

🛠️ Refactor suggestion

Consider using Bootstrap's fw-bold class for consistency

In line 55, you're toggling between the classes 'bold-text' and 'fw-semibold'. For consistency with Bootstrap's standard font-weight classes, consider using 'fw-bold' instead of 'bold-text'. This would update the [ngClass] binding to:

[ngClass]="unreadCount > 0 ? 'fw-bold' : 'fw-semibold'"

Using standard classes enhances maintainability and ensures consistent styling across the application.

Copy link
Contributor

@rabeatwork rabeatwork left a comment

Choose a reason for hiding this comment

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

I have some remarks.

@@ -21,6 +21,6 @@
(click)="emitStoreAndRefresh(sidebarItem.id)"
[routerLinkActive]="'bg-selected border-selected'"
>
<jhi-sidebar-card-item [sidebarType]="sidebarType" [sidebarItem]="sidebarItem" />
<jhi-sidebar-card-item [unreadCount]="this.sidebarItem.conversation?.unreadMessagesCount" [sidebarType]="sidebarType" [sidebarItem]="sidebarItem" />
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need this here

class="small text-truncate me-2"
[title]="sidebarItem.title"
[class.muted]="sidebarItem.conversation?.isMuted"
[ngClass]="unreadCount && unreadCount > 0 ? 'bold-text' : 'fw-semibold'"
Copy link
Contributor

Choose a reason for hiding this comment

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

fw-bold should be enough. Rather change the "no-new-message-font-weight" from semibold to normal [ngClass]="unreadCount > 0 ? 'fw-bold' : 'fw-normal'"

@@ -58,6 +64,9 @@
<fa-icon [fixedWidth]="true" [icon]="sidebarItem.rightIcon" />
}
</span>
@if (unreadCount && unreadCount > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

unreadCount > 0

@@ -58,6 +64,9 @@
<fa-icon [fixedWidth]="true" [icon]="sidebarItem.rightIcon" />
}
</span>
@if (unreadCount && unreadCount > 0) {
<span class="unread-count">{{ formattedUnreadCount }}</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

I would decrease the spacing between the heart and the counter: me-n2
In addition I would also add px-2 to the button of the faEllipsisVertical icon in the conversation-options.component.html file

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!) component:Communication ready for review small tests
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

2 participants