Spaces:
Running
Running
Polish: SEO/OG meta + share image, favicon, remove dead CSS, fix contrast + a11y, real-data wording
Browse files- .gitattributes +1 -0
- Dockerfile +2 -2
- app.py +9 -0
- index.html +48 -60
- og.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
og.png filter=lfs diff=lfs merge=lfs -text
|
Dockerfile
CHANGED
|
@@ -6,8 +6,8 @@ WORKDIR /app
|
|
| 6 |
COPY requirements.txt .
|
| 7 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 8 |
|
| 9 |
-
# App code + the website it serves at "/"
|
| 10 |
-
COPY app.py scrub.py index.html ./
|
| 11 |
|
| 12 |
# HF Spaces route traffic to port 7860.
|
| 13 |
EXPOSE 7860
|
|
|
|
| 6 |
COPY requirements.txt .
|
| 7 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 8 |
|
| 9 |
+
# App code + the website it serves at "/" + the social-preview image at /og.png
|
| 10 |
+
COPY app.py scrub.py index.html og.png ./
|
| 11 |
|
| 12 |
# HF Spaces route traffic to port 7860.
|
| 13 |
EXPOSE 7860
|
app.py
CHANGED
|
@@ -64,6 +64,7 @@ def _rate_ok(ip):
|
|
| 64 |
|
| 65 |
|
| 66 |
SITE_FILE = pathlib.Path(__file__).parent / "index.html"
|
|
|
|
| 67 |
|
| 68 |
|
| 69 |
@app.get("/", response_class=HTMLResponse)
|
|
@@ -74,6 +75,14 @@ def home():
|
|
| 74 |
return HTMLResponse("<h1>Trace Commons</h1><p>Site file not found.</p>", status_code=200)
|
| 75 |
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
@app.get("/health")
|
| 78 |
def health():
|
| 79 |
configured = bool(HF_TOKEN and DATASET_REPO)
|
|
|
|
| 64 |
|
| 65 |
|
| 66 |
SITE_FILE = pathlib.Path(__file__).parent / "index.html"
|
| 67 |
+
OG_FILE = pathlib.Path(__file__).parent / "og.png"
|
| 68 |
|
| 69 |
|
| 70 |
@app.get("/", response_class=HTMLResponse)
|
|
|
|
| 75 |
return HTMLResponse("<h1>Trace Commons</h1><p>Site file not found.</p>", status_code=200)
|
| 76 |
|
| 77 |
|
| 78 |
+
@app.get("/og.png")
|
| 79 |
+
def og_image():
|
| 80 |
+
"""Serve the social-preview image referenced by the page's Open Graph tags."""
|
| 81 |
+
if OG_FILE.exists():
|
| 82 |
+
return FileResponse(str(OG_FILE), media_type="image/png")
|
| 83 |
+
return JSONResponse({"error": "not_found"}, status_code=404)
|
| 84 |
+
|
| 85 |
+
|
| 86 |
@app.get("/health")
|
| 87 |
def health():
|
| 88 |
configured = bool(HF_TOKEN and DATASET_REPO)
|
index.html
CHANGED
|
@@ -4,6 +4,23 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Trace Commons · An open dataset for code agent traces</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 9 |
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Spline+Sans:wght@400;500;600&family=Spline+Sans+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
@@ -42,6 +59,7 @@
|
|
| 42 |
.wrap{max-width:1080px;margin:0 auto;padding:0 28px}
|
| 43 |
a{color:inherit}
|
| 44 |
::selection{background:var(--signal);color:var(--ink)}
|
|
|
|
| 45 |
|
| 46 |
/* ---------- nav ---------- */
|
| 47 |
nav{
|
|
@@ -149,7 +167,7 @@
|
|
| 149 |
opacity:0;transform:translateY(6px);animation:enter .5s forwards;
|
| 150 |
}
|
| 151 |
@keyframes enter{to{opacity:1;transform:none}}
|
| 152 |
-
.entry .seq{color:var(--
|
| 153 |
.entry .who{color:var(--paper-pure)}
|
| 154 |
.entry .who span{color:var(--paper-dim)}
|
| 155 |
.entry .tag{
|
|
@@ -159,20 +177,6 @@
|
|
| 159 |
.entry .tag.cc{color:var(--signal-soft)}
|
| 160 |
.ledger-foot{padding:13px 16px;color:var(--panel-edge);font-size:12px;display:flex;justify-content:space-between}
|
| 161 |
|
| 162 |
-
/* ---------- counter band ---------- */
|
| 163 |
-
.counter{
|
| 164 |
-
display:grid;grid-template-columns:repeat(3,1fr);gap:1px;
|
| 165 |
-
background:var(--line);border:1px solid var(--line);border-radius:14px;
|
| 166 |
-
overflow:hidden;margin:64px 0 0;
|
| 167 |
-
}
|
| 168 |
-
@media(max-width:640px){.counter{grid-template-columns:1fr}}
|
| 169 |
-
.stat{background:var(--surface);padding:26px 28px}
|
| 170 |
-
.stat .n{font-family:var(--display);font-size:40px;font-weight:500;letter-spacing:-.02em;line-height:1}
|
| 171 |
-
.stat .n .unit{font-size:18px;color:var(--paper-dim);font-family:var(--mono);margin-left:4px}
|
| 172 |
-
.stat .l{font-family:var(--mono);font-size:12.5px;letter-spacing:.06em;text-transform:uppercase;
|
| 173 |
-
color:var(--paper-dim);margin-top:12px}
|
| 174 |
-
.stat.is-signal .n{color:var(--signal-soft)}
|
| 175 |
-
|
| 176 |
/* ---------- section scaffold ---------- */
|
| 177 |
section{padding:90px 0;position:relative}
|
| 178 |
.sec-label{font-family:var(--mono);font-size:13px;letter-spacing:.14em;text-transform:uppercase;
|
|
@@ -206,12 +210,6 @@
|
|
| 206 |
border:1px solid var(--panel-edge);border-radius:16px;overflow:hidden;
|
| 207 |
background:linear-gradient(180deg,var(--panel),var(--surface));
|
| 208 |
}
|
| 209 |
-
.tabs{display:flex;border-bottom:1px solid var(--line);font-family:var(--mono);font-size:14px;flex-wrap:wrap}
|
| 210 |
-
.tab{padding:15px 22px;cursor:pointer;color:var(--paper-dim);border-right:1px solid var(--line);
|
| 211 |
-
transition:color .2s,background .2s;user-select:none;position:relative}
|
| 212 |
-
.tab:hover{color:var(--paper-pure)}
|
| 213 |
-
.tab.active{color:var(--paper-pure);background:rgba(232,116,59,.07)}
|
| 214 |
-
.tab.active::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--signal)}
|
| 215 |
.panel-body{padding:30px 30px 34px}
|
| 216 |
.step{display:flex;gap:18px;padding:16px 0;border-bottom:1px solid var(--line)}
|
| 217 |
.step:last-child{border-bottom:none}
|
|
@@ -250,19 +248,6 @@
|
|
| 250 |
.agent-btn:hover{color:var(--paper-pure);border-color:var(--paper-dim)}
|
| 251 |
.agent-btn.active{background:var(--leaf);color:var(--ink);border-color:var(--leaf)}
|
| 252 |
|
| 253 |
-
/* ---------- pipeline strip ---------- */
|
| 254 |
-
.flow{display:grid;grid-template-columns:repeat(4,1fr);gap:0;margin-top:8px;
|
| 255 |
-
border:1px solid var(--line);border-radius:13px;overflow:hidden}
|
| 256 |
-
@media(max-width:760px){.flow{grid-template-columns:1fr}}
|
| 257 |
-
.flow-step{padding:24px 22px;border-right:1px solid var(--line);position:relative}
|
| 258 |
-
.flow-step:last-child{border-right:none}
|
| 259 |
-
@media(max-width:760px){.flow-step{border-right:none;border-bottom:1px solid var(--line)}}
|
| 260 |
-
.flow-step .fi{font-family:var(--mono);font-size:12px;color:var(--leaf);letter-spacing:.08em;margin-bottom:12px}
|
| 261 |
-
.flow-step h4{font-size:16px;font-weight:600;margin-bottom:7px;font-family:var(--display);font-weight:500}
|
| 262 |
-
.flow-step p{font-size:13.5px;color:var(--paper-dim);line-height:1.5}
|
| 263 |
-
.flow-step.local{background:rgba(127,176,154,.05)}
|
| 264 |
-
.flow-step.remote{background:rgba(232,116,59,.05)}
|
| 265 |
-
|
| 266 |
/* ---------- explorer ---------- */
|
| 267 |
.explorer{border:1px solid var(--panel-edge);border-radius:16px;overflow:hidden;
|
| 268 |
background:linear-gradient(180deg,var(--panel),var(--surface))}
|
|
@@ -277,7 +262,7 @@
|
|
| 277 |
padding:13px 22px;border-bottom:1px solid var(--line);font-family:var(--mono);font-size:13px}
|
| 278 |
@media(max-width:640px){.erow{grid-template-columns:1fr auto;gap:8px}.erow .em-hide{display:none}}
|
| 279 |
.erow:hover{background:rgba(243,236,224,.02)}
|
| 280 |
-
.erow .hash{color:var(--
|
| 281 |
.erow .desc{color:var(--paper-pure);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
| 282 |
.erow .harness{color:var(--leaf)}
|
| 283 |
.erow .when{color:var(--paper-dim)}
|
|
@@ -314,10 +299,10 @@
|
|
| 314 |
.foot-links a{text-decoration:none;transition:color .2s}
|
| 315 |
.foot-links a:hover{color:var(--paper-pure)}
|
| 316 |
|
| 317 |
-
.
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
}
|
| 322 |
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
|
| 323 |
</style>
|
|
@@ -355,14 +340,14 @@
|
|
| 355 |
</div>
|
| 356 |
</div>
|
| 357 |
|
| 358 |
-
<div class="ledger" aria-label="
|
| 359 |
<div class="ledger-head">
|
| 360 |
<span class="dot"></span><span class="dot"></span><span class="dot"></span>
|
| 361 |
<span class="ttl">commons.ledger</span>
|
| 362 |
-
<span class="live">
|
| 363 |
</div>
|
| 364 |
<div id="ledgerRows"></div>
|
| 365 |
-
<div class="ledger-foot"><span>append-only</span><span>
|
| 366 |
</div>
|
| 367 |
</div>
|
| 368 |
</div>
|
|
@@ -474,6 +459,7 @@
|
|
| 474 |
</div>
|
| 475 |
<div class="growth-chart">
|
| 476 |
<svg id="growthSvg" viewBox="0 0 880 300" preserveAspectRatio="none" aria-label="Cumulative contributions over time"></svg>
|
|
|
|
| 477 |
<div class="growth-tip" id="growthTip"></div>
|
| 478 |
</div>
|
| 479 |
<div class="growth-axis" id="growthAxis"></div>
|
|
@@ -482,12 +468,12 @@
|
|
| 482 |
<div class="explorer">
|
| 483 |
<div class="exp-head">
|
| 484 |
<span>commons/agent-traces · <span style="color:var(--paper-pure)">recent donations</span></span>
|
| 485 |
-
<div class="filters" id="expFilters">
|
| 486 |
-
<span class="chip active" data-f="all">all</span>
|
| 487 |
-
<span class="chip" data-f="claude_code">claude</span>
|
| 488 |
-
<span class="chip" data-f="codex">codex</span>
|
| 489 |
-
<span class="chip" data-f="pi">pi</span>
|
| 490 |
-
<span class="chip" data-f="opencode">opencode</span>
|
| 491 |
</div>
|
| 492 |
</div>
|
| 493 |
<div class="exp-rows" id="expRows"></div>
|
|
@@ -540,9 +526,7 @@
|
|
| 540 |
const b=e.target.closest('.agent-btn'); if(!b)return;
|
| 541 |
targets.querySelectorAll('.agent-btn').forEach(x=>x.classList.remove('active'));
|
| 542 |
b.classList.add('active');
|
| 543 |
-
|
| 544 |
-
document.getElementById('installCmd').textContent=cmd;
|
| 545 |
-
const hero=document.getElementById('heroCmd'); if(hero)hero.textContent=cmd;
|
| 546 |
document.getElementById('runCmd').textContent = b.dataset.agent==='pi' ? '/skill:donate-trace' : '/donate-trace';
|
| 547 |
});
|
| 548 |
}
|
|
@@ -620,6 +604,7 @@
|
|
| 620 |
const svg=document.getElementById('growthSvg');
|
| 621 |
const tip=document.getElementById('growthTip');
|
| 622 |
const axisEl=document.getElementById('growthAxis');
|
|
|
|
| 623 |
const NS='http://www.w3.org/2000/svg';
|
| 624 |
const VW=880,VH=300,PAD=8;
|
| 625 |
let series=[];
|
|
@@ -635,17 +620,14 @@
|
|
| 635 |
function drawEmpty(){
|
| 636 |
svg.innerHTML='';
|
| 637 |
axisEl.innerHTML='';
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
t.setAttribute('text-anchor','middle');t.setAttribute('fill','rgba(243,236,224,0.35)');
|
| 641 |
-
t.setAttribute('font-size','15');
|
| 642 |
-
t.textContent = SERIES.length===1 ? 'First donation in — the commons has begun.' : 'No donations yet — be the first to contribute.';
|
| 643 |
-
svg.appendChild(t);
|
| 644 |
}
|
| 645 |
function draw(days){
|
| 646 |
document.getElementById('growthTotal').textContent=fmt(TRACES.length);
|
| 647 |
series = seriesForRange(days);
|
| 648 |
if(series.length<2){ drawEmpty(); return; }
|
|
|
|
| 649 |
svg.innerHTML='';
|
| 650 |
const xs=series.length-1;
|
| 651 |
const maxN=series[series.length-1].n, minN=series[0].n;
|
|
@@ -735,10 +717,16 @@
|
|
| 735 |
expRows.appendChild(el);
|
| 736 |
});
|
| 737 |
}
|
| 738 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 739 |
const c=e.target.closest('.chip');if(!c)return;
|
| 740 |
-
|
| 741 |
-
c.classList.add('active');currentFilter=c.dataset.f;renderEx(currentFilter);
|
| 742 |
});
|
| 743 |
// initial render (empty/honest state) then hydrate from the live dataset
|
| 744 |
renderLedger();
|
|
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Trace Commons · An open dataset for code agent traces</title>
|
| 7 |
+
<meta name="description" content="Donate your coding-agent sessions, anonymized on your own machine, to one open public dataset anyone can train on. The data that trains coding models should belong to everyone.">
|
| 8 |
+
<link rel="canonical" href="https://trace-commons-web.hf.space/">
|
| 9 |
+
<meta name="theme-color" content="#0f201f">
|
| 10 |
+
<!-- Open Graph / social preview -->
|
| 11 |
+
<meta property="og:type" content="website">
|
| 12 |
+
<meta property="og:site_name" content="Trace Commons">
|
| 13 |
+
<meta property="og:url" content="https://trace-commons-web.hf.space/">
|
| 14 |
+
<meta property="og:title" content="Trace Commons · An open commons for code agent traces">
|
| 15 |
+
<meta property="og:description" content="The data that trains coding models should belong to everyone. Donate your coding-agent sessions — anonymized locally, reviewed by you — to one open public dataset.">
|
| 16 |
+
<meta property="og:image" content="https://trace-commons-web.hf.space/og.png">
|
| 17 |
+
<meta property="og:image:width" content="1200">
|
| 18 |
+
<meta property="og:image:height" content="630">
|
| 19 |
+
<meta name="twitter:card" content="summary_large_image">
|
| 20 |
+
<meta name="twitter:title" content="Trace Commons · An open commons for code agent traces">
|
| 21 |
+
<meta name="twitter:description" content="The data that trains coding models should belong to everyone. Donate your coding-agent sessions to one open public dataset anyone can train on.">
|
| 22 |
+
<meta name="twitter:image" content="https://trace-commons-web.hf.space/og.png">
|
| 23 |
+
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='1.5' y='1.5' width='21' height='21' rx='4' fill='%230f201f' stroke='%23e8743b' stroke-width='1.5'/%3E%3Cline x1='6' y1='9' x2='18' y2='9' stroke='%23e8743b' stroke-width='1.6'/%3E%3Cline x1='6' y1='12.5' x2='14.5' y2='12.5' stroke='%237fb09a' stroke-width='1.6'/%3E%3Cline x1='6' y1='16' x2='16' y2='16' stroke='%23cdbfa8' stroke-width='1.6'/%3E%3C/svg%3E">
|
| 24 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 25 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 26 |
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Spline+Sans:wght@400;500;600&family=Spline+Sans+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
|
|
| 59 |
.wrap{max-width:1080px;margin:0 auto;padding:0 28px}
|
| 60 |
a{color:inherit}
|
| 61 |
::selection{background:var(--signal);color:var(--ink)}
|
| 62 |
+
:focus-visible{outline:2px solid var(--signal-soft);outline-offset:3px;border-radius:5px}
|
| 63 |
|
| 64 |
/* ---------- nav ---------- */
|
| 65 |
nav{
|
|
|
|
| 167 |
opacity:0;transform:translateY(6px);animation:enter .5s forwards;
|
| 168 |
}
|
| 169 |
@keyframes enter{to{opacity:1;transform:none}}
|
| 170 |
+
.entry .seq{color:var(--leaf);opacity:.72}
|
| 171 |
.entry .who{color:var(--paper-pure)}
|
| 172 |
.entry .who span{color:var(--paper-dim)}
|
| 173 |
.entry .tag{
|
|
|
|
| 177 |
.entry .tag.cc{color:var(--signal-soft)}
|
| 178 |
.ledger-foot{padding:13px 16px;color:var(--panel-edge);font-size:12px;display:flex;justify-content:space-between}
|
| 179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
/* ---------- section scaffold ---------- */
|
| 181 |
section{padding:90px 0;position:relative}
|
| 182 |
.sec-label{font-family:var(--mono);font-size:13px;letter-spacing:.14em;text-transform:uppercase;
|
|
|
|
| 210 |
border:1px solid var(--panel-edge);border-radius:16px;overflow:hidden;
|
| 211 |
background:linear-gradient(180deg,var(--panel),var(--surface));
|
| 212 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
.panel-body{padding:30px 30px 34px}
|
| 214 |
.step{display:flex;gap:18px;padding:16px 0;border-bottom:1px solid var(--line)}
|
| 215 |
.step:last-child{border-bottom:none}
|
|
|
|
| 248 |
.agent-btn:hover{color:var(--paper-pure);border-color:var(--paper-dim)}
|
| 249 |
.agent-btn.active{background:var(--leaf);color:var(--ink);border-color:var(--leaf)}
|
| 250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
/* ---------- explorer ---------- */
|
| 252 |
.explorer{border:1px solid var(--panel-edge);border-radius:16px;overflow:hidden;
|
| 253 |
background:linear-gradient(180deg,var(--panel),var(--surface))}
|
|
|
|
| 262 |
padding:13px 22px;border-bottom:1px solid var(--line);font-family:var(--mono);font-size:13px}
|
| 263 |
@media(max-width:640px){.erow{grid-template-columns:1fr auto;gap:8px}.erow .em-hide{display:none}}
|
| 264 |
.erow:hover{background:rgba(243,236,224,.02)}
|
| 265 |
+
.erow .hash{color:var(--leaf);opacity:.72}
|
| 266 |
.erow .desc{color:var(--paper-pure);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
| 267 |
.erow .harness{color:var(--leaf)}
|
| 268 |
.erow .when{color:var(--paper-dim)}
|
|
|
|
| 299 |
.foot-links a{text-decoration:none;transition:color .2s}
|
| 300 |
.foot-links a:hover{color:var(--paper-pure)}
|
| 301 |
|
| 302 |
+
.growth-empty{
|
| 303 |
+
position:absolute;inset:0;display:none;align-items:center;justify-content:center;
|
| 304 |
+
text-align:center;padding:0 24px;font-family:var(--mono);font-size:14px;
|
| 305 |
+
color:var(--paper-dim);letter-spacing:.02em;pointer-events:none;
|
| 306 |
}
|
| 307 |
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
|
| 308 |
</style>
|
|
|
|
| 340 |
</div>
|
| 341 |
</div>
|
| 342 |
|
| 343 |
+
<div class="ledger" aria-label="Recent donations to the commons">
|
| 344 |
<div class="ledger-head">
|
| 345 |
<span class="dot"></span><span class="dot"></span><span class="dot"></span>
|
| 346 |
<span class="ttl">commons.ledger</span>
|
| 347 |
+
<span class="live">latest</span>
|
| 348 |
</div>
|
| 349 |
<div id="ledgerRows"></div>
|
| 350 |
+
<div class="ledger-foot"><span>append-only</span><span>live from the dataset</span></div>
|
| 351 |
</div>
|
| 352 |
</div>
|
| 353 |
</div>
|
|
|
|
| 459 |
</div>
|
| 460 |
<div class="growth-chart">
|
| 461 |
<svg id="growthSvg" viewBox="0 0 880 300" preserveAspectRatio="none" aria-label="Cumulative contributions over time"></svg>
|
| 462 |
+
<div class="growth-empty" id="growthEmpty"></div>
|
| 463 |
<div class="growth-tip" id="growthTip"></div>
|
| 464 |
</div>
|
| 465 |
<div class="growth-axis" id="growthAxis"></div>
|
|
|
|
| 468 |
<div class="explorer">
|
| 469 |
<div class="exp-head">
|
| 470 |
<span>commons/agent-traces · <span style="color:var(--paper-pure)">recent donations</span></span>
|
| 471 |
+
<div class="filters" id="expFilters" role="group" aria-label="Filter donations by agent">
|
| 472 |
+
<span class="chip active" data-f="all" role="button" tabindex="0" aria-pressed="true">all</span>
|
| 473 |
+
<span class="chip" data-f="claude_code" role="button" tabindex="0" aria-pressed="false">claude</span>
|
| 474 |
+
<span class="chip" data-f="codex" role="button" tabindex="0" aria-pressed="false">codex</span>
|
| 475 |
+
<span class="chip" data-f="pi" role="button" tabindex="0" aria-pressed="false">pi</span>
|
| 476 |
+
<span class="chip" data-f="opencode" role="button" tabindex="0" aria-pressed="false">opencode</span>
|
| 477 |
</div>
|
| 478 |
</div>
|
| 479 |
<div class="exp-rows" id="expRows"></div>
|
|
|
|
| 526 |
const b=e.target.closest('.agent-btn'); if(!b)return;
|
| 527 |
targets.querySelectorAll('.agent-btn').forEach(x=>x.classList.remove('active'));
|
| 528 |
b.classList.add('active');
|
| 529 |
+
document.getElementById('installCmd').textContent=b.dataset.cmd;
|
|
|
|
|
|
|
| 530 |
document.getElementById('runCmd').textContent = b.dataset.agent==='pi' ? '/skill:donate-trace' : '/donate-trace';
|
| 531 |
});
|
| 532 |
}
|
|
|
|
| 604 |
const svg=document.getElementById('growthSvg');
|
| 605 |
const tip=document.getElementById('growthTip');
|
| 606 |
const axisEl=document.getElementById('growthAxis');
|
| 607 |
+
const emptyEl=document.getElementById('growthEmpty');
|
| 608 |
const NS='http://www.w3.org/2000/svg';
|
| 609 |
const VW=880,VH=300,PAD=8;
|
| 610 |
let series=[];
|
|
|
|
| 620 |
function drawEmpty(){
|
| 621 |
svg.innerHTML='';
|
| 622 |
axisEl.innerHTML='';
|
| 623 |
+
emptyEl.textContent = SERIES.length===1 ? 'First donation in — the commons has begun.' : 'No donations yet — be the first to contribute.';
|
| 624 |
+
emptyEl.style.display='flex';
|
|
|
|
|
|
|
|
|
|
|
|
|
| 625 |
}
|
| 626 |
function draw(days){
|
| 627 |
document.getElementById('growthTotal').textContent=fmt(TRACES.length);
|
| 628 |
series = seriesForRange(days);
|
| 629 |
if(series.length<2){ drawEmpty(); return; }
|
| 630 |
+
emptyEl.style.display='none';
|
| 631 |
svg.innerHTML='';
|
| 632 |
const xs=series.length-1;
|
| 633 |
const maxN=series[series.length-1].n, minN=series[0].n;
|
|
|
|
| 717 |
expRows.appendChild(el);
|
| 718 |
});
|
| 719 |
}
|
| 720 |
+
function selectChip(c){
|
| 721 |
+
document.querySelectorAll('#expFilters .chip').forEach(x=>{x.classList.remove('active');x.setAttribute('aria-pressed','false')});
|
| 722 |
+
c.classList.add('active');c.setAttribute('aria-pressed','true');
|
| 723 |
+
currentFilter=c.dataset.f;renderEx(currentFilter);
|
| 724 |
+
}
|
| 725 |
+
const expFilters=document.getElementById('expFilters');
|
| 726 |
+
expFilters.addEventListener('click',e=>{const c=e.target.closest('.chip');if(c)selectChip(c)});
|
| 727 |
+
expFilters.addEventListener('keydown',e=>{
|
| 728 |
const c=e.target.closest('.chip');if(!c)return;
|
| 729 |
+
if(e.key==='Enter'||e.key===' '){e.preventDefault();selectChip(c)}
|
|
|
|
| 730 |
});
|
| 731 |
// initial render (empty/honest state) then hydrate from the live dataset
|
| 732 |
renderLedger();
|
og.png
ADDED
|
Git LFS Details
|