shadok-ai 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/index.html +21 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test test/*.ts .claude/skills/shadok-ai-agents/test/*.test.mjs context/*/test/*.test.mjs",
package/public/index.html CHANGED
@@ -389,8 +389,11 @@
389
389
  .tab-row1 { display: flex; align-items: center; gap: 8px; }
390
390
  /* Context-window usage: tiny number + thin bar at the bottom of the tab. */
391
391
  .tab .ctxnum { font-size: 9px; color: var(--text-dim); flex: none; }
392
- /* Time of the last message, discreet (the flex:1 name pushes it right). */
393
- .tab .lastat { font-size: 9px; color: var(--text-dim); flex: none; line-height: 1.1; font-variant-numeric: tabular-nums; }
392
+ /* Time of the last message (the flex:1 name pushes it right). Colour is the
393
+ full foreground, not the dim one: the age is carried by OPACITY, set per
394
+ tab in JS (ageOpacity) — bright when fresh, nearly gone when old. The
395
+ transition makes the 30s refresh a fade rather than a step. */
396
+ .tab .lastat { font-size: 9px; color: var(--text); flex: none; line-height: 1.1; font-variant-numeric: tabular-nums; transition: opacity 0.6s ease; }
394
397
  .tab .ctxbar {
395
398
  position: absolute;
396
399
  left: 10px;
@@ -3333,11 +3336,27 @@
3333
3336
  if (h < 24) return h + "h ago";
3334
3337
  return Math.round(h / 24) + "d ago";
3335
3338
  }
3339
+ /**
3340
+ * Age → opacity for the tab's "xxx ago": full strength when fresh, fading to
3341
+ * a floor as it gets old, on a LOG scale so both minutes and days get a slice
3342
+ * of the ramp (a linear fade would sit at the floor within the first hour).
3343
+ * Opacity, not colour, so it dims toward the background whatever the theme.
3344
+ */
3345
+ function ageOpacity(ageMs) {
3346
+ const FRESH = 60_000; // ≤ 1 min: freshly spoken, full white
3347
+ const OLD = 7 * 24 * 3600_000; // ~1 week: as faint as it gets
3348
+ const FLOOR = 0.22; // never fully gone — still there on hover
3349
+ if (!(ageMs > FRESH)) return 1;
3350
+ if (ageMs >= OLD) return FLOOR;
3351
+ const t = Math.log(ageMs / FRESH) / Math.log(OLD / FRESH);
3352
+ return +(1 - t * (1 - FLOOR)).toFixed(3);
3353
+ }
3336
3354
  /** (Re)paints the last message's relative time on the tab. */
3337
3355
  function renderLastAt(tab) {
3338
3356
  if (!tab.lastAtEl) return;
3339
3357
  if (!Number.isFinite(tab.lastMsgAt)) { tab.lastAtEl.textContent = ""; return; }
3340
3358
  tab.lastAtEl.textContent = relTime(tab.lastMsgAt);
3359
+ tab.lastAtEl.style.opacity = String(ageOpacity(Date.now() - tab.lastMsgAt));
3341
3360
  tab.lastAtEl.title = new Date(tab.lastMsgAt).toLocaleString();
3342
3361
  }
3343
3362
  // The relative time ages on its own: refresh every tab periodically.