Skip to content

feat: merge Ask Salem and the feedback bubble into one shared launcher#35

Merged
BunsDev merged 1 commit into
mainfrom
feat/merge-salem-feedback-launcher
Jul 21, 2026
Merged

feat: merge Ask Salem and the feedback bubble into one shared launcher#35
BunsDev merged 1 commit into
mainfrom
feat/merge-salem-feedback-launcher

Conversation

@BunsDev

@BunsDev BunsDev commented Jul 21, 2026

Copy link
Copy Markdown
Member

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. Queues init({ launcher: false, placement: 'left' }) on the window.Quackback command stub before injecting sdk.js, so the SDK never mounts its own bubble and the panel opens in the same corner as the launcher. Exposes openFeedback/closeFeedback/onFeedbackEvent helpers 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, SDK open/close events 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 /docs sidebar lift is dropped while the feedback panel occupies that corner (panel anchors at bottom: 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).
  • docs — ask-salem.mdx notes the shared launcher; feedback-widget.mdx documents the custom-launcher pattern this site now uses.

Notes

  • The old inline snippet queued commands on an OpenCovenFeedback global that the served bundle never reads (it only reads window.Quackback) — the bottom-right bubble only ever appeared via the SDK's auto-init fallback, and init/identify calls through that global were silently dropped. The new loader drives the global the bundle actually consumes. The feedback-widget reference page still documents the branded OpenCovenFeedback global 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 --noEmit clean
  • pnpm build green (all doc checks + 118 static pages)
  • node scripts/validate-links.mjs — 0 errors
  • next start smoke test: SSR markup shows the merged launcher (both segments, correct aria labels) and no eager sdk.js script tag
  • Queue-replay contract traced against the served sdk.js bundle: queued init suppresses the bundle's auto-init; on subscriptions queued pre-load replay in order; unsubscribe falls back to an off command for pre-load subscriptions (StrictMode-safe)

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>
Copilot AI review requested due to automatic review settings July 21, 2026 23:51
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
coven-docs Ready Ready Preview Jul 21, 2026 11:53pm

@BunsDev
BunsDev merged commit da9b172 into main Jul 21, 2026
2 checks passed
@BunsDev
BunsDev deleted the feat/merge-salem-feedback-launcher branch July 21, 2026 23:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Quackback queue + script injection) with open/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 thread lib/feedback-widget.ts
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`.
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.

2 participants