Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Oct 29, 2025

Fixes FER-7094

Unify breadcrumb UI between visual editor and live docs

This PR adds breadcrumb navigation to the visual editor matching live docs UI, moves FernBreadcrumbs to a shared package for reuse, and refactors spacing to use a wrapper div.

What was the motivation & context behind this PR?

The visual editor was missing breadcrumb navigation (section names) that appears in live docs. Additionally:

  1. FernBreadcrumbs component was duplicated between packages
  2. Breadcrumbs CSS was not available in the shared components package
  3. Spacing was inconsistently applied via mx-5 classes on individual components

Changes made

Component sharing:

  • Moved FernBreadcrumbs.tsx and FernBreadcrumbs.scss from bundle to @fern-docs/components package
  • Updated bundle's PageHeader.tsx to import from shared location
  • Added SCSS import to components package's index.css

Visual editor breadcrumbs:

  • Added breadcrumb rendering to PageContents.tsx using shared FernBreadcrumbs component
  • Compute breadcrumbs from foundNode.parents using FernNavigation.utils.createBreadcrumb()
  • Pass foundNode prop from PageNode.tsx to PageContents.tsx
  • Breadcrumb links use relative URLs (e.g., /getting-started) and rely on EditorLinkInterceptor for navigation

Spacing & styling refactor:

  • Removed mx-5 from PageTitle and PageSubtitle input components
  • Wrapped breadcrumb, title, and subtitle in parent div with mx-5 not-prose classes
  • Updated subtitle styling to match live docs (break-words, leading-7, text color)

How has this PR been tested?

  • ✅ All 17 CI checks passed
  • ✅ Vercel Agent review found 0 problems
  • ✅ TypeScript compilation and linting successful
  • ⚠️ Manual testing required - Navigation behavior was not tested in live environment

Human review checklist

⚠️ Critical - Navigation behavior:

  • Test left-click on breadcrumbs in editor - should stay within editor context
  • Note: Middle-click, right-click "open in new tab", and copy link will navigate to relative URLs (e.g., /getting-started) instead of staying in editor. This is an accepted tradeoff per Sarah's guidance.

⚠️ Critical - Visual verification:

  • Breadcrumbs appear correctly in visual editor for pages within sections (e.g., "Getting started" section)
  • Breadcrumbs do NOT appear for top-level pages without parent sections
  • Breadcrumb, title, and subtitle alignment looks correct (all aligned with mx-5 spacing)
  • Subtitle styling matches live docs appearance
  • CSS classes (fern-breadcrumb, fern-breadcrumb-item, fern-breadcrumb-arrow) load properly in dashboard

Nice to have:

  • No regressions in live docs bundle breadcrumb rendering
  • Breadcrumbs work correctly across different page types

Link to Devin run: https://app.devin.ai/sessions/91a4960c012d4f4682cb1173f6c903d3
Requested by: Sarah Bawabe ([email protected]) (@sbawabe)

…mes and subtitles

- Add section name rendering above page title for guide layout pages
- Create PageSectionName component to display parent section title
- Update PageSubtitle styling to match live docs UI (prose-p:text-(color:--grayscale-a11) mt-2 break-words leading-7)
- Pass foundNode data from PageNode to PageContents to access navigation hierarchy
- Only show section name for guide layout pages when applicable

Co-Authored-By: Sarah Bawabe <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link
Contributor

vercel bot commented Oct 29, 2025

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

Project Deployment Preview Updated (UTC)
fern-dashboard Ready Ready Preview Oct 30, 2025 7:18pm
fern-dashboard-dev Ready Ready Preview Oct 30, 2025 7:18pm
ferndocs.com Ready Ready Preview Oct 30, 2025 7:18pm
5 Skipped Deployments
Project Deployment Preview Updated (UTC)
dev.ferndocs.com Ignored Ignored Preview Oct 30, 2025 7:18pm
fern-platform Ignored Ignored Oct 30, 2025 7:18pm
preview.ferndocs.com Skipped Skipped Oct 30, 2025 7:18pm
prod-assets.ferndocs.com Skipped Skipped Oct 30, 2025 7:18pm
prod.ferndocs.com Skipped Skipped Oct 30, 2025 7:18pm

- Move FernBreadcrumbs from fern-docs/bundle to @fern-docs/components for reuse
- Update PageHeader in bundle to import from new location
- Delete custom PageSectionName component from dashboard
- Update PageContents in dashboard to use FernBreadcrumbs with computed breadcrumb
- Use createBreadcrumb from FernNavigation to compute breadcrumb from foundNode
- Render breadcrumbs above page title for guide layout pages in visual editor

Co-Authored-By: Sarah Bawabe <[email protected]>
docsUrl: docsUrl as EncodedDocsUrl,
branchName: branch,
slug: breadcrumb.pointsTo
})}
Copy link
Collaborator

Choose a reason for hiding this comment

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

devin is EditorAwareBreadcrumbs necessary? we have our EditorRouteInterceptor logic anyways would think this is unnecessary and would be caught by our interceptor.

@devin-ai-integration
Copy link
Contributor Author

Good question! I investigated this and you're right that the breadcrumbs are within #preview-container so the EditorLinkInterceptor will catch left-clicks. However, the interceptor only handles click events, which means it won't cover:

  • Middle-click (open in new tab)
  • Right-click → "open link in new tab"
  • Copy link address
  • Next.js Link prefetch

Without editor-prefixed hrefs, these actions would navigate to /getting-started instead of staying in the editor context.

If you'd prefer to remove the wrapper component, I could add an optional linkBuilder prop to the shared FernBreadcrumbs component so the editor can pass constructEditorSlug while the bundle keeps current behavior. Would that be cleaner?

…readcrumbs

Per Sarah's guidance, switched to using the shared FernBreadcrumbs component
from @fern-docs/components instead of the custom EditorAwareBreadcrumbs wrapper.

Left-click navigation is handled by EditorLinkInterceptor which intercepts
clicks within #preview-container and rewrites URLs to editor routes.

Note: Middle-click, right-click 'open in new tab', and copy link address
will navigate to relative URLs (e.g., /getting-started) instead of staying
in the editor context. This is an accepted tradeoff for code simplicity.

Co-Authored-By: Sarah Bawabe <[email protected]>
@sbawabe sbawabe merged commit bc333c8 into app Oct 30, 2025
18 checks passed
@sbawabe sbawabe deleted the devin/1761768444-unify-visual-editor-section-name-subtitle branch October 30, 2025 19:27
kennyderek pushed a commit that referenced this pull request Oct 31, 2025
…mes and subtitles (#4567)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Sarah Bawabe <[email protected]>
Co-authored-by: sarah bawabe <[email protected]>
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