Commit graph

5 commits

Author SHA1 Message Date
777genius
1173a4942a refactor(team): split team detail snapshot from messages activity 2026-04-15 21:54:38 +03:00
777genius
9ca8055695 chore(workspace): checkpoint remaining claude team changes 2026-04-12 22:15:57 +03:00
Artem Rootman
bc7981f6b9
fix: use full intervals content in worker cache key, not just length
Two different interval sets with the same length would produce
the same cache key, returning stale results. Serialize each
interval's startedAt~completedAt into the key.
2026-04-05 18:09:59 +00:00
Artem Rootman
0e83d99e0a
fix: address PR review feedback (6 issues)
Critical:
- findLogsForTask: call worker directly instead of wrapping in
  wrapTeamHandler, so failures propagate to catch and trigger the
  main-thread fallback correctly.
- TeamDataWorkerClient: scope error/exit handlers to the specific
  worker instance to prevent a stale worker's exit event from
  rejecting pending requests on a replacement worker (race condition).

Major:
- TeamDataWorkerClient: validate teamName and taskId before forwarding
  to worker thread (input sanitization).
- team-data-worker: include status, since, and intervals length in
  cache key to prevent stale results after filter changes.
- team-data-worker: move logsInFlight.delete() into .finally() so
  rejected lookups don't poison the in-flight map permanently.
- MemberLogsTab: reset refreshCountRef and refreshing state in effect
  cleanup to prevent the refresh indicator from latching on permanently
  when the effect tears down mid-refresh (e.g. on tab switch).
2026-04-05 16:59:44 +00:00
Artem Rootman
da58917032
perf: offload heavy I/O to worker thread, reduce renderer re-renders
Main process — worker thread for team data:
- New team-data-worker thread handles getTeamData and findLogsForTask,
  isolating heavy file I/O (scanning 300+ subagent JSONL files) from
  Electron's main event loop. getTeamData dropped from ~2000ms on the
  main thread to ~110ms via the worker.
- Worker-side dedup and 10s result cache for findLogsForTask prevents
  redundant scans when the same task is queried multiple times.
- Discovery cache TTL raised from 5s to 30s — avoids re-scanning the
  entire project directory on every call.
- Message cap at 200 in TeamDataService to keep IPC payloads under 1MB
  (was sending 2200+ messages / ~3MB, stalling Chromium IPC serialization).
- IPC handlers fall back to main-thread execution if the worker is
  unavailable (graceful degradation).

Renderer — useShallow and memoization (55 files):
- Added useShallow to store selectors across 55 renderer files. Batched
  individual useStore() calls (e.g. 17 calls in ExtensionStoreView,
  10 in ConnectionSection) into single useShallow selectors, cutting
  unnecessary re-render checks on every store update.
- MemberLogsTab: three 5-second polling intervals now pause when the
  parent tab is hidden (display:none). Previously 5 hidden tabs × 3
  intervals = 15 polling timers firing continuously.
- KanbanColumn wrapped in React.memo to skip re-renders when props
  haven't changed.
- MemberList: memoized activeMembers/removedMembers/colorMap; replaced
  O(n×m) per-member task scan with a pre-computed reviewer map.
- Bounded timer Maps in store initialization to prevent unbounded growth
  of debounce/throttle tracking maps during long sessions.
2026-04-05 16:21:05 +00:00