Skip to content

docs: update widget docs#619

Open
shoom3301 wants to merge 3 commits intomainfrom
docs/update-widget-docs
Open

docs: update widget docs#619
shoom3301 wants to merge 3 commits intomainfrom
docs/update-widget-docs

Conversation

@shoom3301
Copy link
Copy Markdown
Contributor

@shoom3301 shoom3301 commented Apr 24, 2026

Description

Updated Widget docs with the latest changes

Summary by CodeRabbit

  • Documentation
    • Quick-start examples updated: width/height now use string CSS units (e.g., "600px").
    • Configuration reference overhauled: new options for targetChainId, iframe origin control (baseUrl, trustedOrigin), forced locale, token selector list controls, disableTrade, disablePostTradeTips, disableWindowOpen, and tokenPairConstraints.
    • Added a dedicated token pair constraints section with example.
    • Removed deprecated banner configuration docs.

@shoom3301 shoom3301 requested a review from a team as a code owner April 24, 2026 08:37
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Apr 27, 2026 10:02am

Request Review

@shoom3301 shoom3301 requested a review from a team April 24, 2026 08:37
@shoom3301 shoom3301 self-assigned this Apr 24, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

📝 Walkthrough

Walkthrough

Updated widget documentation: width/height examples now use CSS-unit strings; the parameter reference table was replaced with a revised set of params (removed provider/env/banners; added targetChainId, baseUrl, trustedOrigin, locale, sellTokenLists/buyTokenLists, disableTrade, tokenPairConstraints, disablePostTradeTips, disableWindowOpen) and a new Token pair constraints section. (45 words)

Changes

Cohort / File(s) Summary
Widget Documentation
docs/cow-protocol/tutorials/widget/widget.md
Rewrote widget quick-start and parameter reference: switched width/height examples to CSS-unit strings; removed deprecated params (provider, env, banners); added new params (targetChainId, baseUrl, trustedOrigin, locale, sellTokenLists, buyTokenLists, disableTrade, tokenPairConstraints, disablePostTradeTips, disableWindowOpen); added dedicated "Token pair constraints" section with example and behavior notes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 I hopped through docs with nimble feet,

Swapped numbers for strings — a neat little feat,
Chains and lists and pairs in a row,
I nudged the widget so options can grow,
A rabbit's tweak — now the guide's complete.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete; it lacks detailed information about what changes were made and why they were necessary. Expand the description to include a 'Changes' section with specific details about parameter updates, removed/added documentation sections, and the reasoning behind these changes.
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive phrasing 'update widget docs' that doesn't convey the specific nature of the changes. Consider a more specific title that highlights the main change, such as 'docs: update widget documentation with new parameters and CSS-unit string examples' or similar.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/update-widget-docs

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
Copy Markdown
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: 3

🤖 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/cow-protocol/tutorials/widget/widget.md`:
- Line 353: Update the `tradeType` table description to replace the sentence
fragment "Can be `swap`, `limit`, or `advanced`" with a full sentence for
clarity — for example: "It can be `swap`, `limit`, or `advanced`." Ensure the
entry referencing `tradeType` and type `TradeType` uses this complete sentence
and preserves the default value `'swap'`.
- Line 351: Update the `chainId` documentation so it lists all chains supported
by the widget consistent with `SupportedChainId` used earlier; specifically
include Avalanche, Polygon, BNB, Linea, and Plasma in addition to Mainnet,
Gnosis Chain, Arbitrum One, Base, and Sepolia so the description matches the
actual supported chains referenced by `SupportedChainId`.
- Line 370: The documentation table incorrectly lists the widget's slippage
parameter as SlippageConfig; update it to FlexibleSlippageConfig to match the
actual accepted type and examples (see FlexibleSlippageConfig defined around
line 244) so the table reflects both global and per-network shapes; locate the
table row for the `slippage` parameter and replace `SlippageConfig` with
`FlexibleSlippageConfig` and optionally add a brief note pointing to the
Slippage configuration section if needed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 684f50a5-3c17-4545-a846-6516ef6fea91

📥 Commits

Reviewing files that changed from the base of the PR and between 99b2eb7 and 2331609.

📒 Files selected for processing (1)
  • docs/cow-protocol/tutorials/widget/widget.md

Comment thread docs/cow-protocol/tutorials/widget/widget.md Outdated
Comment thread docs/cow-protocol/tutorials/widget/widget.md Outdated
Comment thread docs/cow-protocol/tutorials/widget/widget.md Outdated
Copy link
Copy Markdown
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

♻️ Duplicate comments (2)
docs/cow-protocol/tutorials/widget/widget.md (2)

353-353: ⚠️ Potential issue | 🟡 Minor

Fix sentence fragment in tradeType description

The description uses a sentence fragment. Change "Can be swap, limit, or advanced." to a complete sentence for grammatical correctness.

Suggested fix
-| `tradeType`                           | `TradeType`            | `'swap'`            | The type of trade. Can be `swap`, `limit`, or `advanced`.                                                                                                                                                                                                                                                                                                                                    |
+| `tradeType`                           | `TradeType`            | `'swap'`            | The type of trade. It can be `swap`, `limit`, or `advanced`.                                                                                                                                                                                                                                                                                                                                  |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/cow-protocol/tutorials/widget/widget.md` at line 353, The tradeType
table description contains a sentence fragment; update the description for the
`tradeType` (`TradeType`) row so it is a complete sentence — e.g., change "Can
be `swap`, `limit`, or `advanced`." to "It can be `swap`, `limit`, or
`advanced`." ensuring the full cell reads clearly in the docs.

351-351: ⚠️ Potential issue | 🟡 Minor

Update the chainId documentation to include all supported chains

The chainId description references swap.cow.fi generically, but the code examples earlier (lines 89–98) explicitly reference SupportedChainId with 10 specific chains: Mainnet, Arbitrum One, Base, Gnosis Chain, Avalanche, Polygon, BNB, Linea, Plasma, and Sepolia. For better usability, either list all supported chains here or reference the SupportedChainId enum shown in the examples.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/cow-protocol/tutorials/widget/widget.md` at line 351, Update the chainId
documentation to explicitly reference the SupportedChainId enum or list the 10
supported chains shown earlier: Mainnet, Arbitrum One, Base, Gnosis Chain,
Avalanche, Polygon, BNB, Linea, Plasma, and Sepolia; modify the `chainId`
description (symbol: `chainId`, reference: `SupportedChainId`) to either include
that list or add a sentence like "See SupportedChainId enum above for the exact
values" so readers can map names to numeric IDs.
🤖 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/cow-protocol/tutorials/widget/widget.md`:
- Line 370: In the table row for `slippage` / `FlexibleSlippageConfig`, fix the
markdown link by removing the backticks around the anchor so the link text is
[Slippage configuration](`#slippage-configuration`) instead of [Slippage
configuration](`#slippage-configuration`); update the table cell containing
"Sets slippage settings..." accordingly to use the corrected link.

---

Duplicate comments:
In `@docs/cow-protocol/tutorials/widget/widget.md`:
- Line 353: The tradeType table description contains a sentence fragment; update
the description for the `tradeType` (`TradeType`) row so it is a complete
sentence — e.g., change "Can be `swap`, `limit`, or `advanced`." to "It can be
`swap`, `limit`, or `advanced`." ensuring the full cell reads clearly in the
docs.
- Line 351: Update the chainId documentation to explicitly reference the
SupportedChainId enum or list the 10 supported chains shown earlier: Mainnet,
Arbitrum One, Base, Gnosis Chain, Avalanche, Polygon, BNB, Linea, Plasma, and
Sepolia; modify the `chainId` description (symbol: `chainId`, reference:
`SupportedChainId`) to either include that list or add a sentence like "See
SupportedChainId enum above for the exact values" so readers can map names to
numeric IDs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4505f660-b5c7-417d-a03e-147a40efa4e4

📥 Commits

Reviewing files that changed from the base of the PR and between 2331609 and 81a88b7.

📒 Files selected for processing (1)
  • docs/cow-protocol/tutorials/widget/widget.md

Comment thread docs/cow-protocol/tutorials/widget/widget.md Outdated
Copy link
Copy Markdown
Contributor

@limitofzero limitofzero left a comment

Choose a reason for hiding this comment

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

[cause]: Error: Docusaurus found broken links! - in vercel

Copy link
Copy Markdown
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.

♻️ Duplicate comments (1)
docs/cow-protocol/tutorials/widget/widget.md (1)

353-353: ⚠️ Potential issue | 🟡 Minor

Fix sentence fragment in tradeType description.

The description still contains a sentence fragment. Replace "Can be" with a complete sentence for grammatical correctness.

Suggested wording
-| `tradeType`                           | `TradeType`            | `'swap'`            | The type of trade. Can be `swap`, `limit`, or `advanced`.                                                                                                                                                                                                                                                                                                                                    |
+| `tradeType`                           | `TradeType`            | `'swap'`            | The type of trade. It can be `swap`, `limit`, or `advanced`.                                                                                                                                                                                                                                                                                                                                  |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/cow-protocol/tutorials/widget/widget.md` at line 353, The `tradeType`
description contains a sentence fragment; edit the table row for `tradeType`
(the entry showing `TradeType` with default `'swap'`) and replace the fragment
"Can be `swap`, `limit`, or `advanced`." with a complete sentence such as "It
can be `swap`, `limit`, or `advanced`." (or "Values: `swap`, `limit`, or
`advanced`.") so the description for `tradeType` is grammatically correct.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@docs/cow-protocol/tutorials/widget/widget.md`:
- Line 353: The `tradeType` description contains a sentence fragment; edit the
table row for `tradeType` (the entry showing `TradeType` with default `'swap'`)
and replace the fragment "Can be `swap`, `limit`, or `advanced`." with a
complete sentence such as "It can be `swap`, `limit`, or `advanced`." (or
"Values: `swap`, `limit`, or `advanced`.") so the description for `tradeType` is
grammatically correct.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d4515e1d-07e4-444f-b2c0-37ab20d442c4

📥 Commits

Reviewing files that changed from the base of the PR and between 81a88b7 and 7812385.

📒 Files selected for processing (1)
  • docs/cow-protocol/tutorials/widget/widget.md

Copy link
Copy Markdown
Contributor

@kernelwhisperer kernelwhisperer left a comment

Choose a reason for hiding this comment

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

Thank you very much!

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