Skip to content

Conversation

@levadadenys
Copy link
Contributor

Warning!!

We have entered Pixel Lock for Hour of AI! All merges to the staging branch from Dec 2 through Dec 12 must go through live change review and be deemed critical for supporting the Hour of AI. External contributions will not be accepted at this time.

For non-critical changes, please change your base to staging-next and delete this warning. We will merge staging-next into staging on Dec 15, 2025.

[AITT-1319] [Snapshot] Wire up the next/previous student buttons

  • feat: implement navigation for previous and next students in the selection

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

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 implements student navigation functionality in the Student Snapshot header by wiring up the "Previous student" and "Next student" buttons. It replaces placeholder alert calls with actual navigation logic that updates the selected student based on the selectedStudents array from Redux state.

Key changes:

  • Implemented navigation handlers that traverse the selectedStudents array and update the selected student ID
  • Added disabled state logic to buttons based on student position and array availability
  • Moved useAppSelector hook earlier in the component to support the new navigation logic

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

Comment on lines 95 to 105
const handlePreviousStudent = () => {
alert('Previous student clicked!');
if (previousStudent) {
setSelectedStudentId(previousStudent.id);
}
};

const handleNextStudent = () => {
alert('Next student clicked!');
if (nextStudent) {
setSelectedStudentId(nextStudent.id);
}
};
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The new navigation logic in handlePreviousStudent and handleNextStudent lacks test coverage. Since other components in the studentSnapshot directory have comprehensive tests (e.g., StudentRubricWidgetTest.tsx), this component should also have tests covering: (1) clicking previous/next buttons updates the selected student, (2) buttons are disabled at the boundaries (first/last student), (3) navigation works correctly with selectedStudents array changes.

Copilot uses AI. Check for mistakes.
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.

1 participant