Fix score refresh, add granular fetch and live job status
Deploy / lint (push) Successful in 6s
Deploy / test (push) Successful in 35s
Deploy / deploy (push) Successful in 22s

Scores never updated ("101d ago"): get_score only recomputes stale/
missing dimensions, but nothing marked them stale on new data, and there
was no scheduled scoring job.
- Fetch endpoint force-recomputes dimensions + composite.
- Scheduled scan (scan_all_tickers) refreshes scores per ticker, so
  scores stay current globally, not just on manual fetch.

Granular fetch: /ingestion/fetch accepts a sources filter; the freshness
bar gets a per-row refresh button (OHLCV/Sentiment/Fundamentals fetch
that provider only — marked paid; S/R/Scores recompute for free). Header
button is now "Fetch All".

Job visibility: GET /jobs/running (any user) + sidebar live indicator
showing running scheduled jobs with progress, polled every 10s.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 13:10:15 +02:00
parent 3aebfd72d3
commit 316226096b
10 changed files with 296 additions and 94 deletions
@@ -2,6 +2,7 @@ import { NavLink } from 'react-router-dom';
import { useQuery } from '@tanstack/react-query';
import { useAuthStore } from '../../stores/authStore';
import { check as healthCheck } from '../../api/health';
import { getRunningJobs } from '../../api/jobs';
const navItems = [
{ to: '/', label: 'Overview', index: '01', end: true },
@@ -28,6 +29,16 @@ export default function Sidebar() {
const isBackendUp = health.isSuccess;
const jobs = useQuery({
queryKey: ['jobs', 'running'],
queryFn: getRunningJobs,
refetchInterval: 10_000,
retry: 1,
enabled: isBackendUp,
});
const running = jobs.data?.running ?? [];
return (
<aside className="hidden lg:flex lg:flex-col lg:w-64 h-screen sticky top-0 glass border-r border-white/[0.06] rounded-none border-l-0 border-t-0 border-b-0">
{/* Brand */}
@@ -69,6 +80,23 @@ export default function Sidebar() {
{isBackendUp ? 'Backend online' : 'Backend offline'}
</span>
</div>
{/* Live background-job activity */}
{running.length > 0 && (
<div className="px-1 space-y-1">
{running.map((job) => (
<div key={job.name} className="flex items-center gap-2">
<span className="inline-block h-1.5 w-1.5 rounded-full bg-blue-400 animate-signal-pulse shrink-0" />
<span className="text-[11px] text-gray-400 truncate">
{job.label}
{job.progress_pct != null && (
<span className="num text-gray-500"> {Math.round(job.progress_pct)}%</span>
)}
</span>
</div>
))}
</div>
)}
{username && (
<p className="text-xs text-gray-500 truncate px-1">Signed in as {username}</p>
)}