From 4e8caddcc2aabd1fd66f4589baa3e3492d36dd38 Mon Sep 17 00:00:00 2001 From: Chris Sherwood Date: Thu, 14 May 2026 14:52:17 -0700 Subject: [PATCH] fix(KB): remove redundant Refresh button from Processing Queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit useEmbedJobs already polls every 2s while jobs are active (and 30s when idle) and auto-invalidates Stored Files when the queue drains. The manual Refresh button was a no-op signal — it just confuses users who click it and see no change. Per-job 'last activity Xs ago' lines remain as the live-recency indicator. Stacks on feat/kb-job-status-pill (#893) since the Refresh button only exists in that branch. --- admin/inertia/components/ActiveEmbedJobs.tsx | 21 ++------------------ 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/admin/inertia/components/ActiveEmbedJobs.tsx b/admin/inertia/components/ActiveEmbedJobs.tsx index 754f4e5..bb8fbd1 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) => { )} - {/* Refresh row — only shown when at least one job exists so the empty - state stays clean. */} - {jobs && jobs.length > 0 && ( -
- - {dataUpdatedAt > 0 - ? `Last updated ${formatTimeAgo(dataUpdatedAt, tick)}` - : 'Loading…'} - - - Refresh - -
- )} -
{jobs && jobs.length > 0 ? ( jobs.map((job) => {