From 2f9d067a944a0766a81f901e5de5e7cbc916e41a Mon Sep 17 00:00:00 2001 From: OpenSquared Date: Tue, 23 Jun 2026 10:13:40 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20InstitutionalReports=20=E2=80=94=20signa?= =?UTF-8?q?l-aware=20category=20filter=20+=20Agri/Crypto/Bonds/Indices=20p?= =?UTF-8?q?ills=20+=20Specialist=20Desks=20link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Backend: category filter now ORs signal column so multi-category reports (category='multi') appear when filtering by Forex/Energy/Metals/Indices — fixes blank results - Frontend: category pills expanded to match desk taxonomy (agri, crypto, bonds, indices added; equities kept for compatibility) - Frontend: banner pointing to /specialist-desks clarifies the split between auto-fetched reports and manual desk report scheduling Co-Authored-By: Claude Sonnet 4.6 --- backend/routers/institutional.py | 14 ++++++- frontend/src/pages/InstitutionalReports.tsx | 41 ++++++++++++++++++--- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/backend/routers/institutional.py b/backend/routers/institutional.py index 2ea349a..a8fcd16 100644 --- a/backend/routers/institutional.py +++ b/backend/routers/institutional.py @@ -114,7 +114,19 @@ def list_reports( conditions.append("report_type = ?") params.append(report_type) if category: - conditions.append("category = ?") + # For categories that map to a signal column, also match reports + # where that signal is non-neutral (most reports have category='multi') + _signal_col = { + 'forex': 'signal_forex', + 'energy': 'signal_energy', + 'metals': 'signal_metals', + 'equities': 'signal_indices', + 'indices': 'signal_indices', + }.get(category) + if _signal_col: + conditions.append(f"(category = ? OR {_signal_col} != 'neutral')") + else: + conditions.append("category = ?") params.append(category) if importance: conditions.append("importance >= ?") diff --git a/frontend/src/pages/InstitutionalReports.tsx b/frontend/src/pages/InstitutionalReports.tsx index 5ac3b2f..b8dac77 100644 --- a/frontend/src/pages/InstitutionalReports.tsx +++ b/frontend/src/pages/InstitutionalReports.tsx @@ -1,7 +1,8 @@ import { useState } from 'react' +import { Link } from 'react-router-dom' import { useInstitutionalReports, useInstitutionalStats, useRefreshInstitutionalReports } from '../hooks/useApi' import { useQueryClient } from '@tanstack/react-query' -import { RefreshCw, TrendingUp, TrendingDown, Minus, AlertTriangle, Star, CheckCircle, Clock } from 'lucide-react' +import { RefreshCw, TrendingUp, TrendingDown, Minus, AlertTriangle, Star, CheckCircle, Clock, Users, ExternalLink } from 'lucide-react' import clsx from 'clsx' import { format } from 'date-fns' @@ -285,6 +286,21 @@ export default function InstitutionalReports() { )} + {/* Specialist Desks link */} +
+ + + Ces rapports sont analysés automatiquement (fetch + scoring IA). Pour gérer le calendrier des rapports par desk — ajouter un rapport custom (ex. broyage cacao), planifier les prochaines dates, lier à un desk specialist — + + + + Specialist Desks + +
+ {/* Filters */}
@@ -310,18 +326,31 @@ export default function InstitutionalReports() {
Category:
- {['', 'energy', 'metals', 'equities', 'forex', 'volatility', 'macro', 'sentiment', 'multi'].map(c => ( + {([ + { v: '', label: 'All' }, + { v: 'energy', label: 'Energy' }, + { v: 'metals', label: 'Metals' }, + { v: 'agri', label: 'Agri' }, + { v: 'equities', label: 'Equities' }, + { v: 'forex', label: 'Forex' }, + { v: 'crypto', label: 'Crypto' }, + { v: 'bonds', label: 'Bonds' }, + { v: 'volatility',label: 'Volatility'}, + { v: 'macro', label: 'Macro' }, + { v: 'sentiment', label: 'Sentiment'}, + { v: 'multi', label: 'Multi' }, + ]).map(({ v, label }) => ( ))}