From c82dbb397b4e98afac440ea1490bc0a78ac96adc Mon Sep 17 00:00:00 2001 From: caty21 Date: Sat, 27 Jun 2026 22:28:39 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20OIS=20toujours=20visible=20+=20R=C3=A9su?= =?UTF-8?q?m=C3=A9=20IA=20blanc=20+=20news=20s=C3=A9par=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CurrencyCard: OIS toujours dans sigTabs (plus conditionnel à ratePath) → affiche état 'indisponible' quand données absentes, au lieu de disparaître - NarrativeButton: couleur 'Résumé IA' blanc (#ffffff) au lieu d'amber - NewsTab: Inflation/Géopolitique/Emploi/Énergie toujours visibles comme filtres → séparation TOP NEWS (articles avec étiquette macro) vs 'Autres actualités' (articles boursiers sans tag FX) dans section repliable Co-Authored-By: Claude Sonnet 4.6 --- components/CurrencyCard.tsx | 17 +++- components/NarrativeButton.tsx | 6 +- components/NewsTab.tsx | 151 +++++++++++++++++++++------------ 3 files changed, 115 insertions(+), 59 deletions(-) diff --git a/components/CurrencyCard.tsx b/components/CurrencyCard.tsx index 15ee642..4fd00dd 100644 --- a/components/CurrencyCard.tsx +++ b/components/CurrencyCard.tsx @@ -1500,11 +1500,12 @@ export default function CurrencyCard({ <> {/* ── Slider : OIS / COT / Sentiment ──────────────────────── */} {(() => { - const sigTabs: { id: SignauxSlide; label: string }[] = []; - if (ratePath && ratePath.meetings.length > 0) sigTabs.push({ id: "ois", label: "OIS" }); + // OIS est toujours présent (même si données indisponibles) + const sigTabs: { id: SignauxSlide; label: string }[] = [ + { id: "ois", label: "OIS" }, + ]; if (cot) sigTabs.push({ id: "cot", label: "COT" }); if (sentiment) sigTabs.push({ id: "sent", label: "Sentiment" }); - if (!sigTabs.length) return
Données insuffisantes
; return (
{sigTabs.length > 1 && ( @@ -1535,6 +1536,16 @@ export default function CurrencyCard({ {signauxSlide === "ois" && ratePath && ratePath.meetings.length > 0 && ( )} + {/* OIS — état indisponible */} + {signauxSlide === "ois" && (!ratePath || !ratePath.meetings.length) && ( +
+ +
+

Données OIS indisponibles

+

Cache actualisé par GitHub Actions (24–48h)

+
+
+ )} {/* COT */} {signauxSlide === "cot" && cot && (() => { diff --git a/components/NarrativeButton.tsx b/components/NarrativeButton.tsx index 606f58d..8d18c04 100644 --- a/components/NarrativeButton.tsx +++ b/components/NarrativeButton.tsx @@ -45,9 +45,9 @@ export default function NarrativeButton({ currency, phase, macroScore }: Props) - {/* Actualiser */}
- {/* ── Liste ───────────────────────────────────────────────────────────── */} + {/* ── TOP NEWS ────────────────────────────────────────────────────────── */} {loading && items.length === 0 ? (
Chargement des actualités… InvestingLive · Reuters · Bloomberg
- ) : filtered.length === 0 ? ( + ) : topFiltered.length === 0 && otherItems.length === 0 ? (
Aucune actualité pour ce filtre.
) : ( -
- {filtered.map(item => ( - - ))} -
+ <> + {/* Articles macro / top news */} + {topFiltered.length > 0 && ( +
+ {topFiltered.map(item => ( + + ))} +
+ )} + + {/* Section "Autres actualités" — articles sans étiquette macro */} + {otherItems.length > 0 && ( +
+ + + {othersOpen && ( +
+ {otherItems.map(item => ( + + ))} +
+ )} +
+ )} + )} ); @@ -262,7 +304,7 @@ export default function NewsTab({ items, loading, onRefresh }: Props) { // ── NewsCard ────────────────────────────────────────────────────────────────── -function NewsCard({ item }: { item: NewsItem }) { +function NewsCard({ item, secondary = false }: { item: NewsItem; secondary?: boolean }) { const [expanded, setExpanded] = useState(false); const overallDir = @@ -271,20 +313,22 @@ function NewsCard({ item }: { item: NewsItem }) { : item.impacts.some(i => i.direction === "bearish") ? "bearish" : "neutral"; - const isPriority = item.categories.some(c => + const isPriority = !secondary && item.categories.some(c => ["Discours BC", "Décision Taux", "Crise", "Guerre", "Chef d'État"].includes(c) ); - const borderCls = - overallDir === "bullish" ? "border-emerald-500/25" : - overallDir === "bearish" ? "border-red-500/25" : - overallDir === "mixed" ? "border-amber-500/20" : - "border-slate-700/30"; + const borderCls = secondary + ? "border-slate-800/50" + : overallDir === "bullish" ? "border-emerald-500/25" + : overallDir === "bearish" ? "border-red-500/25" + : overallDir === "mixed" ? "border-amber-500/20" + : "border-slate-700/30"; - const bgCls = - overallDir === "bullish" ? "bg-emerald-500/5" : - overallDir === "bearish" ? "bg-red-500/5" : - "bg-slate-800/30"; + const bgCls = secondary + ? "bg-slate-900/30" + : overallDir === "bullish" ? "bg-emerald-500/5" + : overallDir === "bearish" ? "bg-red-500/5" + : "bg-slate-800/30"; const topCat = PRIORITY_CATS.find(p => item.categories.includes(p)); const topMeta = topCat ? CATEGORY_META[topCat] : null; @@ -292,7 +336,6 @@ function NewsCard({ item }: { item: NewsItem }) { return (
- {/* Header */}
{item.source} @@ -308,23 +351,20 @@ function NewsCard({ item }: { item: NewsItem }) { )}
- {/* Titre */} - + {item.title} - {/* Résumé */} - {item.summary && ( + {item.summary && !secondary && (

{item.summary}

)} - {/* Impact badges + heure + bouton analyse */} {item.impacts.length > 0 && (
{item.impacts.map(imp => ( @@ -342,15 +382,20 @@ function NewsCard({ item }: { item: NewsItem }) { ))}
{formatRelativeTime(item.publishedAt)} - + {!secondary && ( + + )}
)} - {/* Détail des raisons */} + {!secondary && item.impacts.length === 0 && ( + {formatRelativeTime(item.publishedAt)} + )} + {expanded && item.impacts.length > 0 && (
{item.impacts.map(imp => (