Skip to content

feat(chat-widget): opt-in nudge above the launcher - #1132

Merged
kmonsoe merged 1 commit into
mainfrom
feat/widget-nudge
Oct 1, 2026
Merged

kmonsoe merged 1 commit into
mainfrom
feat/widget-nudge

Conversation

@kmonsoe

@kmonsoe kmonsoe commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

What

An opt-in nudge for the chat widget: a short teaser above the closed launcher with an eyebrow (<org name> · now), a message bubble, a dismiss button and an inline input. Plus a few launcher refinements that came out of the same design pass.

New embed attributes

Attribute Effect
data-munin-nudge Turns the nudge on. The value is the message; empty (or true) uses a localized default in all 21 bundled languages. Max 280 chars.
data-munin-nudge-delay Seconds after page load before it appears. Default 8, range 0–3600.
data-munin-nudge-color Explicit hex fill for the bubble; text flips between ink and paper for contrast. Without it the bubble is a light tint of the theme color (12% on paper, 24% in dark mode).

Behaviour

  • Sending from the nudge input opens the panel straight into a new chat and posts the text as the first turn on the current session.
  • Clicking the bubble opens the panel; the × dismisses it.
  • While it shows, the launcher badge reads 1; real unread messages always take precedence.
  • It never appears once the panel has been opened, or when the current session already has messages. History is loaded before the decision, so a zero delay can't flash it over a returning visitor's thread.
  • A dismissal or an open snoozes it for 7 days per channel (localStorage, munin-widget-nudge-snoozed:<channelId>).

Launcher changes

  • The launcher shape now follows the existing data-munin-corners: square (still the default) gives a square launcher, rounded keeps the circle. There's no separate shape attribute.
  • The unread badge is larger (22px), has no border, and on the square launcher is centered on the top-right corner.
  • Opening the widget (launcher, nudge or window.mn.widget.open()) when the visitor has no past or current conversation goes straight to a new chat instead of the welcome screen.

Docs

skill://conv/setup-chat-widget and the chat-widget docs guide document the three nudge attributes and data-munin-corners, which wasn't documented before. docs-fixtures/skills.json is regenerated.

Notes

  • The nudge text isn't persisted into the conversation, so the agent only sees what the visitor typed.
  • In a conversation started from the nudge or the direct-to-chat open, the voice call button appears after the first message, because the conversation is created lazily on send. This avoids empty conversations from visitors who open and close the panel.
  • If a visitor clicks the launcher before their past-conversation list has loaded, they land in a new chat; the back arrow still reaches the list.

Testing

  • apps/chat-widget: typecheck, lint and 251 tests pass. New coverage: nudge config parsing (config.test.ts), the snooze window (nudge.test.ts), and nudge UI (badge precedence, dismiss, send, open, explicit color). The two old launcher tests are rewritten for the direct-to-chat behaviour.
  • Manual: ran the full stack against a local widget channel and checked square and rounded corners, several theme colors, an explicit nudge color, and dark mode. Sending from the nudge opened the panel and the message landed with the agent replying.

🤖 Generated with Claude Code

Adds data-munin-nudge, data-munin-nudge-delay and data-munin-nudge-color.
The nudge shows a teaser message with an inline input; sending opens the
panel into a new conversation. It is suppressed once the panel has been
opened or the session has messages, and snoozed for 7 days per channel
after a dismissal or open.

The launcher now follows data-munin-corners (square by default), the
unread badge is larger, borderless and centered on the square corner,
and opening the widget with no conversations goes straight to a new chat.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@kmonsoe
kmonsoe merged commit c333e4c into main Oct 1, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant