Skip to content

[Bugfix:Notifications] Truncate reply/edit-reply Content#12790

Merged
bmcutler merged 5 commits into
Submitty:mainfrom
jndlansh:bugfix/truncate-reply-forum
Jun 8, 2026
Merged

[Bugfix:Notifications] Truncate reply/edit-reply Content#12790
bmcutler merged 5 commits into
Submitty:mainfrom
jndlansh:bugfix/truncate-reply-forum

Conversation

@jndlansh

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Fixes #12789
When a student edits a long forum reply post, the notification displayed to instructors and other subscribers on both the home screen and course notifications page was quoting the entire reply message verbatim. For lengthy posts (hundreds/thousands of characters), this resulted in overwhelming notification summaries.

This fix ensures edited post notifications are truncated to reasonable preview lengths, matching the behavior applied to other forum notifications (new thread, new reply announcements).

What is the New Behavior?

After: Edited post notifications now display truncated previews.

Reply.truncate.mp4

What steps should a reviewer take to reproduce or test the bug or new feature?

  1. Setup (as Instructor)
  2. Create test post (as Student)
  3. Edit the post (as Student)
  4. Verify truncation (as Instructor)

Automated Testing & Documentation

No new unit tests were added. This fix reuses the existing previewText() helper function already in the codebase for similar truncation needs.

Other Information

  • Breaking Change: No. This is a UX improvement.
  • Security Concerns: No. This only affects notification text preview display.

Implementation Detail: Reused existing private function previewText() helper to maintain consistency with truncation applied to new thread/post notifications.

@github-project-automation github-project-automation Bot moved this to Seeking Reviewer in Submitty Development Apr 15, 2026
@jndlansh jndlansh changed the title Fix the long reply/edit-reply message to a truncated version [BugFix:Notifications]reply/edit-reply message to a truncated version Apr 15, 2026

@QuackHonk QuackHonk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm a little confused. When running the issue the instructor page does have the new thread expanded but not by a significant amount. When refreshing the page it does shrink to the normal amount. This occurs on both the main branch and your branch. Also the video is having some technical issues.

Before refresh
Image

After refresh
Image

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Apr 17, 2026
@jndlansh

jndlansh commented Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

@QuackHonk I have fixed the issue of the instructor page does have the new thread expanded. Though I am not sure if this was to be addressed in this PR, because #12789 does not mention this.

trunc.mp4

Could you also please explain me the technical issues in the video?

@jndlansh
jndlansh requested a review from QuackHonk April 17, 2026 17:41
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Apr 17, 2026
@github-actions github-actions Bot added the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label May 3, 2026
@JManion32 JManion32 removed the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label May 25, 2026
@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.61%. Comparing base (249b9c9) to head (84db735).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #12790      +/-   ##
============================================
- Coverage     21.62%   21.61%   -0.01%     
  Complexity     9824     9824              
============================================
  Files           268      268              
  Lines         36816    36818       +2     
  Branches        490      490              
============================================
  Hits           7960     7960              
- Misses        28370    28372       +2     
  Partials        486      486              
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.02% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.66% <0.00%> (-0.01%) ⬇️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JManion32 JManion32 changed the title [BugFix:Notifications]reply/edit-reply message to a truncated version [Bugfix:Notifications] Truncate reply/edit-reply Content May 25, 2026

@JManion32 JManion32 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tested the initial commit and found that it solves the issue. I don't think the second change is necessary here. Just revert that commit and I will approve. Nice work!

@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development May 25, 2026
@jndlansh
jndlansh force-pushed the bugfix/truncate-reply-forum branch from c186724 to 6048743 Compare May 26, 2026 01:29
@jndlansh
jndlansh requested a review from JManion32 May 26, 2026 06:18
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development May 26, 2026

@JManion32 JManion32 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code changes are minimal and the reply notification is now truncated correctly. Nice work!

Image

@bmcutler
bmcutler merged commit b9135e9 into Submitty:main Jun 8, 2026
24 of 26 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Submitty Development Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

notification of forum post edit quotes the entire message....

4 participants