Consolidate setup numbers; clearer staleness message
Deploy / lint (push) Successful in 5s
Deploy / test (push) Successful in 33s
Deploy / deploy (push) Successful in 24s

- Overview Top Setups shows the primary target's probability (concrete,
  distance-calibrated) instead of the overlapping confidence number. The
  stale 100% confidences were leftovers from the old model and self-heal
  on rescan; confidence stays in the detail view + gate.
- Each metric now has one home: composite = ranking, target probability =
  actionability, confidence = direction conviction.
- Staleness message states the real basis (% of entry->target distance
  already covered), not the raw % from entry, so narrow setups read
  correctly ("67% of the move is gone").

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 13:43:17 +02:00
parent 316226096b
commit a32f09c8ba
3 changed files with 23 additions and 8 deletions
+7 -4
View File
@@ -9,7 +9,7 @@ import { Section } from '../components/ui/Section';
import { SkeletonCard, SkeletonTable } from '../components/ui/Skeleton';
import { formatPrice } from '../lib/format';
import { recommendationActionLabel } from '../lib/recommendation';
import { qualifiesSetup, activationSummary } from '../lib/qualification';
import { qualifiesSetup, activationSummary, primaryTargetProbability } from '../lib/qualification';
import type { TradeSetup } from '../lib/types';
function fmtR(value: number | null): string {
@@ -130,7 +130,7 @@ export default function DashboardPage() {
<div className="grid gap-8 xl:grid-cols-5">
{/* Top setups */}
<div className="xl:col-span-3">
<Section title="Top Setups" hint={showingQualified ? 'qualified, by confidence' : 'none qualified — showing all'}>
<Section title="Top Setups" hint={showingQualified ? 'qualified' : 'none qualified — showing all'}>
{trades.isLoading && <SkeletonTable rows={5} cols={5} />}
{trades.isError && <Callout variant="error">Failed to load setups</Callout>}
{trades.data && topSetups.length === 0 && (
@@ -145,7 +145,7 @@ export default function DashboardPage() {
<th className="px-4 py-3">Dir</th>
<th className="px-4 py-3 text-right">Entry</th>
<th className="px-4 py-3 text-right">R:R</th>
<th className="px-4 py-3 text-right">Conf.</th>
<th className="px-4 py-3 text-right">Target&nbsp;Prob</th>
<th className="hidden px-4 py-3 md:table-cell">Action</th>
</tr>
</thead>
@@ -161,7 +161,10 @@ export default function DashboardPage() {
<td className="num px-4 py-3 text-right text-gray-200">{formatPrice(setup.entry_price)}</td>
<td className="num px-4 py-3 text-right text-gray-200">{setup.rr_ratio.toFixed(1)}:1</td>
<td className="num px-4 py-3 text-right text-gray-200">
{setup.confidence_score != null ? `${Math.round(setup.confidence_score)}%` : '—'}
{(() => {
const p = primaryTargetProbability(setup);
return p != null ? `${Math.round(p)}%` : '—';
})()}
</td>
<td className="hidden px-4 py-3 text-xs text-gray-400 md:table-cell">
{recommendationActionLabel(setup.recommended_action)}