feat(ph-ai): notebook artifacts UI
Problem
New NotebookArtifactAnswer to support in-chat Notebooks, and conversion of those to TipTap notebooks.
Changes
- Added new block types to the schema:
LoadingBlock: Displays loading state for artifacts being processedErrorBlock: Shows error messages when artifacts fail to load
- Updated
VisualizationBlockto directly contain query data instead of referencing by ID - Created a new
NotebookArtifactAnswercomponent to render notebook artifacts in Max - Added utility function
markdownToTiptapto convert markdown to Tiptap format for notebook creation - Added storybook examples for different notebook artifact scenarios
- Improved streaming message handling in
maxThreadLogicwithfinalizeStreamingMessagesaction (rationale: with notebooks, we might have more than one streaming message at once, so we need to clean failed streamed messages when restarting the conversation, adding a temp id, so they don't get mistakenly replaced by new streaming content)
How did you test this code?
Stories + tests + locally (needs the next PR in the stack to run)
- #42909
: 2 dependent PRs (#43062
, #43070
) - #42697

- #42696
👈 (View in Graphite) - #42060

- #42052
: 1 other dependent PR (#42704
) - #42888

master
This stack of pull requests is managed by Graphite. Learn more about stacking.
Wiz Scan Summary
⚠️ Many findings detected
Many findings were detected, but only a subset of the findings are displayed inline due to API constraints. To view all findings inline, please click here.
| Scanner | Findings |
|---|---|
| 22 |
|
| 1 |
|
| - | |
| - | |
| - | |
| - | |
| Total | 22 |
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.
Edits:
- Moved to tiptap 3.11.x with Markdown support, removed custom markdown to json conversion
Size Change: +25.9 kB (+0.68%)
Total Size: 3.81 MB
| Filename | Size | Change |
|---|---|---|
frontend/dist/toolbar.js |
3.81 MB | +25.9 kB (+0.68%) |
Visual regression: Storybook UI snapshots updated
Changes: 14 snapshots (6 modified, 8 added, 0 deleted)
What this means:
- Snapshots have been automatically updated to match current rendering
- Next CI run will switch to CHECK mode to verify stability
- If snapshots change again, CHECK mode will fail (indicates flapping)
Next steps:
- Review the changes to ensure they're intentional
- Approve if changes match your expectations
- If unexpected, investigate component rendering
Visual regression: Storybook UI snapshots updated
Changes: 6 snapshots (6 modified, 0 added, 0 deleted)
What this means:
- Snapshots have been automatically updated to match current rendering
- Next CI run will switch to CHECK mode to verify stability
- If snapshots change again, CHECK mode will fail (indicates flapping)
Next steps:
- Review the changes to ensure they're intentional
- Approve if changes match your expectations
- If unexpected, investigate component rendering
Visual regression: Storybook UI snapshots updated
Changes: 2 snapshots (2 modified, 0 added, 0 deleted)
What this means:
- Snapshots have been automatically updated to match current rendering
- Next CI run will switch to CHECK mode to verify stability
- If snapshots change again, CHECK mode will fail (indicates flapping)
Next steps:
- Review the changes to ensure they're intentional
- Approve if changes match your expectations
- If unexpected, investigate component rendering
Merge activity
- Dec 17, 10:23 AM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
- Dec 17, 10:23 AM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..
- Dec 17, 6:10 PM UTC: @kappa90 merged this pull request with Graphite.
Visual regression: Storybook UI snapshots updated
Changes: 12 snapshots (12 modified, 0 added, 0 deleted)
What this means:
- Snapshots have been automatically updated to match current rendering
- Next CI run will switch to CHECK mode to verify stability
- If snapshots change again, CHECK mode will fail (indicates flapping)
Next steps:
- Review the changes to ensure they're intentional
- Approve if changes match your expectations
- If unexpected, investigate component rendering
⏭️ Skipped snapshot commit because branch advanced to 3360c97 while workflow was testing 10660b7.
The new commit will trigger its own snapshot update workflow.
If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:
- Merge master into your branch, or
- Push an empty commit:
git commit --allow-empty -m 'trigger CI' && git push
Query snapshots: Backend query snapshots updated
Changes: 1 snapshots (1 modified, 0 added, 0 deleted)
What this means:
- Query snapshots have been automatically updated to match current output
- These changes reflect modifications to database queries or schema
Next steps:
- Review the query changes to ensure they're intentional
- If unexpected, investigate what caused the query to change