Add error handling and export functionality to JobHistoryPage - #110
Open
faizalmd2603 wants to merge 2 commits into
Open
Add error handling and export functionality to JobHistoryPage#110faizalmd2603 wants to merge 2 commits into
faizalmd2603 wants to merge 2 commits into
Conversation
|
🎉 Thanks for submitting a PR, @faizalmd2603! Please confirm the following checklist before review:
A maintainer will review your PR shortly. Thank you! 🚀 |
adikulkarni006
approved these changes
Jul 3, 2026
adikulkarni006
left a comment
Collaborator
There was a problem hiding this comment.
"### Approved. Code looks solid, logic is correct, and tests are passing. Good to merge. 🚀"
adikulkarni006
self-requested a review
July 3, 2026 16:57
adikulkarni006
approved these changes
Jul 3, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the dashboard’s JobHistoryPage to better handle failed job-list fetches and to add a “Download XLSX” export action per job.
Changes:
- Adds basic fetch error handling for the
/api/screenshotspolling loop and renders an error message. - Adds an “Export” column with a client-side download flow that calls an export endpoint and downloads the returned blob.
- Adjusts the grid layout and row interaction so job selection is triggered via the Job ID element.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+48
to
+54
| setExportingJobId(jobId) | ||
|
|
||
| const response = await fetch(`/api/screenshots/${jobId}/export/xlsx`) | ||
|
|
||
| if (!response.ok) { | ||
| throw new Error('Failed to export XLSX') | ||
| } |
Comment on lines
+114
to
+119
| <span | ||
| onClick={() => setSelectedJob(job)} | ||
| style={{ cursor: 'pointer' }} | ||
| > | ||
| {job.id.slice(0, 10)}... | ||
| </span> |
Comment on lines
+131
to
+143
| <button | ||
| onClick={() => handleExport(job.id)} | ||
| disabled={exportingJobId === job.id} | ||
| style={{ | ||
| padding: '6px 10px', | ||
| border: '1px solid #ccc', | ||
| borderRadius: '4px', | ||
| background: exportingJobId === job.id ? '#f3f3f3' : '#fff', | ||
| cursor: exportingJobId === job.id ? 'not-allowed' : 'pointer', | ||
| }} | ||
| > | ||
| {exportingJobId === job.id ? 'Exporting...' : 'Download XLSX'} | ||
| </button> |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Owner
|
@faizalmd2603 @adikulkarni006 cant approve these changes with no description and not explaining issues, and not following contribution guidlines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: Describe your changes
Issue ticket number and link
Closes #
Changes
Testing
Checklist before requesting a review
.envvalues are committed