feat: merge Ask Salem and the feedback bubble into one shared launcher#35
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates two previously separate floating widgets (Ask Salem and OpenCoven Feedback) into a single bottom-left shared launcher, and switches the feedback SDK to a lazy-loaded integration controlled by the launcher instead of the SDK’s default bubble.
Changes:
- Added a client-side feedback SDK lazy loader (
window.Quackbackqueue + script injection) withopen/close/event helpers. - Updated the Ask Salem UI to a split-pill launcher with mutual exclusion between chat and feedback panels (including Escape-to-close and a “switch to feedback” header action).
- Removed the eager inline feedback
<Script>from the root layout and updated reference docs to describe the shared-launcher pattern.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/feedback-widget.ts | Introduces lazy loader + command queue for the feedback SDK and exposes open/close/event helpers for the shared launcher. |
| components/ask-salem.tsx | Reworks launcher into two segments and coordinates Ask Salem vs. feedback panel visibility/state. |
| components/ask-salem.module.css | Adds styling for the split-pill launcher segments/divider and removes now-obsolete footer padding for the old bubble. |
| app/layout.tsx | Removes the eager inline feedback widget script; keeps AskSalem mounted as the shared entry point. |
| components/widget-identify.tsx | Deletes unused identify helper component. |
| content/docs/reference/ask-salem.mdx | Documents the new shared launcher behavior and lazy feedback loading. |
| content/docs/reference/feedback-widget.mdx | Adds a note about launcher: false enabling custom launchers and references this site’s shared launcher approach. |
Comment on lines
+73
to
+77
| export function openFeedback(): Promise<void> { | ||
| const ready = ensureFeedbackWidget(); | ||
| window.Quackback?.('open'); | ||
| return ready; | ||
| } |
Comment on lines
+35
to
+52
| .launcherSegment { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: 0.45rem; | ||
| padding: 0.6rem 0.9rem; | ||
| border: none; | ||
| background: transparent; | ||
| color: var(--color-fd-foreground); | ||
| font-size: 0.82rem; | ||
| font-weight: 600; | ||
| cursor: pointer; | ||
| transition: background 0.15s ease; | ||
| } | ||
|
|
||
| .launcherSegment:hover, | ||
| .launcherSegment.launcherSegmentActive { | ||
| background: color-mix(in srgb, var(--coven-violet) 10%, transparent); | ||
| } |
Comment on lines
72
to
+74
| To restrict the widget so only your own users can submit feedback, use the SSO token shape and call `init` with `launcher: false`. Then mount the launcher yourself once identity resolves. | ||
|
|
||
| > `launcher: false` is also the hook for replacing the floating bubble with your own UI: call `open`/`close` from any element you control. This docs site does exactly that — its bottom-left launcher is shared with the [Ask Salem assistant](/docs/reference/ask-salem), and the Feedback segment drives the widget through `init({ launcher: false, placement: 'left' })` plus `open`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
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). This merges them into a single bottom-left launcher pill with an Ask Salem segment and a Feedback segment.
How
lib/feedback-widget.ts— lazy loader for the feedback SDK. Queuesinit({ launcher: false, placement: 'left' })on thewindow.Quackbackcommand stub before injectingsdk.js, so the SDK never mounts its own bubble and the panel opens in the same corner as the launcher. ExposesopenFeedback/closeFeedback/onFeedbackEventhelpers and falls back to opening feedback.opencoven.ai in a new tab if the script can't load (offline, content blockers).components/ask-salem.tsx— split-pill launcher (role=group): mutual exclusion between the chat and feedback panels, SDKopen/closeevents mirrored into local state (the panel closes itself from inside its iframe), Escape closes either panel, a feedback shortcut in the chat panel header, and the/docssidebar lift is dropped while the feedback panel occupies that corner (panel anchors atbottom: 88px).app/layout.tsx— removes the eager feedback<Script>; the SDK now loads on first use.components/widget-identify.tsx— removed (unused; the identify pattern remains documented in the feedback-widget reference for apps embedding the widget themselves).Notes
OpenCovenFeedbackglobal that the served bundle never reads (it only readswindow.Quackback) — the bottom-right bubble only ever appeared via the SDK's auto-init fallback, andinit/identifycalls through that global were silently dropped. The new loader drives the global the bundle actually consumes. The feedback-widget reference page still documents the brandedOpenCovenFeedbackglobal for external embedders; worth a follow-up check against what the SDK endpoint actually serves.PageFeedback(the inline "Was this page helpful?" footer row) is untouched — this PR only merges the two floating widgets.Validation
npx tsc --noEmitcleanpnpm buildgreen (all doc checks + 118 static pages)node scripts/validate-links.mjs— 0 errorsnext startsmoke test: SSR markup shows the merged launcher (both segments, correct aria labels) and no eagersdk.jsscript tagsdk.jsbundle: queuedinitsuppresses the bundle's auto-init;onsubscriptions queued pre-load replay in order; unsubscribe falls back to anoffcommand for pre-load subscriptions (StrictMode-safe)