[PR #4309] [MERGED] docs(api-method): fixed syntax highlighting refreshing on tab change #5307

Closed
opened 2026-03-13 12:18:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4309
Author: @ping-maxwell
Created: 8/30/2025
Status: Merged
Merged: 8/30/2025
Merged by: @Bekacru

Base: canaryHead: fix/docs/api-method-new-fuma


📝 Commits (2)

  • 4576e98 docs(api-method): fixed syntax highlighting refreshing on tab change
  • 06d1021 chore: lint

📊 Changes

3 files changed (+131 additions, -28 deletions)

View changed files

📝 docs/app/docs/[[...slug]]/page.tsx (+5 -5)
docs/components/api-method-tabs.tsx (+98 -0)
📝 docs/components/api-method.tsx (+28 -23)

📄 Description

Syntax highlighting refreshes anytime you change a shadcn tab in the APIMethod component, this bug was introduced after the new fumadocs version which changed codeblocks.

This PR implements a new tab component that keeps the dom elements but hides it instead of removing it from the dom tree, unlike shadcn's tab component. This allows us to retain the syntax highlighting on the codeblocks


Summary by cubic

Fixes code block syntax highlighting resetting on API Method tab changes by replacing shadcn Tabs with a custom tabs component that keeps content mounted. This stops re-renders and preserves highlighting after the fumadocs upgrade.

  • Bug Fixes
    • Added ApiMethodTabs that hides inactive panels instead of unmounting them.
    • Switched APIMethod to use ApiMethodTabs to retain highlighted code blocks.
    • Minor className tweaks in docs pages (no visual or behavioral changes).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/4309 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 8/30/2025 **Status:** ✅ Merged **Merged:** 8/30/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/docs/api-method-new-fuma` --- ### 📝 Commits (2) - [`4576e98`](https://github.com/better-auth/better-auth/commit/4576e98d87c4fde5bab40bf6ebdabfba9f65559d) docs(api-method): fixed syntax highlighting refreshing on tab change - [`06d1021`](https://github.com/better-auth/better-auth/commit/06d1021ef070d48c24de6c35a565004d8d482e12) chore: lint ### 📊 Changes **3 files changed** (+131 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `docs/app/docs/[[...slug]]/page.tsx` (+5 -5) ➕ `docs/components/api-method-tabs.tsx` (+98 -0) 📝 `docs/components/api-method.tsx` (+28 -23) </details> ### 📄 Description Syntax highlighting refreshes anytime you change a shadcn tab in the APIMethod component, this bug was introduced after the new fumadocs version which changed codeblocks. This PR implements a new tab component that keeps the dom elements but hides it instead of removing it from the dom tree, unlike shadcn's tab component. This allows us to retain the syntax highlighting on the codeblocks <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes code block syntax highlighting resetting on API Method tab changes by replacing shadcn Tabs with a custom tabs component that keeps content mounted. This stops re-renders and preserves highlighting after the fumadocs upgrade. - **Bug Fixes** - Added ApiMethodTabs that hides inactive panels instead of unmounting them. - Switched APIMethod to use ApiMethodTabs to retain highlighted code blocks. - Minor className tweaks in docs pages (no visual or behavioral changes). <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:18:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5307