Skip to content

feat(drive-integration): async import runs rearchitecture [INTEG-4526]#11092

Open
david-shibley-contentful wants to merge 6 commits into
masterfrom
feat/drive-integration-async-runs-INTEG-4526
Open

feat(drive-integration): async import runs rearchitecture [INTEG-4526]#11092
david-shibley-contentful wants to merge 6 commits into
masterfrom
feat/drive-integration-async-runs-INTEG-4526

Conversation

@david-shibley-contentful

@david-shibley-contentful david-shibley-contentful commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

INTEG-4526

Summary

  • Rearchitects the import flow from synchronous (20-min blocking spinner) to fully async: wizard fires off the agent run, saves to localStorage, redirects immediately to a new Runs page
  • New Runs page becomes the app home screen — lists all imports with live status badges (Running / Needs Review / Completed / Failed / Expired), polls every 10s while any run is in-flight, supports multiple concurrent runs
  • ReviewPage is now reachable directly from the Runs page via a Review CTA (no longer locked inside the wizard flow); entry creation stays synchronous
Screenshot 2026-07-16 at 3 37 09 PM

Key files

  • src/types/runs.tsRunRecord, DisplayStatus, RunWithStatus, AppView types
  • src/hooks/useRunStorage.ts — localStorage-backed run history (max 50, scoped by space+env)
  • src/hooks/useRunsPolling.ts — parallel Promise.all polling, 10s interval while running
  • src/services/workflowService.tsresumeAndPollWorkflow extracted from the hook
  • src/locations/Page/components/runs/RunsPage + RunRow components
  • src/locations/Page/Page.tsxAppView discriminated union state machine replaces binary toggle
  • src/locations/Page/components/mainpage/ModalOrchestrator.tsx — fire-and-forget wizard exit

Test plan

  • 104 unit/component tests pass (npm test across all modified files)
  • TypeScript compiles clean (tsc --noEmit)
  • Vite production build succeeds (npm run build)
  • Start an import → wizard closes immediately, Runs page shows "Running" status
  • Wait for AI analysis → run transitions to "Needs Review", Review CTA appears
  • Click Review → ReviewPage loads with correct mapping payload
  • Create entries → run transitions to "Completed" with entry links
  • Start two concurrent imports → both rows appear independently with correct statuses
  • Dismiss a failed/expired run → row removed from list and localStorage
  • Clear localStorage → empty state with "Start your first import" CTA

Generated with Claude Code

@david-shibley-contentful
david-shibley-contentful requested review from a team as code owners July 16, 2026 21:10
@david-shibley-contentful
david-shibley-contentful force-pushed the feat/drive-integration-async-runs-INTEG-4526 branch from 3ca6d78 to 4bc5d43 Compare July 16, 2026 21:52
david-shibley-contentful and others added 3 commits July 16, 2026 16:00
Rearchitects the drive-integration import flow from synchronous (20-min
blocking spinner) to fully async. Import wizard fires off the agent run,
saves a RunRecord to localStorage, then immediately redirects to a new
Runs page. The Runs page polls agentRun status every 10s for in-flight
imports and supports multiple concurrent runs. ReviewPage is now
reachable directly from the Runs page rather than only from the wizard
flow.

Key changes:
- New RunsPage (home screen) + RunRow components with live status badges
- useRunStorage hook (localStorage-backed RunRecord[] with 50-record cap)
- useRunsPolling hook (parallel Promise.all, 10s interval while running)
- workflowService.ts extracted from useWorkflowAgent (resumeAndPollWorkflow)
- Page.tsx rewritten around AppView discriminated union state machine
- ModalOrchestrator: fire-and-forget startWorkflow → addRun → onRunStarted
- 104 tests passing across all new and modified files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…table after import

Three independent useRunStorage instances (Page, RunsPage, ModalOrchestrator) meant
addRun() only updated local React state — RunsPage wouldn't see the new run without
a page refresh. Lift the hook to Page as the single owner and pass runs/addRun/
removeRun/storageError down as props.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@david-shibley-contentful
david-shibley-contentful force-pushed the feat/drive-integration-async-runs-INTEG-4526 branch from 2734bc2 to 2d23ce1 Compare July 16, 2026 22:00
david-shibley-contentful and others added 3 commits July 16, 2026 16:04
…y ESLint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ixtures from branch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…E_ENABLE_MOCK_REVIEW_PAYLOAD branch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant