Skip to content

Consume reusable Photon Fumadocs theme - #17

Open
Tom Tang (qwerzl) wants to merge 3 commits into
mainfrom
tom/eng-1949-extract-reusable-photon-fumadocs-theme
Open

Consume reusable Photon Fumadocs theme#17
Tom Tang (qwerzl) wants to merge 3 commits into
mainfrom
tom/eng-1949-extract-reusable-photon-fumadocs-theme

Conversation

@qwerzl

@qwerzl Tom Tang (qwerzl) commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

  • replace the embedded Photon theme with @photon-hq/fumadocs-theme@0.1.1
  • install the theme from the internal GitHub Packages registry instead of a private Git dependency
  • keep Astrolabe content, logo, font asset, routing, and deployment configuration local
  • remove components and dependencies that moved into the shared package
  • derive the shared search endpoint from Astrolabe’s centralized docs base path

Dependency

Deployment

Verification

  • authenticated corepack pnpm install --frozen-lockfile
  • corepack pnpm types:check
  • corepack pnpm build
  • installed package reports @photon-hq/fumadocs-theme@0.1.1
  • CodeRabbit and Cloudflare Workers Builds pass

Linear: https://linear.app/photonhq/issue/ENG-1949/extract-reusable-photon-fumadocs-theme

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 11, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
astrolabe-docs fdca47e Jul 12 2026, 02:31 AM

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The docs application now uses the shared Photon Fumadocs theme for providers, layout configuration, styling, page actions, and sidebar actions. Local provider, search, theme-toggle, and action components are removed, dependencies are updated, and setup documentation is added.

Changes

Photon theme migration

Layer / File(s) Summary
Theme dependency and shared layout foundation
docs/package.json, docs/lib/layout.shared.tsx, docs/components/brand.tsx
Adds the Photon theme package, pins Fumadocs versions, configures Photon base options, and exports AstrolabeMark for branding.
Application provider and styling integration
docs/app/layout.tsx, docs/app/global.css
Replaces the local provider with PhotonProvider, configures the search endpoint, and imports Photon styles while preserving mark colors.
Documentation navigation and actions
docs/app/(docs)/[[...slug]]/page.tsx, docs/app/(docs)/layout.tsx
Replaces local page and sidebar actions with Photon components and passes mapped page, navigation, and repository data.
Theme usage documentation and repository setup
docs/.npmrc, docs/README.md, .gitignore
Configures GitHub Packages access, documents Photon theme installation, and ignores the PNPM store directory.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DocsApp
  participant PhotonProvider
  participant PhotonDocsPageHeader
  participant PhotonDocsPageActions
  participant PhotonSidebarActions

  DocsApp->>PhotonProvider: wrap documentation children with searchEndpoint
  DocsApp->>PhotonDocsPageHeader: pass page title, description, and actions
  PhotonDocsPageHeader->>PhotonDocsPageActions: render page URLs and neighbors
  DocsApp->>PhotonSidebarActions: pass repositoryUrl
Loading

Possibly related PRs

  • photon-hq/Astrolabe#16: Establishes related Fumadocs routes and local components that this change replaces with Photon implementations.

Poem

A bunny hops through Photon light,
Replacing widgets left and right.
The docs now search, navigate, and glow,
With shared theme colors in a row.
“Fresh carrots for the build!” we cheer.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adopting the reusable Photon Fumadocs theme package.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tom/eng-1949-extract-reusable-photon-fumadocs-theme

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/app/layout.tsx (1)

18-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Derive the search endpoint from withDocsBasePath instead of hardcoding it.

searchEndpoint="/astrolabe/api/search" duplicates the base-path prefix that withDocsBasePath (used elsewhere in this stack, e.g. docs/app/(docs)/[[...slug]]/page.tsx) already centralizes. A future change to the base path constant would silently desync this literal.

♻️ Proposed fix
-import { PhotonProvider } from 'fumadocs-theme-photon/provider';
+import { PhotonProvider } from 'fumadocs-theme-photon/provider';
+import { withDocsBasePath } from '`@/lib/shared`';
-        <PhotonProvider searchEndpoint="/astrolabe/api/search">
+        <PhotonProvider searchEndpoint={withDocsBasePath('/api/search')}>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/app/layout.tsx` around lines 18 - 20, Update the PhotonProvider
configuration in the layout component to build searchEndpoint through the
existing withDocsBasePath helper instead of hardcoding the /astrolabe prefix,
preserving the /api/search suffix and the current child rendering.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/app/layout.tsx`:
- Around line 18-20: Update the PhotonProvider configuration in the layout
component to build searchEndpoint through the existing withDocsBasePath helper
instead of hardcoding the /astrolabe prefix, preserving the /api/search suffix
and the current child rendering.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5d2bf83b-5d70-4f7b-90cc-abf3b3868363

📥 Commits

Reviewing files that changed from the base of the PR and between a57748e and 060ed57.

⛔ Files ignored due to path filters (1)
  • docs/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • .gitignore
  • docs/README.md
  • docs/app/(docs)/[[...slug]]/page.tsx
  • docs/app/(docs)/layout.tsx
  • docs/app/global.css
  • docs/app/layout.tsx
  • docs/components/brand.tsx
  • docs/components/docs-page-actions.tsx
  • docs/components/provider.tsx
  • docs/components/search.tsx
  • docs/components/sidebar-actions.tsx
  • docs/components/theme-toggle.tsx
  • docs/lib/cn.ts
  • docs/lib/layout.shared.tsx
  • docs/package.json
  • docs/pnpm-workspace.yaml
💤 Files with no reviewable changes (6)
  • docs/components/sidebar-actions.tsx
  • docs/components/search.tsx
  • docs/components/theme-toggle.tsx
  • docs/components/docs-page-actions.tsx
  • docs/lib/cn.ts
  • docs/components/provider.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: CodeRabbit
  • GitHub Check: Workers Builds: astrolabe-docs
⚠️ CI failures not shown inline (1)

GitHub Check: Workers Builds: astrolabe-docs: Workers Builds: astrolabe-docs

Conclusion: failure

View job details

Build ID: [30abb85a-929c-4dcd-b77f-87801bec7df4](https://dash.cloudflare.com/b5176398b5d13edecba1cb601f72e326/workers/services/view/astrolabe-docs/production/builds/30abb85a-929c-4dcd-b77f-87801bec7df4)
Script: [astrolabe-docs](https://dash.cloudflare.com/b5176398b5d13edecba1cb601f72e326/workers/services/view/astrolabe-docs/production)
🔇 Additional comments (9)
docs/README.md (1)

6-18: LGTM!

.gitignore (1)

3-3: LGTM!

docs/pnpm-workspace.yaml (1)

1-3: LGTM!

docs/lib/layout.shared.tsx (1)

6-11: 🎯 Functional Correctness

Confirm theme-switch default in createPhotonBaseOptions.

The previous baseOptions() explicitly disabled themeSwitch; the new call to createPhotonBaseOptions passes only name, mark, homeUrl. If the Photon helper defaults to showing the theme switcher, this reintroduces UI that was intentionally disabled before.

Please check fumadocs-theme-photon's createPhotonBaseOptions signature/defaults (at the pinned commit 2a45c727b85e3e09be9dbfbd5d592cdfd12592c4) for a themeSwitch option and its default value.

docs/app/(docs)/layout.tsx (1)

1-26: LGTM!

docs/app/global.css (1)

5-5: 🩺 Stability & Availability

@import order is valid here. All @import rules come before the first regular CSS rule, so this stylesheet is fine as-is.

			> Likely an incorrect or invalid review comment.
docs/package.json (1)

13-16: 🎯 Functional Correctness

No remaining direct imports. @orama/orama, cnfast, and lucide-react are no longer referenced under docs/.

docs/components/brand.tsx (1)

1-1: 🎯 Functional Correctness

No remaining BrandTitle imports.

docs/app/(docs)/[[...slug]]/page.tsx (1)

30-45: 🎯 Functional Correctness

Check previous/next handling in PhotonDocsPageActions. If those props become plain hrefs, they also need withDocsBasePath; if the component wraps them in Link, the extra prefix is unnecessary.

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