-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development
: Decompose PDF Preview components
#9592
Development
: Decompose PDF Preview components
#9592
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested on ts5 with Firefox, and everything worked correctly
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions. |
Lectures:
Decompose PDF Preview componentsLectures
: Decompose PDF Preview components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me, good job on using signals etc. :)
I tested on TS1 both on safari and chromium and it works as expected but I think there are a few minor improvements that could be done as a follow-up issue in a separate PR:
- The select checkbox is tiny and should be a bit larger, I think at least twice as big
- When pressing "Append PDF" limit the allowed file extensions to just
.pdf
, I could select a PNG and got: "Failed to merge files: Failed to parse PDF document (line:1620 col:357 offset=260789): No PDF header found" - Save button
- There is no immediate user feedback once you press Save and it is processing, I waited 5 seconds before something happened and pressed twice in confusion
- Prevent users from pressing it multiple times and present a loading spinner
- Cancel button
- Group with Save button to the right, no need to keep them them apart. I did not immediately see it
- "View" tooltip on the button is not necessary
- If there unsaved changes alert the user before leaving the page
- When you open a large pdf initially there is no loading spinner and you see an empty canvas, IMO there needs to be a big one in the middle so you know there is something going on
- Some kind of move or reorder 2D drag and drop functionality is missing. If I delete a slide and append an replacement then I cannot move it to the correct spot
Lectures
: Decompose PDF Preview componentsDevelopment
: Decompose PDF Preview components
NOTE: Please test it with both vertical and horizontal PDFs!
Checklist
General
Client
authorities
to all new routes and checked the course groups for displaying navigation elements (links, buttons).Motivation and Context
The current PDF Preview component enables instructors to individually view uploaded lecture slides and make adjustments, such as deleting or adding pages. However, the component's structure is overly complex, with all functionalities layered within a single component, resulting in lengthy, difficult-to-maintain code. To improve maintainability and flexibility, the component should be modularized into several smaller components, each focused on a specific function. This approach will streamline the codebase, making it easier to manage and adapt over time.
Description
The PDF Preview has been decomposed into 3 different components:
1. PDF Preview Component: Holds the general structure of the view and the buttons, along with their functionalities. This structure consists of
2. PDF Preview Thumbnail Grid Component: Holds the grid structure of the slide pages. Consists of
3. PDF Preview Enlarged Canvas Component: Created when the user clicks on one canvas, from the canvas image. Holds the bigger version of the slide page. Consists of
Steps for Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Code Review
Manual Tests
Test Coverage
Screenshots
1. Buttons when no slides are selected and no changes are made
2. Buttons when slides are selected
3. New pages are added
4. Horizontal zoom
5. Vertical zoom
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation
Tests
PdfPreviewComponent
,PdfPreviewEnlargedCanvasComponent
, andPdfPreviewThumbnailGridComponent
to ensure functionality and reliability.