Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

731 B
Raw Blame
import type { WorkspaceSortBy } from '../workspace-view/workspace-row-sort'

/** Keep persisted order without writing during async hydration; latch live Smart for the list lifetime after its first signal. */
export type SmartSortPhase = 'cold' | 'live'

/** Null outside Smart. */
export function smartSortPhase(sortBy: WorkspaceSortBy, latched: boolean): SmartSortPhase | null {
  if (sortBy !== 'smart') {
    return null
  }
  return latched ? 'live' : 'cold'
}

/** Manual and cold Smart rank by persisted order, so they follow another client's save. */
export function ranksFollowPersistedOrder(sortBy: WorkspaceSortBy, latched: boolean): boolean {
  return sortBy === 'manual' || smartSortPhase(sortBy, latched) === 'cold'
}