shadok-ai 0.13.9 → 0.13.10

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 +20 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.13.9",
3
+ "version": "0.13.10",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test test/*.ts context/*/test/*.test.mjs",
package/public/index.html CHANGED
@@ -4190,7 +4190,14 @@
4190
4190
  // Coming back must stop the blink at once, not at the next tick. Both signals
4191
4191
  // matter: switching tabs fires visibilitychange, switching application only
4192
4192
  // fires focus/blur.
4193
- const repaintOnReturn = () => { blinkPhase = 0; paint(); };
4193
+ const repaintOnReturn = () => {
4194
+ blinkPhase = 0;
4195
+ // Back in front of the cockpit → the channel you're VIEWING is no longer
4196
+ // "unread": clear the away-completion flag turn-done may have set on it.
4197
+ const away = document.hidden || !document.hasFocus();
4198
+ if (!away && active && active.btnEl.classList.contains("unread")) setTabMood(active, null);
4199
+ paint();
4200
+ };
4194
4201
  document.addEventListener("visibilitychange", repaintOnReturn);
4195
4202
  window.addEventListener("focus", repaintOnReturn);
4196
4203
  window.addEventListener("blur", repaintOnReturn);
@@ -5894,7 +5901,18 @@
5894
5901
  // "unread" only when the turn produced visible text. An empty turn (e.g.
5895
5902
  // a cron concluding NOTHING TO SHOW) asks for no reading at all, neither
5896
5903
  // on the tab nor on the favicon.
5897
- setTabMood(t, (t === active || !t.turnHadText) ? null : "unread");
5904
+ //
5905
+ // The channel you're VIEWING normally stays quiet — you can see it finish.
5906
+ // But only if you're actually there: with the window in the background
5907
+ // (you're in your terminal), the agent you were watching finishes with NO
5908
+ // signal at all — no tab colour, no favicon "?". So it flags even the
5909
+ // active tab when you're AWAY; `repaintOnReturn` clears it the moment you
5910
+ // come back to the cockpit.
5911
+ {
5912
+ const away = document.hidden || !document.hasFocus();
5913
+ const flag = t.turnHadText && (t !== active || away);
5914
+ setTabMood(t, flag ? "unread" : null);
5915
+ }
5898
5916
  setTabState(t, "ready", "ready");
5899
5917
  break;
5900
5918
  case "dialog":