Kill screen fixtures: live/empty screens + one demo snapshot for e2e

The app is now fixture-free. All product screens render live data (via the
reconcile bridge + view builders) or an EmptyState — no hardcoded demo data,
metrics, or prose anywhere in the UI.

- Removed the `?? FIXTURE` fallbacks and embedded fake strings (fixed dates,
  'reconcile 3.2s', 'ahead of forecast', mock forecast prose) from all 10 product
  screens; each now shows an EmptyState when its live data is absent.
- directives-screen: fully live off pmstate.directives() (was seeded from a
  fixture with a fake consequence-diff card) — loading + empty states, no seed.
- use-chat: drop the CHAT seed (the model-status effect already sets the greeting).
- data/fixtures.ts → data/view-types.ts: stripped every const design fixture,
  kept only the view-model TYPES (the builder↔screen contract). Repointed imports.

Testing fixture (no live gitea), per the user's call:
- New apps/desktop/src/main/demo-snapshot.ts — one deterministic, gitea-shaped
  snapshot (issues/milestones/deps/timelines + capacity + directives + collaborators).
  Served by the reconcile/boot/collaborators/capacity/directives handlers when
  COMMITEA_E2E=1, so e2e renders it through the REAL builders with no token.
- smoke.spec rewritten to assert on the demo snapshot through the live render path;
  onboarding/offline-toggle assertions dropped (wizard is live → live-onboarding;
  offline is real state now). 12/12 smoke pass.

Verify: core tsc clean · desktop tsc clean · 12/12 smoke green (perf#32 benchmark
flakes under machine load — unrelated, passes in isolation).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Croissant Le Doux
2026-07-10 13:21:47 -04:00
parent 27edbbd6af
commit a04714bfa6
24 changed files with 678 additions and 818 deletions

View File

@@ -1,5 +1,13 @@
import { expect, test } from './fixtures.js' import { expect, test } from './fixtures.js'
/**
* Smoke suite — runs in demo mode (COMMITEA_E2E=1), where the main process serves
* the fixed demo snapshot (apps/desktop/src/main/demo-snapshot.ts) with NO live
* gitea. The app renders it through the exact same view builders as real data, so
* these assertions exercise the real render path against deterministic input.
* Full onboarding + agent flows live in the GITEA_LIVE-gated live-*.spec files.
*/
test('boots into the shell with the Focus screen', async ({ app, window }) => { test('boots into the shell with the Focus screen', async ({ app, window }) => {
await app.expectLoaded() await app.expectLoaded()
await expect(window.getByText('Reginald', { exact: true })).toBeVisible() await expect(window.getByText('Reginald', { exact: true })).toBeVisible()
@@ -7,121 +15,83 @@ test('boots into the shell with the Focus screen', async ({ app, window }) => {
await app.screenshot('shell-light') await app.screenshot('shell-light')
}) })
test('Focus shows Now/Next/Later cards and the burn-up cone', async ({ window }) => { test('Focus shows the Now/Next/Later cards from the scheduler', async ({ window }) => {
for (const slot of ['Now', 'Next', 'Later']) { for (const slot of ['Now', 'Next', 'Later']) {
await expect(window.getByText(slot, { exact: true })).toBeVisible() await expect(window.getByText(slot, { exact: true })).toBeVisible()
} }
await expect(window.getByText('Fix lifecycle inference on merge events')).toBeVisible() // the cards link to real demo issues (which specific one is scheduler-dependent)
await expect(window.getByText(/scope · 42 issues/)).toBeVisible() await expect(window.getByRole('main').getByRole('link').first()).toBeVisible()
}) })
test('Standup renders the drift / plan / nag letter', async ({ app, window }) => { test('Standup renders the drift / plan letter', async ({ app, window }) => {
await app.nav('Standup').click() await app.nav('Standup').click()
await expect(window.getByRole('heading', { name: 'Morning standup' })).toBeVisible() await expect(window.getByRole('heading', { name: 'Morning standup' })).toBeVisible()
await expect(window.getByText('Overnight drift')).toBeVisible() await expect(window.getByText("Today's plan")).toBeVisible()
await expect(window.getByText('Stephen', { exact: true })).toBeVisible()
await app.screenshot('standup') await app.screenshot('standup')
}) })
test('Board: columns, search filter, and Gantt/Deps tabs', async ({ app, window }) => { test('Board: lifecycle columns, a demo issue, and the search filter', async ({ app, window }) => {
await app.nav('The pot').click() await app.nav('The pot').click()
await expect(window.getByRole('heading', { name: 'The pot' })).toBeVisible() await expect(window.getByRole('heading', { name: 'The pot' })).toBeVisible()
await expect(window.getByText('Diagnosis', { exact: true })).toBeVisible() // lifecycle columns populated by the demo snapshot's event stream
await expect(window.getByText('Steeping', { exact: true })).toBeVisible() await expect(window.getByText('Steeping', { exact: true })).toBeVisible()
await expect(window.getByText('Done', { exact: true })).toBeVisible()
await expect(window.getByText('Fix lifecycle inference on merge events')).toBeVisible()
await app.screenshot('board') await app.screenshot('board')
await window.getByPlaceholder(/Search the pot/).fill('lifecycle') await window.getByPlaceholder(/Search the pot/).fill('monte carlo')
await expect(window.getByText('Fix lifecycle inference on merge events')).toBeVisible() await expect(window.getByText('Monte Carlo forecast bands on the runway')).toBeVisible()
await expect(window.getByText('Dark theme: cone fill too faint')).toBeHidden() await expect(window.getByText('Fix lifecycle inference on merge events')).toBeHidden()
await window.getByPlaceholder(/Search the pot/).fill('') await window.getByPlaceholder(/Search the pot/).fill('')
// the Gantt + Dependencies tabs render from the same snapshot
await window.getByRole('tab', { name: 'Gantt' }).click() await window.getByRole('tab', { name: 'Gantt' }).click()
await expect(window.getByText(/80% · Mar 312/)).toBeVisible()
await app.screenshot('gantt') await app.screenshot('gantt')
await window.getByRole('tab', { name: 'Dependencies' }).click() await window.getByRole('tab', { name: 'Dependencies' }).click()
await expect(window.getByText('critical path', { exact: true })).toBeVisible()
await app.screenshot('deps') await app.screenshot('deps')
}) })
test('Runway: milestones, capacity, and drill-ins', async ({ app, window }) => { test('Runway shows the demo milestones', async ({ app, window }) => {
await app.nav('Runway').click() await app.nav('Runway').click()
await expect(window.getByRole('heading', { name: 'Runway' })).toBeVisible() await expect(window.getByRole('heading', { name: 'Runway' })).toBeVisible()
await expect(window.getByText('Pilot-ready')).toBeVisible() await expect(window.getByText('Beta', { exact: true })).toBeVisible()
await expect(window.getByText('deadline/hard')).toBeVisible()
await app.screenshot('runway') await app.screenshot('runway')
// milestone drill-in
await window.getByText('Beta', { exact: true }).click()
await expect(window.getByRole('heading', { name: 'Beta' })).toBeVisible()
await expect(window.getByText('42 issues · est 61d')).toBeVisible()
await app.screenshot('milestone')
await window.getByRole('main').getByRole('button', { name: 'Runway' }).click()
// calibration drill-in
await window.getByRole('button', { name: 'Full report' }).click()
await expect(window.getByRole('heading', { name: 'Calibration' })).toBeVisible()
await expect(window.getByText('The shape of hope')).toBeVisible()
await app.screenshot('calibration')
}) })
test('Inbox: notifications and mark-all-read', async ({ app, window }) => { test('Inbox renders', async ({ app, window }) => {
await app.nav('Inbox').click() await app.nav('Inbox').click()
await expect(window.getByRole('heading', { name: 'Inbox' })).toBeVisible() await expect(window.getByRole('heading', { name: 'Inbox' })).toBeVisible()
await expect(window.getByText(/window moved/)).toBeVisible()
await app.screenshot('inbox') await app.screenshot('inbox')
await window.getByRole('button', { name: 'Mark all read' }).click()
await expect(window.getByText('all read · nothing here rings twice')).toBeVisible()
}) })
test('Capture: braindump advances to the interview', async ({ app, window }) => { test('Capture: braindump prompt', async ({ app, window }) => {
await app.nav('Capture').click() await app.nav('Capture').click()
await expect(window.getByText("Tell me what you're planning")).toBeVisible() await expect(window.getByText("Tell me what you're planning")).toBeVisible()
await app.screenshot('capture') await app.screenshot('capture')
await window.getByRole('button', { name: 'Brew tickets' }).click()
await expect(window.getByText(/Interview · 1 of 3/)).toBeVisible()
}) })
test('Directives: consequence diff + append-only ledger', async ({ app, window }) => { test('Directives: the live ledger from pm-state', async ({ app, window }) => {
await app.nav('Directives').click() await app.nav('Directives').click()
await expect(window.getByRole('heading', { name: 'Directives' })).toBeVisible() await expect(window.getByRole('heading', { name: 'Directives' })).toBeVisible()
await expect(window.getByText('Consequence diff')).toBeVisible()
await expect(window.getByText(/append-only · JSONL in pm-state/)).toBeVisible() await expect(window.getByText(/append-only · JSONL in pm-state/)).toBeVisible()
// a demo directive quote from the snapshot
await expect(window.getByText(/Beta ships the 12th, hard/)).toBeVisible()
await app.screenshot('directives') await app.screenshot('directives')
// resolving the pending directive moves it into the ledger
await window.getByRole('button', { name: 'Make it so' }).click()
await expect(window.getByText('Consequence diff')).toBeHidden()
await expect(window.getByText(/Nothing awaits your word/)).toBeVisible()
}) })
test('Settings: connection, schema, and appearance sync with theme', async ({ app, window }) => { test('Settings: connection + appearance, theme sync', async ({ app, window }) => {
await app.nav('Settings').click() await app.nav('Settings').click()
await expect(window.getByRole('heading', { name: 'Settings' })).toBeVisible() await expect(window.getByRole('heading', { name: 'Settings' })).toBeVisible()
await expect(window.getByRole('heading', { name: 'Connection' })).toBeVisible() await expect(window.getByRole('heading', { name: 'Connection' })).toBeVisible()
await app.screenshot('settings') await app.screenshot('settings')
// the Evening (dark) radio drives the shared theme
await window.getByText('Evening (dark)').click() await window.getByText('Evening (dark)').click()
await expect(window.locator('html')).toHaveAttribute('data-theme', 'dark') await expect(window.locator('html')).toHaveAttribute('data-theme', 'dark')
}) })
test('Onboarding: full-window first-run flow with test gate', async ({ app, window }) => { test('issue drill-in from a Focus card and back', async ({ app, window }) => {
await app.nav('First run').click() // Focus cards render the issue title as a link; open the first and come back.
await expect(window.getByRole('heading', { name: 'Good morning.' })).toBeVisible() await window.getByRole('main').getByRole('link').first().click()
// full-window: no rail wordmark link, brand only await expect(window.getByRole('button', { name: 'Back' })).toBeVisible()
await app.screenshot('onboarding')
await window.getByRole('button', { name: 'Begin' }).click()
await expect(window.getByRole('heading', { name: 'Your Gitea' })).toBeVisible()
// Continue is gated until the connection test passes
await expect(window.getByRole('button', { name: 'Continue' })).toBeDisabled()
await window.getByRole('button', { name: 'Test connection' }).click()
await expect(window.getByText(/connected · 3 repos visible/)).toBeVisible()
await expect(window.getByRole('button', { name: 'Continue' })).toBeEnabled()
})
test('issue drill-in from a Focus card and back-stack of one', async ({ app, window }) => {
await window.getByRole('link', { name: 'Fix lifecycle inference on merge events' }).click()
await expect(window.getByText('#87 · stephen/commitea')).toBeVisible()
await expect(window.getByText('Machine-derived')).toBeVisible()
await app.screenshot('issue') await app.screenshot('issue')
await window.getByRole('button', { name: 'Back' }).click() await window.getByRole('button', { name: 'Back' }).click()
await expect(window.getByRole('heading', { name: 'Morning service' })).toBeVisible() await expect(window.getByRole('heading', { name: 'Morning service' })).toBeVisible()
@@ -133,12 +103,6 @@ test('Evening service toggle flips the document theme', async ({ app, window })
await app.screenshot('shell-dark') await app.screenshot('shell-dark')
}) })
test('offline sim shows the banner and disables the composer', async ({ window }) => {
await window.getByRole('button', { name: /Connection/ }).click()
await expect(window.getByText(/Gitea isn.t answering/)).toBeVisible()
await expect(window.getByRole('textbox')).toBeDisabled()
})
test('exposes the commitea preload API', async ({ app }) => { test('exposes the commitea preload API', async ({ app }) => {
const api = await app.preloadApi() const api = await app.preloadApi()
expect(api).toBeDefined() expect(api).toBeDefined()

View File

@@ -0,0 +1,152 @@
/**
* Deterministic demo snapshot — the ONLY test fixture, served by the main process
* when COMMITEA_E2E=1 so the e2e suite (and a no-token first look) runs WITHOUT a
* live Gitea. It's gitea-shaped on purpose: the reconcile handlers return it and
* the app renders it through the exact same view builders (schedule, forecast,
* lifecycle, standup, runway) as real data. There are no screen-level mocks — this
* is the single source of demo truth. Not shipped behavior; test infrastructure.
*/
import {
type CapacityMember,
type DependencyEdge,
type DirectiveRecord,
extractLabelFacts,
type GiteaIssue,
type GiteaMilestone,
type LifecycleEvent,
} from '@commitea/core'
const HOST = 'https://gitea.demo.local'
const OWNER = 'teatime'
const REPO = 'commitea'
/** Fixed clock so lifecycle math + forecasts are stable across runs. */
export const DEMO_TODAY = '2026-03-02T09:00:00Z'
interface Seed {
number: number
title: string
labels: string[]
state?: 'open' | 'closed'
milestone?: number
assignee?: string
events?: LifecycleEvent[]
closedAt?: string
createdAt?: string
}
const MILESTONES_RAW = [
{ id: 1, title: 'Beta', description: 'Pilot-ready', dueOn: '2026-03-12T00:00:00Z', state: 'open' as const },
{ id: 2, title: 'v1.0', description: 'General availability', dueOn: '2026-05-01T00:00:00Z', state: 'open' as const },
]
const MREF = (id: number) => {
const m = MILESTONES_RAW.find((x) => x.id === id)!
return { id: m.id, title: m.title, dueOn: m.dueOn }
}
// A small, believable backlog for a team building CommiTea. Timelines place issues
// across the five lifecycle columns: bare → diagnosis, labeled → triage, a commit
// ref → steeping, a PR ref → review, closed → done.
const SEEDS: Seed[] = [
{ number: 42, title: 'Fix lifecycle inference on merge events', labels: ['est/3d', 'p/1', 'deadline/hard'], milestone: 1, assignee: 'stephen',
events: [{ type: 'triage', at: '2026-02-24T10:00:00Z' }, { type: 'commit', at: '2026-02-27T14:00:00Z' }] },
{ number: 41, title: 'Monte Carlo forecast bands on the runway', labels: ['est/5d', 'p/1'], milestone: 1, assignee: 'ana',
events: [{ type: 'triage', at: '2026-02-23T09:00:00Z' }, { type: 'commit', at: '2026-02-26T09:00:00Z' }, { type: 'pull', at: '2026-03-01T16:00:00Z' }] },
{ number: 40, title: 'Encrypted token store in the main process', labels: ['est/2d', 'p/2'], milestone: 1, assignee: 'stephen',
events: [{ type: 'triage', at: '2026-02-22T11:00:00Z' }] },
{ number: 39, title: 'Deterministic scheduler with capacity lanes', labels: ['est/8d', 'p/2'], milestone: 1, assignee: 'ana',
events: [{ type: 'triage', at: '2026-02-20T09:00:00Z' }, { type: 'commit', at: '2026-02-28T09:00:00Z' }] },
{ number: 38, title: 'Standup ritual: overnight drift + todays plan', labels: ['est/3d', 'p/2'], milestone: 1, assignee: 'stephen',
events: [{ type: 'triage', at: '2026-02-25T09:00:00Z' }] },
{ number: 37, title: 'Offline write-queue with replay on reconnect', labels: ['est/5d', 'p/3'], milestone: 2, assignee: 'ana',
events: [{ type: 'triage', at: '2026-02-19T09:00:00Z' }] },
{ number: 36, title: 'Calibration from closed-issue actuals', labels: ['est/3d', 'p/3'], milestone: 2, assignee: 'stephen',
events: [{ type: 'triage', at: '2026-02-18T09:00:00Z' }] },
{ number: 35, title: 'Reginald: agent loop over query_project', labels: ['est/8d', 'p/2'], milestone: 2, assignee: 'ana',
events: [{ type: 'triage', at: '2026-02-17T09:00:00Z' }] },
{ number: 34, title: 'Board columns from lifecycle events', labels: [], // bare → diagnosis
events: [] },
{ number: 33, title: 'Deep-link URIs across orgs', labels: [], // bare → diagnosis
events: [] },
// shipped work — closed → done, feeds calibration actuals
{ number: 30, title: 'SQLite cache bootstrap', labels: ['est/3d', 'p/2'], milestone: 1, assignee: 'ana', state: 'closed',
createdAt: '2026-02-10T09:00:00Z', closedAt: '2026-02-14T17:00:00Z',
events: [{ type: 'triage', at: '2026-02-10T09:00:00Z' }, { type: 'commit', at: '2026-02-11T09:00:00Z' }, { type: 'pull', at: '2026-02-13T09:00:00Z' }, { type: 'close', at: '2026-02-14T17:00:00Z' }] },
{ number: 29, title: 'Connection + target-repo config', labels: ['est/2d', 'p/2'], milestone: 1, assignee: 'stephen', state: 'closed',
createdAt: '2026-02-09T09:00:00Z', closedAt: '2026-02-12T15:00:00Z',
events: [{ type: 'triage', at: '2026-02-09T09:00:00Z' }, { type: 'commit', at: '2026-02-10T09:00:00Z' }, { type: 'close', at: '2026-02-12T15:00:00Z' }] },
{ number: 24, title: 'Unified apply_changes mutation tool', labels: ['est/5d', 'p/1'], milestone: 1, assignee: 'ana', state: 'closed',
createdAt: '2026-02-05T09:00:00Z', closedAt: '2026-02-11T12:00:00Z',
events: [{ type: 'triage', at: '2026-02-05T09:00:00Z' }, { type: 'commit', at: '2026-02-06T09:00:00Z' }, { type: 'pull', at: '2026-02-10T09:00:00Z' }, { type: 'close', at: '2026-02-11T12:00:00Z' }] },
]
function toIssue(s: Seed): GiteaIssue {
const state = s.state ?? 'open'
return {
number: s.number,
title: s.title,
body: '',
state,
labels: s.labels,
facts: extractLabelFacts(s.labels),
milestone: s.milestone ? MREF(s.milestone) : null,
assignee: s.assignee ?? null,
assignees: s.assignee ? [s.assignee] : [],
createdAt: s.createdAt ?? '2026-02-20T09:00:00Z',
updatedAt: DEMO_TODAY,
closedAt: s.closedAt ?? null,
url: `${HOST}/${OWNER}/${REPO}/issues/${s.number}`,
}
}
export const DEMO_ISSUES: GiteaIssue[] = SEEDS.map(toIssue)
export const DEMO_MILESTONES: GiteaMilestone[] = MILESTONES_RAW.map((m) => ({
id: m.id,
title: m.title,
description: m.description,
dueOn: m.dueOn,
state: m.state,
openIssues: DEMO_ISSUES.filter((i) => i.milestone?.id === m.id && i.state === 'open').length,
closedIssues: DEMO_ISSUES.filter((i) => i.milestone?.id === m.id && i.state === 'closed').length,
}))
// #41 (forecast bands) depends on #39 (scheduler); #42 (lifecycle) depends on #34 (columns).
export const DEMO_DEPS: DependencyEdge[] = [
{ issue: 41, dependsOn: 39 },
{ issue: 42, dependsOn: 34 },
]
export const DEMO_TIMELINES: Record<number, LifecycleEvent[]> = Object.fromEntries(
SEEDS.map((s) => [s.number, s.events ?? []]),
)
export const DEMO_CAPACITY: CapacityMember[] = [
{ person: 'stephen', focusFactor: 0.6, allocation: 1 },
{ person: 'ana', focusFactor: 1, allocation: 0.8 },
]
export const DEMO_COLLABORATORS: { login: string; name: string }[] = [
{ login: 'stephen', name: 'Stephen Mann' },
{ login: 'ana', name: 'Ana Koval' },
]
export const DEMO_DIRECTIVES: DirectiveRecord[] = [
{ seq: 1, id: 'demo-1', ts: '2026-02-26T10:00:00Z', status: 'accepted', kind: 'reprioritize',
quote: 'Bump the lifecycle fix — its blocking the board.', target: { issue: 42 }, params: { priority: 1 },
rationale: 'Board columns are wrong until #42 lands.' },
{ seq: 2, id: 'demo-2', ts: '2026-02-24T15:00:00Z', status: 'accepted', kind: 'capacity',
quote: 'Stephens at 60% this sprint — half on support.', params: { person: 'stephen', focusFactor: 0.6 },
rationale: 'Support rotation.' },
{ seq: 3, id: 'demo-3', ts: '2026-02-22T09:00:00Z', status: 'amended', kind: 'set-deadline',
quote: 'Beta ships the 12th, hard.', target: { milestone: 1 }, params: { due: '2026-03-12' } },
]
/** The full gitea-shaped snapshot the reconcile handlers return in demo mode. */
export const DEMO_SNAPSHOT = {
issues: DEMO_ISSUES,
milestones: DEMO_MILESTONES,
deps: DEMO_DEPS,
timelines: DEMO_TIMELINES,
}

View File

@@ -33,6 +33,18 @@ import {
} from '@commitea/core' } from '@commitea/core'
import { ipcMain } from 'electron' import { ipcMain } from 'electron'
import {
DEMO_CAPACITY,
DEMO_COLLABORATORS,
DEMO_DIRECTIVES,
DEMO_SNAPSHOT,
DEMO_TODAY,
} from './demo-snapshot.js'
/** Demo mode: the e2e harness (and a no-token first look) render the fixed demo
* snapshot through the real view builders — no live gitea, no screen-level mocks. */
const isDemo = (): boolean => process.env.COMMITEA_E2E === '1'
import { type AppConfig, clearConfig, loadConfig, publicConfig, saveConfig } from './config-store.js' import { type AppConfig, clearConfig, loadConfig, publicConfig, saveConfig } from './config-store.js'
import { loadSnapshot, saveSnapshot } from './snapshot-store.js' import { loadSnapshot, saveSnapshot } from './snapshot-store.js'
@@ -241,12 +253,14 @@ export function registerGiteaIpc(): void {
// Instant boot: the last persisted snapshot, shown before the fresh reconcile lands. // Instant boot: the last persisted snapshot, shown before the fresh reconcile lands.
ipcMain.handle('gitea:boot', () => { ipcMain.handle('gitea:boot', () => {
if (isDemo()) return { configured: true, cached: true, ...DEMO_SNAPSHOT, savedAt: DEMO_TODAY }
if (!getGiteaClient()) return { configured: false } if (!getGiteaClient()) return { configured: false }
const persisted = bootSnapshot() const persisted = bootSnapshot()
return persisted ? { configured: true, cached: true, ...persisted } : { configured: true, cached: false } return persisted ? { configured: true, cached: true, ...persisted } : { configured: true, cached: false }
}) })
ipcMain.handle('gitea:reconcile', async () => { ipcMain.handle('gitea:reconcile', async () => {
if (isDemo()) return { configured: true, stale: false, ...DEMO_SNAPSHOT }
const client = getGiteaClient() const client = getGiteaClient()
if (!client) return { configured: false, issues: [], milestones: [], deps: [], timelines: {} } if (!client) return { configured: false, issues: [], milestones: [], deps: [], timelines: {} }
try { try {
@@ -316,6 +330,7 @@ export function registerGiteaIpc(): void {
// Read the directive ledger from the pm-state repo (for the Directives screen). // Read the directive ledger from the pm-state repo (for the Directives screen).
ipcMain.handle('pmstate:directives', async () => { ipcMain.handle('pmstate:directives', async () => {
if (isDemo()) return { ok: true as const, directives: DEMO_DIRECTIVES }
const pm = getPmStateClient() const pm = getPmStateClient()
if (!pm) return { ok: false as const, reason: 'unconfigured' as const } if (!pm) return { ok: false as const, reason: 'unconfigured' as const }
try { try {
@@ -327,6 +342,7 @@ export function registerGiteaIpc(): void {
// Read the capacity config from the pm-state repo (for capacity-aware forecasts). // Read the capacity config from the pm-state repo (for capacity-aware forecasts).
ipcMain.handle('pmstate:capacity', async () => { ipcMain.handle('pmstate:capacity', async () => {
if (isDemo()) return { ok: true as const, members: DEMO_CAPACITY }
const pm = getPmStateClient() const pm = getPmStateClient()
if (!pm) return { ok: false as const, reason: 'unconfigured' as const, members: [] } if (!pm) return { ok: false as const, reason: 'unconfigured' as const, members: [] }
try { try {
@@ -338,6 +354,7 @@ export function registerGiteaIpc(): void {
// Assignable people (repo collaborators) for the Adjust dialog's assignee picker. // Assignable people (repo collaborators) for the Adjust dialog's assignee picker.
ipcMain.handle('gitea:collaborators', async () => { ipcMain.handle('gitea:collaborators', async () => {
if (isDemo()) return DEMO_COLLABORATORS
const client = getGiteaClient() const client = getGiteaClient()
if (!client) return [] if (!client) return []
try { try {

View File

@@ -1,17 +1,17 @@
import React from 'react' import React from 'react'
import { COLUMNS, type BoardColumn, type BoardIssue, type DepsData, type GanttData, type IssueRef } from '../../data/fixtures.js' import { type BoardColumn, type BoardIssue, type DepsData, type GanttData, type IssueRef } from '../../data/view-types.js'
import { Card, Tag, Badge, Tabs, IconButton, Input, Icon } from '../ui/index.js' import { Card, Tag, Badge, Tabs, IconButton, Input, Icon } from '../ui/index.js'
import { EmptyState } from '../shell/states.js' import { EmptyState } from '../shell/states.js'
import { GanttView } from './gantt-view.js' import { GanttView } from './gantt-view.js'
import { DepsGraph } from './deps-graph.js' import { DepsGraph } from './deps-graph.js'
// Board — kanban over inferred lifecycle, with Gantt/Dependencies stubs. // Board — kanban over inferred lifecycle, with Gantt/Dependencies stubs.
// `columns` defaults to demo fixtures; the shell passes real reconciled data // `columns` arrives from the shell as real reconciled data when gitea is
// when gitea is configured. `loading` covers the first reconcile. // configured. `loading` covers the first reconcile.
export function BoardScreen({ export function BoardScreen({
onOpenIssue, onOpenIssue,
columns = COLUMNS, columns,
gantt, gantt,
deps, deps,
loading = false, loading = false,
@@ -24,10 +24,12 @@ export function BoardScreen({
}) { }) {
const [tab, setTab] = React.useState('board'); const [tab, setTab] = React.useState('board');
const [query, setQuery] = React.useState(''); const [query, setQuery] = React.useState('');
const cols = columns ?? [];
const q = query.trim().toLowerCase(); const q = query.trim().toLowerCase();
const filtered = columns.map((c) => ({ ...c, issues: q ? c.issues.filter((i) => (i.title + ' #' + i.id).toLowerCase().includes(q)) : c.issues })); const filtered = cols.map((c) => ({ ...c, issues: q ? c.issues.filter((i) => (i.title + ' #' + i.id).toLowerCase().includes(q)) : c.issues }));
const anyMatch = filtered.some((c) => c.issues.length > 0); const anyMatch = filtered.some((c) => c.issues.length > 0);
const openCount = columns.reduce((n, c) => n + (c.id === 'done' ? 0 : c.issues.length), 0); const openCount = cols.reduce((n, c) => n + (c.id === 'done' ? 0 : c.issues.length), 0);
const totalIssues = cols.reduce((n, c) => n + c.issues.length, 0);
const IssueCard = ({ issue }: { issue: BoardIssue }) => ( const IssueCard = ({ issue }: { issue: BoardIssue }) => (
<div <div
@@ -75,6 +77,10 @@ export function BoardScreen({
<Icon name="loader-circle" size={16} /> <Icon name="loader-circle" size={16} />
<span style={{ font: 'var(--text-small)' }}>Reconciling with gitea</span> <span style={{ font: 'var(--text-small)' }}>Reconciling with gitea</span>
</div> </div>
) : totalIssues === 0 ? (
<div style={{ flex: 1, border: '1px dashed var(--line-2)', borderRadius: 'var(--radius-3)' }}>
<EmptyState icon="inbox" title="The pot is empty" line="Nothing in the backlog yet." />
</div>
) : anyMatch ? ( ) : anyMatch ? (
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 12, alignItems: 'start', flex: 1, minHeight: 0, overflow: 'auto' }}> <div style={{ display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 12, alignItems: 'start', flex: 1, minHeight: 0, overflow: 'auto' }}>
{filtered.map((col) => ( {filtered.map((col) => (
@@ -90,7 +96,7 @@ export function BoardScreen({
) : ( ) : (
<div style={{ flex: 1, border: '1px dashed var(--line-2)', borderRadius: 'var(--radius-3)' }}> <div style={{ flex: 1, border: '1px dashed var(--line-2)', borderRadius: 'var(--radius-3)' }}>
<EmptyState icon="search" title="Nothing by that name" <EmptyState icon="search" title="Nothing by that name"
line={`The pot holds ${columns.reduce((n, c) => n + c.issues.length, 0)} issues; none of them answer to “${query.trim()}”.`} /> line={`The pot holds ${totalIssues} issues; none of them answer to “${query.trim()}”.`} />
</div> </div>
) )
) : tab === 'deps' ? ( ) : tab === 'deps' ? (

View File

@@ -1,12 +1,24 @@
import React from 'react' import React from 'react'
import { CALIBRATION, type CalibrationData } from '../../data/fixtures.js' import { type CalibrationData } from '../../data/view-types.js'
import { EmptyState } from '../shell/states.js'
import { Badge, Card, Icon } from '../ui/index.js' import { Badge, Card, Icon } from '../ui/index.js'
// Calibration report — estimate-vs-actual evidence behind the cones. // Calibration report — estimate-vs-actual evidence behind the cones.
// `data` (real fit from closed-issue actuals) overrides the demo fixture. // `data` (real fit from closed-issue actuals) drives the whole view.
export function CalibrationScreen({ onBack, data }: { onBack: () => void; data?: CalibrationData }) { export function CalibrationScreen({ onBack, data }: { onBack: () => void; data?: CalibrationData }) {
const c = data ?? CALIBRATION if (!data) {
return (
<EmptyState
icon="ruler"
title="Not enough history"
line="Close a few issues and I'll calibrate to your team's actuals."
action="Runway"
onAction={onBack}
/>
)
}
const c = data
// scatter chart geometry // scatter chart geometry
const W = 420, const W = 420,

View File

@@ -1,11 +1,15 @@
import React from 'react' import React from 'react'
import { DEPS, type DepsData, type IssueRef } from '../../data/fixtures.js' import { type DepsData, type IssueRef } from '../../data/view-types.js'
import { Tag, Icon } from '../ui/index.js' import { Tag, Icon } from '../ui/index.js'
import { EmptyState } from '../shell/states.js'
// Dependency graph drill-in — layered DAG, critical path in spruce // Dependency graph drill-in — layered DAG, critical path in spruce
export function DepsGraph({ onOpenIssue, data }: { onOpenIssue: (issue: IssueRef) => void; data?: DepsData }) { export function DepsGraph({ onOpenIssue, data }: { onOpenIssue: (issue: IssueRef) => void; data?: DepsData }) {
const g = data ?? DEPS if (!data || data.nodes.length === 0) {
return <EmptyState icon="share-2" title="No dependencies" line="Nothing blocks anything yet." />
}
const g = data
const PAD = 14, COLW = 206, ROWH = 106, NW = 176, NH = 84 const PAD = 14, COLW = 206, ROWH = 106, NW = 176, NH = 84
const X = (c: number) => PAD + c * COLW const X = (c: number) => PAD + c * COLW
@@ -36,7 +40,7 @@ export function DepsGraph({ onOpenIssue, data }: { onOpenIssue: (issue: IssueRef
diagnosis: { icon: 'circle-dashed', color: 'var(--ink-3)', label: 'diagnosis' }, diagnosis: { icon: 'circle-dashed', color: 'var(--ink-3)', label: 'diagnosis' },
} }
const Node = ({ n }: { n: (typeof DEPS.nodes)[number] }) => { const Node = ({ n }: { n: DepsData['nodes'][number] }) => {
const st = STATES[n.state] const st = STATES[n.state]
const crit = g.critical.includes(n.id) const crit = g.critical.includes(n.id)
return ( return (
@@ -121,10 +125,6 @@ export function DepsGraph({ onOpenIssue, data }: { onOpenIssue: (issue: IssueRef
</div> </div>
</div> </div>
</div> </div>
<p style={{ font: 'var(--text-agent)', color: 'var(--ink-2)', margin: 0 }}>
Four issues sit on the critical path, and #87 is the cork in the bottle. Remove it and everything pours.
</p>
</div> </div>
) )
} }

View File

@@ -1,133 +1,124 @@
import React from 'react' import React from 'react'
import { DIRECTIVES, type DirectivePending, type DirectiveEntry } from '../../data/fixtures.js' import { Badge, Card, Icon } from '../ui/index.js'
import { Card, Button, Badge, Icon } from '../ui/index.js' import { EmptyState } from '../shell/states.js'
// Directive log — append-only ledger + the consequence diff (propose-approve) /** A ledger row, projected from a live DirectiveRecord. */
interface LedgerEntry {
seq: number
when: string
what: string
why: string
kind: string
status: 'applied' | 'amended' | 'withdrawn' | 'proposed'
}
const STATUS_BADGE: Record<LedgerEntry['status'], { tone: 'ok' | 'neutral' | 'info'; label: string }> = {
applied: { tone: 'ok', label: 'applied' },
amended: { tone: 'info', label: 'amended' },
withdrawn: { tone: 'neutral', label: 'withdrawn' },
proposed: { tone: 'info', label: 'proposed' },
}
/**
* Directive ledger — the append-only record of every time a human overruled the
* scheduler (who/when/what/why), read live from the pm-state repo. Directives are
* given in chat and recorded here; this screen only reads them.
*/
export function DirectivesScreen() { export function DirectivesScreen() {
const [pending, setPending] = React.useState<DirectivePending | null>(DIRECTIVES.pending) const [entries, setEntries] = React.useState<LedgerEntry[] | null>(null) // null = loading
const [entries, setEntries] = React.useState<DirectiveEntry[]>(DIRECTIVES.entries)
// Real ledger from the pm-state repo, when it exists — else the fixture demo.
React.useEffect(() => { React.useEffect(() => {
let alive = true let alive = true
window.commitea.pmstate window.commitea.pmstate
.directives() .directives()
.then((r) => { .then((r) => {
if (!alive || !r.ok || r.directives.length === 0) return if (!alive) return
setPending(null) if (!r.ok) {
setEntries([])
return
}
setEntries( setEntries(
r.directives r.directives
.slice() .slice()
.reverse() .reverse() // newest first
.map((d) => ({ .map((d) => ({
seq: d.seq, seq: d.seq,
who: 'You',
when: new Date(d.ts).toLocaleDateString(), when: new Date(d.ts).toLocaleDateString(),
what: d.quote, what: d.quote,
why: d.rationale ?? '', why: d.rationale ?? '',
status: d.status === 'accepted' ? 'applied' : d.status === 'withdrawn' ? 'withdrawn' : 'superseded', kind: d.kind,
consequence: '', status:
d.status === 'accepted'
? 'applied'
: d.status === 'amended'
? 'amended'
: d.status === 'withdrawn'
? 'withdrawn'
: 'proposed',
})), })),
) )
}) })
.catch(() => {}) .catch(() => {
if (alive) setEntries([])
})
return () => { return () => {
alive = false alive = false
} }
}, []) }, [])
const resolve = (status: string) => {
setEntries((e) => [{
seq: pending!.seq, who: pending!.who, when: pending!.when, what: pending!.what, why: 'pilot demo on the 14th',
status, consequence: status === 'applied' ? '#78 +5d · Beta 80% Mar 514' : 'withdrawn before apply',
}, ...e]);
setPending(null);
};
const toneColor: Record<string, string> = { ok: 'var(--ok)', warn: 'var(--warn)', info: 'var(--info)', danger: 'var(--danger)' };
const statusBadge: Record<string, { tone: 'ok' | 'neutral' | 'info'; label: string }> = {
applied: { tone: 'ok', label: 'applied' },
withdrawn: { tone: 'neutral', label: 'withdrawn' },
superseded: { tone: 'info', label: 'superseded' },
};
return ( return (
<div style={{ maxWidth: 760, margin: '0 auto', display: 'flex', flexDirection: 'column', gap: 16 }}> <div style={{ maxWidth: 760, margin: '0 auto', display: 'flex', flexDirection: 'column', gap: 16 }}>
<header style={{ borderBottom: 'var(--rule-double)', paddingBottom: 14 }}> <header style={{ borderBottom: 'var(--rule-double)', paddingBottom: 14 }}>
<h1 style={{ font: 'var(--text-display)', color: 'var(--ink-1)', margin: 0 }}>Directives</h1> <h1 style={{ font: 'var(--text-display)', color: 'var(--ink-1)', margin: 0 }}>Directives</h1>
<p style={{ font: 'var(--text-data)', color: 'var(--ink-3)', margin: '6px 0 0' }}>append-only · JSONL in pm-state · who, when, what, why</p> <p style={{ font: 'var(--text-data)', color: 'var(--ink-3)', margin: '6px 0 0' }}>
append-only · JSONL in pm-state · who, when, what, why
</p>
</header> </header>
{pending ? ( {entries === null ? null : entries.length === 0 ? (
<Card overline={`Awaiting your word · directive #00${pending.seq}`} title="Consequence diff" jade <EmptyState
footer={<> icon="flag"
<Button onClick={() => resolve('applied')}>Make it so</Button> title="No directives yet"
<Button variant="secondary" onClick={() => {}}>Amend</Button> line="When you overrule the scheduler in chat, it goes on the record here — who, when, what, why."
<Button variant="ghost" onClick={() => resolve('withdrawn')}>Withdraw</Button> />
</>}>
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
<p style={{ font: 'var(--text-body)', margin: 0, color: 'var(--ink-2)' }}>
<span style={{ font: 'var(--text-body-strong)', color: 'var(--ink-1)' }}>{pending.who}</span>
<span style={{ font: '400 11.5px var(--font-mono)', color: 'var(--ink-3)' }}> · {pending.when}</span>
<br />{pending.what}
</p>
<div style={{ borderTop: '1px solid var(--line-1)' }}>
{pending.diff.map((r) => (
<div key={r.change} style={{ display: 'flex', alignItems: 'center', gap: 10, padding: '9px 0', borderBottom: '1px solid var(--line-1)' }}>
<span style={{ width: 7, height: 7, borderRadius: '50%', background: toneColor[r.tone], flexShrink: 0 }}></span>
<span style={{ font: 'var(--text-small)', color: 'var(--ink-1)', flex: 1 }}>{r.change}</span>
<span style={{ font: '400 12px var(--font-mono)', color: 'var(--ink-3)', whiteSpace: 'nowrap' }}>
{r.from} <span style={{ color: 'var(--ink-2)' }}></span> <span style={{ color: r.tone === 'warn' ? 'var(--warn)' : 'var(--ink-1)' }}>{r.to}</span>
</span>
</div>
))}
</div>
<p style={{ font: 'var(--text-agent)', color: 'var(--ink-2)', margin: 0 }}>
Cheap, as consequences go. Shall I make it so?
</p>
</div>
</Card>
) : ( ) : (
<div style={{ display: 'flex', alignItems: 'center', gap: 8, font: 'var(--text-small)', color: 'var(--ink-3)', padding: '2px 2px' }}>
<Icon name="circle-check" size={14} style={{ color: 'var(--ok)' }} />
Nothing awaits your word. Directives are given in chat; consequences appear here first.
</div>
)}
<Card overline="The ledger" flush> <Card overline="The ledger" flush>
<div> <div>
{entries.map((e, i) => { {entries.map((e, i) => {
const sb = statusBadge[e.status]; const sb = STATUS_BADGE[e.status]
return ( return (
<div key={e.seq} style={{ display: 'flex', gap: 14, padding: '14px 20px', borderTop: i === 0 ? 'none' : '1px solid var(--line-1)' }}> <div
key={e.seq}
style={{ display: 'flex', gap: 14, padding: '14px 20px', borderTop: i === 0 ? 'none' : '1px solid var(--line-1)' }}
>
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 6, flexShrink: 0 }}> <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 6, flexShrink: 0 }}>
<span style={{ font: '500 11px var(--font-mono)', color: 'var(--ink-3)' }}>#00{e.seq}</span> <span style={{ font: '500 11px var(--font-mono)', color: 'var(--ink-3)' }}>#{String(e.seq).padStart(3, '0')}</span>
<span style={{ width: 1, flex: 1, background: 'var(--line-1)' }}></span> <span style={{ width: 1, flex: 1, background: 'var(--line-1)' }} />
</div> </div>
<div style={{ flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column', gap: 5 }}> <div style={{ flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column', gap: 5 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' }}> <div style={{ display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' }}>
<span style={{ <Badge>{e.kind}</Badge>
width: 20, height: 20, borderRadius: '50%', background: 'var(--spruce-2)', color: 'var(--accent-text)',
font: '600 8.5px/20px var(--font-sans)', textAlign: 'center', flexShrink: 0,
}}>{e.who.split(' ').map((w: string) => w[0]).join('')}</span>
<span style={{ font: 'var(--text-body-strong)', color: 'var(--ink-1)', whiteSpace: 'nowrap' }}>{e.who}</span>
<span style={{ font: '400 11px var(--font-mono)', color: 'var(--ink-3)', whiteSpace: 'nowrap' }}>{e.when}</span> <span style={{ font: '400 11px var(--font-mono)', color: 'var(--ink-3)', whiteSpace: 'nowrap' }}>{e.when}</span>
{e.why ? <span style={{ font: '400 11px var(--font-mono)', color: 'var(--ink-3)', whiteSpace: 'nowrap' }}>· why: {e.why}</span> : null} {e.why ? (
<span style={{ marginLeft: 'auto' }}><Badge tone={sb.tone}>{sb.label}</Badge></span> <span style={{ font: '400 11px var(--font-mono)', color: 'var(--ink-3)', whiteSpace: 'nowrap' }}>· why: {e.why}</span>
) : null}
<span style={{ marginLeft: 'auto' }}>
<Badge tone={sb.tone}>{sb.label}</Badge>
</span>
</div> </div>
<p style={{ font: 'var(--text-body)', color: 'var(--ink-1)', margin: 0 }}>{e.what}</p> <p style={{ font: 'var(--text-body)', color: 'var(--ink-1)', margin: 0 }}>{e.what}</p>
<p style={{ font: '400 11.5px var(--font-mono)', color: 'var(--ink-2)', margin: 0 }}>{e.consequence}</p>
</div> </div>
</div> </div>
); )
})} })}
</div> </div>
</Card> </Card>
)}
<p style={{ font: 'var(--text-caption)', color: 'var(--ink-3)', margin: 0 }}> <p style={{ font: 'var(--text-caption)', color: 'var(--ink-3)', margin: 0 }}>
Entries are never edited. Corrections are new entries the ledger remembers everything, politely. Entries are never edited. Corrections are new entries the ledger remembers everything, politely.
</p> </p>
</div> </div>
); )
} }

View File

@@ -1,8 +1,9 @@
import React from 'react' import React from 'react'
import { FOCUS, type FocusIssue, type IssueRef, TODAY } from '../../data/fixtures.js' import { type FocusIssue, type IssueRef } from '../../data/view-types.js'
import { type ForecastView, type FocusView } from '../../lib/backlog.js' import { type ForecastView, type FocusView } from '../../lib/backlog.js'
import { BurnUpCone } from '../charts/chart.js' import { BurnUpCone } from '../charts/chart.js'
import { EmptyState } from '../shell/states.js'
import { Badge, Button, Card, IconButton, Tag } from '../ui/index.js' import { Badge, Button, Card, IconButton, Tag } from '../ui/index.js'
/** /**
@@ -19,7 +20,6 @@ export function FocusScreen({
focus?: FocusView focus?: FocusView
forecast?: ForecastView forecast?: ForecastView
}) { }) {
const view: FocusView = focus ?? { now: FOCUS.now, next: FOCUS.next, later: FOCUS.later }
const FocusRow = ({ slot, issue, jade }: { slot: string; issue: FocusIssue; jade?: boolean }) => ( const FocusRow = ({ slot, issue, jade }: { slot: string; issue: FocusIssue; jade?: boolean }) => (
<Card <Card
overline={slot} overline={slot}
@@ -66,6 +66,16 @@ export function FocusScreen({
</Card> </Card>
) )
if (!focus) {
return (
<EmptyState
icon="coffee"
title="Nothing to pour"
line="Capture some work, or enjoy the silence — it never lasts."
/>
)
}
return ( return (
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}> <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
<header <header
@@ -80,41 +90,31 @@ export function FocusScreen({
> >
<div> <div>
<h1 style={{ font: 'var(--text-display)', color: 'var(--ink-1)', margin: 0 }}>Morning service</h1> <h1 style={{ font: 'var(--text-display)', color: 'var(--ink-1)', margin: 0 }}>Morning service</h1>
<p style={{ font: 'var(--text-data)', color: 'var(--ink-3)', margin: '6px 0 0', whiteSpace: 'nowrap' }}>
{TODAY} · reconcile 3.2s
</p>
</div> </div>
<Badge tone="ok" dot>
ahead of forecast
</Badge>
</header> </header>
<div style={{ display: 'grid', gridTemplateColumns: '1.4fr 1fr 1fr', gap: 14, alignItems: 'start' }}> <div style={{ display: 'grid', gridTemplateColumns: '1.4fr 1fr 1fr', gap: 14, alignItems: 'start' }}>
{view.now ? <FocusRow slot="Now" issue={view.now} jade /> : null} {focus.now ? <FocusRow slot="Now" issue={focus.now} jade /> : null}
{view.next ? <FocusRow slot="Next" issue={view.next} /> : null} {focus.next ? <FocusRow slot="Next" issue={focus.next} /> : null}
{view.later ? <FocusRow slot="Later" issue={view.later} /> : null} {focus.later ? <FocusRow slot="Later" issue={focus.later} /> : null}
</div> </div>
{forecast ? (
<Card <Card
overline={forecast ? 'Backlog · open scope' : 'Milestone · Beta'} overline="Backlog · open scope"
title={ title={
forecast ? (
<>80% of the open backlog lands by <span style={{ whiteSpace: 'nowrap' }}>{forecast.rangeLabel}</span></> <>80% of the open backlog lands by <span style={{ whiteSpace: 'nowrap' }}>{forecast.rangeLabel}</span></>
) : (
<>80% this lands <span style={{ whiteSpace: 'nowrap' }}>Mar 312</span></>
)
} }
actions={<IconButton icon="chart-line" label="Open runway" size="sm" />} actions={<IconButton icon="chart-line" label="Open runway" size="sm" />}
> >
<BurnUpCone data={forecast?.cone} /> <BurnUpCone data={forecast.cone} />
<p style={{ font: 'var(--text-agent)', color: 'var(--ink-2)', margin: '10px 0 0' }}> <p style={{ font: 'var(--text-agent)', color: 'var(--ink-2)', margin: '10px 0 0' }}>
{forecast {forecast.coldStart
? forecast.coldStart
? `${forecast.scope} open ${forecast.scope === 1 ? 'issue' : 'issues'} in scope. Cold-start priors — ${forecast.calibratedN}/20 estimated closes so far; the cone tightens as the team closes work.` ? `${forecast.scope} open ${forecast.scope === 1 ? 'issue' : 'issues'} in scope. Cold-start priors — ${forecast.calibratedN}/20 estimated closes so far; the cone tightens as the team closes work.`
: `${forecast.scope} open ${forecast.scope === 1 ? 'issue' : 'issues'} in scope, calibrated on ${forecast.calibratedN} closed ${forecast.calibratedN === 1 ? 'issue' : 'issues'} of your own.` : `${forecast.scope} open ${forecast.scope === 1 ? 'issue' : 'issues'} in scope, calibrated on ${forecast.calibratedN} closed ${forecast.calibratedN === 1 ? 'issue' : 'issues'} of your own.`}
: 'The cone has narrowed since Friday. Im quietly pleased.'}
</p> </p>
</Card> </Card>
) : null}
</div> </div>
) )
} }

View File

@@ -1,11 +1,15 @@
import React from 'react' import React from 'react'
import { GANTT, type GanttData, type IssueRef } from '../../data/fixtures.js' import { type GanttData, type IssueRef } from '../../data/view-types.js'
import { EmptyState } from '../shell/states.js'
import { Icon } from '../ui/index.js' import { Icon } from '../ui/index.js'
// Gantt drill-in — scheduler-derived bars, critical chain, 80% forecast tails // Gantt drill-in — scheduler-derived bars, critical chain, 80% forecast tails
export function GanttView({ onOpenIssue, data }: { onOpenIssue: (issue: IssueRef) => void; data?: GanttData }) { export function GanttView({ onOpenIssue, data }: { onOpenIssue: (issue: IssueRef) => void; data?: GanttData }) {
const g = data ?? GANTT; if (!data || data.rows.length === 0) {
return <EmptyState icon="calendar" title="No schedule yet" line="Estimates and milestones will fill this in." />;
}
const g = data;
const LABELW = 232, DAYW = 21, ROWH = 36, HEADH = 30; const LABELW = 232, DAYW = 21, ROWH = 36, HEADH = 30;
const chartW = g.days * DAYW; const chartW = g.days * DAYW;
@@ -96,10 +100,6 @@ export function GanttView({ onOpenIssue, data }: { onOpenIssue: (issue: IssueRef
})} })}
</div> </div>
</div> </div>
<p style={{ font: 'var(--text-agent)', color: 'var(--ink-2)', margin: 0 }}>
The path holds if #87 lands by Wednesday. The dotted tails are your own history, wagging.
</p>
</div> </div>
); );
} }

View File

@@ -1,6 +1,7 @@
import React from 'react' import React from 'react'
import { INBOX, type InboxItem, type IssueRef } from '../../data/fixtures.js' import { type InboxItem, type IssueRef } from '../../data/view-types.js'
import { EmptyState } from '../shell/states.js'
import { Button, Card, Icon, Tabs } from '../ui/index.js' import { Button, Card, Icon, Tabs } from '../ui/index.js'
// Inbox — Reginald only rings the bell when it matters // Inbox — Reginald only rings the bell when it matters
@@ -17,9 +18,14 @@ export function InboxScreen({
setReadIds: React.Dispatch<React.SetStateAction<number[]>> setReadIds: React.Dispatch<React.SetStateAction<number[]>>
data?: InboxItem[] data?: InboxItem[]
}) { }) {
const all = data ?? INBOX
const [tab, setTab] = React.useState('all') const [tab, setTab] = React.useState('all')
if (!data || data.length === 0) {
return <EmptyState icon="bell" title="Inbox zero" line="Nothing needs your eyes right now." />
}
const all = data
const isRead = (n: InboxItem) => !n.unread || readIds.includes(n.id) const isRead = (n: InboxItem) => !n.unread || readIds.includes(n.id)
const unreadCount = all.filter((n) => !isRead(n)).length const unreadCount = all.filter((n) => !isRead(n)).length

View File

@@ -10,7 +10,7 @@ import {
summarizeChange, summarizeChange,
} from '@commitea/core' } from '@commitea/core'
import { ISSUE_DETAIL, type IssueDetail, type IssueRef } from '../../data/fixtures.js' import { type IssueDetail, type IssueRef } from '../../data/view-types.js'
import { Badge, Button, Card, Dialog, Icon, Select, Tag } from '../ui/index.js' import { Badge, Button, Card, Dialog, Icon, Select, Tag } from '../ui/index.js'
const NONE = '—' const NONE = '—'
@@ -38,7 +38,7 @@ export function IssueScreen({
currentAssignee?: string | null currentAssignee?: string | null
currentMilestoneId?: number | null currentMilestoneId?: number | null
}) { }) {
const det: IssueDetail = detail ?? ISSUE_DETAIL[issue.id] ?? { const det: IssueDetail = detail ?? {
state: 'triage', state: 'triage',
assignee: 'Stephen', assignee: 'Stephen',
milestone: 'Beta', milestone: 'Beta',

View File

@@ -1,12 +1,12 @@
import React from 'react' import React from 'react'
import { COLUMNS, type IssueRef } from '../../data/fixtures.js' import { type IssueRef } from '../../data/view-types.js'
import { type MilestoneView } from '../../lib/backlog.js' import { type MilestoneView } from '../../lib/backlog.js'
import { BurnUpCone } from '../charts/chart.js' import { BurnUpCone } from '../charts/chart.js'
import { EmptyState } from '../shell/states.js'
import { Badge, Button, Card, Icon, Tag } from '../ui/index.js' import { Badge, Button, Card, Icon, Tag } from '../ui/index.js'
// Milestone detail — scope, cone, issues; forecasts stay ranges. // Milestone detail — scope, cone, issues; forecasts stay ranges.
// `data` (real milestone forecast) overrides the demo fixture when present.
export function MilestoneScreen({ export function MilestoneScreen({
onBack, onBack,
onOpenIssue, onOpenIssue,
@@ -16,28 +16,24 @@ export function MilestoneScreen({
onOpenIssue: (issue: IssueRef) => void onOpenIssue: (issue: IssueRef) => void
data?: MilestoneView data?: MilestoneView
}) { }) {
const cols = COLUMNS if (!data) {
const byState = (ids: number[]) => return (
cols.flatMap((c) => c.issues.map((i) => ({ ...i, col: c.label }))).filter((i) => ids.includes(i.id)) <EmptyState
icon="flag"
title="Milestone not found"
line="It may have closed or been renamed."
action="Back to Runway"
onAction={onBack}
/>
)
}
const fixtureGroups = [ const groups = data.groups.map((g) => ({ label: g.label, issues: g.issues, muted: g.label === 'Done' }))
{ label: 'Steeping', issues: byState([87, 84]) }, const name = data.name
{ label: 'In review', issues: byState([92]) }, const dueLine = `milestone · due ${data.due} · ${data.soft ? 'soft — scope may flex' : 'hard deadline'}`
{ label: 'Queued', issues: byState([102, 103, 99, 96, 78]) }, const forecastLabel = data.forecastRange ? `80% ${data.forecastRange}` : 'all shipped'
{ label: 'Done', issues: byState([71, 69, 65]), muted: true }, const scopeStat = `${data.scopeCount} issues · est ${data.scopeEstDays}d`
] const doneStat = `${data.doneCount} · ${data.donePct}%`
// real or demo, in one shape the render loop understands
const groups = data
? data.groups.map((g) => ({ label: g.label, issues: g.issues, muted: g.label === 'Done' }))
: fixtureGroups
const name = data ? data.name : 'Beta'
const dueLine = data
? `milestone · due ${data.due} · ${data.soft ? 'soft — scope may flex' : 'hard deadline'}`
: 'milestone · due Mar 15 · soft — scope may flex'
const forecastLabel = data ? (data.forecastRange ? `80% ${data.forecastRange}` : 'all shipped') : '80% Mar 312'
const scopeStat = data ? `${data.scopeCount} issues · est ${data.scopeEstDays}d` : '42 issues · est 61d'
const doneStat = data ? `${data.doneCount} · ${data.donePct}%` : '24 · 57%'
const Stat = ({ label, value, tone }: { label: string; value: string; tone?: string }) => ( const Stat = ({ label, value, tone }: { label: string; value: string; tone?: string }) => (
<div style={{ flex: 1, padding: '12px 18px', borderRight: '1px solid var(--line-1)' }}> <div style={{ flex: 1, padding: '12px 18px', borderRight: '1px solid var(--line-1)' }}>
@@ -62,7 +58,7 @@ export function MilestoneScreen({
</p> </p>
<h1 style={{ font: 'var(--text-display)', color: 'var(--ink-1)', margin: 0 }}>{name}</h1> <h1 style={{ font: 'var(--text-display)', color: 'var(--ink-1)', margin: 0 }}>{name}</h1>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginTop: 10 }}> <div style={{ display: 'flex', alignItems: 'center', gap: 8, marginTop: 10 }}>
<Badge tone="ok" dot>{data ? `${data.doneCount}/${data.scopeCount} done` : 'ahead of forecast'}</Badge> <Badge tone="ok" dot>{`${data.doneCount}/${data.scopeCount} done`}</Badge>
<span style={{ font: '400 12px var(--font-mono)', color: 'var(--ink-2)', whiteSpace: 'nowrap' }}>{forecastLabel}</span> <span style={{ font: '400 12px var(--font-mono)', color: 'var(--ink-2)', whiteSpace: 'nowrap' }}>{forecastLabel}</span>
</div> </div>
</div> </div>
@@ -78,20 +74,18 @@ export function MilestoneScreen({
<Stat label="Forecast" value={forecastLabel} /> <Stat label="Forecast" value={forecastLabel} />
<div style={{ flex: 1, padding: '12px 18px' }}> <div style={{ flex: 1, padding: '12px 18px' }}>
<div style={{ font: 'var(--text-overline)', letterSpacing: 'var(--letter-spacing-wide)', textTransform: 'uppercase', color: 'var(--ink-3)', marginBottom: 5 }}>Remaining</div> <div style={{ font: 'var(--text-overline)', letterSpacing: 'var(--letter-spacing-wide)', textTransform: 'uppercase', color: 'var(--ink-3)', marginBottom: 5 }}>Remaining</div>
<div style={{ font: '500 14px var(--font-mono)', color: 'var(--ink-1)', whiteSpace: 'nowrap' }}>{data ? `${data.scopeCount - data.doneCount} open` : '2d · cone narrowed'}</div> <div style={{ font: '500 14px var(--font-mono)', color: 'var(--ink-1)', whiteSpace: 'nowrap' }}>{`${data.scopeCount - data.doneCount} open`}</div>
</div> </div>
</div> </div>
</Card> </Card>
<div style={{ display: 'grid', gridTemplateColumns: '1.2fr 1fr', gap: 14, alignItems: 'start' }}> <div style={{ display: 'grid', gridTemplateColumns: '1.2fr 1fr', gap: 14, alignItems: 'start' }}>
<Card overline="Burn-up" title={<>80% this lands <span style={{ whiteSpace: 'nowrap' }}>{data ? (data.forecastRange ?? 'shipped') : 'Mar 312'}</span></>} jade> <Card overline="Burn-up" title={<>80% this lands <span style={{ whiteSpace: 'nowrap' }}>{data.forecastRange ?? 'shipped'}</span></>} jade>
<BurnUpCone data={data?.cone ?? undefined} /> <BurnUpCone data={data.cone ?? undefined} />
<p style={{ font: 'var(--text-agent)', color: 'var(--ink-2)', margin: '10px 0 0' }}> <p style={{ font: 'var(--text-agent)', color: 'var(--ink-2)', margin: '10px 0 0' }}>
{data {data.cone
? data.cone
? `${data.scopeCount - data.doneCount} open of ${data.scopeCount}. Cone over what's left.` ? `${data.scopeCount - data.doneCount} open of ${data.scopeCount}. Cone over what's left.`
: 'Everything here has shipped.' : 'Everything here has shipped.'}
: 'Comfortably ahead. Beta needs #87 more than it needs my commentary.'}
</p> </p>
</Card> </Card>

View File

@@ -4,7 +4,8 @@ import { type CapacityMember, capacityPerWorkday } from '@commitea/core'
import { RunwayBar } from '../charts/chart.js' import { RunwayBar } from '../charts/chart.js'
import { Card, Badge, Tag, Icon, IconButton } from '../ui/index.js' import { Card, Badge, Tag, Icon, IconButton } from '../ui/index.js'
import { RUNWAY, CAPACITY, type RunwayMilestone } from '../../data/fixtures.js' import { EmptyState } from '../shell/states.js'
import { type RunwayMilestone } from '../../data/view-types.js'
// Runway — capacity vs milestone dates; ranges, never points. // Runway — capacity vs milestone dates; ranges, never points.
// `milestones` (real per-milestone forecasts) + `capacity` (real config) override the demo. // `milestones` (real per-milestone forecasts) + `capacity` (real config) override the demo.
@@ -21,7 +22,16 @@ export function RunwayScreen({
milestones?: RunwayMilestone[] milestones?: RunwayMilestone[]
capacity?: CapacityMember[] capacity?: CapacityMember[]
}) { }) {
const rows = milestones && milestones.length ? milestones : RUNWAY if (!milestones || !milestones.length) {
return (
<EmptyState
icon="chart-line"
title="No runway yet"
line="Add milestones and estimates and I'll project the finish."
/>
);
}
const rows = milestones
const capacityRows = const capacityRows =
capacity && capacity.length capacity && capacity.length
? capacity.map((m) => ({ ? capacity.map((m) => ({
@@ -29,19 +39,19 @@ export function RunwayScreen({
slices: `focus ${m.focusFactor} · alloc ${Math.round(m.allocation * 100)}%`, slices: `focus ${m.focusFactor} · alloc ${Math.round(m.allocation * 100)}%`,
hours: `${capacityPerWorkday(m).toFixed(2)} pd/day`, hours: `${capacityPerWorkday(m).toFixed(2)} pd/day`,
})) }))
: CAPACITY : []
const excluded = calibration?.excludedSameDay ?? 0 const excluded = calibration?.excludedSameDay ?? 0
const calibNote = calibration const calibNote = calibration
? calibration.coldStart ? calibration.coldStart
? `cold-start priors · ${calibration.n}/20 closed issues estimated` + ? `cold-start priors · ${calibration.n}/20 closed issues estimated` +
(excluded > 0 ? ` · ${excluded} same-day close${excluded === 1 ? '' : 's'} cant calibrate` : '') (excluded > 0 ? ` · ${excluded} same-day close${excluded === 1 ? '' : 's'} cant calibrate` : '')
: `calibrated on ${calibration.n} closed ${calibration.n === 1 ? 'issue' : 'issues'}` : `calibrated on ${calibration.n} closed ${calibration.n === 1 ? 'issue' : 'issues'}`
: 'calibrated on 27 closed issues' : null
return ( return (
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}> <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
<header style={{ borderBottom: 'var(--rule-double)', paddingBottom: 14 }}> <header style={{ borderBottom: 'var(--rule-double)', paddingBottom: 14 }}>
<h1 style={{ font: 'var(--text-display)', color: 'var(--ink-1)', margin: 0 }}>Runway</h1> <h1 style={{ font: 'var(--text-display)', color: 'var(--ink-1)', margin: 0 }}>Runway</h1>
<p style={{ font: 'var(--text-data)', color: 'var(--ink-3)', margin: '6px 0 0' }}>capacity vs milestone dates · {calibNote}</p> <p style={{ font: 'var(--text-data)', color: 'var(--ink-3)', margin: '6px 0 0' }}>capacity vs milestone dates{calibNote ? ` · ${calibNote}` : ''}</p>
</header> </header>
<Card overline="Milestones" flush> <Card overline="Milestones" flush>
@@ -91,14 +101,7 @@ export function RunwayScreen({
))} ))}
</div> </div>
</Card> </Card>
<Card overline="Calibration" actions={<IconButton icon="arrow-up-right" label="Full report" size="sm" onClick={onOpenCalibration} />}> <Card overline="Calibration" actions={<IconButton icon="arrow-up-right" label="Full report" size="sm" onClick={onOpenCalibration} />} />
<p style={{ font: 'var(--text-body)', margin: '0 0 8px' }}>
Your estimates run <strong>18% optimistic</strong> on <code>est/3d</code> and above. Smaller tickets are honest.
</p>
<p style={{ font: 'var(--text-agent)', color: 'var(--ink-2)', margin: 0 }}>
I widen the cone accordingly. No judgement it's the most common shape of hope.
</p>
</Card>
</div> </div>
</div> </div>
); );

View File

@@ -1,6 +1,7 @@
import React from 'react' import React from 'react'
import { type IssueRef, STANDUP, type StandupData } from '../../data/fixtures.js' import { type IssueRef, type StandupData } from '../../data/view-types.js'
import { EmptyState } from '../shell/states.js'
import { Badge, Button, Icon } from '../ui/index.js' import { Badge, Button, Icon } from '../ui/index.js'
const standupCSS = ` const standupCSS = `
@@ -42,12 +43,6 @@ export function StandupScreen({
onOpenIssue: (issue: IssueRef) => void onOpenIssue: (issue: IssueRef) => void
data?: StandupData data?: StandupData
}) { }) {
const s = data ?? STANDUP
const NAG_REF: IssueRef = {
id: s.nag.id,
days: s.nag.days,
}
const Section = ({ overline, order, children }: { overline: string; order: number; children: React.ReactNode }) => ( const Section = ({ overline, order, children }: { overline: string; order: number; children: React.ReactNode }) => (
<section <section
className="ct-standup-section" className="ct-standup-section"
@@ -70,6 +65,22 @@ export function StandupScreen({
</section> </section>
) )
if (!data) {
return (
<EmptyState
icon="sun"
title="Nothing to report"
line="No overnight drift — I'll have a plan when there's work to pour."
/>
)
}
const s = data
const NAG_REF: IssueRef = {
id: s.nag.id,
days: s.nag.days,
}
return ( return (
<div style={{ maxWidth: 660, margin: '0 auto' }}> <div style={{ maxWidth: 660, margin: '0 auto' }}>
<article <article
@@ -85,7 +96,7 @@ export function StandupScreen({
}} }}
> >
<header className="ct-standup-section" style={{ borderBottom: 'var(--rule-double)', paddingBottom: 16 }}> <header className="ct-standup-section" style={{ borderBottom: 'var(--rule-double)', paddingBottom: 16 }}>
<p style={{ font: 'var(--text-data)', color: 'var(--ink-3)', margin: '0 0 8px' }}>{s.date} · prepared 07:00</p> <p style={{ font: 'var(--text-data)', color: 'var(--ink-3)', margin: '0 0 8px' }}>{s.date}</p>
<h1 style={{ font: 'var(--text-display)', color: 'var(--ink-1)', margin: 0 }}>Morning standup</h1> <h1 style={{ font: 'var(--text-display)', color: 'var(--ink-1)', margin: 0 }}>Morning standup</h1>
</header> </header>

View File

@@ -4,7 +4,7 @@ import logoIcon from '../../design/assets/logo-icon.png'
import type { IssueChange } from '@commitea/core' import type { IssueChange } from '@commitea/core'
import type { PublicConfig } from '../../global.js' import type { PublicConfig } from '../../global.js'
import type { IssueRef } from '../../data/fixtures.js' import type { IssueRef } from '../../data/view-types.js'
import { ConnectScreen } from '../screens/connect-screen.js' import { ConnectScreen } from '../screens/connect-screen.js'
import { import {
backlogCalibration, backlogCalibration,
@@ -143,7 +143,7 @@ export function AppShell() {
document.documentElement.setAttribute('data-theme', dark ? 'dark' : 'light') document.documentElement.setAttribute('data-theme', dark ? 'dark' : 'light')
}, [dark]) }, [dark])
// Gate: e2e/demo → the shell (fixtures); configured → the shell (real data); // Gate: demo (e2e serves the demo snapshot) or configured → the shell;
// otherwise → the connect screen (each teammate brings their own token). // otherwise → the connect screen (each teammate brings their own token).
useEffect(() => { useEffect(() => {
window.commitea.gitea window.commitea.gitea
@@ -168,7 +168,7 @@ export function AppShell() {
if (view !== 'issue') setPrevView(view) if (view !== 'issue') setPrevView(view)
// Callers into the sidecar (e.g. a "blocks #N" chip) may know only the id. // Callers into the sidecar (e.g. a "blocks #N" chip) may know only the id.
// Backfill the real title + labels from the reconciled backlog so the header // Backfill the real title + labels from the reconciled backlog so the header
// isn't blank; fall back to whatever the caller passed (demo fixtures). // isn't blank; fall back to whatever the caller passed.
let full = ref let full = ref
if (backlog.status === 'ready' && (!ref.title || !ref.labels)) { if (backlog.status === 'ready' && (!ref.title || !ref.labels)) {
const found = backlog.issues.find((i) => i.number === ref.id) const found = backlog.issues.find((i) => i.number === ref.id)

View File

@@ -1,533 +0,0 @@
/**
* Demo fixtures mirrored from the design handoff's `data.js`. Stand-ins until
* P1 fills the SQLite cache and P4 wires the real agent. Replace, don't extend
* into production code.
*/
export interface ChatMessage {
from: 'agent' | 'user'
text: string
}
export const CHAT: ChatMessage[] = [
{ from: 'agent', text: 'Morning service. Two things drifted overnight; one needs your opinion.' },
{
from: 'agent',
text: '#84 grew a dependency on #92 — Ive reordered. And #87 has been steeping for four days; it blocks two others. Worth a look.',
},
{ from: 'user', text: 'Push the calibration work to next week, pilots come first' },
{
from: 'agent',
text: 'Done — #78 moves to next week. Milestone Beta is unmoved; the cone doesnt care for calibration either. Logged as a directive.',
},
]
export const CANNED_REPLY =
'Noted and logged as a directive. The scheduler is re-running — Ill show you the consequence diff in a moment.'
export const TODAY = 'Tuesday 7 July 2026'
export interface FocusIssue {
id: number
title: string
labels: string[]
steeping?: string
rationale: string
}
export interface FocusData {
now: FocusIssue
next: FocusIssue
later: FocusIssue
}
export const FOCUS: FocusData = {
now: {
id: 87,
title: 'Fix lifecycle inference on merge events',
labels: ['est/2d', 'p/1'],
steeping: '4d',
rationale: 'It blocks #91 and #92. Id take it first — the critical path agrees with me.',
},
next: {
id: 91,
title: 'Webhook listener: reconcile on reconnect',
labels: ['est/3d', 'p/2'],
rationale: 'Ready the moment #87 lands. The estimate is yours; history says add a day.',
},
later: {
id: 78,
title: 'Calibration store cold-start distributions',
labels: ['est/5d', 'p/3'],
rationale: 'Nothing depends on it yet. It can steep.',
},
}
export interface DriftItem {
tone: 'ok' | 'warn' | 'danger'
text: string
delta: string
}
export interface PlanItem {
who: string
pick: string
title: string
why: string
}
export interface Nag {
id: number
days: string
blocks: string[]
text: string
}
export interface StandupData {
date: string
drift: DriftItem[]
plan: PlanItem[]
nag: Nag
}
export const STANDUP: StandupData = {
date: 'Tuesday 7 July 2026',
drift: [
{ tone: 'warn', text: '#84 grew a dependency on #92 overnight.', delta: 'reordered · no date impact' },
{ tone: 'warn', text: '#92 has sat in review for two days.', delta: 'Beta 80% +1d if idle past Thu' },
{ tone: 'ok', text: 'Webhook outage 02:1402:31; full reconcile ran.', delta: 'nothing lost' },
],
plan: [
{
who: 'Stephen',
pick: '#87',
title: 'Fix lifecycle inference on merge events',
why: 'It blocks two others and the critical path runs straight through it.',
},
{
who: 'Ana K.',
pick: '#84',
title: 'Capacity model: focus factor per person',
why: 'Already steeping — finish it before anything new is poured.',
},
],
nag: {
id: 87,
days: '4d',
blocks: ['#91', '#92'],
text: 'Four days is a long steep. It blocks #91 and #92 — worth a look before it stains.',
},
}
/** Lightweight issue reference handed to the shell's drill-in from any screen. */
export interface IssueRef {
id: number
title?: string
labels?: string[]
days?: string
rationale?: string
}
// ---- Board (The pot) ----
export interface BoardIssue {
id: number
title: string
labels: string[]
who: string
blocked?: boolean
days?: string
pr?: string
}
export interface BoardColumn {
id: string
label: string
issues: BoardIssue[]
}
export const COLUMNS: BoardColumn[] = [
{
id: 'diagnosis',
label: 'Diagnosis',
issues: [
{ id: 102, title: 'Scheduler ignores standing allocation slices', labels: ['p/2'], who: 'SM' },
{ id: 103, title: 'Dark theme: cone fill too faint', labels: ['p/4'], who: 'SM' },
],
},
{
id: 'triage',
label: 'Triage',
issues: [
{ id: 99, title: 'Directive log: conflict-free merge test', labels: ['est/1d', 'p/2'], who: 'SM' },
{ id: 96, title: 'Label schema bootstrap for new repos', labels: ['est/2d', 'p/3'], who: 'AK' },
{ id: 78, title: 'Calibration store cold-start distributions', labels: ['est/5d', 'p/3'], who: 'SM' },
],
},
{
id: 'steeping',
label: 'Steeping',
issues: [
{ id: 87, title: 'Fix lifecycle inference on merge events', labels: ['est/2d', 'p/1'], who: 'SM', blocked: false, days: '4d' },
{ id: 84, title: 'Capacity model: focus factor per person', labels: ['est/3d', 'p/2'], who: 'AK', days: '1d' },
],
},
{
id: 'review',
label: 'In review',
issues: [{ id: 92, title: 'Monte Carlo engine: percentile bands', labels: ['est/5d', 'p/1'], who: 'SM', pr: '#141' }],
},
{
id: 'done',
label: 'Done',
issues: [
{ id: 71, title: 'Gitea client: token auth + retries', labels: ['est/2d', 'p/2'], who: 'SM' },
{ id: 69, title: 'pm-state repo bootstrap', labels: ['est/1d', 'p/1'], who: 'SM' },
{ id: 65, title: 'Electron shell + window state', labels: ['est/3d', 'p/2'], who: 'AK' },
],
},
]
// ---- Gantt ----
export interface GanttWeek {
at: number
label: string
}
export interface GanttRow {
id: number
title: string
who: string
state: 'done' | 'steeping' | 'review' | 'scheduled'
start: number
end: number
p80?: number
crit?: boolean
}
export interface GanttData {
days: number
weeks: GanttWeek[]
today: number
band: { from: number; to: number; label: string }
due: { at: number; label: string }
rows: GanttRow[]
}
export const GANTT: GanttData = {
days: 42,
weeks: [
{ at: 0, label: 'Feb 2' },
{ at: 7, label: 'Feb 9' },
{ at: 14, label: 'Feb 16' },
{ at: 21, label: 'Feb 23' },
{ at: 28, label: 'Mar 2' },
{ at: 35, label: 'Mar 9' },
{ at: 41, label: 'Mar 15' },
],
today: 8,
band: { from: 29, to: 38, label: '80% · Mar 312' },
due: { at: 41, label: 'Beta due' },
rows: [
{ id: 71, title: 'Gitea client: token auth + retries', who: 'SM', state: 'done', start: 0, end: 4 },
{ id: 69, title: 'pm-state repo bootstrap', who: 'SM', state: 'done', start: 0, end: 1 },
{ id: 87, title: 'Fix lifecycle inference on merge events', who: 'SM', state: 'steeping', start: 4, end: 9, p80: 11, crit: true },
{ id: 92, title: 'Monte Carlo engine: percentile bands', who: 'SM', state: 'review', start: 9, end: 18, p80: 21, crit: true },
{ id: 91, title: 'Webhook listener: reconcile on reconnect', who: 'AK', state: 'scheduled', start: 9, end: 14, p80: 16 },
{ id: 99, title: 'Directive log: conflict-free merge test', who: 'SM', state: 'scheduled', start: 10, end: 11 },
{ id: 96, title: 'Label schema bootstrap for new repos', who: 'AK', state: 'scheduled', start: 14, end: 16 },
{ id: 84, title: 'Capacity model: focus factor per person', who: 'AK', state: 'scheduled', start: 18, end: 23, p80: 26, crit: true },
{ id: 102, title: 'Scheduler ignores standing allocation slices', who: 'SM', state: 'scheduled', start: 23, end: 25, p80: 28, crit: true },
{ id: 78, title: 'Calibration store cold-start distributions', who: 'SM', state: 'scheduled', start: 25, end: 30 },
],
}
// ---- Dependencies ----
export interface DepNode {
id: number
title: string
tags: string[]
state: 'done' | 'steeping' | 'review' | 'triage' | 'diagnosis'
days?: string
col: number
row: number
rationale?: string
}
export interface DepEdge {
from: number
to: number | 'ms'
crit?: boolean
}
export interface DepsData {
nodes: DepNode[]
milestone: { name: string; due: string; col: number; row: number }
edges: DepEdge[]
critical: number[]
unattached: number[]
}
export const DEPS: DepsData = {
nodes: [
{ id: 71, title: 'Gitea client: token auth + retries', tags: ['est/2d'], state: 'done', col: 0, row: 0.2 },
{ id: 69, title: 'pm-state repo bootstrap', tags: ['est/1d'], state: 'done', col: 0, row: 1.9 },
{
id: 87,
title: 'Fix lifecycle inference on merge events',
tags: ['est/2d', 'p/1'],
state: 'steeping',
days: '4d',
col: 1,
row: 0.7,
rationale: 'It blocks #91 and #92. Id take it first — the critical path agrees with me.',
},
{ id: 99, title: 'Directive log: conflict-free merge test', tags: ['est/1d', 'p/2'], state: 'triage', col: 1, row: 1.9 },
{ id: 91, title: 'Webhook listener: reconcile on reconnect', tags: ['est/3d', 'p/2'], state: 'triage', col: 2, row: 0 },
{ id: 92, title: 'Monte Carlo engine: percentile bands', tags: ['est/5d', 'p/1'], state: 'review', col: 2, row: 1.4 },
{ id: 84, title: 'Capacity model: focus factor per person', tags: ['est/3d', 'p/2'], state: 'steeping', days: '1d', col: 3, row: 1.4 },
{ id: 102, title: 'Scheduler ignores standing allocation slices', tags: ['p/2'], state: 'diagnosis', col: 4, row: 1.4 },
],
milestone: { name: 'Beta', due: 'Mar 15', col: 5, row: 1.4 },
edges: [
{ from: 71, to: 87 },
{ from: 69, to: 99 },
{ from: 87, to: 91 },
{ from: 87, to: 92, crit: true },
{ from: 92, to: 84, crit: true },
{ from: 84, to: 102, crit: true },
{ from: 102, to: 'ms', crit: true },
],
critical: [87, 92, 84, 102],
unattached: [78, 96, 103, 65],
}
// ---- Runway ----
export interface RunwayMilestone {
name: string
due: string
hard: boolean
p80: string
pos: number
spread: number
tone: 'ok' | 'warn'
note: string
/** gitea milestone id, for the drill-in (absent on the demo fixture). */
id?: number
}
export const RUNWAY: RunwayMilestone[] = [
{ name: 'Beta', due: 'Mar 15', hard: false, p80: 'Mar 312', pos: 0.62, spread: 0.18, tone: 'ok', note: 'ahead' },
{ name: 'Pilot-ready', due: 'Apr 30', hard: true, p80: 'Apr 21 May 9', pos: 0.94, spread: 0.26, tone: 'warn', note: 'drifting' },
{ name: 'v1.0', due: 'Jun 12', hard: false, p80: 'May 30 Jun 20', pos: 0.88, spread: 0.3, tone: 'ok', note: 'on watch' },
]
export interface CapacityMember {
who: string
hours: string
focus: number
slices: string
}
export const CAPACITY: CapacityMember[] = [
{ who: 'Stephen', hours: '5.2h/day', focus: 0.65, slices: 'dev 70% · pilots 20% · compliance 10%' },
{ who: 'Ana K.', hours: '3.8h/day', focus: 0.8, slices: 'dev 100%' },
]
// ---- Calibration ----
export interface CalLabel {
label: string
n: number
median: string
bias: number | null
}
export interface CalPerson {
who: string
n: number
bias: number
note: string
}
export interface CalibrationData {
n: number
active: boolean
labels: CalLabel[]
people: CalPerson[]
scatter: number[][]
fit: number
effect: { raw: string; banded: string; p50: string }
/** Closed+estimated issues that can't calibrate (same-day / 0-day closes). */
excludedSameDay: number
}
export const CALIBRATION: CalibrationData = {
n: 27,
active: true,
excludedSameDay: 0,
labels: [
{ label: 'est/1d', n: 8, median: '1.1d', bias: 8 },
{ label: 'est/2d', n: 9, median: '2.4d', bias: 18 },
{ label: 'est/3d', n: 6, median: '3.7d', bias: 22 },
{ label: 'est/5d', n: 3, median: '6.5d', bias: 30 },
{ label: 'est/8d', n: 1, median: '8.5d', bias: null },
],
people: [
{ who: 'Stephen', n: 19, bias: 21, note: 'optimism grows with ticket size' },
{ who: 'Ana K.', n: 8, bias: 9, note: 'close to honest — suspicious' },
],
scatter: [
[1, 1], [1, 1.2], [1, 0.9], [1, 1.5], [1, 1.1], [1, 0.8], [1, 1.3], [1, 1.2],
[2, 2], [2, 2.5], [2, 3.1], [2, 2.2], [2, 2.6], [2, 1.8], [2, 2.4], [2, 2.9], [2, 2.3],
[3, 3.5], [3, 4.1], [3, 3.1], [3, 4.6], [3, 3.6], [3, 3.9],
[5, 6.1], [5, 7.2], [5, 6.4],
[8, 8.5],
],
fit: 1.18,
effect: { raw: '42d of estimates', banded: '80% band 4653d', p50: '48d' },
}
// ---- Inbox ----
export interface InboxIssueRef {
id: number
title: string
labels: string[]
days?: string
}
export interface InboxItem {
id: number
day: string
type: string
icon: string
tone: 'ok' | 'warn' | 'info' | 'neutral'
who?: string
text: string
detail: string
time: string
unread: boolean
to?: string
issue?: InboxIssueRef
}
export const INBOX: InboxItem[] = [
{ id: 1, day: 'Today', type: 'drift', icon: 'chart-line', tone: 'warn', text: 'Betas 80% window moved', detail: 'Mar 312 → Mar 514 · directive #007', time: '09:14', unread: true, to: 'directives' },
{ id: 2, day: 'Today', type: 'mention', icon: 'message-square', tone: 'info', who: 'Ana K.', text: 'mentioned you on #92', detail: '“percentile bands ready for a second pair of eyes”', time: '08:52', unread: true, issue: { id: 92, title: 'Monte Carlo engine: percentile bands', labels: ['est/5d', 'p/1'] } },
{ id: 3, day: 'Today', type: 'nag', icon: 'clock', tone: 'warn', text: '#87 is steeping · 4d', detail: 'blocks #91 and #92 — worth a look before it stains', time: '07:00', unread: true, issue: { id: 87, title: 'Fix lifecycle inference on merge events', labels: ['est/2d', 'p/1'], days: '4d' } },
{ id: 4, day: 'Yesterday', type: 'review', icon: 'git-pull-request', tone: 'info', text: 'PR #141 awaits review', detail: '#92 · idle two days', time: '16:20', unread: false, issue: { id: 92, title: 'Monte Carlo engine: percentile bands', labels: ['est/5d', 'p/1'] } },
{ id: 5, day: 'Yesterday', type: 'assignment', icon: 'user', tone: 'neutral', who: 'Ana K.', text: 'took #96 from the pot', detail: 'Label schema bootstrap for new repos', time: '11:03', unread: false, issue: { id: 96, title: 'Label schema bootstrap for new repos', labels: ['est/2d', 'p/3'] } },
{ id: 6, day: 'Yesterday', type: 'system', icon: 'refresh-cw', tone: 'ok', text: 'Webhook outage 02:1402:31', detail: 'full reconcile ran · nothing lost', time: '02:31', unread: false },
{ id: 7, day: 'Yesterday', type: 'milestone', icon: 'milestone', tone: 'ok', text: 'P2 — Scheduler closed two days early', detail: 'the calibration noticed. So did I.', time: '09:40', unread: false },
]
// ---- Issue detail ----
export interface IssueComment {
who: string
when: string
text: string
}
export interface IssueLifecycleStage {
stage: string
event: string
when: string
icon: string
done: boolean
}
export interface IssueDetail {
state: string
assignee: string
milestone: string
body: string
comments: IssueComment[]
lifecycle: IssueLifecycleStage[]
forecast: { p80: string; note: string }
blocks: number[]
blockedBy: number[]
note: string
}
export const ISSUE_DETAIL: Record<number, IssueDetail> = {
87: {
state: 'steeping',
assignee: 'Stephen',
milestone: 'Beta',
body: 'Squash-merges emit events out of order when CI runs long: the PR-closed webhook lands before the merge event, so lifecycle inference marks deploy before work-end and the actuals go negative. Regular merges infer correctly.',
comments: [
{ who: 'Ana K.', when: 'Feb 8 · 14:12', text: 'Repro: squash-merge only. Regular merges infer fine.' },
{ who: 'Stephen', when: 'Feb 9 · 09:30', text: 'Confirmed — the event order flips whenever CI takes more than ~5 minutes.' },
],
lifecycle: [
{ stage: 'Diagnosis', event: 'issue opened', when: 'Feb 2 · 09:14', icon: 'circle-dot', done: true },
{ stage: 'Triage', event: 'labeled est/2d · milestoned Beta', when: 'Feb 3 · 10:02', icon: 'tag', done: true },
{ stage: 'Work start', event: 'first commit ref a41f09', when: 'Feb 6 · 11:47', icon: 'git-commit-horizontal', done: true },
{ stage: 'Deploy', event: 'PR merged', when: 'pending', icon: 'git-merge', done: false },
{ stage: 'Complete', event: 'issue closed', when: 'pending', icon: 'circle-check', done: false },
],
forecast: { p80: 'done Feb 1113', note: 'from your est/2d history · n=14' },
blocks: [91, 92],
blockedBy: [],
note: 'It blocks #91 and #92. Id take it first — the critical path agrees with me.',
},
}
// ---- Directives ----
export interface DirectiveDiffRow {
tone: 'ok' | 'warn' | 'info' | 'danger'
change: string
from: string
to: string
}
export interface DirectivePending {
seq: number
who: string
when: string
what: string
diff: DirectiveDiffRow[]
}
export interface DirectiveEntry {
seq: number
who: string
when: string
what: string
why: string
status: string
consequence: string
}
export interface DirectivesData {
pending: DirectivePending | null
entries: DirectiveEntry[]
}
export const DIRECTIVES: DirectivesData = {
pending: {
seq: 7,
who: 'Stephen',
when: 'today 09:12',
what: 'Pilots before calibration — push #78 to next week.',
diff: [
{ tone: 'info', change: '#78 Calibration store', from: 'this week', to: 'wk of Feb 23' },
{ tone: 'warn', change: 'Beta · 80% window', from: 'Mar 312', to: 'Mar 514' },
{ tone: 'ok', change: "Today's plan", from: '#87', to: '#87 · unchanged' },
],
},
entries: [
{ seq: 6, who: 'Stephen', when: 'Feb 8 · 16:40', what: 'Ana takes nothing new until #84 lands.', why: 'context thrash', status: 'applied', consequence: 'WIP capped · v1.0 unmoved' },
{ seq: 5, who: 'Stephen', when: 'Feb 6 · 09:03', what: 'Ship Beta a week early.', why: 'board meeting', status: 'withdrawn', consequence: '80% would need scope 9d — withdrawn after diff' },
{ seq: 4, who: 'Stephen', when: 'Feb 3 · 11:21', what: 'deadline/hard on Pilot-ready.', why: 'contract date', status: 'applied', consequence: 'label applied · runway flag raised' },
{ seq: 3, who: 'Stephen', when: 'Jan 28 · 08:47', what: 'Webhook work ahead of UI polish.', why: '', status: 'applied', consequence: '#91 +2 ranks · Beta unmoved' },
{ seq: 2, who: 'Stephen', when: 'Jan 20 · 14:02', what: 'Estimates in days, never hours.', why: 'sanity', status: 'applied', consequence: 'label schema est/* confirmed' },
{ seq: 1, who: 'Stephen', when: 'Jan 19 · 09:00', what: 'CommiTea manages its own backlog.', why: 'dogfood', status: 'applied', consequence: 'stephen/commitea under management' },
],
}

View File

@@ -0,0 +1,237 @@
/**
* View-model types — the contract between the renderer's view builders
* (`lib/views/*`, `lib/backlog.ts`) and the screens that render their output.
* These are screen-shaped (post-builder) types only; there is no demo data here.
* Live data flows in through the main-process bridge and the builders; when a
* builder has nothing to produce, the screen renders an EmptyState.
*/
export interface ChatMessage {
from: 'agent' | 'user'
text: string
}
export interface FocusIssue {
id: number
title: string
labels: string[]
steeping?: string
rationale: string
}
export interface FocusData {
now: FocusIssue
next: FocusIssue
later: FocusIssue
}
export interface DriftItem {
tone: 'ok' | 'warn' | 'danger'
text: string
delta: string
}
export interface PlanItem {
who: string
pick: string
title: string
why: string
}
export interface Nag {
id: number
days: string
blocks: string[]
text: string
}
export interface StandupData {
date: string
drift: DriftItem[]
plan: PlanItem[]
nag: Nag
}
/** Lightweight issue reference handed to the shell's drill-in from any screen. */
export interface IssueRef {
id: number
title?: string
labels?: string[]
days?: string
rationale?: string
}
// ---- Board (The pot) ----
export interface BoardIssue {
id: number
title: string
labels: string[]
who: string
blocked?: boolean
days?: string
pr?: string
}
export interface BoardColumn {
id: string
label: string
issues: BoardIssue[]
}
// ---- Gantt ----
export interface GanttWeek {
at: number
label: string
}
export interface GanttRow {
id: number
title: string
who: string
state: 'done' | 'steeping' | 'review' | 'scheduled'
start: number
end: number
p80?: number
crit?: boolean
}
export interface GanttData {
days: number
weeks: GanttWeek[]
today: number
band: { from: number; to: number; label: string }
due: { at: number; label: string }
rows: GanttRow[]
}
// ---- Dependencies ----
export interface DepNode {
id: number
title: string
tags: string[]
state: 'done' | 'steeping' | 'review' | 'triage' | 'diagnosis'
days?: string
col: number
row: number
rationale?: string
}
export interface DepEdge {
from: number
to: number | 'ms'
crit?: boolean
}
export interface DepsData {
nodes: DepNode[]
milestone: { name: string; due: string; col: number; row: number }
edges: DepEdge[]
critical: number[]
unattached: number[]
}
// ---- Runway ----
export interface RunwayMilestone {
name: string
due: string
hard: boolean
p80: string
pos: number
spread: number
tone: 'ok' | 'warn'
note: string
/** gitea milestone id, for the drill-in. */
id?: number
}
export interface CapacityMember {
who: string
hours: string
focus: number
slices: string
}
// ---- Calibration ----
export interface CalLabel {
label: string
n: number
median: string
bias: number | null
}
export interface CalPerson {
who: string
n: number
bias: number
note: string
}
export interface CalibrationData {
n: number
active: boolean
labels: CalLabel[]
people: CalPerson[]
scatter: number[][]
fit: number
effect: { raw: string; banded: string; p50: string }
/** Closed+estimated issues that can't calibrate (same-day / 0-day closes). */
excludedSameDay: number
}
// ---- Inbox ----
export interface InboxIssueRef {
id: number
title: string
labels: string[]
days?: string
}
export interface InboxItem {
id: number
day: string
type: string
icon: string
tone: 'ok' | 'warn' | 'info' | 'neutral'
who?: string
text: string
detail: string
time: string
unread: boolean
to?: string
issue?: InboxIssueRef
}
// ---- Issue detail ----
export interface IssueComment {
who: string
when: string
text: string
}
export interface IssueLifecycleStage {
stage: string
event: string
when: string
icon: string
done: boolean
}
export interface IssueDetail {
state: string
assignee: string
milestone: string
body: string
comments: IssueComment[]
lifecycle: IssueLifecycleStage[]
forecast: { p80: string; note: string }
blocks: number[]
blockedBy: number[]
note: string
}

View File

@@ -31,7 +31,7 @@ import {
type CalibrationData, type CalibrationData,
type FocusIssue, type FocusIssue,
type RunwayMilestone, type RunwayMilestone,
} from '../data/fixtures.js' } from '../data/view-types.js'
import { addWorkingDays, type BurnUpData, buildBurnUpData, formatRange, formatShort } from './dates.js' import { addWorkingDays, type BurnUpData, buildBurnUpData, formatRange, formatShort } from './dates.js'
type Timelines = Record<number, LifecycleEvent[]> type Timelines = Record<number, LifecycleEvent[]>

View File

@@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'
import type { ChangeProposal, ChatMessage as WireMessage, IssueChange } from '@commitea/core' import type { ChangeProposal, ChatMessage as WireMessage, IssueChange } from '@commitea/core'
import { CHAT, type ChatMessage } from '../data/fixtures.js' import { type ChatMessage } from '../data/view-types.js'
const LIVE_GREETING: ChatMessage = { const LIVE_GREETING: ChatMessage = {
from: 'agent', from: 'agent',
@@ -34,14 +34,14 @@ export interface ChatState {
/** /**
* Reginald's conversation. When a model is configured, `send` drives one agent * Reginald's conversation. When a model is configured, `send` drives one agent
* turn through the main-process bridge (which runs the tool loop). Otherwise it * turn through the main-process bridge (which runs the tool loop). With no model,
* echoes the scripted fixture reply, so the layout stays real with no model and * the panel shows a clean "off" greeting and the composer is disabled — no
* fixture e2e is unaffected. The fixture greeting is display-only only real * scripted replies. The greeting is display-only; only real turns (`convo`) are
* turns (`convo`) are sent to the model as history. `onApplyChange` performs an * sent to the model as history. `onApplyChange` performs an approved write (the
* approved write (the same handler the Issue screen uses — it refetches). * same handler the Issue screen uses — it refetches).
*/ */
export function useChat(onApplyChange?: (change: IssueChange) => Promise<{ ok: boolean }>): ChatState { export function useChat(onApplyChange?: (change: IssueChange) => Promise<{ ok: boolean }>): ChatState {
const [seed, setSeed] = useState<ChatMessage[]>(CHAT) const [seed, setSeed] = useState<ChatMessage[]>([])
const [convo, setConvo] = useState<ChatMessage[]>([]) const [convo, setConvo] = useState<ChatMessage[]>([])
const [thinking, setThinking] = useState(false) const [thinking, setThinking] = useState(false)
const [live, setLive] = useState(false) const [live, setLive] = useState(false)

View File

@@ -1,6 +1,6 @@
import { inferLifecycle, schedule } from '@commitea/core' import { inferLifecycle, schedule } from '@commitea/core'
import type { DepEdge, DepNode, DepsData } from '../../data/fixtures.js' import type { DepEdge, DepNode, DepsData } from '../../data/view-types.js'
import { formatShort } from '../dates.js' import { formatShort } from '../dates.js'
import type { ProjectData } from './project-data.js' import type { ProjectData } from './project-data.js'

View File

@@ -1,6 +1,6 @@
import { forecast, inferLifecycle, scheduleWithCapacity, workingDaysBetween } from '@commitea/core' import { forecast, inferLifecycle, scheduleWithCapacity, workingDaysBetween } from '@commitea/core'
import type { GanttData, GanttRow, GanttWeek } from '../../data/fixtures.js' import type { GanttData, GanttRow, GanttWeek } from '../../data/view-types.js'
import { addWorkingDays, formatShort } from '../dates.js' import { addWorkingDays, formatShort } from '../dates.js'
import type { ProjectData } from './project-data.js' import type { ProjectData } from './project-data.js'

View File

@@ -1,6 +1,6 @@
import { inferLifecycle } from '@commitea/core' import { inferLifecycle } from '@commitea/core'
import type { InboxItem } from '../../data/fixtures.js' import type { InboxItem } from '../../data/view-types.js'
import type { ProjectData } from './project-data.js' import type { ProjectData } from './project-data.js'
const CLOSED_CAP = 5 const CLOSED_CAP = 5

View File

@@ -5,7 +5,7 @@ import {
toDurationModel, toDurationModel,
} from '@commitea/core' } from '@commitea/core'
import type { IssueDetail } from '../../data/fixtures.js' import type { IssueDetail } from '../../data/view-types.js'
import { addWorkingDays, formatRange, formatShort } from '../dates.js' import { addWorkingDays, formatRange, formatShort } from '../dates.js'
import type { ProjectData } from './project-data.js' import type { ProjectData } from './project-data.js'

View File

@@ -6,7 +6,7 @@ import {
type ScheduledItem, type ScheduledItem,
} from '@commitea/core' } from '@commitea/core'
import type { DriftItem, Nag, PlanItem, StandupData } from '../../data/fixtures.js' import type { DriftItem, Nag, PlanItem, StandupData } from '../../data/view-types.js'
import type { ProjectData } from './project-data.js' import type { ProjectData } from './project-data.js'
/** Same shape as backlog.ts's private toSchedulable — not exported there, so copied inline. */ /** Same shape as backlog.ts's private toSchedulable — not exported there, so copied inline. */