Skip to content

feat(dashboard, api-service, framework, worker): Rich content for chat channels#10816

Draft
scopsy wants to merge 7 commits intonextfrom
wip-block-slack
Draft

feat(dashboard, api-service, framework, worker): Rich content for chat channels#10816
scopsy wants to merge 7 commits intonextfrom
wip-block-slack

Conversation

@scopsy
Copy link
Copy Markdown
Contributor

@scopsy scopsy commented Apr 21, 2026

What changed? Why was the change needed?

@coderabbitai summary

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

scopsy added 4 commits April 21, 2026 17:02
Introduce a rich chat card editor and preview pipeline across dashboard and API. Adds a full editor UI (card types, serializer, block list/menu, header editor, and sync hook) and preview renderers for text, Slack, Teams (adaptive cards) and Discord embeds in the dashboard. Server-side: wire ChatContentCompiler into NovuBridgeModule and ChatOutputRendererUsecase to render Liquid in card leaves, compile multi-platform previews and return ChatCompiledPreviews; fall back to legacy text when no card is present. Also add chat content-compiler service and platform-specific adapters in application-generic, plus small schema and provider updates to support the new features.
Keep editor-side block ids in CardElement JSON and adjust chat/send-message typing edges.

- Dashboard: add ID_KEY ('_editorId') and readId() to persist per-block editor ids through the form→JSON→form round-trip so inputs don't remount and lose focus; include these ids when serializing blocks/fields/actions. Stop filtering out empty blocks in docToCardElement so in-progress empty blocks are preserved; remove isBlockEmpty. Doc-to-fallback rendering now skips empty content for presentation only.

- API: annotate why ChatOutputRendererUsecase results are cast at the call site and cast the result in construct-framework-workflow to bridge the loose shared DTO shape (Record<string, unknown>) with the framework's stricter inferred card type.

- Worker: change conditional spreads to ternary spreads for compiled adaptiveCard/discordEmbeds/slackBlocks to satisfy TypeScript when those fields are typed as unknown.

These changes avoid UI focus/jank, make type boundaries explicit, and fix TS spread errors while keeping runtime payload compatibility.
Add a full-featured Novu card preview and overhaul the chat rich-body editor UI and interactions. Introduces a ChatMessageFrame and NovuCard renderer (images, links, fields, actions) used as the default preview tab (renamed from text to 'Novu'), with improved handling for mini/default variants and preview pending state. Replace legacy flat text preview with a faithful card rendering and update Slack/Teams/Discord previews to use shared button styling.

Refactor the rich-body editor: group Add Block menu items (Content / Layout / Interactive), add quick-insert buttons for common blocks, and rework BlockListItem to a compact, focused layout with inline controls. Implement new editors for text, link, image, fields, and actions using Popover and Button primitives, editable styles for text and action buttons, and safer image fallbacks. Card header now supports image editing via popover. Many styling and UX tweaks to improve consistency and preview fidelity.
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 21, 2026

Deploy preview added

Name Link
🔨 Latest commit ab3a2e3
🔍 Latest deploy log https://app.netlify.com/projects/dashboard-v2-novu-staging/deploys/69e7a590f3e90a000821b632
😎 Deploy Preview https://deploy-preview-10816.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f7842ef4-e5c0-4b19-9904-a8a2a9eec2b0

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

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Hey there and thank you for opening this pull request! 👋

We require pull request titles to follow specific formatting rules and it looks like your proposed title needs to be adjusted.

Your PR title is: feat(dashboard, api-service, framework, worker): Rich content for chat channels

Requirements:

  1. Follow the Conventional Commits specification
  2. As a team member, include Linear ticket ID at the end: fixes TICKET-ID or include it in your branch name

Expected format: feat(scope): Add fancy new feature fixes NOV-123

Details:

PR title must end with 'fixes TICKET-ID' (e.g., 'fixes NOV-123') or include ticket ID in branch name

@github-actions
Copy link
Copy Markdown
Contributor

LaunchDarkly flag references

🔍 1 flag added or modified

Name Key Aliases found Info
IS_CHAT_RICH_CONTENT_ENABLED IS_CHAT_RICH_CONTENT_ENABLED

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 21, 2026

Open in StackBlitz

@novu/framework

npm i https://pkg.pr.new/novuhq/novu/@novu/framework@10816

novu

npm i https://pkg.pr.new/novuhq/novu@10816

@novu/providers

npm i https://pkg.pr.new/novuhq/novu/@novu/providers@10816

@novu/shared

npm i https://pkg.pr.new/novuhq/novu/@novu/shared@10816

@novu/stateless

npm i https://pkg.pr.new/novuhq/novu/@novu/stateless@10816

commit: ab3a2e3

Add support for transient paragraph nodes inserted by Maily's "+" slash menu: register @tiptap/extension-paragraph in the chat editor and treat surviving paragraph nodes as plain cardText during serialization and fallback-text generation. Refactor block commands by introducing replaceBlockWithAtom and setCardTextStyle helpers so selecting a slash-menu block replaces the whole parent block (avoids leaving empty paragraphs). Also import Editor/Range types and bump left padding in the chat rich-body layout.
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