posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat(ph-ai): notebook artifacts UI

Open kappa90 opened this issue 1 month ago • 6 comments

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 processed
    • ErrorBlock: Shows error messages when artifacts fail to load
  • Updated VisualizationBlock to directly contain query data instead of referencing by ID
  • Created a new NotebookArtifactAnswer component to render notebook artifacts in Max
  • Added utility function markdownToTiptap to convert markdown to Tiptap format for notebook creation
  • Added storybook examples for different notebook artifact scenarios
  • Improved streaming message handling in maxThreadLogic with finalizeStreamingMessages action (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)

kappa90 avatar Dec 04 '25 13:12 kappa90

This stack of pull requests is managed by Graphite. Learn more about stacking.

kappa90 avatar Dec 04 '25 13:12 kappa90

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
Vulnerability Finding Vulnerabilities 22 High 22 Medium 13 Low
Data Finding Sensitive Data 1 Info
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Supply Chain Finding Software Supply Chain Findings -
Total 22 High 22 Medium 13 Low 1 Info

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

wiz-7ad640923b[bot] avatar Dec 04 '25 13:12 wiz-7ad640923b[bot]

Edits:

  • Moved to tiptap 3.11.x with Markdown support, removed custom markdown to json conversion

kappa90 avatar Dec 06 '25 20:12 kappa90

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%)

compressed-size-action

github-actions[bot] avatar Dec 06 '25 20:12 github-actions[bot]

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

Review snapshot changes →

posthog-bot avatar Dec 06 '25 20:12 posthog-bot

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

Review snapshot changes →

posthog-bot avatar Dec 06 '25 21:12 posthog-bot

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

Review snapshot changes →

posthog-bot avatar Dec 15 '25 16:12 posthog-bot

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.

graphite-app[bot] avatar Dec 17 '25 10:12 graphite-app[bot]

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

Review snapshot changes →

posthog-bot avatar Dec 17 '25 16:12 posthog-bot

⏭️ 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

posthog-bot avatar Dec 17 '25 16:12 posthog-bot

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

Review snapshot changes →

posthog-bot avatar Dec 17 '25 17:12 posthog-bot