import type { WorkDetail } from '../use-work'

export const workDetailFixture = {
  work: {
    id: 'work-storybook',
    title: 'Extract Storybook rendering seams',
    objective: 'Move user-visible Work surfaces behind pure props interfaces while preserving runtime behavior.',
    linkedIssueId: null,
    handoffTitle: 'Expand Storybook architecture',
    handoffSummary: 'Extracted Work delivery and execution surfaces from their query and mutation adapters.',
    handoffTestPlan: 'Run web typecheck, tests, Storybook build, and desktop/mobile visual verification.',
    preparedAt: 30,
    lastSubmittedAt: 20,
    closedAt: null,
    archivedAt: null,
    createdAt: 1,
    updatedAt: 30,
  },
  primaryThread: {
    id: 'session-storybook',
    execution: { kind: 'local' },
    parentSessionId: null,
    sideContextSource: null,
    workspaceId: 'workspace-storybook',
    title: 'Storybook architecture',
    origin: 'work',
    providerTargetId: null,
    agentId: null,
    modelId: 'gpt-5',
    thinkingEffort: 'high',
    linkedIssueId: null,
    sessionGroupId: null,
    runtimeKind: 'codex',
    status: 'idle',
    pinned: 0,
    archivedAt: null,
    lastReadAt: null,
    createdAt: 1,
    updatedAt: 30,
    latestUserMessageAt: 2,
    latestAssistantMessageAt: 29,
    unread: false,
    isIsolated: true,
    worktreeId: 'worktree-storybook',
    worktreeBranch: 'cradle/wt/storybook-views',
    worktreePath: '/workspace/.cradle/worktrees/storybook-views',
    worktreeHealth: 'ok',
    pendingWorktreeId: null,
    isolationBoundaryRequired: true,
  },
  execution: {
    isIsolated: true,
    worktreeId: 'worktree-storybook',
    worktreeBranch: 'cradle/wt/storybook-views',
    worktreePath: '/workspace/.cradle/worktrees/storybook-views',
    worktreeHealth: 'ok',
    pendingWorktreeId: null,
    isolationBoundaryRequired: true,
  },
  readiness: {
    isolated: true,
    clean: true,
    branch: 'cradle/wt/storybook-views',
    baseRef: 'main',
    commitsAhead: 3,
    changedFiles: 0,
  },
  pullRequest: {
    owner: 'cradle',
    repo: 'cradle-app',
    number: 71,
    url: 'https://github.com/cradle/cradle-app/pull/71',
    title: 'Expand fixture-driven rendering seams',
    isDraft: true,
    state: 'open',
    merged: false,
    headRef: 'cradle/wt/storybook-views',
    baseRef: 'main',
    headSha: 'storybook-head',
    createdAt: 20,
    updatedAt: 30,
  },
  activity: 'idle',
} satisfies WorkDetail

export const unhealthyWorkDetailFixture = {
  ...workDetailFixture,
  work: {
    ...workDetailFixture.work,
    handoffSummary: null,
    handoffTestPlan: null,
  },
  execution: {
    ...workDetailFixture.execution,
    worktreeHealth: 'missing',
  },
  readiness: {
    ...workDetailFixture.readiness,
    clean: false,
    commitsAhead: 0,
    changedFiles: 12,
  },
  pullRequest: null,
} satisfies WorkDetail
