myrlin-workbook 0.8.6 → 0.8.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myrlin-workbook",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "description": "Browser-based project manager for Claude Code sessions - session discovery, multi-terminal, cost tracking, docs, and kanban board",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -373,14 +373,17 @@ class PtySessionManager {
373
373
  }
374
374
  }
375
375
 
376
- // Throttled lastActive update - fires immediately then at most once per 30s
376
+ // Throttled lastActive update - deferred via setImmediate to avoid
377
+ // blocking the PTY data path with synchronous JSON file I/O.
377
378
  if (!session._lastActiveTimer) {
378
- try {
379
- const store = getStore();
380
- if (store.getSession(sessionId)) {
381
- store.updateSession(sessionId, {});
382
- }
383
- } catch (_) {}
379
+ setImmediate(() => {
380
+ try {
381
+ const store = getStore();
382
+ if (store.getSession(sessionId)) {
383
+ store.updateSession(sessionId, {});
384
+ }
385
+ } catch (_) {}
386
+ });
384
387
  session._lastActiveTimer = setTimeout(() => {
385
388
  session._lastActiveTimer = null;
386
389
  }, 30000);
@@ -1009,14 +1009,18 @@ class TerminalPane {
1009
1009
  // Track completion (debounced internally)
1010
1010
  this._trackActivityForCompletion();
1011
1011
 
1012
- // Debounce activity detection to at most once per 200ms
1012
+ // Debounce activity detection to at most once per 200ms.
1013
+ // Skip for unfocused terminals to avoid wasting CPU on regex
1014
+ // parsing when the result won't be visible anyway.
1013
1015
  if (!this._activityDebounceTimer) {
1014
1016
  this._activityDebounceTimer = setTimeout(() => {
1015
1017
  this._activityDebounceTimer = null;
1016
1018
  const sample = this._activitySample;
1017
1019
  this._activitySample = '';
1018
- if (sample) this._detectActivity(sample);
1019
- this._analyzeForAutoTrust(sample);
1020
+ if (sample && this._isFocused) {
1021
+ this._detectActivity(sample);
1022
+ this._analyzeForAutoTrust(sample);
1023
+ }
1020
1024
  }, 200);
1021
1025
  }
1022
1026
  }