Spaces:
Running
Running
Deploy 46c0b8af
Browse files- frontend/src/main.jsx +5 -2
- frontend/src/styles.css +2 -0
frontend/src/main.jsx
CHANGED
|
@@ -11,9 +11,12 @@ function Verdict({ job }) {
|
|
| 11 |
if (!job?.verdict) return null;
|
| 12 |
const v = job.verdict;
|
| 13 |
const blocking = ["block", "request_changes"].includes(v.recommendation);
|
|
|
|
|
|
|
|
|
|
| 14 |
return <section className={`result-card verdict ${blocking ? "blocking" : "approved"}`} aria-labelledby="verdict-title">
|
| 15 |
-
<div className="result-title"><div><span className="panel-kicker">
|
| 16 |
-
<p>{v.summary || "
|
| 17 |
</section>;
|
| 18 |
}
|
| 19 |
|
|
|
|
| 11 |
if (!job?.verdict) return null;
|
| 12 |
const v = job.verdict;
|
| 13 |
const blocking = ["block", "request_changes"].includes(v.recommendation);
|
| 14 |
+
const score = typeof v.overall_score === "number" ? v.overall_score : null;
|
| 15 |
+
const scoreLabel = score == null ? "Not scored" : score < 4 ? "High risk" : score < 7 ? "Review carefully" : "Low risk";
|
| 16 |
+
const scoreHelp = score == null ? "The review did not return a numeric score." : score < 4 ? "Resolve the high-severity findings before merging." : score < 7 ? "Read the findings and confirm the risk before merging." : "No major risks were detected by the review.";
|
| 17 |
return <section className={`result-card verdict ${blocking ? "blocking" : "approved"}`} aria-labelledby="verdict-title">
|
| 18 |
+
<div className="result-title"><div><span className="panel-kicker">Review decision</span><h3 id="verdict-title">{pretty(v.recommendation).toUpperCase()}</h3></div><div className="score-block"><strong className="score">{score == null ? "—" : `${score.toFixed(1)}/10`}</strong><span>{scoreLabel}</span></div></div>
|
| 19 |
+
<p className="verdict-summary">{v.summary || "The review is ready for your decision."}</p><div className="score-explanation"><strong>What this means</strong><span>{scoreHelp}</span></div><div className="metrics"><span>{job.findings?.length || 0} findings</span>{job.cost && <span>Cost {typeof job.cost === "string" ? job.cost : JSON.stringify(job.cost)}</span>}</div>
|
| 20 |
</section>;
|
| 21 |
}
|
| 22 |
|
frontend/src/styles.css
CHANGED
|
@@ -26,3 +26,5 @@ body{background:#fbfbfa;color:#2f3437}.topbar{background:#fff;border-color:#eaea
|
|
| 26 |
.topbar{position:sticky;top:0;z-index:10;height:72px;padding:0 clamp(24px,6vw,88px);background:rgba(234,242,246,.88);backdrop-filter:blur(14px);border-bottom:1px solid rgba(47,52,55,.1)}.brand{gap:11px;font-size:15px;letter-spacing:-.04em}.brand-mark{width:34px;height:34px;border-radius:8px;background:#111;color:#fff;border:0;font:600 10px 'DM Mono',monospace;letter-spacing:.05em}.topbar>div:last-child{display:flex;align-items:center;gap:16px}.topbar .status-dot:last-of-type{padding-left:16px;border-left:1px solid rgba(47,52,55,.14)}.topbar .status-dot:before{width:6px;height:6px}.theme-toggle{margin-left:2px;padding:8px 12px;border-color:rgba(47,52,55,.18);background:rgba(255,255,255,.55)}.theme-toggle:hover{background:#fff;transform:translateY(-1px)}html[data-theme="dark"] .topbar{background:rgba(21,27,33,.9);border-color:rgba(255,255,255,.1)}html[data-theme="dark"] .brand-mark{background:#f0f4f5;color:#11151a}html[data-theme="dark"] .topbar .status-dot:last-of-type{border-color:rgba(255,255,255,.14)}
|
| 27 |
|
| 28 |
@media(max-width:760px){.topbar{height:64px;padding:0 16px}.topbar>div:last-child{gap:8px;min-width:0}.topbar .status-dot{display:inline-block;max-width:92px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px}.topbar .status-dot:last-of-type{display:none}.topbar .status-dot:before{margin-right:5px}.brand{font-size:13px;gap:8px}.brand-mark{width:30px;height:30px}.theme-toggle{font-size:9px;padding:7px 9px;margin-left:0}.content{width:min(100% - 32px,1180px);padding-top:46px}.intro-band{gap:2.5rem;padding-bottom:2.5rem}.intro-copy>p:not(.eyebrow){font-size:1rem}.review-preview{padding:1rem}.trust-strip{padding-bottom:2.5rem}.auth-wall{padding:2rem 1.25rem}}
|
|
|
|
|
|
|
|
|
| 26 |
.topbar{position:sticky;top:0;z-index:10;height:72px;padding:0 clamp(24px,6vw,88px);background:rgba(234,242,246,.88);backdrop-filter:blur(14px);border-bottom:1px solid rgba(47,52,55,.1)}.brand{gap:11px;font-size:15px;letter-spacing:-.04em}.brand-mark{width:34px;height:34px;border-radius:8px;background:#111;color:#fff;border:0;font:600 10px 'DM Mono',monospace;letter-spacing:.05em}.topbar>div:last-child{display:flex;align-items:center;gap:16px}.topbar .status-dot:last-of-type{padding-left:16px;border-left:1px solid rgba(47,52,55,.14)}.topbar .status-dot:before{width:6px;height:6px}.theme-toggle{margin-left:2px;padding:8px 12px;border-color:rgba(47,52,55,.18);background:rgba(255,255,255,.55)}.theme-toggle:hover{background:#fff;transform:translateY(-1px)}html[data-theme="dark"] .topbar{background:rgba(21,27,33,.9);border-color:rgba(255,255,255,.1)}html[data-theme="dark"] .brand-mark{background:#f0f4f5;color:#11151a}html[data-theme="dark"] .topbar .status-dot:last-of-type{border-color:rgba(255,255,255,.14)}
|
| 27 |
|
| 28 |
@media(max-width:760px){.topbar{height:64px;padding:0 16px}.topbar>div:last-child{gap:8px;min-width:0}.topbar .status-dot{display:inline-block;max-width:92px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px}.topbar .status-dot:last-of-type{display:none}.topbar .status-dot:before{margin-right:5px}.brand{font-size:13px;gap:8px}.brand-mark{width:30px;height:30px}.theme-toggle{font-size:9px;padding:7px 9px;margin-left:0}.content{width:min(100% - 32px,1180px);padding-top:46px}.intro-band{gap:2.5rem;padding-bottom:2.5rem}.intro-copy>p:not(.eyebrow){font-size:1rem}.review-preview{padding:1rem}.trust-strip{padding-bottom:2.5rem}.auth-wall{padding:2rem 1.25rem}}
|
| 29 |
+
|
| 30 |
+
.score-block{display:flex;flex-direction:column;align-items:flex-end;gap:3px}.score-block>span{font:500 10px 'DM Mono',monospace;text-transform:uppercase;letter-spacing:.06em;color:#9f2f2d}.score-explanation{display:grid;gap:4px;margin:14px 0;padding:12px 14px;border-radius:6px;background:#fbf3db;color:#956400;font-size:13px;line-height:1.45}.score-explanation strong{font-size:11px;text-transform:uppercase;letter-spacing:.08em}.verdict-summary{font-size:15px!important}.verdict.approved .score-block>span{color:#346538}.verdict.approved .score-explanation{background:#edf3ec;color:#346538}
|