Skip to content

Conversation

@nicklathe
Copy link
Contributor

@nicklathe nicklathe commented Jan 7, 2026

This PR fixes a regression introduced in 66957 that removed the hidden property from being included in the return hash of the new summarize_for_participant method. That property is eventually evaluated in the ParticipantSections component. This resulted in sections archived by teachers still showing up in student dashboards, in the Classroom Section table.

This PR addresses the regression with the following:

  • Adds the hidden property to the hash returned by summarize_for_participant
  • Re-adds the hidden property to existing tests
  • Adds new unit test to cover functionality and help catch future regressions.

Screenshots

Teacher archives section
Screenshot 2026-01-07 at 1 33 22 PM

Student view without the hidden property, archived section still included
Screenshot 2026-01-07 at 1 33 13 PM

Student view with hidden property added, archived section no longer included
Screenshot 2026-01-07 at 1 32 54 PM

Links

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Creation Checklist:

  • Tests provide adequate coverage
  • Privacy impacts have been documented
  • Security impacts have been documented
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Follow-up work items (including potential tech debt) are tracked and linked

@nicklathe nicklathe requested a review from Copilot January 7, 2026 22:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a regression where archived sections were incorrectly displayed on student dashboards due to the missing hidden property in the summarize_for_participant method. The fix restores the hidden property to the returned hash, updates existing test data to include this property, and adds a new unit test to prevent future regressions.

Key Changes

  • Restored the hidden property to the summarize_for_participant method in the Section model
  • Updated all existing test fixtures to include the hidden: false property for consistency
  • Added new test case and fixture data to verify that archived sections (with hidden: true) are properly filtered from student views

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
dashboard/app/models/sections/section.rb Adds the hidden property back to the hash returned by summarize_for_participant
apps/test/unit/templates/studioHomepages/homepagesTestData.js Updates test fixtures to include the hidden: false property for all non-archived sections
apps/test/unit/templates/studioHomepages/fakeSectionUtils.js Adds hidden: false to existing section fixtures and introduces a new archivedSections fixture
apps/test/unit/templates/studioHomepages/ParticipantSectionsTest.jsx Adds new test case to verify archived sections are not displayed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@carl-codeorg carl-codeorg left a comment

Choose a reason for hiding this comment

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

LGTM

@nicklathe nicklathe requested review from a team, bethanyaconnor, etaderhold and kobryan0619 and removed request for a team and kobryan0619 January 7, 2026 22:31
Copy link
Contributor

@etaderhold etaderhold left a comment

Choose a reason for hiding this comment

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

Thanks!

@nicklathe nicklathe force-pushed the nlathe/fix-archived-section-student-view branch from 367e4c2 to a9c388e Compare January 8, 2026 17:13
  - Fix regression where archived sections are showing up in student
    dashboard
  - Add hidden property back to section data passed to the frontend
  - Re-add property in existing tests
  - Add new unit test to cover functionality

Signed-off-by: Nick Lathe <nick.lathe@code.org>
@nicklathe nicklathe force-pushed the nlathe/fix-archived-section-student-view branch from 52e1cb3 to 1302c90 Compare January 8, 2026 23:05
@nicklathe nicklathe merged commit 2d341c6 into staging Jan 8, 2026
6 checks passed
@nicklathe nicklathe deleted the nlathe/fix-archived-section-student-view branch January 8, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants