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: Rename 'hidden' to 'archived' for conversations #10385

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

Conversation

asliayk
Copy link
Contributor

@asliayk asliayk commented Feb 22, 2025

Checklist

General

Client

  • I strictly followed the client coding and design guidelines.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Motivation and Context

  1. If a channel is currently open and gets archived for everyone, the channel should become read-only immediately, and the input area should become invisible. Currently, the input area remains visible until a refresh, leading to error messages. (Closes Communication: Input area remains active for archived channels without refreshing #9986)

  2. As decided in the communication subgroup, the "Hide" channel feature should be renamed to "Archive" to avoid confusion:

  • The "Hide" button should be renamed to "Archive".
  • The "Hidden" section in the sidebar should be renamed to "Archived".
  • The global archive feature should remain unchanged. When a channel is archived by a moderator from the channel settings, the channel will receive the suffix "(Archived)". Globally archived channels will remain in their current section, while locally archived channels (previously the "hide" feature) will be moved to the Archived section, as it currently works on iOS and Android.

Description

  • The "Hide" button is now labeled "Archive".
  • The "Hidden" section in the sidebar has been renamed to "Archived".
  • The input area now correctly becomes invisible immediately when a currently open channel is archived for everyone, without requiring a page refresh.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Course with Communication enabled
  1. Log in to Artemis.
  2. Navigate to the Communication section of a course.
  3. Use the three-dot menu of a channel to test the "archive" feature. When you click on it, the channel should be moved to the Archived section. Clicking on it again ("unarchive") will move it back to its previous section.
  4. Open a channel and click on its settings in the menu to open the channel settings.
  5. Click on "Archive channel for everyone."
  6. Notice that when a channel is globally archived, the input area immediately becomes invisible, and the channel receives the "(Archived)" suffix.

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Client

Class/File Line Coverage Confirmation (assert/expect)
course-conversations.component.ts 91.63% ✅ ❌
conversation-messages.component.ts 95.72% ✅ ❌
course-overview.service.ts 93.45% ✅ ❌
conversation-options.component.ts 92.07% ✅ ❌
sidebar.ts not found (modified)

Screenshots

archived section
image

Summary by CodeRabbit

  • New Features

    • The conversation interface now displays “Archive” and “Unarchive” actions with refreshed icons.
    • Dashboard groupings show conversations under “Archived” with updated labels in multiple languages.
  • Refactor

    • Consistent terminology has been applied across conversation channels for a more unified user experience.

@asliayk asliayk self-assigned this Feb 22, 2025
@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels Feb 22, 2025
@asliayk asliayk added the small label Feb 22, 2025
@asliayk asliayk marked this pull request as ready for review February 23, 2025 10:55
@asliayk asliayk requested a review from a team as a code owner February 23, 2025 10:55
Copy link

coderabbitai bot commented Feb 23, 2025

Walkthrough

The changes modify the channel management functionality by renaming properties and constants from "hiddenChannels" to "archivedChannels" across the codebase. In addition, conditional logic has been updated in the conversation messaging component to check for changes in the archived status. The changes also update UI elements, localization labels, and associated tests to align with the new terminology.

Changes

File(s) Change Summary
.../course-conversations/course-conversations.component.ts Renamed properties and constants: hiddenChannelsarchivedChannels in DEFAULT_CHANNEL_GROUPS, CHANNEL_TYPE_ICON, DEFAULT_COLLAPSE_STATE, and DEFAULT_SHOW_ALWAYS.
.../course-conversations/layout/conversation-messages/conversation-messages.component.ts Added a conditional check in subscribeToActiveConversation to update _activeConversation based on a change in the isArchived status.
.../course-overview.service.ts Replaced hiddenChannels with archivedChannels in DEFAULT_CHANNEL_GROUPS and updated group logic in getConversationGroup.
.../sidebar/conversation-options/conversation-options.component.html Updated the button: changed click handler from onHiddenClicked($event) to onArchiveClicked($event) and switched icons from faEye/faEyeSlash to faBoxOpen/faBoxArchive.
.../sidebar/conversation-options/conversation-options.component.ts Removed imports for faEye/faEyeSlash and added faBoxArchive/faBoxOpen; renamed the method onHiddenClicked to onArchiveClicked (logic unchanged).
.../types/sidebar.ts Updated the ChannelGroupCategory type: replaced the literal 'hiddenChannels' with 'archivedChannels'.
.../i18n/de/conversation.json
.../i18n/en/conversation.json
.../i18n/de/student-dashboard.json
.../i18n/en/student-dashboard.json
Updated UI labels and JSON keys from hiddenChannels to archivedChannels and adjusted associated text labels (e.g., "Show"/"Hide" → "Unarchive"/"Archive", "Ausgeblendet" → "Archiviert").
.../spec/component/course/course-overview.service.spec.ts Renamed test case from "should group favorite and hidden conversations correctly" to "should group favorite and archived conversations correctly" and updated assertions accordingly.

Sequence Diagram(s)

sequenceDiagram
    participant C as ConversationMessagesComponent
    participant S as Conversation Service
    participant M as Model

    C->>S: subscribeToActiveConversation()
    S->>C: Emit new conversation event
    alt Archived status changed
      C->>M: Update _activeConversation with new conversation
    else
      C-->>M: No update
    end
Loading
sequenceDiagram
    participant U as User
    participant CO as ConversationOptionsComponent
    participant S as Conversation Service

    U->>CO: Click on Archive button
    CO->>CO: onArchiveClicked(event) – stop propagation, validate IDs
    CO->>S: Trigger archive update for conversation
    S-->>CO: Return updated conversation status
Loading

Possibly related PRs

Suggested labels

feature, bugfix, ready to merge, component:Communication

Suggested reviewers

  • kevinfischer4
  • HawKhiem
  • florian-glombik
  • sachmii
  • anian03
  • rabeatwork
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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: 0

🧹 Nitpick comments (3)
src/main/webapp/i18n/en/student-dashboard.json (1)

73-73: Duplicate or Redundant Key Check: "archived"
There is a key "archived": "Archived" following the updated key. Please verify whether this key is needed for a different UI context or if it might be redundant. Consolidating similar keys can help maintain clarity and avoid potential inconsistencies in localization.

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

188-190: Improve efficiency and readability of the archived status check.

The condition can be made more efficient and readable by storing the channel DTOs and using descriptive variable names.

-            if (this._activeConversation && getAsChannelDTO(conversation)?.isArchived !== getAsChannelDTO(this._activeConversation)?.isArchived) {
+            const newChannel = getAsChannelDTO(conversation);
+            const currentChannel = getAsChannelDTO(this._activeConversation);
+            if (this._activeConversation && newChannel?.isArchived !== currentChannel?.isArchived) {
                 this._activeConversation = conversation;
             }

131-132: Align variable names with "archived" terminology.

For consistency with the PR's objective of renaming "hidden" to "archived", consider renaming these variables.

-    isHiddenInputWithCallToAction = false;
-    isHiddenInputFull = false;
+    isArchivedInputWithCallToAction = false;
+    isArchivedInputFull = false;

Remember to update all references to these variables in the template file as well.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b3c4ed and 6d70929.

📒 Files selected for processing (11)
  • src/main/webapp/app/overview/course-conversations/course-conversations.component.ts (5 hunks)
  • src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.ts (1 hunks)
  • src/main/webapp/app/overview/course-overview.service.ts (2 hunks)
  • src/main/webapp/app/shared/sidebar/conversation-options/conversation-options.component.html (1 hunks)
  • src/main/webapp/app/shared/sidebar/conversation-options/conversation-options.component.ts (3 hunks)
  • src/main/webapp/app/types/sidebar.ts (1 hunks)
  • src/main/webapp/i18n/de/conversation.json (1 hunks)
  • src/main/webapp/i18n/de/student-dashboard.json (1 hunks)
  • src/main/webapp/i18n/en/conversation.json (1 hunks)
  • src/main/webapp/i18n/en/student-dashboard.json (1 hunks)
  • src/test/javascript/spec/component/course/course-overview.service.spec.ts (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/main/webapp/i18n/de/student-dashboard.json
🧰 Additional context used
📓 Path-based instructions (4)
`src/main/webapp/i18n/de/**/*.json`: German language transla...

src/main/webapp/i18n/de/**/*.json: German language translations should be informal (dutzen) and should never be formal (sietzen). So the user should always be addressed with "du/dein" and never with "sie/ihr".

  • src/main/webapp/i18n/de/conversation.json
`src/main/webapp/**/*.ts`: angular_style:https://angular.io/...

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.ts
  • src/main/webapp/app/types/sidebar.ts
  • src/main/webapp/app/overview/course-overview.service.ts
  • src/main/webapp/app/shared/sidebar/conversation-options/conversation-options.component.ts
  • src/main/webapp/app/overview/course-conversations/course-conversations.component.ts
`src/main/webapp/**/*.html`: @if and @for are new and valid ...

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/conversation-options/conversation-options.component.html
`src/test/javascript/spec/**/*.ts`: jest: true; mock: NgMock...

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}}

  • src/test/javascript/spec/component/course/course-overview.service.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Call Build Workflow / Build and Push Docker Image
  • GitHub Check: Call Build Workflow / Build .war artifact
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: client-tests-selected
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Analyse
🔇 Additional comments (16)
src/main/webapp/app/types/sidebar.ts (1)

28-28: LGTM! Type definition updated correctly.

The change from 'hiddenChannels' to 'archivedChannels' in the ChannelGroupCategory type is consistent with the PR objectives to improve terminology clarity.

src/main/webapp/app/shared/sidebar/conversation-options/conversation-options.component.ts (3)

5-5: LGTM! Icon imports updated appropriately.

The change from eye icons to box archive icons better represents the archiving functionality.


61-62: LGTM! Icon properties updated consistently.

The new icon properties align with the updated imports and better represent the archive/unarchive actions.


82-97: LGTM! Method renamed while preserving functionality.

The method rename from onHiddenClicked to onArchiveClicked maintains the same functionality while using clearer terminology.

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

68-68: LGTM! Default channel groups updated correctly.

The change from 'hiddenChannels' to 'archivedChannels' in DEFAULT_CHANNEL_GROUPS is consistent with the type changes.


177-177: LGTM! Channel grouping logic updated appropriately.

The getConversationGroup method now correctly uses 'archivedChannels' instead of 'hiddenChannels'.

src/test/javascript/spec/component/course/course-overview.service.spec.ts (1)

456-456: LGTM! Test cases updated to reflect new terminology.

The test cases have been correctly updated to use "archived" terminology while maintaining the same test coverage and assertions.

Also applies to: 469-469, 479-479

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

7-7: LGTM!

The import of faBoxArchive icon is appropriate for the new archiving functionality.


70-70: LGTM!

The renaming from hiddenChannels to archivedChannels in DEFAULT_CHANNEL_GROUPS improves clarity of the feature's purpose.


82-82: LGTM!

The icon change to faBoxArchive in CHANNEL_TYPE_ICON provides better visual representation of the archiving action.


96-96: LGTM!

The consistent renaming in DEFAULT_COLLAPSE_STATE and DEFAULT_SHOW_ALWAYS maintains the new terminology across the component.

Also applies to: 110-110

src/main/webapp/app/shared/sidebar/conversation-options/conversation-options.component.html (1)

29-31: LGTM!

The changes to the button improve UX by:

  1. Using more accurate method name onArchiveClicked
  2. Using appropriate archive-related icons that better represent the action
src/main/webapp/i18n/en/conversation.json (1)

57-58: LGTM!

The label changes from "show"/"hide" to "Unarchive"/"Archive" better reflect the actual functionality and improve user understanding.

src/main/webapp/i18n/de/conversation.json (1)

39-40: LGTM!

The German translations "Dearchivieren"/"Archivieren" correctly match the English terms and maintain informal language (dutzen) as required.

src/main/webapp/i18n/en/student-dashboard.json (1)

69-69: Key Rename Confirmation: "archivedChannels"
The key "archivedChannels": "Archived" correctly replaces the old "hiddenChannels" key, and the new translation value reflects the intended renaming for clarity in the UI.

src/main/webapp/app/overview/course-conversations/layout/conversation-messages/conversation-messages.component.ts (1)

186-198:

❓ Verification inconclusive

Verify the component's behavior with archived conversations.

The new condition only updates _activeConversation when the archived status changes. Ensure this doesn't prevent other important state changes from being reflected in the UI.


🏁 Script executed:

#!/bin/bash
# Search for other properties that might need to trigger an update
ast-grep --pattern 'getAsChannelDTO($_).$_'

Length of output: 169


Action Required: Double-check archived conversation update logic

Please verify that limiting updates of _activeConversation to changes in the archived status truly covers all necessary state changes for the component. In particular, ensure that if other conversation properties (such as title, participants, etc.) change while the archived flag remains the same, these updates are either handled elsewhere or intentionally ignored. It might be useful to run additional searches—e.g., using a filtered search such as:

#!/bin/bash
# Search for getAsChannelDTO usage in TypeScript files, excluding test files
rg "getAsChannelDTO" -g '!src/test/**' --type ts

—to confirm that no other crucial properties are expected to trigger a UI update. Manual verification or targeted tests in this scenario is recommended.

@@ -36,8 +36,8 @@
},
"conversationSelectionSideBar": {
"header": "Konversationen",
"show": "Konversationen zeigen",
"hide": "Konversationen ausblenden",
"show": "Dearchivieren",
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds a bit odd to me, i think something along "Wiederherstellen" might be better?

Copy link
Contributor

@PaRangger PaRangger left a comment

Choose a reason for hiding this comment

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

Code LGTM ✅ Left an optional comment.

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 tests
Projects
Status: Work In Progress
Development

Successfully merging this pull request may close these issues.

Communication: Input area remains active for archived channels without refreshing
2 participants