Skip to content

feat(Discussion): Add masonry layout#2317

Merged
breity merged 6 commits into
developfrom
discussion-masonry-layout
Jun 5, 2026
Merged

feat(Discussion): Add masonry layout#2317
breity merged 6 commits into
developfrom
discussion-masonry-layout

Conversation

@breity

@breity breity commented Jun 2, 2026

Copy link
Copy Markdown
Member

Changes

  • Improve student and teacher Discussion views with a masonry layout (grid lanes that automatically adjust space between posts when new posts are added and post content heights change).
  • Utilize new CSS feature display: grid-lanes.
  • Fall back to js masonry implementation for browsers that don't yet support display: grid-lanes.
  • Clean up discussion styles.

Test

  • Make sure Discussion activities work as before in both the student unit view and teacher grading view.
  • Ensure that you can create new posts and replies and add images to posts in the student view.
  • Ensure that you can hide and show posts and replies in the teacher grading view and that you can toggle opened and closed hidden posts and replies.

@breity breity requested a review from hirokiterashima June 2, 2026 17:33
@breity breity self-assigned this Jun 2, 2026
@breity breity added the enhancement New feature of any size or improvement (UI, performance, security) label Jun 2, 2026
@qltysh

qltysh Bot commented Jun 2, 2026

Copy link
Copy Markdown

❌ 2 blocking issues (2 total)

Tool Category Rule Count
qlty Structure Function with many parameters (count = 11): constructor 1
qlty Duplication Found 24 lines of similar code in 5 locations (mass = 71) 1

protected studentAssetService: StudentAssetService,
protected dataService: StudentDataService
protected dataService: StudentDataService,
private ngZone: NgZone

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Function with many parameters (count = 11): constructor [qlty:function-parameters]

@qltysh

qltysh Bot commented Jun 2, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

Unable to calculate total coverage change because base branch coverage was not found.

Modified Files with Diff Coverage (2)

RatingFile% DiffUncovered Line #s
New Coverage rating: D
.../discussion/discussion-student/discussion-student.component.ts43.8%108-120, 124-137...
New Coverage rating: D
...mponents/discussion/class-response/class-response.component.ts0.0%42
Total42.4%
🤖 Increase coverage with AI coding...
In the `discussion-masonry-layout` branch, add test coverage for this new code:

- `src/assets/wise5/components/discussion/class-response/class-response.component.ts` -- Line 42
- `src/assets/wise5/components/discussion/discussion-student/discussion-student.component.ts` -- Lines 108-120, 124-137, and 141-144

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@hirokiterashima hirokiterashima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! Ready to merge after fixing these minor issues:

  1. Student view without image attachment looks off:
Image
  1. We should call emit() directly in template. I added an inline comment.

Comment on lines +92 to +94
protected onToggleHiddenPost(): void {
this.toggleHiddenPost.emit();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Call emit() directly in template?

@breity breity merged commit 7d0dc77 into develop Jun 5, 2026
1 check passed
@breity breity deleted the discussion-masonry-layout branch June 5, 2026 18:06
@hirokiterashima

Copy link
Copy Markdown
Member

🎉 This PR is included in version 5.232.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature of any size or improvement (UI, performance, security) released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants