Skip to content

feat: ai chat journey editor prototype#8891

Draft
edmonday wants to merge 9 commits intomainfrom
25-03-RB-feat-ai-chat-journey-editor
Draft

feat: ai chat journey editor prototype#8891
edmonday wants to merge 9 commits intomainfrom
25-03-RB-feat-ai-chat-journey-editor

Conversation

@edmonday
Copy link
Contributor

No description provided.

edmonday and others added 7 commits March 19, 2026 11:31
Phase 0 of the AI Chat Journey Editor. Replaces the flat card field
structure with an ordered content array using a discriminated union.

- All 8 addable block types: heading, text, button, image, video,
  poll, multiselect, textInput, spacer
- All 5 action kinds: navigate, url, email, chat, phone
- Content-derived card IDs (card-welcome, not card-1)
- Cross-card reference validation via Zod superRefine
- Image width/height/blurhash made optional (server computes)
- Card x/y made optional (auto-layout)
- URL scheme validation (https/http only)
- backgroundVideo support alongside backgroundImage
- Image I/O moved outside transaction in updateSimpleJourney
- Added @ai-sdk/anthropic dependency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 1 of the AI Chat Journey Editor. Adds the complete backend
agent infrastructure.

- GraphQL SSE subscription (journeyAiChatCreateSubscription)
- Two-phase loop: AI plans via submit_plan, server executes
- AgentJourney type with blockIds on every content item
- PlanOperation discriminated union (10 tool types)
- Surgical tools: createCard, deleteCard, updateCard, addBlock,
  updateBlock, deleteBlock, reorderCards, updateJourneySettings
- search_images tool (batch Unsplash API, up to 5 queries)
- Full system prompt with examples and behavioral constraints
- Redis-based undo snapshots (per-turn checkpoints)
- journeyAiChatUndo + journeyAiChatExecutePlan mutations
- Tiered model selection (Gemini Flash free / Claude BYOK)
- Mid-session model switching via preferredTier
- Published journey warning
- Prompt hardening (preSystemPrompt + hardenPrompt)
- History validation (roles, length, entry limits)
- Server-derived requiresConfirmation
- sanitizeErrorMessage for safe error propagation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds subscription, mutations, input types, and message type
for the AI chat journey editor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New /journeys/[id]/ai-chat route with split-pane AI editor.

Canvas (60%):
- AiJourneyFlow with React Flow, dagre auto-layout
- AiCardPreviewNode with full card previews at 0.55 scale
- AiViewEdge with labeled edges (default/button/poll)
- Card selection as context (blue border)
- Shimmer overlay on cards being edited

Chat Panel (40%):
- AiChatPanel with message list, auto-scroll
- MessageBubble (user/AI) with hover-to-reveal undo
- PlanCard with operation status (pending/running/done/failed)
- StarterSuggestions with suggestion chips
- ChatInput with context pill, send/stop toggle
- ModelIndicator (free/premium tier display)
- ToolCallCard for tool progress
- AiEditorToolbar with Edit Manually navigation guard

Entry point:
- AI Editor button added to existing editor Toolbar

Dependencies:
- @dagrejs/dagre for branching layout

Note: Full build requires running nf start for API servers
and regenerating gateway schema + Apollo client codegen.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Composes the federated gateway schema with journeyAiChat types.
Generates Apollo client TypeScript types for journeys-admin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Updated searchImages tool to return error message when image service is unavailable.
- Added languageName field to JourneyAiChatInput for better localization support.
- Fixed path reference in next-env.d.ts for improved type resolution.
- Introduced ThinkingIndicator component in AiChatPanel for better user feedback during processing.
- Enhanced AiChatPanel to handle plan confirmations and rejections with new props.
- Updated ChatInput to display selected card label dynamically.
- Improved PlanCard component with collapsible details and action buttons for plan execution.
- Integrated Apollo Client mutation for executing plans in AiEditor.
- Refactored message handling in AiEditor to support new plan message types.
- Updated useJourneyAiChatSubscription to handle new message types and refetch queries correctly.
- Added optional backgroundImage property to plan operation schema for enhanced customization.
- Made action property in journeySimpleBlockSchema optional for better flexibility.
@edmonday edmonday self-assigned this Mar 22, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 22, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eeb7efad-efe5-4690-8ea1-5f34407d0d8e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 25-03-RB-feat-ai-chat-journey-editor

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.

OpenGrep is compatible with Semgrep configurations. Add an opengrep.yml or semgrep.yml configuration file to your project to enable OpenGrep analysis.

@edmonday edmonday changed the title 25 03 rb feat ai chat journey editor feat: ai chat journey editor prototype Mar 22, 2026
edmonday and others added 2 commits March 22, 2026 06:20
…-journey-editor

# Conflicts:
#	package.json
#	pnpm-lock.yaml
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nx-cloud
Copy link

nx-cloud bot commented Mar 22, 2026

View your CI Pipeline Execution ↗ for commit a0936a0

Command Status Duration Result
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 2s View ↗
nx run-many --target=upload-sourcemaps --projec... ✅ Succeeded 9s View ↗
nx run-many --target=deploy --projects=journeys... ✅ Succeeded 2m 53s View ↗
nx run-many --target=vercel-alias --projects=watch ✅ Succeeded 2s View ↗
nx run-many --target=upload-sourcemaps --projec... ✅ Succeeded 5s View ↗
nx run-many --target=vercel-alias --projects=vi... ✅ Succeeded 2s View ↗
nx run-many --target=vercel-alias --projects=re... ✅ Succeeded 2s View ↗
nx run-many --target=upload-sourcemaps --projec... ✅ Succeeded 6s View ↗
Additional runs (19) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-03-22 06:28:33 UTC

@github-actions
Copy link
Contributor

Fails
🚫 Please request a reviewer for this PR.
Warnings
⚠️ ❗ Big PR (24732 changes)

(change count - 24732): Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR will helps faster, easier review.

Generated by 🚫 dangerJS against a0936a0

@github-actions github-actions bot temporarily deployed to Preview - short-links March 22, 2026 06:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin March 22, 2026 06:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - player March 22, 2026 06:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - watch March 22, 2026 06:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin March 22, 2026 06:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - resources March 22, 2026 06:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - watch-modern March 22, 2026 06:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys March 22, 2026 06:23 Inactive
@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch-modern ✅ Ready watch-modern preview Sun Mar 22 19:25:20 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
docs ✅ Ready docs preview Sun Mar 22 19:25:37 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
short-links ✅ Ready short-links preview Sun Mar 22 19:25:38 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Sun Mar 22 19:25:41 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
player ✅ Ready player preview Sun Mar 22 19:25:42 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
resources ✅ Ready resources preview Sun Mar 22 19:25:52 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Sun Mar 22 19:25:54 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Sun Mar 22 19:25:58 NZDT 2026

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Sun Mar 22 19:27:59 NZDT 2026

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