Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Routes Component [slt-317] #3226

Merged
merged 6 commits into from
Oct 7, 2024

Conversation

trajan0x
Copy link
Contributor

@trajan0x trajan0x commented Oct 3, 2024

Reverts #3225

Summary by CodeRabbit

  • Documentation
    • Added a new section in the Routes documentation outlining supported tokens by blockchain and instructions for using the Synapse Bridge.
    • Updated titles and labels in the Code Examples documentation for clarity.
    • Modified a hyperlink in the Bridge documentation for improved navigation.
    • Deleted the Supported Routes documentation, consolidating information into existing sections.
    • Enhanced the rendering logic for displaying chain images and token icons in the Routes component.

1f58c29: docs preview link
7baaa9a: docs preview link
2cca32b: docs preview link

Copy link
Contributor

coderabbitai bot commented Oct 3, 2024

Walkthrough

The changes involve updates to the documentation files related to the Synapse Bridge. A new section has been added to 03-Routes.md that includes an import statement for the Routes component and provides an overview of supported tokens by blockchain. Modifications in 04-Code-Examples.md include updates to section titles for clarity, while index.md has a hyperlink updated to point to the new routes documentation. Additionally, two files related to supported routes have been deleted.

Changes

File Path Change Summary
docs/bridge/docs/01-About/03-Routes.md Added a new section with an import statement for the Routes component and overview of tokens.
docs/bridge/docs/02-Bridge/04-Code-Examples.md Updated section titles and labels for clarity; no changes to code snippets.
docs/bridge/docs/02-Bridge/index.md Updated hyperlink for "20+ EVM and non-EVM blockchains" to point to /docs/About/Routes.
docs/bridge/docs/02-Bridge/05-Supported-Routes.md
docs/bridge/docs/02-Bridge/_05-Supported-Routes.md
Deleted files containing documentation on supported routes for the Synapse Bridge.

Possibly related PRs

  • feat(rest-api): Adds validateRouteExists validation [SLT-260] #3180: The addition of the validateRouteExists function enhances route validation, which is directly related to the documentation updates in the main PR that instruct users to verify routes between token pairs.
  • Hide Routes component #3225: The removal of the <Routes /> component in the documentation is directly related to the changes made in the main PR, which also involves the Routes component and its usage in the documentation.

Suggested labels

size/s, Sol, Typescript

Suggested reviewers

  • trajan0x

Poem

In the land of code, where rabbits hop,
New routes are drawn, we’ll never stop!
With examples clear and links that shine,
Our Synapse Bridge is simply divine!
Hopping through tokens, we’ll find our way,
Join us, dear friends, let’s code and play! 🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between af4f8ae and 91653c9.

📒 Files selected for processing (1)
  • docs/bridge/src/components/Routes.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/bridge/src/components/Routes.tsx

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🧹 Outside diff range and nitpick comments (1)
docs/bridge/docs/01-About/03-Routes.md (1)

5-5: LGTM with a minor suggestion: Consider adding more context.

The explanatory text is clear and informative, providing good context for the Routes component. It also helpfully directs users to the Synapse Bridge for checking route availability.

Consider adding a brief explanation of what the Routes component will display, to set user expectations. For example:

- This page contains a list of supported tokens, listed per-chain. For a given pair, use the [Synapse Bridge](https://synapseprotocol.com) to see if a route between them exists.
+ This page contains a list of supported tokens, listed per-chain. The table below shows all available routes between chains and tokens. For a given pair, use the [Synapse Bridge](https://synapseprotocol.com) to see if a specific route between them exists and to perform the transfer.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b93ba4b and 74da268.

📒 Files selected for processing (5)
  • docs/bridge/docs/01-About/03-Routes.md (1 hunks)
  • docs/bridge/docs/02-Bridge/04-Code-Examples.md (1 hunks)
  • docs/bridge/docs/02-Bridge/05-Supported-Routes.md (0 hunks)
  • docs/bridge/docs/02-Bridge/_05-Supported-Routes.md (0 hunks)
  • docs/bridge/docs/02-Bridge/index.md (1 hunks)
💤 Files with no reviewable changes (2)
  • docs/bridge/docs/02-Bridge/05-Supported-Routes.md
  • docs/bridge/docs/02-Bridge/_05-Supported-Routes.md
✅ Files skipped from review due to trivial changes (1)
  • docs/bridge/docs/02-Bridge/04-Code-Examples.md
🔇 Additional comments (4)
docs/bridge/docs/01-About/03-Routes.md (3)

1-1: LGTM: Import statement is correct.

The import statement for the Routes component is properly formatted and uses the @site alias, which is typical for documentation frameworks like Docusaurus.


3-3: LGTM: Clear and descriptive section header.

The "Chains & Tokens" header effectively communicates the content of this section.


7-7: LGTM: Component rendering looks correct. Verify component behavior.

The Routes component is correctly rendered using JSX syntax, which is appropriate for React-based documentation systems like Docusaurus.

To ensure the Routes component functions as expected, please verify:

  1. The component renders without errors in the documentation.
  2. It displays the intended information about supported chains and tokens.
  3. The data shown is up-to-date and consistent with the current state of the Synapse Bridge.

Consider running the documentation locally and checking the rendered output of this page.

docs/bridge/docs/02-Bridge/index.md (1)

10-10: Approved: Hyperlink update aligns with PR objectives.

The change from ./Supported-Routes to /docs/About/Routes appears to be reverting a previous modification, which aligns with the PR's objective of "Revert 'Hide Routes component'". This update potentially improves access to route information.

To ensure the new link is correct and functional, please run the following verification:

✅ Verification successful

Verified: Hyperlink update is correct and no remaining references to 'Supported-Routes' were found.

The new link /docs/About/Routes is functional and aligns with the PR objectives. All references to Supported-Routes have been successfully removed from the documentation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the existence of the new Routes page
fd -t f "Routes.md" docs/About

# Check for any remaining references to the old path
rg -i "Supported-Routes" docs/

Length of output: 159


Script:

#!/bin/bash
# Locate all Routes.md files in the repository
fd -t f "Routes.md"

# Search for any remaining references to 'Supported-Routes' in the documentation
rg -i "Supported-Routes" docs/

Length of output: 89

Copy link

cloudflare-workers-and-pages bot commented Oct 3, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 91653c9
Status: ✅  Deploy successful!
Preview URL: https://c20fabff.sanguine-fe.pages.dev
Branch Preview URL: https://revert-3225-docs-hide-routes.sanguine-fe.pages.dev

View logs

Copy link

codecov bot commented Oct 3, 2024

Bundle Report

Changes will decrease total bundle size by 3.74MB (-10.5%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sdk-router-@synapsecns/sdk-router-esm* 255.08kB 426 bytes (0.17%) ⬆️
sdk-router-@synapsecns/sdk-router-cjs* 527.17kB 409.93kB (349.65%) ⬆️
explorer-ui-server-cjs* 708.77kB 157.29kB (-18.16%) ⬇️
explorer-ui-client-array-push* 2.15MB 162.81kB (-7.04%) ⬇️
synapse-interface-client-array-push* 7.38MB 100.07kB (1.38%) ⬆️
synapse-interface-server-cjs* 1.65MB 150.9kB (10.1%) ⬆️
widget-cjs-esm* 271.27kB 2.03kB (-0.74%) ⬇️
docs-bridge-client-array-push 7.18MB 724.77kB (-9.17%) ⬇️
docs-bridge-server-cjs 11.17MB 3.71MB (-24.92%) ⬇️
synapse-constants-esm-cjs* 174.63kB 174.63kB (100%) ⬆️
synapse-constants-cjs-esm* 174.18kB 174.18kB (100%) ⬆️

ℹ️ *Bundle size includes cached data from a previous commit

@trajan0x trajan0x changed the title Revert "Hide Routes component" Revert "Hide Routes component" [slt-160] Oct 5, 2024
@trajan0x trajan0x changed the title Revert "Hide Routes component" [slt-160] Add Routes Component [slt-160] Oct 5, 2024
@trajan0x trajan0x changed the title Add Routes Component [slt-160] Add Routes Component [slt-317] Oct 5, 2024
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

🧹 Outside diff range and nitpick comments (1)
docs/bridge/src/components/Routes.tsx (1)

25-26: Improved image rendering with a suggestion

The changes improve the rendering of chain images by using a standard <img> element with proper attributes. This enhances accessibility and prevents layout shifts. However, consider adding error handling for the image.

Consider adding an onError handler to the <img> element to gracefully handle cases where the image fails to load:

- <img width="28" height="28" src={chainImg} alt={chain.name} />
+ <img
+   width="28"
+   height="28"
+   src={chainImg}
+   alt={chain.name}
+   onError={(e) => {
+     e.currentTarget.style.display = 'none';
+     // Optionally, you can set a fallback image or show the chain name as text
+   }}
+ />

This will ensure a better user experience if the image fails to load for any reason.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 74da268 and af4f8ae.

📒 Files selected for processing (1)
  • docs/bridge/src/components/Routes.tsx (2 hunks)
🧰 Additional context used
🔇 Additional comments (1)
docs/bridge/src/components/Routes.tsx (1)

14-14: LGTM: Improved variable extraction

The extraction of chain.chainImg into a separate variable enhances code readability and potentially improves performance by avoiding repeated property access.

@github-actions github-actions bot added size/s and removed size/xs labels Oct 7, 2024
@abtestingalpha abtestingalpha merged commit c167cf0 into master Oct 7, 2024
30 checks passed
@abtestingalpha abtestingalpha deleted the revert-3225-docs/hide-routes-component branch October 7, 2024 15:37
This was referenced Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants