Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

803 B
Raw Blame
import { create } from 'zustand'

// Transient "AI naming in progress" flag per node id. Kept in a store (not in the SessionRow
// component) so the spinner survives the row unmounting — e.g. when the sidebar closes or a
// hover-peek collapses while the name is still being generated. The generate-name request runs
// at the Canvas level and applies its result regardless of the row's mount state.
interface SessionNamingState {
  byId: Record<string, boolean>
  set(id: string, naming: boolean): void
}

export const useSessionNaming = create<SessionNamingState>((set) => ({
  byId: {},
  set: (id, naming) =>
    set((s) => {
      if (!!s.byId[id] === naming) return s
      const byId = { ...s.byId }
      if (naming) byId[id] = true
      else delete byId[id]
      return { byId }
    })
}))