shadok-ai 0.2.38 → 0.2.39

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 +16 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.2.38",
3
+ "version": "0.2.39",
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",
package/public/index.html CHANGED
@@ -2812,17 +2812,27 @@
2812
2812
  if (tab === active && el._stickBottom !== false) el.scrollTop = el.scrollHeight;
2813
2813
  }
2814
2814
 
2815
- /* Heure d'un message : « 21:57 », avec la date complète en title= — un
2816
- historique repris peut dater d'avant-hier, et hh:mm seul induirait en
2817
- erreur. `at` vient du .jsonl (même heure en direct et au rechargement) ;
2818
- absent sur les vieux transcripts on n'affiche rien plutôt qu'une heure
2819
- inventée. */
2815
+ /* Date/heure d'un message. Aujourd'hui → heure seule (« 21:57 »). Un autre
2816
+ jour date + heure (« 3 août, 21:57 »), avec l'année si elle diffère —
2817
+ sinon un historique repris de plusieurs jours affichait juste « 21:57 », ce
2818
+ qui induit en erreur. Date complète en title=. `at` vient du .jsonl (même
2819
+ valeur en direct et au rechargement) ; absent sur les vieux transcripts →
2820
+ on n'affiche rien plutôt qu'une heure inventée. */
2820
2821
  function fmtTime(at) {
2821
2822
  if (!Number.isFinite(at)) return null;
2822
2823
  const d = new Date(at);
2824
+ const now = new Date();
2825
+ const time = d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
2823
2826
  const el = document.createElement("span");
2824
2827
  el.className = "time";
2825
- el.textContent = d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
2828
+ if (d.toDateString() === now.toDateString()) {
2829
+ el.textContent = time;
2830
+ } else {
2831
+ const date = d.toLocaleDateString([], d.getFullYear() === now.getFullYear()
2832
+ ? { day: "numeric", month: "short" }
2833
+ : { day: "numeric", month: "short", year: "numeric" });
2834
+ el.textContent = date + ", " + time;
2835
+ }
2826
2836
  el.title = d.toLocaleString();
2827
2837
  return el;
2828
2838
  }