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

Release Notes

  • New Features

    • Added SDK Explorer interface with integrated theme support and responsive design.
  • UI/UX Improvements

    • Updated dark theme colors for improved visual contrast and readability.
  • Documentation

    • Updated page title from "Introduction" to "What is Agentuity?" and refined navigation structure for improved homepage experience.

✏️ 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

This PR introduces an SDK Explorer iframe component to the docs portal, updates routing to use it as the homepage, modifies dark theme color tokens, and adjusts the documentation structure and navigation configuration.

Changes

Cohort / File(s) Summary
SDK Explorer Component
components/SDKExplorerIframe.tsx
New client-side component that renders an external SDK Explorer within an iframe, supporting theme synchronization via postMessage and navigation handling with origin validation.
Docs Page Integration
app/(docs)/\[\[...slug\]\]/page.tsx
Adds guards for undefined slug parameter to render SDKExplorerIframe as homepage; repositions page retrieval logic and updates generateMetadata to return SDK Explorer-specific metadata when slug is absent.
Theming & Styling
app/global.css
Updates dark theme color tokens (cyan-400 to cyan-500) and adds CSS for fixed-position SDK Explorer wrapper with responsive adjustments for mobile viewports.
Navigation & Routing
app/layout.config.tsx, next.config.mjs
Changes primary nav URL from '/Get-Started/what-is-agentuity' to '/'; removes obsolete redirect for the old URL and updates redirect for '/Introduction' to point to the renamed content page.
Documentation Content
content/Get-Started/what-is-agentuity.mdx, content/meta.json
Renames page title to "What is Agentuity?" and adjusts table formatting; updates navigation metadata to replace "index" entry with "SDK Explorer" as the first page.
🚥 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.


📜 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 a2d4c48 and 12bb74f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • next.config.mjs
🔇 Additional comments (1)
next.config.mjs (1)

12-15: Verify if /Introduction should redirect to the SDK Explorer root path.

The redirect destination /Get-Started/what-is-agentuity may be intentional for legacy traffic routing. However, if PR objectives aim to establish the SDK Explorer (currently at /) as the primary entry point, consider whether /Introduction should redirect to / instead. Note that there is no /SDK-Explorer path; the SDK Explorer is served at the root homepage.

✏️ 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.

@parteeksingh24 parteeksingh24 merged commit 7730990 into main Jan 23, 2026
1 check was pending
@parteeksingh24 parteeksingh24 deleted the add-sdk-explorer branch January 23, 2026 00:59
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