Skip to content

Enable fumadocs search, dual-theme highlighting, and UX enhancements#99

Merged
huangyiirene merged 7 commits intomainfrom
copilot/enable-fumadocs-features-plugins
Jan 22, 2026
Merged

Enable fumadocs search, dual-theme highlighting, and UX enhancements#99
huangyiirene merged 7 commits intomainfrom
copilot/enable-fumadocs-features-plugins

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 20, 2026

  • Initial plan
  • Enable fumadocs useful features - search, twoslash, better code highlighting, edit on GitHub
  • Update fumadocs configuration for static export and fix component usage
  • Add features demo page showcasing fumadocs enhancements
  • Remove package-lock.json
  • Delete features.mdx
  • Fix CI - Update pnpm-lock.yaml for new dependencies (fumadocs-docgen, fumadocs-twoslash)
Original prompt

启用fumadocs的各种有用的功能和插件


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 20, 2026

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

Project Deployment Review Updated (UTC)
objectos-site Ready Ready Preview, Comment Jan 20, 2026 7:45pm

Request Review

… highlighting, edit on GitHub

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…t usage

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Add various useful features and plugins for Fumadocs Enable fumadocs search, dual-theme highlighting, and UX enhancements Jan 20, 2026
Copilot AI requested a review from hotlong January 20, 2026 15:20
@github-actions
Copy link
Copy Markdown

⚠️ This PR is very large. Consider breaking it down into smaller, more focused changes for easier review.

@huangyiirene
Copy link
Copy Markdown
Contributor

@copilot fix ci

@hotlong
Copy link
Copy Markdown
Contributor

hotlong commented Jan 20, 2026

@copilot 继续

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 20, 2026

@copilot 继续

Fixed CI failure by updating pnpm-lock.yaml to include the new dependencies (fumadocs-docgen and fumadocs-twoslash). Commit: b3989de

@github-actions github-actions bot added size/m and removed size/s labels Jan 21, 2026
@hotlong hotlong marked this pull request as ready for review January 21, 2026 04:24
Copilot AI review requested due to automatic review settings January 21, 2026 04:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enables several fumadocs documentation features including static search, TypeScript twoslash hover information, dual-theme code highlighting (github-light/github-dark), package manager syntax conversion, collapsible sidebar navigation, and GitHub edit links for documentation pages.

Changes:

  • Added fumadocs-docgen and fumadocs-twoslash dependencies for enhanced documentation features
  • Configured dual-theme code highlighting with github-light and github-dark themes
  • Enabled static search functionality in the documentation site
  • Added "Edit on GitHub" links to documentation pages with custom footer component
  • Configured collapsible sidebar with default open level set to 0

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pnpm-lock.yaml Added dependencies for fumadocs-docgen (^3.0.5) and fumadocs-twoslash (^3.1.12) with all transitive dependencies including oxc-transform and TypeScript VFS
apps/site/package.json Added fumadocs-docgen and fumadocs-twoslash to dependencies
apps/site/source.config.ts Configured remarkInstall plugin, dual-theme code highlighting, and transformerTwoslash for TypeScript hover information
apps/site/tailwind.config.ts Added fumadocs-twoslash to content paths and included @tailwindcss/typography plugin
apps/site/app/layout.tsx Enabled static search in RootProvider configuration
apps/site/app/layout.config.tsx Added transparentMode navigation, external flag for GitHub link, and githubUrl property
apps/site/app/global.css Imported fumadocs-twoslash/twoslash.css stylesheet for twoslash styling
apps/site/app/docs/layout.tsx Configured collapsible sidebar with defaultOpenLevel set to 0
apps/site/app/docs/[[...slug]]/page.tsx Implemented custom footer with "Edit on GitHub" link using hardcoded branch and file extension
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +22 to +35
export default defineConfig({
mdxOptions: {
remarkPlugins: [remarkInstall],
rehypeCodeOptions: {
themes: {
light: 'github-light',
dark: 'github-dark',
},
transformers: [
...(rehypeCodeDefaultOptions.transformers ?? []),
transformerTwoslash(),
],
},
},
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The MDX configuration introduces new plugins and transformers (remarkInstall, transformerTwoslash) with dual-theme code highlighting, but lacks inline comments or documentation explaining their purpose and behavior. Consider adding brief comments to explain what each plugin does, especially for future maintainers who may not be familiar with fumadocs ecosystem plugins. For example, explain that remarkInstall handles package manager syntax conversion and transformerTwoslash provides TypeScript hover information.

Copilot uses AI. Check for mistakes.
footer={{
children: (
<a
href={`https://github.com/objectstack-ai/objectos/blob/main/${githubPath}`}
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The GitHub edit URL hardcodes the branch name as 'main'. If the default branch is different (e.g., 'master', 'develop') or if the project uses a different branching strategy, users will be directed to a non-existent page. Consider making the branch name configurable through an environment variable or a constant, or verify that 'main' is indeed the correct default branch for this repository.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +33
<svg className="size-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
</svg>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The inline SVG for the edit icon lacks an accessible title or aria-label attribute, which may create accessibility issues for users relying on screen readers. Consider adding an aria-label to the anchor element or using a semantic component from lucide-react (which is already a dependency) like the Edit icon for better accessibility and maintainability.

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +17
const githubPath = params.slug
? `apps/site/content/docs/${params.slug.join('/')}.mdx`
: 'apps/site/content/docs/index.mdx';
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The GitHub edit link construction assumes all documentation files use the .mdx extension, but this may not always be accurate if some files use .md extension instead. Consider checking the actual file extension from the page metadata or handling both .md and .mdx extensions to avoid potential 404 errors when users click the "Edit this page" link.

Copilot uses AI. Check for mistakes.
Comment on lines 30 to 34
{
text: 'GitHub',
url: 'https://github.com/objectstack-ai/objectos',
external: true,
},
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

There is duplication in the GitHub repository URL configuration. The URL 'https://github.com/objectstack-ai/objectos' appears both in the links array (line 32) and as the githubUrl property (line 36). Consider using only the githubUrl property, as fumadocs-ui can automatically generate the GitHub link in the navigation from this property, avoiding potential inconsistencies if the URL needs to be updated in the future.

Suggested change
{
text: 'GitHub',
url: 'https://github.com/objectstack-ai/objectos',
external: true,
},

Copilot uses AI. Check for mistakes.
@huangyiirene huangyiirene merged commit 4b92555 into main Jan 22, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants