Skip to content

Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.

TypeScript

fix(KB): remove redundant Refresh button from Processing Queue

Chris Sherwood4e8caddcc2aa
diff --git a/admin/inertia/components/ActiveEmbedJobs.tsx b/admin/inertia/components/ActiveEmbedJobs.tsx
index 754f4e52..bb8fbd1a 100644
--- a/admin/inertia/components/ActiveEmbedJobs.tsx
+++ b/admin/inertia/components/ActiveEmbedJobs.tsx
@@ -1,7 +1,6 @@
import { useEffect, useState } from 'react'
import useEmbedJobs from '~/hooks/useEmbedJobs'
import HorizontalBarChart from './HorizontalBarChart'
-import StyledButton from './StyledButton'
import StyledSectionHeader from './StyledSectionHeader'
import {
JOB_HEALTH_DISPLAY,
@@ -14,10 +13,9 @@ interface ActiveEmbedJobsProps {
}
const ActiveEmbedJobs = ({ withHeader = false }: ActiveEmbedJobsProps) => {
- const { data: jobs, invalidate, dataUpdatedAt } = useEmbedJobs()
+ const { data: jobs } = useEmbedJobs()
- // Live "last refreshed Xs ago" tick. We re-render every 5s purely to keep
- // the relative timestamp current, without touching React Query state.
+ // Re-render every 5s to keep per-job "last activity Xs ago" timestamps fresh.
const [tick, setTick] = useState(() => Date.now())
useEffect(() => {
const id = setInterval(() => setTick(Date.now()), 5000)
@@ -30,21 +28,6 @@ const ActiveEmbedJobs = ({ withHeader = false }: ActiveEmbedJobsProps) => {
<StyledSectionHeader title="Processing Queue" className="mt-12 mb-4" />
)}
- {/* Refresh row — only shown when at least one job exists so the empty
- state stays clean. */}
- {jobs && jobs.length > 0 && (
- <div className="flex items-center justify-between mb-3 text-sm">
- <span className="text-text-muted">
- {dataUpdatedAt > 0
- ? `Last updated ${formatTimeAgo(dataUpdatedAt, tick)}`
- : 'Loading…'}
- </span>
- <StyledButton variant="ghost" size="sm" icon="IconRefresh" onClick={invalidate}>
- Refresh
- </StyledButton>
- </div>
- )}
-
<div className="space-y-4">
{jobs && jobs.length > 0 ? (
jobs.map((job) => {