Skip to content

fix: resolve syllabus preview/download loading state after filter selection#603

Open
Vedthakar wants to merge 1 commit into
lovelymahor:mainfrom
Vedthakar:fix/syllabus-infinite-loading-601
Open

fix: resolve syllabus preview/download loading state after filter selection#603
Vedthakar wants to merge 1 commit into
lovelymahor:mainfrom
Vedthakar:fix/syllabus-infinite-loading-601

Conversation

@Vedthakar

Copy link
Copy Markdown

Summary

This PR fixes an issue where users could become stuck in an infinite loading state when attempting to preview or download a syllabus after applying filters (University, Department, and Semester). Syllabus PDFs now open correctly, and the loading state is properly reset.

Changes

Syllabus Page

  • Added fileUrl support to syllabus entries.

  • Moved syllabus data outside the component to prevent unnecessary re-creation on each render.

  • Added openingSyllabusId state to track the syllabus currently being opened.

  • Replaced the mock download handler with a dedicated openSyllabusFile function.

  • Open syllabus PDFs in a new tab using window.open.

  • Added error handling for:

    • Missing syllabus files
    • Blocked pop-ups
    • Failed open attempts
  • Ensured loading state is always reset using finally.

UI Improvements

  • Updated Download Syllabus to open the syllabus PDF.
  • Updated Preview to open the same syllabus PDF.
  • Added disabled states while a syllabus is being opened.
  • Added contextual "Opening..." feedback during file launch.

Tests

Added automated test coverage for the reported issue:

  • Applies University, Department, and Semester filters.
  • Selects a filtered syllabus.
  • Clicks the Preview button.
  • Verifies the correct PDF is opened in a new tab.

Problem Resolved

Previously, after filtering syllabi and attempting to preview or download a syllabus, users could become stuck in a loading state that never completed. This update ensures syllabus files open successfully and prevents users from getting trapped in an infinite loading state.

Testing

  • Applied filters and opened syllabus preview.
  • Verified correct PDF URL is opened.
  • Verified loading state resets after opening.
  • Verified buttons are disabled while opening.
  • Added automated test coverage for the filtered preview flow.

Fixes #601

Tags

bug frontend react ui testing syllabus user-experience fixes-601

…mahor#601)

Open syllabus PDFs from Download/Preview actions and reset the opening state so users are not stuck after selecting university, department, and semester.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

@Vedthakar is attempting to deploy a commit to the Lovely Mahour's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Syllabus page stuck in infinite loading after selecting University, Department, and Semester

1 participant