Skip to content

Add error handling and export functionality to JobHistoryPage - #110

Open
faizalmd2603 wants to merge 2 commits into
madhav2348:mainfrom
faizalmd2603:patch-5
Open

Add error handling and export functionality to JobHistoryPage#110
faizalmd2603 wants to merge 2 commits into
madhav2348:mainfrom
faizalmd2603:patch-5

Conversation

@faizalmd2603

Copy link
Copy Markdown

Summary: Describe your changes

Issue ticket number and link

Closes #

Changes

Testing

  • Added/updated tests
  • Tested locally (describe steps)

Checklist before requesting a review

  • Code follows the project's TypeScript style conventions
  • No secrets or .env values are committed
  • I have performed a self-review of my code
  • CI passes

@github-actions

Copy link
Copy Markdown

🎉 Thanks for submitting a PR, @faizalmd2603!

Please confirm the following checklist before review:

  • ⭐ I have starred this repository
  • 🍴 I have forked this repository
  • 📖 I have read the Contributing Guidelines
  • 🔀 My changes are pushed to the develop branch

A maintainer will review your PR shortly. Thank you! 🚀

@adikulkarni006 adikulkarni006 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"### Approved. Code looks solid, logic is correct, and tests are passing. Good to merge. 🚀"

@adikulkarni006
adikulkarni006 self-requested a review July 3, 2026 16:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/screenshots polling 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 thread src/features/ss-app/pages/dashboard/JobHistoryPage.tsx Outdated
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>
@madhav2348

Copy link
Copy Markdown
Owner

@faizalmd2603 @adikulkarni006 cant approve these changes with no description and not explaining issues, and not following contribution guidlines

@madhav2348 madhav2348 added anonyomous invalid This doesn't seem right labels Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

anonyomous invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants