Skip to content

Conversation

@ntietje1
Copy link
Collaborator

Summary

  • Moves a monstrous amount of code into 2 react query hooks
  • Adds shared caching between student works list and student work individual queries (blazingly fast :o)

Checklist

  • I have performed a self-review of my code
  • I have reached out to another developer to review my code
  • New and existing unit tests pass locally with my changes
  • All Lint and CI checks are passing

@ntietje1 ntietje1 changed the base branch from main to feature/assignment-base-repo-link April 10, 2025 22:26
@ntietje1 ntietje1 requested a review from Copilot April 11, 2025 00:25
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.

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

Comments suppressed due to low confidence (3)

frontend/src/pages/Assignments/StudentSubmission/index.tsx:42

  • Calling ErrorToast directly during render may trigger duplicate alerts on re-renders. Consider wrapping this call in a useEffect hook that watches submissionError to trigger the toast only once per error occurrence.
if (submissionError) { ErrorToast("Error loading submission data", "submissionError"); }

frontend/src/pages/Assignments/StudentSubmission/index.tsx:46

  • Directly calling ErrorToast in the render path may result in repeated notifications. Moving this logic into a useEffect hook triggered by analyticsError will help control side effects more reliably.
if (analyticsError) { ErrorToast("Error loading analytics data", "analyticsError"); }

frontend/src/hooks/useStudentWorks.ts:127

  • Using Date objects as keys in a Map can lead to issues because different Date instances with the same time are not considered equal. Consider using a consistent key format (e.g., an ISO string) for reliable date comparisons.
if (!commitsPerDay.has(currentDate)) { commitsPerDay.set(new Date(currentDate), 0); }

@ntietje1 ntietje1 changed the title Feature/student work page upgrade Feature/student work page upgrade (KHO-339) Apr 16, 2025
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.

2 participants