Skip to content

feat: add pinned callout for job processing/error status in documents table#93

Open
tifa2UP wants to merge 1 commit intomainfrom
feat/documents-processing-callout
Open

feat: add pinned callout for job processing/error status in documents table#93
tifa2UP wants to merge 1 commit intomainfrom
feat/documents-processing-callout

Conversation

@tifa2UP
Copy link
Member

@tifa2UP tifa2UP commented Jan 17, 2026

image

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

  • DataTable component: Added pinnedTopContent prop to render a pinned row at the top of the table body
  • PaginatedTable component: Added pinnedContent prop that passes through to DataTable
  • useJobsStatus hook: New hook that tracks job status with three states:
    • idle - no active jobs
    • processing - jobs are being processed (shows info callout)
    • error - a job failed (shows error callout with dismiss button)
  • Documents page: Replaced the static Alert component with the new pinned callout

Features

  • Processing callout shows when documents are being processed
  • Error callout shows when a job fails (only for jobs that failed after page load)
  • Error callout can be dismissed with an X button
  • "No results" message is hidden when a callout is displayed (since the callout explains the situation)
  • No layout shift - the callout is part of the table structure

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.

  • Added pinnedTopContent prop to DataTable component to render content in a pinned row
  • Created useJobsStatus hook that tracks three states: idle, processing (active jobs), and error (jobs that failed after mount)
  • Error callouts can be dismissed and only show for jobs that failed after the page loaded
  • "No results" message is hidden when callout is displayed

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

  • This PR is safe to merge with minimal risk
  • The implementation is straightforward and well-structured. The changes add new functionality without modifying critical logic. The pinned content pattern is a clean solution that integrates well with the existing table component. The only suggestion is a minor defensive coding improvement.
  • No files require special attention

Important Files Changed

Filename Overview
apps/web/src/app/app.agentset.ai/(dashboard)/[slug]/[namespaceSlug]/documents/use-pending-jobs.ts Added useJobsStatus hook to track job processing/error states with dismiss functionality
apps/web/src/app/app.agentset.ai/(dashboard)/[slug]/[namespaceSlug]/documents/page.client.tsx Replaced static Alert with pinned callout content passed to PaginatedTable
packages/ui/src/components/ui/data-table.tsx Added pinnedTopContent prop to render pinned row at top of table body
apps/web/src/app/app.agentset.ai/(dashboard)/[slug]/[namespaceSlug]/documents/paginated-table.tsx Added pinnedContent prop that passes through to DataTable's pinnedTopContent

… 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
@vercel
Copy link

vercel bot commented Jan 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
app-agentset-ai Ready Ready Preview, Comment Jan 17, 2026 2:43pm

Request Review

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +96 to +100
const dismissError = () => {
if (failedJob) {
setDismissedErrorJobId(failedJob.id);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant