Skip to content

Every mounted task panel polls GetBranchCommits every 5s regardless of visibility #205

Description

@johannesjo

Problem

Every mounted task panel polls GetBranchCommits on a fixed 5-second interval regardless of visibility or activity — and every task stays mounted, even hidden ones.

  • TaskPanel.tsx:198-234: setInterval(fetchCommits, 5000) per panel; only guards are isLandedTask()/git-isolation, not visibility.
  • All tasks stay mounted via the panel cache (TilingLayout.tsx:233-244); focus mode hides inactive panels with visibility: hidden rather than unmounting (:581).
  • At 30 tasks that's ~6 git subprocess invocations per second just for commit lists, plus 30 live xterm instances.

The codebase already solved this problem for git status polling — computeAllTasksInterval scales the interval with task count (src/store/taskStatus.ts:1071-1074) — the commit poll just never got the same treatment. Viewport visibility is also already computed and stored (taskViewportVisibility, TilingLayout.tsx:98-113).

Proposed fix

  • Gate the per-panel commit poll on taskViewportVisibility (skip or slow polling for offscreen/hidden panels), and/or reuse the scaled-interval pattern from taskStatus.ts.
  • Longer term: consider unmounting panel bodies far offscreen — terminals already survive remounts via DOM reparenting (TaskPanel.tsx:247-265) and the pty buffer lives in the main process.
  • Sidebar task list is a plain <For> (Sidebar.tsx:717) — fine for now, but worth virtualizing if task counts grow.

From a full design/UX audit (2026-07-07); adversarially verified. Line numbers as of b342bbd (v1.12.0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestuxUX / design improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions