Skip to content

Collapse Agent Skills callouts by default and add product-disambiguation fallback#357

Merged
lucatorella merged 18 commits into
mainfrom
product-fallback-disclosure
May 21, 2026
Merged

Collapse Agent Skills callouts by default and add product-disambiguation fallback#357
lucatorella merged 18 commits into
mainfrom
product-fallback-disclosure

Conversation

@raffaelefarinaro
Copy link
Copy Markdown
Contributor

@raffaelefarinaro raffaelefarinaro commented May 21, 2026

Summary

  • Adds a product-disambiguation fallback callout on doc pages where the existing product-specific SkillsCallout doesn't fire (top-level concept pages, framework landings, etc.), so visitors who haven't picked a product still get a path into the data-capture-sdk agent skill. A small URL denylist excludes release notes, migration guides, and the agent-skills page itself.
  • Collapses all callouts (product + shared) by default behind a native <details> with the existing blue chrome. Right-aligned Show › / Hide ‹ micro-label, button-like hover with a cursor-follow spotlight, and a smooth slide-and-fade open/close animation in browsers that support ::details-content + interpolate-size (Chrome/Edge 131+; Firefox/Safari snap as today).
  • Fires a new PostHog event skills_callout_expanded on every open with { variant, pathname, product?, framework? }. Dashboard 693119 has four new tiles wired to it: total expansions, expansions by variant, expansions by page (top 25), and an expand → copy funnel against the existing skills_command_copied event.
  • Removes the 4px blue border-left accent on the callout in favor of a uniform 1px border. Drops the homepage banner's larger padding so the callout height matches docs.
  • Drives the variant choice from the swizzle at `src/theme/DocItem/Content/index.tsx`: product → shared → null based on the URL, gated on a `KNOWN_PRODUCTS` set so URL segments like `/sdks/ios/add-sdk` don't get incorrectly treated as products.
  • Small unrelated cleanup: removes an unused image block from the Smart Label Capture intro partial.

Raffaele Farinaro added 18 commits May 21, 2026 14:00
Without this, framework-level pages like /sdks/ios/add-sdk are parsed
as if 'add-sdk' were a product, so the swizzle renders the product
variant (which then no-ops because skills.json has no entry for it)
instead of falling through to the fallback disclosure.
- Both product and shared variants now render as a collapsed <details>
  with the existing blue callout chrome. Both consolidate behind a small
  internal CalloutDetails wrapper so the toggle handling and tracking
  stay in one place.
- The `fallback` variant is removed; non-product/non-denylist doc pages
  now render the shared variant directly.
- A `details.callout` rule with !important overrides Docusaurus's
  `[class^=docMainContainer_] details { background-color: transparent }`
  selector, which was wiping the blue background on doc pages.
- Homepage shared callout moves above the slogan and product cards so
  it's the first thing on the page.
- Extract `capturePostHogEvent` into its own module and fire
  `skills_callout_expanded` on every open of the disclosure, with
  variant / pathname / product / framework as properties. PostHog can
  compute the expand→copy funnel against the existing
  `skills_command_copied` event.
…hover

- Move the disclosure chevron to the right and pair it with a small
  uppercase "Show"/"Hide" hint that swaps via CSS based on the [open]
  state. Makes the affordance unambiguous without leaning on body copy.
- Whole collapsed callout now reads as a single interactive surface:
  hover-tinted background, focus-visible outline on the summary. Hover
  styles deliberately drop once expanded — the user is reading, not
  clicking.
- Keep padding-top constant across collapsed/open (1.3rem) so the title
  stays in the exact same vertical position when expanding. Only
  padding-bottom flexes for optical centering of the single summary
  line when collapsed.
- Drop the .banner padding override so the homepage callout matches the
  docs callout height when collapsed. .banner keeps margin: 0 only.
- Remove the 4px blue side-stripe in favor of a uniform 1px border on
  all sides. Side-stripe accents on callouts read as a SaaS-template
  tic; the background + soft border carry the same Scandit-blue signal
  without that connotation.
When the callout is collapsed and the visitor hovers it, a soft
blue radial gradient follows the cursor across the surface, and the
right-aligned Show + chevron hint slides 4px toward the edge with
an ease-out-quart curve. Both effects fall away once the disclosure
is open so the chrome doesn't compete with the content the user is
now reading. Replaces the previous solid hover-tint.

The cursor position is written to --callout-mx / --callout-my via a
React onMouseMove handler; the gradient lives on a ::before overlay
that's clipped by overflow:hidden on the callout so the spotlight
respects the rounded corners. Summary and body get z-index:1 to sit
above the overlay; the overlay itself is pointer-events:none.

Dark-mode variant uses a higher alpha on the gradient so the
spotlight remains legible against the darker base background.
Polish:
- Scale the install-command monospace from 1rem to 0.9375rem so it
  reads at the same optical size as the surrounding proportional text.
- Bump .description and .tabHint line-height from 1.5 to 1.65 so the
  description's wrapped lines have room to breathe — particularly
  important when inline <code> chips inflate the line metrics.

Animation:
- Use ::details-content + interpolate-size: allow-keywords + longhand
  transition (height, opacity, content-visibility) + transition-behavior:
  allow-discrete for a smooth slide-and-fade on open/close. Chrome 131+
  / Edge 131+ get the animation; Firefox and older Safari gracefully
  snap as today. Respects prefers-reduced-motion.
- The longhand transition is required because the build's CSS minifier
  strips `allow-discrete` from the transition shorthand.

Magnetic chevron:
- Drop the :not([open]) gate. The right-side hint now glides on hover
  in both states so the click affordance for "close" stays signaled
  once the disclosure is open. Spotlight stays collapsed-only so it
  doesn't compete with body content.
When the callout is open, body-content hover was triggering the hint
translate at the top of the box where the user wasn't looking. Scope
to .calloutSummary:hover (and :focus-visible for keyboard) so the
animation fires precisely when the user is aiming at the click
target — both collapsed and open.
Drop the :not([open]) guard on both the React mouse-move handler and
the CSS hover rule so the soft blue gradient follows the cursor across
the surface regardless of whether the disclosure is collapsed or open.
The 0.22 alpha keeps it subtle enough not to compete with the install
tabs underneath.
- Spotlight alpha: 0.22 → 0.12 (light) and 0.32 → 0.18 (dark). Still
  visible enough to read as cursor-tracking, no longer competes with
  the install tabs content underneath.
- Magnetic chevron translate now only fires when collapsed. Once open,
  the right-side hint stays put — the user isn't aiming to expand it
  again, and the spotlight already signals interactivity.
- Side note: keyboard focus outline on the summary now fires in both
  states (was incorrectly scoped to :not([open])). Keyboard users need
  the focus indicator regardless of disclosure state.
@lucatorella lucatorella merged commit e9324ac into main May 21, 2026
2 checks passed
@lucatorella lucatorella deleted the product-fallback-disclosure branch May 21, 2026 15:08
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