Skip to content

fix: content layout on spider monkey browser engine#137

Merged
Kinfe123 merged 2 commits intomainfrom
fix/browser-engine-content-layout
Apr 27, 2026
Merged

fix: content layout on spider monkey browser engine#137
Kinfe123 merged 2 commits intomainfrom
fix/browser-engine-content-layout

Conversation

@Kinfe123
Copy link
Copy Markdown
Member

@Kinfe123 Kinfe123 commented Apr 27, 2026

  • fix: content layout on spider monkey browser engine
  • chore: format

Summary by cubic

Removed the extra display: contents wrapper around the docs layout root to fix layout issues on SpiderMonkey/Firefox. Rendering is now stable across browsers with no API changes.

  • Bug Fixes
    • In createDocsLayout and TanstackDocsLayout, removed the outer <div id="nd-docs-layout" style="display: contents"> and render DocsLayout as the root.
    • Added tests to ensure no extra wrapper or inline display style is introduced.

Written for commit 74f9c47. Summary will update on new commits. Review in cubic

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

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

Project Deployment Actions Updated (UTC)
docs-website Ready Ready Preview, Comment Apr 27, 2026 9:27pm

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 27, 2026

Open in StackBlitz

@farming-labs/astro

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/astro@137

@farming-labs/astro-theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/astro-theme@137

@farming-labs/docs

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/docs@137

@farming-labs/theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/theme@137

@farming-labs/next

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/next@137

@farming-labs/nuxt

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/nuxt@137

@farming-labs/nuxt-theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/nuxt-theme@137

@farming-labs/svelte

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/svelte@137

@farming-labs/svelte-theme

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/svelte-theme@137

@farming-labs/tanstack-start

pnpm add https://pkg.pr.new/farming-labs/docs/@farming-labs/tanstack-start@137

commit: 74f9c47

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR removes a <div id="nd-docs-layout" style={{ display: "contents" }}> wrapper from both createDocsLayout (Next.js/fumadocs) and TanstackDocsLayout (TanStack Start) that was causing content layout regressions on the SpiderMonkey browser engine. Since fumadocs-ui's DocsLayout already renders its own root element with id="nd-docs-layout", the wrapper was producing duplicate IDs in the DOM; removing it leaves all existing CSS selectors and JavaScript querySelector calls targeting #nd-docs-layout fully intact. Regression tests are added for both layout entry points.

Confidence Score: 5/5

Safe to merge — the change is a clean removal of a redundant wrapper div with no functional regressions.

All remaining findings are P2 or lower. The #nd-docs-layout ID already lives on fumadocs-ui's DocsLayout root, so CSS selectors and JavaScript querySelector calls across all theme files continue to work unchanged. The duplicate-ID problem is resolved as a side effect. Both layout paths have matching regression tests.

No files require special attention.

Important Files Changed

Filename Overview
packages/fumadocs/src/docs-layout.tsx Removes the redundant display: contents wrapper div; DocsLayout from fumadocs-ui already owns the #nd-docs-layout root element, so all CSS/JS selectors remain valid.
packages/fumadocs/src/tanstack-layout.tsx Same display: contents wrapper removal as docs-layout.tsx; clean, symmetric change with no other modifications.
packages/fumadocs/src/docs-layout.test.ts Adds a regression test asserting the root element returned by createDocsLayout is not a <div> with id or style.display set — correctly guards the fix.
packages/fumadocs/src/tanstack-layout.test.ts New test file with equivalent regression coverage for TanstackDocsLayout.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["createDocsLayout / TanstackDocsLayout"] --> B["DocsLayout\n(fumadocs-ui/layouts/docs)\nroot: id='nd-docs-layout'"]
    B --> C["ColorStyle / TypographyStyle / LayoutStyle"]
    B --> D["DocsCommandSearch (Suspense)"]
    B --> E["DocsAIFeatures (Suspense, if enabled)"]
    B --> F["DocsPageClient (Suspense)"]
    F --> G["children"]

    style A fill:#f0f4ff,stroke:#4f6ef7
    style B fill:#d1fae5,stroke:#059669

    classDef removed fill:#fee2e2,stroke:#ef4444
    OLD["Removed: div#nd-docs-layout style=display:contents caused SpiderMonkey layout bug"]:::removed
Loading

Reviews (1): Last reviewed commit: "chore: format" | Re-trigger Greptile

@Kinfe123 Kinfe123 merged commit 09a21ac into main Apr 27, 2026
8 of 9 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.

1 participant