shadok-ai 0.1.141 → 0.1.142

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 +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.1.141",
3
+ "version": "0.1.142",
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
@@ -1586,6 +1586,9 @@
1586
1586
  persistDraft(active);
1587
1587
  }
1588
1588
  active = tab;
1589
+ // Un reload doit revenir sur le canal qu'on regardait : on mémorise son
1590
+ // sessionId (hors restauration initiale, qui rejoue les activate elle-même).
1591
+ if (!restoring && tab.sessionId) localStorage.setItem("cp.activeSession", tab.sessionId);
1589
1592
  // Viewing the channel clears its "unread response" highlight.
1590
1593
  if (tab.btnEl.classList.contains("unread")) setTabMood(tab, null);
1591
1594
  tabs.forEach((t) => {
@@ -2311,6 +2314,9 @@
2311
2314
  if (t === active) refreshChrome();
2312
2315
  if (msg.sessionId) {
2313
2316
  localStorage.setItem("cp.session", msg.sessionId);
2317
+ // A restored/new channel learns its session id here; if it's the one
2318
+ // we're viewing, record it so a reload comes back to it.
2319
+ if (t === active) localStorage.setItem("cp.activeSession", msg.sessionId);
2314
2320
  // Custom name remembered for this session.
2315
2321
  if (!t.customName && savedNames[msg.sessionId]) {
2316
2322
  t.customName = true;
@@ -3079,7 +3085,10 @@
3079
3085
  repo: s.repo || serverCwd || undefined,
3080
3086
  });
3081
3087
  }
3082
- activate(tabs[0]);
3088
+ // Revenir sur le canal actif d'avant le reload (fallback : le premier).
3089
+ const savedActive = localStorage.getItem("cp.activeSession");
3090
+ const target = (savedActive && tabs.find((t) => t.sessionId === savedActive)) || tabs[0];
3091
+ activate(target);
3083
3092
  // Restore done: re-enable persistence and write the full set once.
3084
3093
  restoring = false;
3085
3094
  persistChannels();