Conversation
WalkthroughThis PR restructures the documentation site's navigation and landing page. The theme changes from maple to mint, navigation tabs are reorganized (including "Swaps" → "Overview"), content is redesigned into a card-based component layout, and new top-level sections are added alongside styling updates. Changes
Possibly Related PRs
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
docs.json (3)
42-152:⚠️ Potential issue | 🟠 MajorTop-level navigation no longer matches the required two-tab structure.
This introduces additional top-level tabs beyond the required IA and renames
HometoOverview.As per coding guidelines, "Configure two navigation tabs in
docs.json: 'Home' and 'API reference'."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs.json` around lines 42 - 152, The top-level navigation in docs.json currently contains multiple tabs ("API Reference", "Toolkit", "Market Makers", "Verifier Contract") and has renamed the required "Home" tab to "Overview"; update docs.json to strictly configure exactly two top-level tabs named "Home" and "API reference" (case- and spacing-exact). Remove or merge the extra tab objects (the ones with "tab": "Toolkit", "tab": "Market Makers", "tab": "Verifier Contract", etc.) and ensure all necessary pages are moved under the two required tabs; rename any "Overview" tab back to "Home", and consolidate the existing "API Reference" content under a single "API reference" tab while preserving its groups (including the openapi entries and page lists).
159-183:⚠️ Potential issue | 🟠 MajorRequired global anchors are missing from the updated navigation model.
I don’t see global anchors for Supported Chains, System Status, and API Keys in the current config.
As per coding guidelines, "Include global anchors for 'Supported Chains', 'System Status', and 'API Keys' in
docs.json."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs.json` around lines 159 - 183, The navbar configuration under "navbar" -> "links" is missing required global anchors for Supported Chains, System Status, and API Keys; add three new link entries with labels "Supported Chains", "System Status", and "API Keys" to the "links" array (matching the existing link object shape used for "Status"/"Explorer"/"Support"), and set their "href" values to the corresponding global anchor IDs (e.g., "#supported-chains", "#system-status", "#api-keys") so the navigation includes these anchors; update the "links" array near the existing entries to include these new objects.
3-9:⚠️ Potential issue | 🟠 MajorRestore required docs theme config and strict mode.
The config currently sets
mintand omits strict appearance mode; this conflicts with repository requirements.Suggested fix
- "theme": "mint", + "theme": "maple", + "appearance": { + "strict": true + },As per coding guidelines, "Set theme to
maplewith primary color#fb4d01(orange) and enableappearance.strict: trueindocs.json."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs.json` around lines 3 - 9, Update the docs.json config: change the "theme" value from "mint" to "maple", ensure the "colors.primary" remains "#fb4d01" (orange) and adjust the "colors" block as needed to match repository style, and add an "appearance" object with "strict": true (i.e., set appearance.strict: true) so the file contains "theme": "maple", "colors": { "primary": "#fb4d01", ... }, and "appearance": { "strict": true }.
🧹 Nitpick comments (1)
index.mdx (1)
12-40: Adjust copy to consistently address the reader as “you.”Some lines are neutral/third-person and should be rewritten in second-person voice for consistency.
As per coding guidelines, "Write in second-person voice ('you') in all documentation content."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@index.mdx` around lines 12 - 40, The content in index.mdx uses mixed voices (neutral/third-person) inside several Card children — e.g., the copy nodes under Card(title="API Quickstart"), Card(title="React Widget"), Card(title="SDK Libraries"), Card(title="What are intents?"), Card(title="Market Makers"), and Card(title="Verifier Contract") — and should be rewritten into consistent second-person voice; update each Card's child text to directly address the reader using "you" (for example change "Execute your first cross-chain swap in minutes." if needed to "Execute your first cross-chain swap in minutes, and get started quickly" or similar second-person phrasing) so all documentation lines use "you" consistently. Ensure only the copy strings inside those Card components are changed and preserve titles, icons, hrefs, and CTA props.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs.json`:
- Around line 45-53: Replace the blank group placeholders in the docs JSON (the
"group": " " objects) with named nested group entries that include a Font
Awesome icon and explicit label; e.g., change the object containing pages like
"integration/distribution-channels/1click-api/about-1click-api" to have "group":
"1Click API", add an "icon": "fas fa-something" (choose an appropriate FA icon),
and if desired wrap pages under a nested "items" or "pages" array according to
existing nav schema; repeat the same refactor for the other occurrence
referenced (the block around lines 79-87) so all group objects use named groups
and include "icon" keys to conform to the navigation standard.
In `@index.mdx`:
- Around line 17-39: The Card components use root-absolute hrefs (e.g.,
href="/integration/...") which violate the guideline to use relative paths;
update each Card's href prop to a relative path (remove the leading slash) for
internal links in this MDX file—locate the Card elements (e.g., the Card
instances titled "API Quickstart", "React Widget", "SDK Libraries", "What are
intents?", "Market Makers", "Verifier Contract") and change their href
attributes from "/..." to "./integration/..." or the correct relative path from
the current document location.
- Around line 16-43: Replace the Two <Columns> blocks with the repository's
introduction page pattern by using <CardGroup> instead: remove the <Columns
cols={4}> and <Columns cols={2}> wrappers and wrap all six <Card> components
inside a single <CardGroup> (or two <CardGroup> blocks if layout needs
grouping), keeping each <Card>'s title, icon, href, cta and body unchanged;
update imports to include CardGroup (remove Columns import if no longer used)
and ensure JSX remains valid with matching opening/closing <CardGroup> tags.
- Around line 1-3: The MDX frontmatter only contains mode and is missing
required fields; update the top frontmatter block (the leading --- section) to
include at minimum title and description keys (e.g., title: "Your Title" and
description: "Short page description"), and optionally add icon, sidebarTitle,
or openapi if this is an API page, ensuring the frontmatter remains valid YAML
inside the existing --- delimiters.
---
Outside diff comments:
In `@docs.json`:
- Around line 42-152: The top-level navigation in docs.json currently contains
multiple tabs ("API Reference", "Toolkit", "Market Makers", "Verifier Contract")
and has renamed the required "Home" tab to "Overview"; update docs.json to
strictly configure exactly two top-level tabs named "Home" and "API reference"
(case- and spacing-exact). Remove or merge the extra tab objects (the ones with
"tab": "Toolkit", "tab": "Market Makers", "tab": "Verifier Contract", etc.) and
ensure all necessary pages are moved under the two required tabs; rename any
"Overview" tab back to "Home", and consolidate the existing "API Reference"
content under a single "API reference" tab while preserving its groups
(including the openapi entries and page lists).
- Around line 159-183: The navbar configuration under "navbar" -> "links" is
missing required global anchors for Supported Chains, System Status, and API
Keys; add three new link entries with labels "Supported Chains", "System
Status", and "API Keys" to the "links" array (matching the existing link object
shape used for "Status"/"Explorer"/"Support"), and set their "href" values to
the corresponding global anchor IDs (e.g., "#supported-chains",
"#system-status", "#api-keys") so the navigation includes these anchors; update
the "links" array near the existing entries to include these new objects.
- Around line 3-9: Update the docs.json config: change the "theme" value from
"mint" to "maple", ensure the "colors.primary" remains "#fb4d01" (orange) and
adjust the "colors" block as needed to match repository style, and add an
"appearance" object with "strict": true (i.e., set appearance.strict: true) so
the file contains "theme": "maple", "colors": { "primary": "#fb4d01", ... }, and
"appearance": { "strict": true }.
---
Nitpick comments:
In `@index.mdx`:
- Around line 12-40: The content in index.mdx uses mixed voices
(neutral/third-person) inside several Card children — e.g., the copy nodes under
Card(title="API Quickstart"), Card(title="React Widget"), Card(title="SDK
Libraries"), Card(title="What are intents?"), Card(title="Market Makers"), and
Card(title="Verifier Contract") — and should be rewritten into consistent
second-person voice; update each Card's child text to directly address the
reader using "you" (for example change "Execute your first cross-chain swap in
minutes." if needed to "Execute your first cross-chain swap in minutes, and get
started quickly" or similar second-person phrasing) so all documentation lines
use "you" consistently. Ensure only the copy strings inside those Card
components are changed and preserve titles, icons, hrefs, and CTA props.
| { | ||
| "group": " ", | ||
| "pages": [ | ||
| "integration/distribution-channels/1click-api/about-1click-api", | ||
| "integration/distribution-channels/1click-api/quickstart", | ||
| "integration/distribution-channels/1click-api/authentication", | ||
| "integration/distribution-channels/1click-api/fee-config" | ||
| ] | ||
| }, |
There was a problem hiding this comment.
Use named nested groups with icons instead of blank group placeholders.
Using "group": " " and icon-less groups in new sections diverges from the navigation standard and makes sidebar structure less clear.
As per coding guidelines, "Use nested groups with Font Awesome icons for navigation in docs.json."
Also applies to: 79-87
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs.json` around lines 45 - 53, Replace the blank group placeholders in the
docs JSON (the "group": " " objects) with named nested group entries that
include a Font Awesome icon and explicit label; e.g., change the object
containing pages like
"integration/distribution-channels/1click-api/about-1click-api" to have "group":
"1Click API", add an "icon": "fas fa-something" (choose an appropriate FA icon),
and if desired wrap pages under a nested "items" or "pages" array according to
existing nav schema; repeat the same refactor for the other occurrence
referenced (the block around lines 79-87) so all group objects use named groups
and include "icon" keys to conform to the navigation standard.
| --- | ||
| hidden: true | ||
| mode: "wide" | ||
| mode: "custom" | ||
| --- |
There was a problem hiding this comment.
Add required title and description frontmatter fields.
This page currently has only mode, which breaks the MDX metadata requirement.
Suggested fix
---
mode: "custom"
+title: "NEAR Intents"
+description: "Learn how you can integrate NEAR Intents across API, SDK, and contract workflows."
---As per coding guidelines, "Every MDX file must include frontmatter with title and description fields; optional fields include icon and sidebarTitle; API pages must include an openapi field referencing the endpoint."
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| --- | |
| hidden: true | |
| mode: "wide" | |
| mode: "custom" | |
| --- | |
| --- | |
| mode: "custom" | |
| title: "NEAR Intents" | |
| description: "Learn how you can integrate NEAR Intents across API, SDK, and contract workflows." | |
| --- |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@index.mdx` around lines 1 - 3, The MDX frontmatter only contains mode and is
missing required fields; update the top frontmatter block (the leading ---
section) to include at minimum title and description keys (e.g., title: "Your
Title" and description: "Short page description"), and optionally add icon,
sidebarTitle, or openapi if this is an API page, ensuring the frontmatter
remains valid YAML inside the existing --- delimiters.
| <Columns cols={4}> | ||
| <Card title="API Quickstart" icon="rocket" href="/integration/distribution-channels/1click-api/quickstart" cta="Integrate" arrow> | ||
| Execute your first cross-chain swap in minutes. | ||
| </Card> | ||
|
|
||
| // Request a quote | ||
| const quote = await fetch('https://1click.chaindefuser.com/v0/quote', { | ||
| method: 'POST', | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| 'Authorization': 'Bearer YOUR_JWT_TOKEN' | ||
| }, | ||
| body: JSON.stringify({ | ||
| swapType: 'EXACT_INPUT', | ||
| originAsset: 'nep141:wrap.near', | ||
| depositType: 'ORIGIN_CHAIN', | ||
| destinationAsset: 'nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near', | ||
| amount: '100000000000000000000000', | ||
| // ... | ||
| }) | ||
| }); | ||
| const result = await quote.json(); | ||
| ``` | ||
| <Card title="React Widget" icon="palette" href="/integration/devkit/react-widget" cta="Integrate" arrow> | ||
| Embed a customizable swap UI with a ready-to-use React component. | ||
| </Card> | ||
|
|
||
| ```python Python | ||
| import requests | ||
| <Card title="SDK Libraries" icon="window-restore" href="/integration/devkit/sdk" cta="Explore" arrow> | ||
| Build with TypeScript, Go, and Rust SDKs for typed API integration. | ||
| </Card> | ||
|
|
||
| # Query supported tokens | ||
| tokens_response = requests.get('https://1click.chaindefuser.com/v0/tokens') | ||
| tokens = tokens_response.json() | ||
| <Card title="What are intents?" icon="lightbulb" href="/getting-started/what-are-intents" cta="Read docs" arrow> | ||
| Learn how the protocol works and core concepts. | ||
| </Card> | ||
| </Columns> | ||
| <Columns cols={2}> | ||
| <Card title="Market Makers" icon="users" href="/integration/market-makers/introduction" cta="Learn how" arrow> | ||
| Provide liquidity by fulfilling cross-chain swap intents. | ||
| </Card> | ||
|
|
||
| # Request a quote | ||
| quote = requests.post( | ||
| 'https://1click.chaindefuser.com/v0/quote', | ||
| headers={ | ||
| 'Content-Type': 'application/json', | ||
| 'Authorization': 'Bearer YOUR_JWT_TOKEN' | ||
| }, | ||
| json={ | ||
| 'swapType': 'EXACT_INPUT', | ||
| 'originAsset': 'nep141:wrap.near', | ||
| 'depositType': 'ORIGIN_CHAIN', | ||
| 'destinationAsset': 'nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near', | ||
| 'amount': '100000000000000000000000', | ||
| # ... | ||
| } | ||
| ) | ||
| result = quote.json() | ||
| ``` | ||
| </CodeGroup> | ||
| </Columns> | ||
| <Card title="Verifier Contract" icon="credit-card" href="/integration/verifier-contract/introduction" cta="Read docs" arrow> | ||
| Interact with the smart contract for custom integrations. | ||
| </Card> | ||
|
|
||
| <Columns cols={2}> | ||
| <img src="/images/widget/swap-widget.png" alt="Swap Widget UI" class="rounded-lg border border-gray-950/10 dark:border-white/10 swap-widget-preview" /> | ||
| <div> | ||
| <h2 class="mb-2"> React Widget </h2> | ||
| <p>Integrate a customizable, cross-chain swap interface into your app with just a few lines of code.</p> | ||
| <p><a href="/integration/devkit/react-widget"> Learn More -> </a></p> | ||
| </div> | ||
| </Columns> | ||
|
|
There was a problem hiding this comment.
Use <CardGroup> for this introduction page navigation grid.
The current Columns-based layout conflicts with the repository’s introduction-page pattern.
As per coding guidelines, "Introduction pages should use <CardGroup> component to guide readers to subtopics."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@index.mdx` around lines 16 - 43, Replace the Two <Columns> blocks with the
repository's introduction page pattern by using <CardGroup> instead: remove the
<Columns cols={4}> and <Columns cols={2}> wrappers and wrap all six <Card>
components inside a single <CardGroup> (or two <CardGroup> blocks if layout
needs grouping), keeping each <Card>'s title, icon, href, cta and body
unchanged; update imports to include CardGroup (remove Columns import if no
longer used) and ensure JSX remains valid with matching opening/closing
<CardGroup> tags.
| <Card title="API Quickstart" icon="rocket" href="/integration/distribution-channels/1click-api/quickstart" cta="Integrate" arrow> | ||
| Execute your first cross-chain swap in minutes. | ||
| </Card> | ||
|
|
||
| // Request a quote | ||
| const quote = await fetch('https://1click.chaindefuser.com/v0/quote', { | ||
| method: 'POST', | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| 'Authorization': 'Bearer YOUR_JWT_TOKEN' | ||
| }, | ||
| body: JSON.stringify({ | ||
| swapType: 'EXACT_INPUT', | ||
| originAsset: 'nep141:wrap.near', | ||
| depositType: 'ORIGIN_CHAIN', | ||
| destinationAsset: 'nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near', | ||
| amount: '100000000000000000000000', | ||
| // ... | ||
| }) | ||
| }); | ||
| const result = await quote.json(); | ||
| ``` | ||
| <Card title="React Widget" icon="palette" href="/integration/devkit/react-widget" cta="Integrate" arrow> | ||
| Embed a customizable swap UI with a ready-to-use React component. | ||
| </Card> | ||
|
|
||
| ```python Python | ||
| import requests | ||
| <Card title="SDK Libraries" icon="window-restore" href="/integration/devkit/sdk" cta="Explore" arrow> | ||
| Build with TypeScript, Go, and Rust SDKs for typed API integration. | ||
| </Card> | ||
|
|
||
| # Query supported tokens | ||
| tokens_response = requests.get('https://1click.chaindefuser.com/v0/tokens') | ||
| tokens = tokens_response.json() | ||
| <Card title="What are intents?" icon="lightbulb" href="/getting-started/what-are-intents" cta="Read docs" arrow> | ||
| Learn how the protocol works and core concepts. | ||
| </Card> | ||
| </Columns> | ||
| <Columns cols={2}> | ||
| <Card title="Market Makers" icon="users" href="/integration/market-makers/introduction" cta="Learn how" arrow> | ||
| Provide liquidity by fulfilling cross-chain swap intents. | ||
| </Card> | ||
|
|
||
| # Request a quote | ||
| quote = requests.post( | ||
| 'https://1click.chaindefuser.com/v0/quote', | ||
| headers={ | ||
| 'Content-Type': 'application/json', | ||
| 'Authorization': 'Bearer YOUR_JWT_TOKEN' | ||
| }, | ||
| json={ | ||
| 'swapType': 'EXACT_INPUT', | ||
| 'originAsset': 'nep141:wrap.near', | ||
| 'depositType': 'ORIGIN_CHAIN', | ||
| 'destinationAsset': 'nep141:arb-0x912ce59144191c1204e64559fe8253a0e49e6548.omft.near', | ||
| 'amount': '100000000000000000000000', | ||
| # ... | ||
| } | ||
| ) | ||
| result = quote.json() | ||
| ``` | ||
| </CodeGroup> | ||
| </Columns> | ||
| <Card title="Verifier Contract" icon="credit-card" href="/integration/verifier-contract/introduction" cta="Read docs" arrow> | ||
| Interact with the smart contract for custom integrations. |
There was a problem hiding this comment.
Switch internal card links to relative paths.
These links are root-absolute (/...) instead of relative.
As per coding guidelines, "Use relative paths for all internal links in MDX documentation files."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@index.mdx` around lines 17 - 39, The Card components use root-absolute hrefs
(e.g., href="/integration/...") which violate the guideline to use relative
paths; update each Card's href prop to a relative path (remove the leading
slash) for internal links in this MDX file—locate the Card elements (e.g., the
Card instances titled "API Quickstart", "React Widget", "SDK Libraries", "What
are intents?", "Market Makers", "Verifier Contract") and change their href
attributes from "/..." to "./integration/..." or the correct relative path from
the current document location.
|
I have been asking devs on our channels - most of who use near intents in their projects - and so far nobody found this to be better than the current version (7 users preferred the current docs - 0 preferred this version) |
This PR switches the main look & feel from the docs to follow the
"mint"theme as suggested by the Defuse Team.I personally prefer the current deployed version and advice against implementing this view, but feel free to merge it if y'all feel it improves the docs readability.