From e73f8cec47125559ec0a9ba5fd1e97f1af24d392 Mon Sep 17 00:00:00 2001 From: Val Alexander Date: Tue, 21 Jul 2026 18:50:57 -0500 Subject: [PATCH] feat: merge Ask Salem and the feedback bubble into one shared launcher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The docs site floated two separate widgets: the Ask Salem pill (bottom-left) and the OpenCoven Feedback bubble (bottom-right, mounted by an inline layout script). They now share a single bottom-left launcher pill with an Ask Salem segment and a Feedback segment. - lib/feedback-widget.ts: lazy loader for the feedback SDK. Queues init({ launcher: false, placement: 'left' }) on the window.Quackback command stub before injecting sdk.js, so the SDK never mounts its own bubble; exposes open/close/on helpers and a portal fallback if the script cannot load. (The previous layout snippet queued commands on an OpenCovenFeedback global the served bundle never reads — the old bubble only appeared via the SDK's auto-init fallback.) - components/ask-salem.tsx: split-pill launcher (role=group) with mutual exclusion between the chat panel and the feedback panel, SDK open/close events mirrored into local state, Escape handling for both, a feedback shortcut in the chat panel header, and the /docs sidebar lift dropped while the feedback panel occupies that corner. - app/layout.tsx: drop the eager feedback Script tag; the SDK now loads on first use of the Feedback segment. - components/widget-identify.tsx: removed (unused; identify() remains documented in the feedback-widget reference for apps that embed the widget themselves). - docs: note the shared launcher in ask-salem.mdx and the custom- launcher pattern this site uses in feedback-widget.mdx. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- app/layout.tsx | 11 +-- components/ask-salem.module.css | 58 +++++++---- components/ask-salem.tsx | 110 ++++++++++++++++++--- components/widget-identify.tsx | 33 ------- content/docs/reference/ask-salem.mdx | 2 + content/docs/reference/feedback-widget.mdx | 2 + lib/feedback-widget.ts | 102 +++++++++++++++++++ 7 files changed, 246 insertions(+), 72 deletions(-) delete mode 100644 components/widget-identify.tsx create mode 100644 lib/feedback-widget.ts diff --git a/app/layout.tsx b/app/layout.tsx index ab61737..165986b 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -4,7 +4,6 @@ import 'fumadocs-ui/style.css'; import 'fumadocs-ui/components/image-zoom2.css'; import { Inter } from 'next/font/google'; import type { ReactNode } from 'react'; -import Script from 'next/script'; import { Analytics } from '@vercel/analytics/next'; import { SpeedInsights } from '@vercel/speed-insights/next'; import { CovenSearchDialog } from '@/components/search-dialog'; @@ -72,18 +71,12 @@ export default function Layout({ children }: { children: ReactNode }) { }} > {children} + {/* Shared launcher: Ask Salem chat + OpenCoven Feedback panel. + The feedback SDK is lazy-loaded on first use (lib/feedback-widget). */} - {/* OpenCoven Feedback widget — loads anonymously; identify() called per-page when user is known */} -