Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

656 B
Raw Blame
import type { WorkbenchSession } from '../context/ApiContext';

const compareDesc = (left: string | null, right: string | null): number =>
  (right ?? '').localeCompare(left ?? '');

export const compareProjectSessions = (left: WorkbenchSession, right: WorkbenchSession): number => {
  if (left.pinned !== right.pinned) return left.pinned ? -1 : 1;
  return (
    compareDesc(left.last_active_at, right.last_active_at) ||
    compareDesc(left.created_at, right.created_at) ||
    compareDesc(left.id, right.id)
  );
};

export const orderProjectSessions = (sessions: WorkbenchSession[]): WorkbenchSession[] =>
  [...sessions].sort(compareProjectSessions);