Skip to content

feat: v2 - ai assistant chat window#2327

Open
maxy-shpfy wants to merge 1 commit into
masterfrom
05-26-feat_v2_-_ai_assistant_chat_window
Open

feat: v2 - ai assistant chat window#2327
maxy-shpfy wants to merge 1 commit into
masterfrom
05-26-feat_v2_-_ai_assistant_chat_window

Conversation

@maxy-shpfy
Copy link
Copy Markdown
Collaborator

@maxy-shpfy maxy-shpfy commented May 28, 2026

Description

Introduces the foundational scaffolding for an AI Assistant panel in the V2 editor, gated behind a new ai-assistant feature flag (disabled by default, categorized as beta).

The panel opens as a floating window in the editor and provides a chat interface where users can ask questions about their pipeline. This PR establishes the core architecture:

  • AiChatStore (MobX observable) holds messages, thread ID, pending state, and thinking text outside the React tree so state survives window minimize/hide/unmount. The sendMessage implementation is currently a stub that echoes the user's prompt back — the real LLM integration is deferred to a follow-up PR.
  • AiChatStoreProvider / useAiChatStore expose the store via React context, wrapping the editor session.
  • AiChatContent composes ChatMessageList and ChatInput into the panel body.
  • ChatMessageList auto-scrolls to the latest message and renders an empty state when no messages exist.
  • ChatInput supports Enter to submit and Shift+Enter for newlines.
  • ThinkingMessage displays an animated spinner with status text while a response is pending.
  • Markdown rendering via react-markdown + remark-gfm with custom component overrides for headings, lists, tables, blockquotes, code blocks, and links.
  • Custom link protocols (entity:// and component://) are resolved into interactive EntityChip and ComponentChip elements. EntityChip navigates to the corresponding task/input/output node in the canvas. ComponentChip is draggable onto the canvas and opens a ComponentDetailsDialog on click.
  • useGatedAiChatWindow opens the window only when the feature flag is enabled and the window does not already exist.

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)

AI Assistant - Echo and markdown for chat.mov (uploaded via Graphite)

Test Instructions

  1. Enable the ai-assistant feature flag in the beta flags settings panel.
  2. Open a pipeline in the V2 editor — an "AI Assistant" floating window should appear.
  3. Type a message and press Enter or click the send button. The message should be echoed back as an assistant reply.
  4. Verify the window persists when minimized and re-shown.
  5. Disable the flag and confirm the window does not open.

Additional Comments

The sendMessage method currently echoes the user prompt as the assistant response. The actual LLM/worker integration is intentionally left for a subsequent PR. The threadId field on AiChatStore is reserved for that integration.

For test you can use markdown:

# H1: Pipeline assistant test

## H2: Section heading

### H3: Subsection

#### H4: Smallest heading

A paragraph with **bold**, *italic*, ~~strikethrough~~, and `inline code`.
Soft line break here
and another line.

---

## Lists

Unordered list:

- First item
- Second item with `inline code`
- Nested:
  - Nested item one
  - Nested item two
- Last item

Ordered list:

1. Step one
2. Step two
3. Step three

Task list (GFM):

- [x] Completed task
- [ ] Pending task

---

## Blockquote

> This is a blockquote. It should render with a left border, italic, and muted color.
>
> Second paragraph inside the blockquote.

---

## Table (GFM)

| Component        | Status | Notes                        |
| ---------------- | :----: | ---------------------------- |
| Data loader      |   OK   | Reads from GCS               |
| Training task    |  FAIL  | OOM at epoch 3               |
| Evaluation task  |   --   | Skipped (upstream failed)    |


---

## Links and chips

Regular external link: [OpenAI docs](https://platform.openai.com/docs).

* Entity chip (task): [Train model](entity://task-train-001).
* Entity chip (input): [training_data](entity://input-data-001).
* Entity chip (output): [trained_model](entity://output-model-001).
* Entity chip (unknown id, renders as question mark): [missing-thing](entity://does-not-exist).

* Component chip with backing ref (renders draggable `ComponentChip`):
[Format date and time](component://7784069b3bd1301674cfb4bbf7170b7db91ffd289138eb2d8838e3368158b70c).

* Component chip whose id is missing from `componentReferences` (falls through to the `<span>` fallback):
[unknown component](component://not-in-refs).

@maxy-shpfy maxy-shpfy force-pushed the 05-26-feat_v2_-_ai_assistant_chat_window branch from 13d4bc7 to 8dfdf7a Compare May 28, 2026 05:42
@github-actions
Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 05-26-feat_v2_-_ai_assistant_chat_window/8dfdf7a

@maxy-shpfy maxy-shpfy marked this pull request as ready for review May 28, 2026 05:43
@maxy-shpfy maxy-shpfy requested a review from a team as a code owner May 28, 2026 05:43
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.

1 participant