fix(sidebar): poll project actions only while one is running
The sidebar indicator kept the terminal listing loop going for as long as the sidebar was visible, in every client, whether or not anything was running. It now lists once on mount, to pick up runs another client started, and keeps the loop only while a project action is known to be running anywhere; an idle sidebar costs no polling. Claude-Session: https://claude.ai/code/session_01VqV56Hez25hTxXH4ipJfzH
This commit is contained in:
@@ -278,6 +278,12 @@ const nextDefaultTabLabel = (tabs: readonly TerminalTab[]): string => {
|
||||
return highest === 0 ? 'Terminal' : `Terminal ${highest + 1}`;
|
||||
};
|
||||
|
||||
/** A project action the user would expect to see marked as running. */
|
||||
export const isActiveProjectActionTab = (tab: TerminalTab): boolean =>
|
||||
tab.purpose.type === 'project-action'
|
||||
&& tab.purpose.executionId !== null
|
||||
&& ACTIVE_PROJECT_ACTION_LIFECYCLES.has(tab.lifecycle);
|
||||
|
||||
const isLiveRunningTerminal = (tab: TerminalTab | undefined): boolean =>
|
||||
Boolean(tab && tab.terminalSessionId !== null && tab.lifecycle === 'running');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user