feat: add pinned callout for job processing/error status in documents table#93
Open
feat: add pinned callout for job processing/error status in documents table#93
Conversation
… table - Add pinnedTopContent prop to DataTable component for pinned rows - Add pinnedContent prop to PaginatedTable to pass through to DataTable - Create useJobsStatus hook to track processing and error states - Show processing callout when jobs are being processed - Show error callout with dismiss button when a job fails - Hide 'No results' message when callout is displayed
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Comment on lines
+96
to
+100
| const dismissError = () => { | ||
| if (failedJob) { | ||
| setDismissedErrorJobId(failedJob.id); | ||
| } | ||
| }; |
Contributor
There was a problem hiding this comment.
style: dismissError sets the dismissed job ID, but doesn't check if failedJob exists before accessing it. While unlikely to cause issues since the dismiss button only appears when there's an error, defensively check that failedJob is truthy.
Suggested change
| const dismissError = () => { | |
| if (failedJob) { | |
| setDismissedErrorJobId(failedJob.id); | |
| } | |
| }; | |
| const dismissError = () => { | |
| if (failedJob?.id) { | |
| setDismissedErrorJobId(failedJob.id); | |
| } | |
| }; |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/src/app/app.agentset.ai/(dashboard)/[slug]/[namespaceSlug]/documents/use-pending-jobs.ts
Line: 96:100
Comment:
**style:** `dismissError` sets the dismissed job ID, but doesn't check if `failedJob` exists before accessing it. While unlikely to cause issues since the dismiss button only appears when there's an error, defensively check that `failedJob` is truthy.
```suggestion
const dismissError = () => {
if (failedJob?.id) {
setDismissedErrorJobId(failedJob.id);
}
};
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
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
Adds a pinned callout row inside the documents table that shows job processing or error status, replacing the previous static alert that caused layout shifts.
Changes
pinnedTopContentprop to render a pinned row at the top of the table bodypinnedContentprop that passes through to DataTableidle- no active jobsprocessing- jobs are being processed (shows info callout)error- a job failed (shows error callout with dismiss button)Features
Greptile Summary
Replaced static Alert component with a pinned callout row inside the documents table to show job processing or error status without causing layout shifts.
pinnedTopContentprop to DataTable component to render content in a pinned rowuseJobsStatushook that tracks three states: idle, processing (active jobs), and error (jobs that failed after mount)The implementation is clean and follows existing patterns in the codebase. The pinned row approach elegantly solves the layout shift problem.
Confidence Score: 5/5
Important Files Changed
useJobsStatushook to track job processing/error states with dismiss functionalitypinnedTopContentprop to render pinned row at top of table bodypinnedContentprop that passes through to DataTable'spinnedTopContent