[Closes #515] Export trial data to PDF - #519
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @MarianaES, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a significant new capability: the ability to export student trial data into a well-formatted PDF report. This feature enhances data accessibility and provides a convenient way to share progress reports, improving record-keeping and communication for student benchmarks.
Highlights
- PDF Export Functionality: Implemented a new feature allowing users to export comprehensive trial data reports to PDF format.
- Backend PDF Generation: Introduced a new backend utility (pdf-generator.ts) that leverages Puppeteer to render dynamic HTML content into a printable PDF document.
- New API Endpoint: Added a iep.exportReport mutation to the backend, responsible for fetching relevant student, goal, benchmark, and trial data, calculating success rates, and orchestrating the PDF generation.
- Frontend Integration: A "Data Report" button has been added to the benchmark view page, enabling users to trigger the PDF export directly from the UI and download the generated report.
- Detailed Report Content: The generated PDF report includes an overview of trials, success rates, staff members involved, benchmark details, success rate progress over time, and a detailed breakdown of individual trial data.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request adds a valuable feature for exporting trial data to a PDF. The implementation using Puppeteer on the backend is solid. My review focuses on improving correctness, maintainability, and performance. The most critical issue is the use of timezone-sensitive date functions, which can lead to incorrect data grouping on both the backend and frontend. I've also identified opportunities to refactor duplicated code, improve performance in the PDF generation process, and clean up the client-side code.
… to group by date and aggregate success rates
* add MUI X dependency * show trial data first pass Co-authored-by: Vincent Shuali <100994924+canjalal@users.noreply.github.com> * Add a goal header, and allow it to be non-editable * Add averaged points * Normalize y-axis * Add exploded points for single dates * Allow exploded points to collapse * Add target level line * Add percents * Add more data to each point * Add tooltips with data from trials Co-authored-by: NV <nickvisut@users.noreply.github.com> * add breadcrumbs and header to View Data page * Resize chart manually since responsive not working * implement workaround for y-axis label placement * center chart and tweak y-axis label position * [Closes #515] Export trial data to PDF (#519) * Create a tRPC endpoint to handle the PDF generation and utility * Add data export button to the ViewBenchmarkPage * Install puppeteer dependency * Implement fn to prevent XSS, improve header and stat cards design * Remove success rate data points * Move button to comply with design position * Sync package-lock.json with package.json * Update package-lock.json and package.json as prev version * Re install puppeteer * Retry packahe-lock file fix * Run format to fix lint error * Set puppeteer version to fix storybook/webpack error (tap) * fix: format README.md * Ensure report timestamps reflect user's local time * Ensure report timestamps reflect user's local time and refactor logic to group by date and aggregate success rates * Remove unnecessary networkidle0 prop * Replace manual base64-to-blob conversion with fetch() data URI approach * Ran npm audit fix * Feature/chart view (#532) * Include missing trial type * Implement charts/plots with toggle btns and additional stats info * Improve benchmark chart responsiveness and UI alignment and labels * Improve labeling * Improve CustomItemTooltip to include individual trials, headers and style * Extract rangeMarkerType to const for consistency * Remove unused allTrials array * Clean out dead code --------- Co-authored-by: Nick Visutsithiwong <2823112+nickvisut@users.noreply.github.com> Co-authored-by: Vincent Shuali <100994924+canjalal@users.noreply.github.com> Co-authored-by: Vincent Shuali <vincent.shuali@gmail.com> Co-authored-by: NV <nickvisut@users.noreply.github.com> Co-authored-by: Mariana Enriquez Sánchez <mariana.enriquez.s@gmail.com>
Button in the view page

PDF Generated
1/2

2/2
