Skip to content

docs: add reusable Invent callout bubble - #776

Merged
NiamhRelevance merged 1 commit into
mainfrom
invent-bubble-callout
Aug 18, 2026
Merged

docs: add reusable Invent callout bubble#776
NiamhRelevance merged 1 commit into
mainfrom
invent-bubble-callout

Conversation

@jordanc-relevanceai

Copy link
Copy Markdown
Collaborator

Adds a reusable bubble for telling readers Invent can do the thing a page is teaching them to do by hand. Blobby, the Invent mascot, sits on the left and tracks the cursor.

No doc page uses it yet. This PR is the component only — the bubbles get placed in a follow-up.

How a page uses it

Three lines at the top level of any .mdx, blank line either side. No import, no <Snippet>, no docs.json entry:

<div className="invent-callout">
  <strong>Invent can do this for you.</strong> Ask Invent to create an Agent with a name and a purpose, and it sets up the system prompt, picks the Tools, and connects the integrations it needs.
</div>

Only the copy changes between usages. The markup, class name, and <strong> lead-in stay identical, so one edit in style.css restyles every bubble in the docs.

Why a class and not a snippet

Snippet props were the obvious route, but this version of Mintlify renders snippet variables as empty — <Snippet file="x.mdx" text="hello" /> reaches the snippet with {text} blank. Importing an exported component out of a snippet doesn't render at all, on either the /_snippets/ or /snippets/ path. So per-instance text rules out a snippet, and the pattern is a class plus a root script.

Files

File What it does
style.css .invent-callout and .invent-blobby — all geometry and colour, both themes
invent-callout.js Builds Blobby and animates his eyes. Auto-loaded by Mintlify, no-ops on pages without a bubble
images/invent-blobby-seal.svg The pd/inventor sprite, lifted from relevance-api-node
images/invent-blobby.svg Same seal with static eyes — the fallback when JS is off
CLAUDE.md An ## Invent callout section with the usage block and rules, so agents working in this repo reach for it instead of inventing a new pattern

Details worth knowing

  • Faithful to the product. The seal is the real sprite, not a redraw. The gaze, blink cadence, and ^ ^ hover greeting are ported from the product's useInventorEyes composable, down to the 0.14 lerp and the occasional double blink. The bubble wears the same four layers the seal is built from — white sheen and cyan off the top-left, magenta off the bottom-right, indigo base — so it reads as one big soft Blobby.
  • One source of truth for geometry. --blobby-size and --blobby-gap on .invent-callout drive his size, his position, and the bubble's padding, for both the live badge and the static fallback. The text gap either side of him is computed, so it stays even at any size.
  • Degrades quietly. A failed seal fetch leaves the static fallback showing and retries on the next navigation. prefers-reduced-motion holds his eyes open and still.
  • SPA-safe. Mounts through a MutationObserver so bubbles survive client-side navigation and hydration, coalesced to one check per frame. Blink timers stop when a bubble leaves the DOM.
  • Bubble text is user-select: none, so it can't be highlighted or copied — deliberate, since readers tend to drag at Blobby.

🤖 Generated with Claude Code

A styled bubble for pointing readers at Invent as a faster path through
whatever a page teaches by hand. Blobby, the Invent mascot, sits on the
left and tracks the cursor.

Usage is a plain div with a class, so only the copy differs between
pages and all styling stays in style.css:

  <div className="invent-callout">
    <strong>Invent can do this for you.</strong> Ask Invent to...
  </div>

Snippet props were the obvious route but Mintlify renders snippet
variables as empty in this version, and importing a component out of a
snippet doesn't render at all — hence the class plus a root script.

The seal is the pd/inventor sprite lifted from relevance-api-node, and
the eye behaviour is ported from its useInventorEyes composable so the
gaze, blink, and hover greeting match the product. invent-callout.js
builds him; images/invent-blobby.svg is the static fallback when JS is
off. --blobby-size and --blobby-gap on .invent-callout control his size
and the spacing around him, for both the live badge and the fallback.

No page uses it yet — the bubbles get placed in a follow-up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
relevanceai 🟢 Ready View Preview Aug 18, 2026, 6:30 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@github-actions

Copy link
Copy Markdown
Contributor

🎯 Vibe check

Reviewed: 3 files (2 with issues, 1 clean) — no .mdx files changed; review covers the JS/CSS files that directly affect documentation rendering and the updated CLAUDE.md

Scores

Dimension Score What's holding it back
🟡 Consistency 7/10 Usage example in style.css shows a bold label inside the callout, which conflicts with CLAUDE.md's "no bold labels inside" callout rule. New component pattern is undocumented in CLAUDE.md, so writers have no guidance on when or how to use it.
🟡 Technical clarity 7/10 user-select: none on the full .invent-callout element prevents readers from selecting or copying callout text — counterproductive when the expected copy is an Invent prompt. The component has no entry in CLAUDE.md for writers to reference.
🟢 Non-technical clarity N/A No documentation content changed — pure infrastructure PR.
🟢 Structure N/A No MDX pages changed — structure judgement not applicable.

Score key: 🟢 9–10, 🟡 6–8, 🔴 1–5.

Overall vibe: Solid implementation — the JS handles prefers-reduced-motion, SPA navigation, no-JS fallback, and gradient ID namespacing correctly. The two issues are real and worth fixing before writers start using the component: text in the callout can't be selected (frustrating when readers want to copy a prompt), and CLAUDE.md gives writers no guidance on the new pattern.

🔧 Issues (2)
  • style.css:434–435user-select: none is applied to the entire .invent-callout block, including its text content. The usage comment below shows the callout copy as "Ask Invent to…" — text readers would likely want to select and copy as a prompt. Scope user-select: none to .invent-blobby only (the animated character), so the text content stays selectable.

  • CLAUDE.md — The new invent-callout component isn't documented anywhere in the project instructions. Writers need: (1) the exact markup snippet (<div className="invent-callout"><strong>Invent can do this for you.</strong> Ask Invent to…</div>), (2) when to use it (when Invent can automate the manual task the page is teaching), and (3) a note that <strong> is intentional here and doesn't conflict with the "no bold labels" rule for built-in Mintlify callouts, which is a separate category.

🧩 Component suggestions (1)
  • style.css:413–414 — The usage comment shows <strong>Invent can do this for you.</strong> as a bold label inside a callout div. CLAUDE.md says "no bold labels inside" callouts. This is a custom <div> (not a Mintlify <Note>/<Tip>), and the bold label is styled deliberately (indigo #4D40EC), so the design intent is clear — but the rule needs a carve-out in CLAUDE.md to prevent confusion when writers read "no bold labels in callouts" and wonder if this component breaks the rule.
✅ Clean files (1)

invent-callout.js — Correct aria-hidden="true" on the decorative Blobby badge. Uses <span> rather than <a> to avoid Mintlify's anchor underline animation. Gradient IDs are namespaced per badge instance to prevent collisions when multiple bubbles appear on one page. Handles prefers-reduced-motion, SPA client-side navigation via MutationObserver, and no-JS fallback correctly.

🔋 Credit usage
Item Count
Files reviewed 3
Context pages read 0
Total lines processed ~855

Files read: invent-callout.js (215 lines), style.css (558 lines), CLAUDE.md (82 lines)

@NiamhRelevance
NiamhRelevance merged commit d0e08a8 into main Aug 18, 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.

2 participants