Skip to content

Communication: Add send as regular message option for replies #10739

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

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

Conversation

asliayk
Copy link
Contributor

@asliayk asliayk commented Apr 24, 2025

Checklist

General

Server

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.
  • 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.
  • I translated all newly inserted strings into English and German.

Motivation and Context

Currently, when replying to a message, the response is always created as an AnswerPost. However, there is no option to post the reply as a regular Post instead. This limitation is not always ideal in scenarios where the reply is relevant to the entire conversation rather than just being tied to the original message. (Closes #9953)

Description

This PR introduces "Also send as direct message" option when writing a reply.

  • A checkbox has been added below the input field for replies.
  • When selected, the reply is sent both as an AnswerPost and as a regular Post within the same conversation.
  • The Post version of the reply includes a link to navigate to the related thread, similar to Slack.

To achieve this feature, an original_post_id column has been added to the Post table. This column stores the ID of the first message in the thread (i.e., the original post), enabling seamless navigation from any reply back to its corresponding thread.

  • hasForwardedMessages field, which was present in both Post and AnswerPost, has been moved to the parent class Posting.

Steps for Testing

Prerequisites:

  • 1 User
  • 1 Course with Communication enabled
  1. Log in to Artemis.
  2. Navigate to the Communication section of a course.
  3. Select a message and type a reply in the input field.
  4. Before sending, check the "Also Send as Direct Message" checkbox below the input field.
  5. Verify that the reply is sent both as an AnswerPost and as a regular Post in the same conversation.
  6. Locate the "replied to a thread" line above the post.
  7. Click the "replied to a thread" link and confirm that it navigates to the original thread.

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)
message-reply-inline-input.component.spec.ts not found (modified)
message-reply-inline-input.component.ts 77.35% ✅ ❌
post.component.spec.ts not found (modified)
post.component.ts 93.1% ✅ ❌
posting-reactions-bar.component.ts 85.94% ✅ ❌
metis.service.spec.ts not found (modified)
metis.service.ts 90.15% ✅ ❌
course-conversations.component.ts 92.68% ✅ ❌
post.model.ts 100%

Screenshots

reply input with checkbox
image

navigation link to the thread
image

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added support for marking posts as replies with an original post reference, including UI elements to view and navigate to the original thread.
    • Introduced an option to send messages as direct messages, with dynamic labels based on conversation type.
    • Added new translation keys for thread-related actions and message-sending options in both English and German.
  • Improvements

    • Enhanced post display to indicate replies and provide direct navigation to original threads.
    • Improved reply and thread action buttons with context-sensitive behavior.
    • Refined channel selection to exclude archived channels when forwarding posts.
    • Added markdown stripping for original post content display to improve readability.
    • Optimized post retrieval by ID with caching to improve performance.
    • Updated navigation logic to open threads appropriately based on post type and conversation context.
  • Bug Fixes

    • Ensured thread navigation works correctly for posts with valid conversation references.
  • Tests

    • Added tests for toggling direct message sending, form resets, direct-message post creation, markdown stripping, and post retrieval by ID.
  • Style

    • Introduced new CSS classes for improved layout and text handling in post components.

asliayk and others added 21 commits February 27, 2025 15:08
…ssage

# Conflicts:
#	src/main/webapp/app/communication/post/post.component.ts
#	src/test/javascript/spec/component/shared/metis/message-reply-inline-input/message-reply-inline-input.component.spec.ts
…ssage

# Conflicts:
#	src/main/java/de/tum/cit/aet/artemis/communication/domain/Posting.java
#	src/main/java/de/tum/cit/aet/artemis/communication/dto/PostingDTO.java
#	src/main/webapp/app/communication/message/message-reply-inline-input/message-reply-inline-input.component.spec.ts
#	src/main/webapp/app/communication/message/message-reply-inline-input/message-reply-inline-input.component.ts
#	src/main/webapp/app/communication/post/post.component.spec.ts
@asliayk asliayk added feature tests client Pull requests that update TypeScript code. (Added Automatically!) communication Pull requests that affect the corresponding module labels Apr 24, 2025
@asliayk asliayk self-assigned this Apr 24, 2025
@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Apr 24, 2025
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.

Re-approve, tested on TS2

Copy link
Contributor

@eylulnc eylulnc 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, works as described.
Screenshot 2025-05-12 at 23 14 23

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de May 13, 2025 08:02 Inactive
Copy link

@HawKhiem HawKhiem left a comment

Choose a reason for hiding this comment

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

Tested again on TS3. Reapprove

Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed53m 13s 708ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 47s 113ms

@helios-aet helios-aet bot temporarily deployed to artemis-test5.artemis.cit.tum.de May 13, 2025 22:18 Inactive
Copy link

End-to-End (E2E) Test Results Summary

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de May 15, 2025 10:58 Inactive
Copy link

End-to-End (E2E) Test Results Summary

Copy link

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions bot closed this Jun 7, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Communication Webclient Jun 7, 2025
@krusche krusche reopened this Jun 26, 2025
@krusche krusche requested a review from a team as a code owner June 26, 2025 11:55
@github-project-automation github-project-automation bot moved this from Ready For Review to Work In Progress in Artemis Development Jun 26, 2025
@github-project-automation github-project-automation bot moved this from Done to In Progress in Communication Webclient Jun 26, 2025
@github-actions github-actions bot removed the stale label Jun 26, 2025
Copy link

github-actions bot commented Jul 3, 2025

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jul 3, 2025
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 database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. feature server Pull requests that update Java code. (Added Automatically!) stale tests
Projects
Status: Work In Progress
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Communication: Send answer as direct message
9 participants