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 29 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.

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
PaRangger
PaRangger previously approved these changes Apr 25, 2025
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.

Tested on TS4, works great! 😄

julian-wls
julian-wls previously approved these changes Apr 25, 2025
Copy link
Contributor

@julian-wls julian-wls left a comment

Choose a reason for hiding this comment

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

Thank you for implementing my review.
Everything works as expected, tested on TS4 👍

…ssage

# Conflicts:
#	src/main/webapp/app/communication/post/post.component.ts
#	src/main/webapp/app/communication/shared/entities/post.model.ts
coderabbitai[bot]
coderabbitai bot previously approved these changes May 1, 2025
Copy link

github-actions bot commented May 1, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran194 passed3 skipped4 failed53m 11s 623ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 2s 998ms
e2e/exercise/quiz-exercise/QuizExerciseManagement.spec.ts
ts.Quiz Exercise Management › Quiz Exercise Creation › Creates a Quiz with Drag and Drop❌ failure2m 2s 490ms
e2e/exercise/quiz-exercise/QuizExerciseParticipation.spec.ts
ts.Quiz Exercise Participation › DnD Quiz participation › Student can participate in DnD Quiz❌ failure2m 3s 5ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 45s 105ms

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de May 1, 2025 11:38 Inactive
Copy link

github-actions bot commented May 1, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran195 passed3 skipped3 failed51m 7s 665ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 3s 91ms
e2e/exercise/quiz-exercise/QuizExerciseManagement.spec.ts
ts.Quiz Exercise Management › Quiz Exercise Creation › Creates a Quiz with Drag and Drop❌ failure2m 2s 225ms
e2e/exercise/quiz-exercise/QuizExerciseParticipation.spec.ts
ts.Quiz Exercise Participation › DnD Quiz participation › Student can participate in DnD Quiz❌ failure2m 3s 901ms

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 TS1, works as described!

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de May 1, 2025 16:30 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.

Retested on TS1. Reapprove

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-tested on TS4

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 ready for review server Pull requests that update Java code. (Added Automatically!)
Projects
Status: Ready For Review
Status: Todo
Development

Successfully merging this pull request may close these issues.

8 participants