Skip to content

Conversation

@jaydgoss
Copy link
Member

@jaydgoss jaydgoss commented Feb 9, 2026

Summary

Adds a Copy as Markdown / Text button to all product onboarding empty states, allowing users to copy SDK setup instructions for use with AI coding agents or documentation.

  • Introduces a stepsToMarkdown utility that converts OnboardingStep[] to clean Markdown (with fenced code blocks, links, lists, alerts)
  • Adds CopyAsDropdown to 14 onboarding surfaces across Issues, Performance, Profiling, Metrics, Logs, Agents, MCP, Feedback, Replay, Feature Flags, and sidebar drawers
  • Fixes tab selection bug: when copying from surfaces with tabbed code blocks (npm/yarn/pnpm), only the currently selected tab is included in the output (not all variants)
  • Creates a SelectedCodeTabContext to sync tab selection between TabbedCodeSnippet and the copy function
  • Extracts a reusable OnboardingCopyAsDropdown component to reduce boilerplate across all call sites

Surfaces with Copy as button

Product empty state pages: Issues, Performance/Tracing, Profiling, Metrics, Logs, Agent Monitoring, MCP

Sidebar drawers: Performance sidebar, Profiling sidebar

Onboarding layouts (rendered in sidebars): Feedback, Replay, Feature Flags

Other: Releases promo, Cron monitor quick start guide

Test plan

  • CI=true pnpm test stepsToMarkdown.spec.tsx — 48 tests passing
  • pnpm run lint:js — clean on all modified files
  • pnpm run typecheck — passes
  • Manual: Open any onboarding page with tabs (e.g. Performance on a JS project) → switch to "yarn" → Copy as Markdown → verify only yarn commands in output
  • Manual: Open /insights/backend/#performance-sidequest → verify CopyAsDropdown appears in sidebar
  • Manual: Open Feedback/Replay onboarding sidebar → verify CopyAsDropdown appears

…Markdown

Adds utility functions to convert OnboardingStep[]/ContentBlock[] arrays
into clean Markdown and plain text. Uses renderToStaticMarkup + a custom
lightweight HTML-to-Markdown converter (no external deps like Turndown).

Handles all ContentBlock types: text, code (single + tabbed), alert,
subheader, list, conditional, and custom blocks.
Adds CopyAsDropdown to Logs, Metrics, Profiling, Performance/Traces,
and Agent Monitoring empty states. Users can copy all onboarding steps
(install + configure + verify) as Markdown or plain text for pasting
into LLMs. Analytics events track copy usage per source.
… states

Extend the CopyAsDropdown button to MCP monitoring, Issues
(UpdatedEmptyState), Feedback sidebar, Session Replay sidebar,
Releases, and Cron Monitoring onboarding surfaces.

Also adds <pre><code> fenced code block handling to
simpleHtmlToMarkdown for the Crons renderToStaticMarkup approach.
…ng surfaces

Copy as Markdown/Text was including all tab variants (npm/yarn/pnpm)
instead of only the user's selected tab. This adds a SelectedCodeTabContext
that syncs tab selection from TabbedCodeSnippet to stepsToMarkdown, so
copied output respects the active tab. Tabbed blocks now default to the
first tab when no selection has been made.

Also extracts a reusable OnboardingCopyAsDropdown component to reduce
boilerplate across 11 call sites, and adds CopyAsDropdown to 3 surfaces
that were missing it: performance sidebar, profiling sidebar, and feature
flag onboarding.
@linear
Copy link

linear bot commented Feb 9, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 9, 2026
…im releases copy

- Loop HTML tag stripping to prevent nested tag reassembly (security bot feedback)
- Remove hardcoded preface from releases promo copy output
The Copy as Markdown/Text feature was copying the raw ___ORG_AUTH_TOKEN___
placeholder instead of the actual generated token. Now reads the token
from AuthTokenGeneratorContext and substitutes it in code blocks.
… Markdown

When text blocks use tct() with components like <Link> or <ExternalLink>
that require router context, renderToStaticMarkup throws. The catch
block was returning '' — silently dropping the text. Now falls back to
walking the React element tree directly, preserving text and links.
Use React.PropsWithChildren for component prop types so children
is optional (passed via third arg to React.createElement).
… button

Simplify the copy UI from a dropdown with Markdown/Text options to a single
"Copy as Markdown" button with a tooltip ("Let an LLM do all the work instead").
Users overwhelmingly want Markdown for LLM use, so a single-click button is
better UX than a dropdown.
The stepsToText function and its helper stripMarkdownFormatting had no
production consumers, causing the knip --production check to fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant