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

@@ -33,6 +33,18 @@ import {
} from '@commitea/core'
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 { 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.
ipcMain.handle('gitea:boot', () => {
if (isDemo()) return { configured: true, cached: true, ...DEMO_SNAPSHOT, savedAt: DEMO_TODAY }
if (!getGiteaClient()) return { configured: false }
const persisted = bootSnapshot()
return persisted ? { configured: true, cached: true, ...persisted } : { configured: true, cached: false }
})
ipcMain.handle('gitea:reconcile', async () => {
if (isDemo()) return { configured: true, stale: false, ...DEMO_SNAPSHOT }
const client = getGiteaClient()
if (!client) return { configured: false, issues: [], milestones: [], deps: [], timelines: {} }
try {
@@ -316,6 +330,7 @@ export function registerGiteaIpc(): void {
// Read the directive ledger from the pm-state repo (for the Directives screen).
ipcMain.handle('pmstate:directives', async () => {
if (isDemo()) return { ok: true as const, directives: DEMO_DIRECTIVES }
const pm = getPmStateClient()
if (!pm) return { ok: false as const, reason: 'unconfigured' as const }
try {
@@ -327,6 +342,7 @@ export function registerGiteaIpc(): void {
// Read the capacity config from the pm-state repo (for capacity-aware forecasts).
ipcMain.handle('pmstate:capacity', async () => {
if (isDemo()) return { ok: true as const, members: DEMO_CAPACITY }
const pm = getPmStateClient()
if (!pm) return { ok: false as const, reason: 'unconfigured' as const, members: [] }
try {
@@ -338,6 +354,7 @@ export function registerGiteaIpc(): void {
// Assignable people (repo collaborators) for the Adjust dialog's assignee picker.
ipcMain.handle('gitea:collaborators', async () => {
if (isDemo()) return DEMO_COLLABORATORS
const client = getGiteaClient()
if (!client) return []
try {