Skip to content

Commit 06e47db

Browse files
fix: quality_gate badge in live demo, All 50 filter, grade thresholds match API
- renderResult() now shows PASSED/REVIEW/FAILED badge + Risk: LOW/MEDIUM/HIGH colour-coded in the live Try It scorer on the landing page. The key differentiator was invisible in the demo — now it is the first thing you see after scoring. - Grade thresholds corrected: A>=90 B>=75 C>=60 D>=45 F<45 (matches API) - Filter button 'All 40' corrected to 'All 50' Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 184b647 commit 06e47db

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

index.html

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ <h2>All 50 Endpoints</h2>
682682
<p class="section-sub">Instant scoring, AI generation, and Proof Intelligence endpoints for measurable content performance.</p>
683683

684684
<div style="display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-bottom:28px;">
685-
<button class="ep-filter-btn active" data-filter="all" onclick="filterEndpoints('all',this)">All 40</button>
685+
<button class="ep-filter-btn active" data-filter="all" onclick="filterEndpoints('all',this)">All 50</button>
686686
<button class="ep-filter-btn" data-filter="instant" onclick="filterEndpoints('instant',this)">⚡ Instant</button>
687687
<button class="ep-filter-btn" data-filter="ai" onclick="filterEndpoints('ai',this)">✦ AI Generation</button>
688688
<button class="ep-filter-btn" data-filter="system" onclick="filterEndpoints('system',this)">⬡ System + Proof</button>
@@ -1744,8 +1744,11 @@ <h2 style="text-align:center;font-size:1.6rem;margin-bottom:32px;color:#e0e0e0;"
17441744
const t = text.toLowerCase();
17451745
return POWER_WORDS.filter(w => t.includes(w));
17461746
}
1747-
function renderResult(score, grade, meta, suggestions, found) {
1747+
function renderResult(score, grade, quality_gate, operational_risk, meta, suggestions, found) {
17481748
const gradeClass = 'grade-' + grade.toLowerCase();
1749+
const gateColor = quality_gate === 'PASSED' ? '#4ade80' : quality_gate === 'REVIEW' ? '#facc15' : '#f87171';
1750+
const gateBg = quality_gate === 'PASSED' ? '#14532d' : quality_gate === 'REVIEW' ? '#422006' : '#450a0a';
1751+
const riskColor = operational_risk === 'LOW' ? '#5ec8a0' : operational_risk === 'MEDIUM' ? '#facc15' : '#f87171';
17491752
const resultEl = document.getElementById('tryResult');
17501753
resultEl.innerHTML = `
17511754
<div style="display:flex;align-items:center;gap:20px;margin-bottom:16px;flex-wrap:wrap;">
@@ -1754,6 +1757,10 @@ <h2 style="text-align:center;font-size:1.6rem;margin-bottom:32px;color:#e0e0e0;"
17541757
<div style="color:#9999aa;font-size:0.8rem;">Grade: <strong style="color:#f0f0f5">${grade}</strong></div>
17551758
</div>
17561759
<div style="flex:1;min-width:200px;">
1760+
<div style="margin-bottom:8px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;">
1761+
<span style="background:${gateBg};color:${gateColor};font-size:0.72rem;font-weight:700;padding:3px 10px;border-radius:20px;letter-spacing:0.05em;">${quality_gate}</span>
1762+
<span style="color:${riskColor};font-size:0.72rem;font-weight:600;">Risk: ${operational_risk}</span>
1763+
</div>
17571764
<div style="color:#9999aa;font-size:0.81rem;line-height:1.7;">${meta}</div>
17581765
${found.length ? `<div style="color:#7c6af7;font-size:0.81rem;margin-top:4px;">Power words: ${found.slice(0,6).join(', ')}</div>` : ''}
17591766
</div>
@@ -1936,8 +1943,10 @@ <h2 style="text-align:center;font-size:1.6rem;margin-bottom:32px;color:#e0e0e0;"
19361943
}
19371944

19381945
score = Math.max(0, Math.min(100, score));
1939-
const grade = score >= 80 ? 'A' : score >= 60 ? 'B' : score >= 40 ? 'C' : 'D';
1940-
return { score, grade, meta, suggestions, found };
1946+
const grade = score >= 90 ? 'A' : score >= 75 ? 'B' : score >= 60 ? 'C' : score >= 45 ? 'D' : 'F';
1947+
const quality_gate = score >= 70 ? 'PASSED' : score >= 50 ? 'REVIEW' : 'FAILED';
1948+
const operational_risk = score >= 70 ? 'LOW' : score >= 50 ? 'MEDIUM' : 'HIGH';
1949+
return { score, grade, quality_gate, operational_risk, meta, suggestions, found };
19411950
}
19421951

19431952
function runPlatformScore() {
@@ -1947,8 +1956,8 @@ <h2 style="text-align:center;font-size:1.6rem;margin-bottom:32px;color:#e0e0e0;"
19471956
btn.disabled = true;
19481957
btn.textContent = 'Scoring...';
19491958
setTimeout(() => {
1950-
const { score, grade, meta, suggestions, found } = scoreContent(currentPlatform, text);
1951-
renderResult(score, grade, meta, suggestions, found);
1959+
const { score, grade, quality_gate, operational_risk, meta, suggestions, found } = scoreContent(currentPlatform, text);
1960+
renderResult(score, grade, quality_gate, operational_risk, meta, suggestions, found);
19521961
btn.disabled = false;
19531962
btn.textContent = 'Score It →';
19541963
}, 400);

0 commit comments

Comments
 (0)