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: Show indication if forwarded post has been deleted #10434

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

Conversation

julian-wls
Copy link
Contributor

@julian-wls julian-wls commented Mar 2, 2025

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 principle of data economy for all client-server REST calls.
  • 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 documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Motivation and Context

When a message has been forwarded and is deleted afterwards the forwarded message currently does not reflect this information, instead the forwarded message is not shown at all.

Description

This PR makes it possible for users to see whether the source post has been deleted by showing a short info.
Instead of skipping the forwarded messages for which a post wasn't found in the database, null is added to the list of forwarded messages. In forwarded-message.component.ts null checks have been added to show an indication for these messages. If a null value is found the forwarded message cannot show any post information and falls back to the information state, which shows an information label instead.

Before:
image

After:
image

Steps for Testing

Prerequisites:

  • 1 Student
  • 1 Course with Communication enabled
  1. Log in to Artemis
  2. Navigate to Course Communication
  3. Go to conversation A.
  4. Forward a message to channel B
  5. Delete this source message
  6. EDIT: Due to a bug, that is currently causing problems loading a chat after deleting a source post it is required to log out and log in again between step 6 and 7!
  7. Go to channel B and verify that a placeholder is shown indicating that the source message has been deleted.

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

Summary by CodeRabbit

  • New Features

    • Enhanced handling and display of forwarded messages, including informative messages for deleted posts and clear presentation of author details and posting dates.
    • Added localized notifications to indicate when forwarded content originates from an unknown conversation.
  • Style

    • Updated visual styling for forwarded message components to better differentiate and highlight missing or deleted messages.
  • Bug Fixes

    • Improved robustness in the handling of null values within forwarded posts and answer posts, ensuring graceful management of missing content.

@julian-wls julian-wls self-assigned this Mar 2, 2025
@julian-wls julian-wls requested a review from a team as a code owner March 2, 2025 17:17
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Mar 2, 2025
@julian-wls julian-wls added communication Pull requests that affect the corresponding module ready for review labels Mar 2, 2025
Copy link

coderabbitai bot commented Mar 2, 2025

Walkthrough

This pull request updates several model and component files to allow forwarded post properties to include null values by changing their types from strictly non-null arrays to arrays of (Type | null). Additionally, component logic is modified to better handle cases where referenced posts are missing or deleted. The updates include changes to type declarations, navigation checks, conditional UI rendering, styling adjustments, and new translation keys for forwarded message statuses.

Changes

File(s) Change Summary
src/.../metis/answer-post.model.ts, src/.../metis/post.model.ts Updated type declarations for forwardedPosts and forwardedAnswerPosts to allow `(Type
src/.../metis/post.component.ts, src/.../metis/posting-thread/posting-thread.component.ts, src/.../metis/posting-reactions-bar/posting-reactions-bar.component.ts, src/.../course-conversations/layout/conversation-messages/conversation-messages.component.ts Modified component logic and type-checks for handling forwarded posts: simplified navigation, enhanced filtering, and ensured robust processing of missing or deleted posts.
src/.../forwarded-message/forwarded-message.component.ts, src/.../forwarded-message/forwarded-message.component.html, src/.../forwarded-message/forwarded-message.component.scss, src/.../metis/post/post.component.html Updated UI templates and styles to conditionally render forwarded message content and display messages when the original post is deleted.
src/.../i18n/de/metis.json, src/.../i18n/en/metis.json Added new translation keys for forwarded message statuses (“forwarded from unknown” and “message deleted”).

Possibly related PRs

Suggested labels

tests, small, bugfix, component:Communication

Suggested reviewers

  • PaRangger
  • HawKhiem
  • cremertim

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7795ed5 and 586e4e4.

📒 Files selected for processing (1)
  • src/test/javascript/spec/component/overview/course-conversations/layout/conversation-messages/conversation-messages.component.spec.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/test/javascript/spec/component/overview/course-conversations/layout/conversation-messages/conversation-messages.component.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Call Build Workflow / Build .war artifact
  • GitHub Check: Call Build Workflow / Build and Push Docker Image
  • GitHub Check: client-tests-selected
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Analyse

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.
  • @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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 2, 2025
@github-actions github-actions bot added tests and removed communication Pull requests that affect the corresponding module labels Mar 2, 2025
@julian-wls julian-wls added communication Pull requests that affect the corresponding module and removed tests labels Mar 2, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 2, 2025
@github-actions github-actions bot added tests and removed communication Pull requests that affect the corresponding module labels Mar 2, 2025
@julian-wls julian-wls added communication Pull requests that affect the corresponding module and removed tests labels Mar 2, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de March 3, 2025 08:45 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de March 3, 2025 09:40 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de March 4, 2025 12:35 Inactive
Copy link
Contributor

@AjayvirS AjayvirS left a comment

Choose a reason for hiding this comment

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

Tested on TS1, however the placeholder does not seem to be visible. Let me know if this behavior is intended:

Screen.Recording.2025-03-04.134422.mp4

@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de March 5, 2025 10:39 Inactive
@FelberMartin
Copy link
Contributor

FelberMartin commented Mar 5, 2025

Tested on TS2 and noticed the same issue as @AjayvirS (the post containing the forwarded post is no longer there after deleting the forwarded post). However I also could reproduce this issue on TS3 without this PR's changes deployed.

To me this seems like an issue/bug not related to this PR's changes, but the bug should be fixed in order to being able to test this PR

@julian-wls
Copy link
Contributor Author

julian-wls commented Mar 5, 2025

Thanks for testing, @asliayk and I were previously looking into this and found out that there seems indeed to be an issue after deleting the source post and returning back to the conversation that contains the forwarded post. Since we were both able to reproduce this issue on other test servers with other deployments it's safe to say that the described issue is unrelated to this PR. I'll open an issue for this.
I think in the meantime, this PR can be tested by logging out after deleting the source post and logging back in to verify that the indication is shown.

Edit: I opened this issue that describes the observed behavior.

Copy link
Contributor

@FelberMartin FelberMartin left a comment

Choose a reason for hiding this comment

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

Tested on TS2 with logging out and in again, the indicator is shown
image

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!) communication Pull requests that affect the corresponding module ready for review
Projects
Status: Work In Progress
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants