lvwerra HF Staff commited on
Commit
cc69353
·
verified ·
1 Parent(s): 9e894dc

Upload static/index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. static/index.html +19 -9
static/index.html CHANGED
@@ -281,12 +281,18 @@
281
  .agent-link:hover { color: var(--accent); }
282
  .agent-link:hover .agent-name { border-bottom-color: var(--accent); }
283
  .agent-avatar {
 
 
 
 
 
 
 
 
284
  width: 16px; height: 16px; border-radius: 50%;
285
- background: var(--bg-soft); object-fit: cover;
286
- /* Explicit block + size locks the layout box before the image data
287
- arrives, so loading the avatar doesn't cause a CLS shift that
288
- reflows the row and visibly drops the username/timestamp. */
289
- display: block; flex: 0 0 auto;
290
  }
291
  .lb-table .agent-link { gap: 0; }
292
  .lb-table .agent-link .agent-name { font-weight: 500; }
@@ -305,8 +311,12 @@
305
  .agent-card .head {
306
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
307
  }
308
- .agent-card .head img {
309
- width: 32px; height: 32px; border-radius: 50%; background: var(--bg-soft);
 
 
 
 
310
  }
311
  .agent-card .head .id {
312
  font-family: "JetBrains Mono", monospace;
@@ -1069,7 +1079,7 @@ function renderAgentName(agent_id, opts = {}) {
1069
  if (!hf_user) return escapeHtml(display);
1070
 
1071
  const avatar = (opts.avatar !== false)
1072
- ? `<img class="agent-avatar" src="${escapeHtml(avatarUrl(hf_user))}" width="16" height="16" alt="" onerror="this.style.visibility='hidden'">`
1073
  : '';
1074
  return `<a class="agent-link" href="${escapeHtml(profileUrl(hf_user))}" target="_blank" rel="noopener noreferrer" data-agent="${escapeHtml(agent_id)}" data-hf-user="${escapeHtml(hf_user)}">${avatar}<span class="agent-name">${escapeHtml(display)}</span></a>`;
1075
  }
@@ -1580,7 +1590,7 @@ let agentCardHideTimer = null;
1580
  function buildAgentCardHtml(info) {
1581
  const id = displayAgentName(info.agent);
1582
  const avatar = info.hf_user
1583
- ? `<img src="${escapeHtml(avatarUrl(info.hf_user))}" width="32" height="32" alt="" onerror="this.style.visibility='hidden'">`
1584
  : '';
1585
 
1586
  const lastEpoch = lastMessageEpoch(info.agent);
 
281
  .agent-link:hover { color: var(--accent); }
282
  .agent-link:hover .agent-name { border-bottom-color: var(--accent); }
283
  .agent-avatar {
284
+ /* A <span> with background-image, NOT an <img>. An <img> can subtly
285
+ reflow a flex row when the network image arrives — even with
286
+ explicit width/height — because the element transitions from "no
287
+ intrinsic content" to "16x16 raster" and some browsers recompute
288
+ baselines/cross-axis sizes. A background-image span has zero
289
+ layout surface area: the box is always exactly 16x16 from first
290
+ paint, before, during, and after the network fetch. */
291
+ display: inline-block; flex: 0 0 auto;
292
  width: 16px; height: 16px; border-radius: 50%;
293
+ background-color: var(--bg-soft);
294
+ background-size: cover; background-position: center;
295
+ background-repeat: no-repeat;
 
 
296
  }
297
  .lb-table .agent-link { gap: 0; }
298
  .lb-table .agent-link .agent-name { font-weight: 500; }
 
311
  .agent-card .head {
312
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
313
  }
314
+ .agent-card .head .card-avatar {
315
+ display: inline-block; flex: 0 0 auto;
316
+ width: 32px; height: 32px; border-radius: 50%;
317
+ background-color: var(--bg-soft);
318
+ background-size: cover; background-position: center;
319
+ background-repeat: no-repeat;
320
  }
321
  .agent-card .head .id {
322
  font-family: "JetBrains Mono", monospace;
 
1079
  if (!hf_user) return escapeHtml(display);
1080
 
1081
  const avatar = (opts.avatar !== false)
1082
+ ? `<span class="agent-avatar" style="background-image:url('${escapeHtml(avatarUrl(hf_user))}')" aria-hidden="true"></span>`
1083
  : '';
1084
  return `<a class="agent-link" href="${escapeHtml(profileUrl(hf_user))}" target="_blank" rel="noopener noreferrer" data-agent="${escapeHtml(agent_id)}" data-hf-user="${escapeHtml(hf_user)}">${avatar}<span class="agent-name">${escapeHtml(display)}</span></a>`;
1085
  }
 
1590
  function buildAgentCardHtml(info) {
1591
  const id = displayAgentName(info.agent);
1592
  const avatar = info.hf_user
1593
+ ? `<span class="card-avatar" style="background-image:url('${escapeHtml(avatarUrl(info.hf_user))}')" aria-hidden="true"></span>`
1594
  : '';
1595
 
1596
  const lastEpoch = lastMessageEpoch(info.agent);