Skip to content

refactor: v2 - ai assistant - move ai chat components to shared space#2353

Open
maxy-shpfy wants to merge 2 commits into
masterfrom
06-02-refactor_v2_-_ai_assistant_-_move_ai_chat_components_to_shared_space
Open

refactor: v2 - ai assistant - move ai chat components to shared space#2353
maxy-shpfy wants to merge 2 commits into
masterfrom
06-02-refactor_v2_-_ai_assistant_-_move_ai_chat_components_to_shared_space

Conversation

@maxy-shpfy

@maxy-shpfy maxy-shpfy commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Description

The AI Chat feature has been moved from src/routes/v2/pages/Editor/components/AiChat/ to src/routes/v2/shared/components/AiChat/ so it can be reused outside the Editor (e.g., a future RunView). As part of this, the undo dependency has been removed from the shared BridgeDeps interface and isolated into a new CsomBridgeDeps type that extends BridgeDeps. This makes the shared bridge infrastructure agnostic to Editor-specific concerns.

AiChatContent now accepts a createBridge prop instead of constructing the bridge internally, allowing each consumer to inject the appropriate bridge implementation. The Editor passes createEditorToolBridge (renamed from createToolBridge) with the undo store attached, while other consumers can provide a read-only bridge.

CodeBlock has also been promoted from PinnedTaskContent/components/ to src/routes/v2/shared/components/ since it is now referenced by the shared AI Chat markdown renderer.

Related Issue and Pull requests

Type of Change

  • Bug fix
  • New feature
  • Improvement
  • Cleanup/Refactor
  • Breaking change
  • Documentation update

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

Test Instructions

  1. Open the Editor and verify the AI Assistant chat window opens and functions correctly, including spec mutations being undoable.
  2. Confirm that createEditorToolBridge tests pass (toolBridge.test.ts).
  3. Verify the PinnedTaskContent code block still renders correctly after the CodeBlock relocation.

Additional Comments

The debugBridge and runBridge modules have also been relocated to the shared toolbridge directory, as they contain no Editor-specific logic and are now imported from there by the Editor's index.ts.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 06-02-refactor_v2_-_ai_assistant_-_move_ai_chat_components_to_shared_space/3556d18

maxy-shpfy commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Merge activity

  • Jun 10, 11:59 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 11, 12:04 AM UTC: Graphite couldn't merge this PR because it had merge conflicts.

@maxy-shpfy maxy-shpfy changed the base branch from 06-02-fix_v2_-_window_state_for_startvisible to graphite-base/2353 June 10, 2026 23:59
@maxy-shpfy maxy-shpfy changed the base branch from graphite-base/2353 to master June 11, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants