review fixes: broadcast session state on working, guard the CodemanSessionOrder global

The running group sorts on lastSubmitAt, but nothing pushed a session:updated
when a turn STARTS — the browser kept whatever stamp it loaded with, so a
30-second-old turn could rank (and read) as an hour-long one. The working
handler now rides the same debounced state broadcast idle already uses.

And both call sites of window.CodemanSessionOrder now degrade to tab order
when the global is missing (iOS Safari's documented stale-cached-JS after a
deploy) instead of TypeErroring the whole home screen away.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-08-16 19:18:49 +02:00
parent 19aabe34d2
commit c6f428e687
3 changed files with 15 additions and 2 deletions
+4 -1
View File
@@ -216,7 +216,10 @@ Object.assign(CodemanApp.prototype, {
};
});
return window.CodemanSessionOrder.sort(rows);
// Guarded like every other constants.js consumer: a stale cached
// constants.js (iOS Safari serves old JS after a deploy) must degrade to
// tab order, not TypeError the whole home screen away.
return window.CodemanSessionOrder ? window.CodemanSessionOrder.sort(rows) : rows;
},
// ═══════════════════════════════════════════════════════════════