Skip to content

Conversation

@parteeksingh24
Copy link
Contributor

@parteeksingh24 parteeksingh24 commented Jan 13, 2026

  • Add SDKExplorerIframe component with theme sync via postMessage
  • Add SDK-Explorer.mdx page with full-width iframe layout
  • Update redirect and nav URL to /SDK-Explorer
  • Fade-in iframe on load, prevent reload on theme change

Summary by CodeRabbit

  • New Features

    • Embedded interactive SDK Explorer in docs with theme sync, safe in-iframe navigation, and shown as the default when no doc slug is provided.
  • Documentation

    • Updated landing title/site metadata and numerous internal links to use service-scoped paths (e.g., Services/Storage, Services/Observability); minor table formatting tweaks.
  • Chores

    • Updated navigation/redirects, made SDK Explorer primary entry, added responsive overlay styling, and refined dark theme color tokens.

✏️ Tip: You can customize this high-level summary in your review settings.

- Add SDKExplorerIframe component with theme sync via postMessage
- Add SDK-Explorer.mdx page with full-width iframe layout
- Update redirect and nav URL to /SDK-Explorer
- Fade-in iframe on load, prevent reload on theme change
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

Adds a new SDK Explorer iframe component and integrates it as the docs root when no slug is provided; updates global styles, navigation/redirects, metadata handling, and many internal documentation link targets and site metadata ordering.

Changes

Cohort / File(s) Summary
SDK Explorer component
components/SDKExplorerIframe.tsx
New client component rendering the SDK Explorer in an iframe; manages initial theme, posts theme updates, validates NAVIGATE messages, and handles load/fade-in state.
Docs page integration
app/(docs)/[[...slug]]/page.tsx
Guard for undefined params.slug to short-circuit page fetch and render the SDK Explorer; generateMetadata returns SDK Explorer metadata when slug absent; CodeFromFiles import moved.
Styling
app/global.css
Adds .sdk-explorer-wrapper and iframe styles (full-viewport, offsets for nav/sidebar, responsive mobile rule); updates two dark-theme color tokens.
Navigation, redirects & site meta
app/layout.config.tsx, next.config.mjs, content/meta.json
Nav base URL changed to /; redirect rules adjusted (removed /Get-Started/what-is-agentuity -> /, updated /Introduction target); first pages entry replaced with "[SDK Explorer](/)".
Content formatting & link updates
content/Get-Started/what-is-agentuity.mdx, plus many content/.../*.mdx files
Title/table formatting change in what-is-agentuity; numerous internal docs links updated from /Storage and /Observability paths to /Services/Storage and /Services/Observability equivalents (multiple files).

Sequence Diagram(s)

sequenceDiagram
    participant Browser
    participant NextPage as Next.js Page
    participant SDKExplorer as SDKExplorerIframe
    participant IFrame as Explorer IFrame
    participant External as External SDK Service

    Browser->>NextPage: Request docs root (no slug)
    NextPage->>SDKExplorer: Render SDKExplorerIframe
    SDKExplorer->>IFrame: Set src with initialTheme
    IFrame->>External: Load explorer assets/content
    External-->>IFrame: Return content

    Note over SDKExplorer,IFrame: Runtime interactions
    SDKExplorer->>IFrame: postMessage(SET_THEME)
    IFrame-->>SDKExplorer: postMessage(NAVIGATE, path)
    SDKExplorer->>Browser: Validate origin/path and navigate (relative only)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-sdk-explorer


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8573082 and a2d4c48.

📒 Files selected for processing (23)
  • content/Agents/ai-gateway.mdx
  • content/Agents/events-lifecycle.mdx
  • content/Agents/state-management.mdx
  • content/Agents/streaming-responses.mdx
  • content/Learn/Cookbook/Patterns/background-tasks.mdx
  • content/Learn/Cookbook/Patterns/cron-with-storage.mdx
  • content/Learn/Cookbook/Patterns/product-search.mdx
  • content/Learn/Cookbook/Tutorials/rag-agent.mdx
  • content/Reference/CLI/debugging.mdx
  • content/Reference/CLI/deployment.mdx
  • content/Reference/CLI/development.mdx
  • content/Reference/CLI/storage.mdx
  • content/Reference/sdk-reference.mdx
  • content/Routes/cron.mdx
  • content/Services/Observability/logging.mdx
  • content/Services/Observability/sessions-debugging.mdx
  • content/Services/Observability/tracing.mdx
  • content/Services/Storage/custom.mdx
  • content/Services/Storage/database.mdx
  • content/Services/Storage/durable-streams.mdx
  • content/Services/Storage/key-value.mdx
  • content/Services/Storage/object.mdx
  • content/Services/Storage/vector.mdx
✅ Files skipped from review due to trivial changes (8)
  • content/Agents/streaming-responses.mdx
  • content/Learn/Cookbook/Tutorials/rag-agent.mdx
  • content/Reference/CLI/development.mdx
  • content/Learn/Cookbook/Patterns/product-search.mdx
  • content/Services/Storage/vector.mdx
  • content/Agents/state-management.mdx
  • content/Agents/ai-gateway.mdx
  • content/Reference/sdk-reference.mdx
🔇 Additional comments (15)
content/Services/Observability/logging.mdx (1)

163-164: LGTM!

Navigation links correctly updated to the new /Services/Observability/ path structure, consistent with the broader documentation path realignment.

content/Reference/CLI/debugging.mdx (1)

293-293: LGTM!

Logging reference link correctly updated to the new /Services/Observability/logging path.

content/Learn/Cookbook/Patterns/cron-with-storage.mdx (1)

165-165: LGTM!

Key-Value Storage link correctly updated to the new /Services/Storage/key-value path.

content/Agents/events-lifecycle.mdx (1)

254-255: LGTM!

Logging and Tracing links correctly updated to the new /Services/Observability/ paths.

content/Services/Observability/tracing.mdx (1)

268-269: LGTM!

Navigation links correctly updated to the new /Services/Observability/ path structure.

content/Services/Storage/durable-streams.mdx (1)

13-16: LGTM!

The internal navigation links in both the comparison table and Next Steps section are consistently updated to the new /Services/Storage/ path structure.

Also applies to: 399-402

content/Learn/Cookbook/Patterns/background-tasks.mdx (1)

164-164: LGTM!

The durable streams reference is correctly updated to the new /Services/Storage/ path.

content/Services/Storage/custom.mdx (1)

116-119: LGTM!

Next Steps links are consistently updated to the new /Services/Storage/ path structure, aligning with the broader documentation reorganization.

content/Reference/CLI/deployment.mdx (1)

418-419: LGTM!

Next Steps links correctly updated to the new /Services/Observability/ and /Services/Storage/ paths.

content/Services/Observability/sessions-debugging.mdx (1)

144-144: LGTM!

The KV storage reference and Next Steps links are correctly updated to the new /Services/Storage/ and /Services/Observability/ paths, maintaining consistency with the broader documentation restructuring.

Also applies to: 199-200

content/Services/Storage/key-value.mdx (1)

13-16: LGTM!

The navigation links are consistently updated to the new /Services/Storage/... path structure in both the comparison table and Next Steps section.

Also applies to: 281-284

content/Services/Storage/object.mdx (1)

13-16: LGTM!

The navigation links are consistently updated to the new /Services/Storage/... path structure, maintaining alignment with the other storage documentation files.

Also applies to: 153-156

content/Services/Storage/database.mdx (1)

13-16: LGTM!

The navigation links are consistently updated to the new /Services/Storage/... path structure, maintaining consistency with the other storage documentation files.

Also applies to: 156-159

content/Routes/cron.mdx (1)

147-147: LGTM!

The Key-Value Storage link is correctly updated to the new path structure while other non-storage links appropriately remain unchanged.

content/Reference/CLI/storage.mdx (1)

97-97: LGTM!

All storage-related links throughout the CLI documentation are consistently updated to the new /Services/Storage/... path structure, including both in-line references and the Next Steps section.

Also applies to: 144-144, 234-234, 293-293, 317-317, 349-352

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @components/SDKExplorerIframe.tsx:
- Around line 38-46: The message handler in SDKExplorerIframe.tsx's useEffect
(handleMessage) doesn't validate event.origin, enabling open redirects; update
handleMessage to verify the message origin (or message.source matches the known
iframe contentWindow) against an allowlist of trusted origins before acting on
event.data.type === 'NAVIGATE', and only then perform window.location.href =
event.data.path; keep the origin check strict (exact match or configured list)
and ensure the removal of the listener remains unchanged.
- Around line 28-35: The postMessage call in the useEffect currently uses '*'
which broadcasts the theme to all frames; change the targetOrigin to the
explorer iframe's origin instead (compute it via new
URL(explorerUrlOrSrc).origin) and pass that as the second argument to
iframeRef.current.contentWindow.postMessage; ensure you reference the iframe
source or prop (e.g., explorerUrl or iframeRef.current.src) to compute the
origin, validate it exists before posting, and fall back to no-op or a safe
default if the origin cannot be determined.
🧹 Nitpick comments (2)
app/global.css (1)

160-166: Hardcoded mobile nav height may drift from actual nav.

The mobile breakpoint uses a hardcoded 56px for top, while the desktop version uses var(--fd-nav-height, 0px). If the fumadocs-ui nav height changes, this will need manual synchronization.

Consider using the CSS variable consistently, or add a comment documenting why 56px is appropriate for mobile if the variable isn't available in that context.

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

34-46: URL case sensitivity may cause issues.

The check params.slug?.[0] === 'SDK-Explorer' is case-sensitive. If users navigate to /sdk-explorer or /Sdk-Explorer, they'll get the regular DocsPage rendering instead of the iframe.

Consider using a case-insensitive comparison if the URL should be flexible:

-	const isSDKExplorer = params.slug?.[0] === 'SDK-Explorer';
+	const isSDKExplorer = params.slug?.[0]?.toLowerCase() === 'sdk-explorer';

Alternatively, if the canonical URL is strictly /SDK-Explorer, this is fine as-is and Next.js redirects can enforce the casing.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c674de6 and 6291ecb.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • app/(docs)/[[...slug]]/page.tsx
  • app/global.css
  • app/layout.config.tsx
  • components/SDKExplorerIframe.tsx
  • content/Get-Started/what-is-agentuity.mdx
  • content/SDK-Explorer.mdx
  • content/meta.json
  • next.config.mjs
🔇 Additional comments (11)
content/SDK-Explorer.mdx (1)

1-7: LGTM!

Clean placeholder MDX file with appropriate frontmatter. The full: true flag and comment explaining the special handling in page.tsx provide good context for future maintainers.

next.config.mjs (1)

10-20: LGTM!

The redirect configuration is well-structured:

  • Root redirect to /SDK-Explorer uses permanent: false, allowing flexibility to change the landing page later.
  • The /Introduction redirect correctly uses permanent: true since it's a URL migration.
app/layout.config.tsx (1)

9-11: LGTM!

The navigation URL update to /SDK-Explorer is consistent with the redirect configuration in next.config.mjs, ensuring the navbar logo click and root redirect both lead to the same destination.

content/meta.json (1)

4-6: LGTM!

Placing SDK-Explorer first in the navigation order is consistent with the PR's goal of making it the primary entry point. This aligns with the redirect and nav URL changes.

content/Get-Started/what-is-agentuity.mdx (3)

1-4: LGTM!

The title change from "Introduction" to "What is Agentuity" is more descriptive and aligns with the redirect from /Introduction to this page's new URL.


10-28: Verify the model name gpt-5-mini is intentional.

The example uses openai("gpt-5-mini") which doesn't appear to be a current OpenAI model name. If this is a placeholder for documentation purposes, consider adding a comment or using a real model name like gpt-4o-mini to avoid confusion for readers following the example.


51-64: LGTM!

The table formatting and JSX wrapper changes are clean cosmetic updates with no functional impact.

app/global.css (1)

145-152: LGTM!

The fixed positioning approach with CSS variables for sidebar and nav dimensions is clean and integrates well with the fumadocs-ui layout system.

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

37-46: LGTM on the dynamic import pattern.

Using dynamic import for SDKExplorerIframe is appropriate here—it keeps the component out of the main bundle for regular doc pages.

components/SDKExplorerIframe.tsx (2)

14-20: Initial theme detection pattern is solid.

Capturing the initial theme in state prevents iframe URL changes on theme toggle, avoiding unnecessary reloads. The SSR fallback to 'dark' is reasonable.


48-51: LGTM on the hydration mismatch prevention.

Returning a placeholder div until mounted avoids React hydration errors from client-only iframe rendering.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @components/SDKExplorerIframe.tsx:
- Around line 37-50: The message handler in the useEffect (handleMessage)
validates event.origin but then assigns event.data.path directly to
window.location.href; validate the path before navigating by ensuring
event.data.path is either a same-origin URL or a safe relative path: reject
schemes like "javascript:" or any absolute URL whose origin !==
window.location.origin, or require path startsWith('/') and does not contain
protocol characters; if valid, use window.location.assign(path) (or construct a
new URL(path, window.location.href) and compare origins) before navigating.
Ensure checks reference the existing symbols: useEffect, handleMessage,
EXPLORER_URL, event.data.path, and window.location.href/window.location.assign.
🧹 Nitpick comments (1)
components/SDKExplorerIframe.tsx (1)

57-66: Good UX with fade-in transition and accessibility attributes.

One optional consideration: the iframe lacks a sandbox attribute, giving it full capabilities. Since this is a trusted first-party domain, this is likely intentional. If the explorer doesn't need features like form submission or popups, adding sandbox="allow-scripts allow-same-origin" could provide defense-in-depth.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6291ecb and 9a394d3.

📒 Files selected for processing (3)
  • app/(docs)/[[...slug]]/page.tsx
  • app/global.css
  • components/SDKExplorerIframe.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/global.css
  • app/(docs)/[[...slug]]/page.tsx
🔇 Additional comments (4)
components/SDKExplorerIframe.tsx (4)

1-6: LGTM!

Good use of the 'use client' directive and clean constant extraction for the explorer URL.


8-20: LGTM!

The initial theme capture via lazy useState with SSR guard is a solid pattern to avoid hydration mismatches while preserving the initial theme for the iframe URL.


27-35: Previous feedback addressed: targetOrigin now restricted to EXPLORER_URL.

Minor consideration: postMessage may fire before the iframe finishes loading, so the initial theme message could be missed. The iframe's ?theme= query param handles the initial state, so this is acceptable. However, if the user changes theme rapidly before iframe load, those intermediate messages are lost (likely harmless since the next change will sync correctly).


52-55: LGTM!

Good hydration guard with a styled placeholder that maintains layout consistency.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/(docs)/[[...slug]]/page.tsx (1)

110-112: Include the root path in generateStaticParams() for static generation of the SDK Explorer.

For optional catch-all routes ([[...slug]]), generateParams() typically generates params only for content pages and does not include the root path. The SDK Explorer page (at / with slug: undefined) should be explicitly included in static params. Add:

export async function generateStaticParams() {
	return [
		...source.generateParams(),
		{ slug: [] },
	];
}

This ensures the root path is statically generated rather than dynamically rendered on each request.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 18793ae and 7121511.

📒 Files selected for processing (1)
  • app/(docs)/[[...slug]]/page.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
app/(docs)/[[...slug]]/page.tsx (2)
components/SDKExplorerIframe.tsx (1)
  • SDKExplorerIframe (8-77)
lib/source.ts (1)
  • source (5-8)
🔇 Additional comments (4)
app/(docs)/[[...slug]]/page.tsx (4)

14-14: LGTM on imports.

The new SDKExplorerIframe import at line 14 correctly follows the @/components/... alias pattern used by surrounding imports (lines 11-19). The CodeFromFiles import at line 21 follows the relative path pattern already used by adjacent imports (lines 22-25).

Consider standardizing all component imports to use the @/ alias for consistency across the file, but this is a pre-existing style issue and not introduced by this PR.

Also applies to: 21-25


32-38: LGTM on SDK Explorer routing.

The conditional correctly handles the root path case (params.slug === undefined), rendering the SDK Explorer with:

  • Full-width layout via full prop
  • Footer disabled via footer={{ enabled: false }}

This aligns with the PR objectives and efficiently short-circuits before the source.getPage() call.


40-41: LGTM on page retrieval repositioning.

Moving source.getPage() after the undefined slug guard is correct. TypeScript's control flow analysis narrows params.slug to string[] at this point, and the notFound() fallback appropriately handles missing pages.


118-124: LGTM on generateMetadata update.

The metadata guard mirrors the page rendering logic correctly, providing appropriate SEO metadata for the SDK Explorer route. The title format (SDK Explorer — Agentuity Docs) is consistent with the existing pattern used for other pages.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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.

3 participants