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

feat(synapse-interface): Link to docs #3442

Merged
merged 5 commits into from
Dec 6, 2024
Merged

feat(synapse-interface): Link to docs #3442

merged 5 commits into from
Dec 6, 2024

Conversation

abtestingalpha
Copy link
Collaborator

@abtestingalpha abtestingalpha commented Dec 6, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Updated navigation to include the $SYN token, replacing the previous Contracts link.
    • Added a new URL for the SYN token documentation.
  • Localization Updates

    • Comprehensive updates to localization files for Arabic, English, Spanish, French, Japanese, Turkish, and Chinese, enhancing clarity and usability.
    • New entries added for the $SYN token across multiple languages, improving navigation and user experience.
  • Bug Fixes

    • Improved error messages and user prompts related to bridging functionalities.

9a9aa30: synapse-interface preview link

Copy link
Contributor

coderabbitai bot commented Dec 6, 2024

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/synapse-interface/components/toast/index.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Failed to load parser '@babel/eslint-parser' declared in 'packages/synapse-interface/.eslintrc.js': Cannot find module '@babel/core/package.json'
Require stack:

  • /node_modules/@babel/eslint-parser/lib/parse.cjs
  • /node_modules/@babel/eslint-parser/lib/index.cjs
  • /node_modules/@eslint/eslintrc/dist/eslintrc.cjs
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object. (/node_modules/@babel/eslint-parser/lib/parse.cjs:14:19)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
    at Module._load (node:internal/modules/cjs/loader:1127:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)

Walkthrough

The pull request introduces modifications to the Synapse interface, primarily focusing on updating navigation links and localization files. Key changes include the replacement of the Contracts navigation link with a new SYN link, associated with the $SYN token. Additionally, new constants and localization entries for various languages have been added to enhance user experience and clarity regarding bridging and transactions.

Changes

File Path Change Summary
packages/synapse-interface/components/layouts/LandingPageWrapper/index.tsx Updated MoreInfoButtons function in LandingNav to replace Contracts link with SYN link, modifying to, labelText, and description attributes.
packages/synapse-interface/constants/routes.ts Removed INTERCHAIN_LINK from NAVIGATION and added SYN with path SYN_TOKEN_LINK and text '$SYN'.
packages/synapse-interface/constants/urls/index.tsx Added new constant SYN_TOKEN_LINK pointing to SYN token documentation URL.
packages/synapse-interface/messages/ar.json Comprehensive updates to Arabic localization, including new entries for bridging and transactions, and added $SYN in the "Nav" section.
packages/synapse-interface/messages/en-US.json Updated English localization with grammatical corrections and added $SYN in the "Nav" section.
packages/synapse-interface/messages/es.json Significant updates to Spanish localization, including new translations for various UI elements and added $SYN in the "Nav" section.
packages/synapse-interface/messages/fr.json Comprehensive updates to French localization with new phrases and added $SYN in the "Nav" section.
packages/synapse-interface/messages/jp.json Updates to Japanese localization with new entries and added $SYN in the "Nav" section.
packages/synapse-interface/messages/tr.json Comprehensive updates to Turkish localization, including new translations and warnings, with added $SYN in the "Nav" section.
packages/synapse-interface/messages/zh-CN.json Updates to Chinese localization with new entries for bridging and transactions, and added $SYN in the "Nav" section.
packages/synapse-interface/components/toast/ToastContent.tsx Added a new ToastContent function component to handle toast notifications with dynamic styling based on toastData.
packages/synapse-interface/components/toast/index.tsx Modified CustomToaster to enhance type safety by changing the function declaration to a constant variable with explicit type annotation.
packages/synapse-interface/pages/_app.tsx Added WagmiProvider and GoogleAnalytics components to the provider hierarchy, updating the application context management.

Possibly related PRs

  • feat(synapse-interface): bridge quote uuid #2900: This PR introduces a new property pendingLabel to the BridgeTransactionButton component, which is related to the changes in the main PR that update the MoreInfoButtons function and its navigation links, indicating a connection in the context of transaction handling.
  • feat(synapse-interface): refund RFQ transaction [SLT-272] #3197: This PR adds a new refund status to the _Transaction component, which is directly related to the changes in the main PR that involve updating transaction statuses and handling refunds, indicating a strong connection in functionality.
  • Adding ETH on BNB Chain [SLT-398] #3338: This PR adds support for the ETH token on the BNB chain, which is relevant to the changes in the main PR that involve updating navigation links and token references, indicating a connection in the context of token management and bridging functionality.

Suggested labels

size/s, M-docs

Suggested reviewers

  • bigboydiamonds
  • trajan0x

Poem

In the land of code, where tokens play,
A new path for $SYN has come to stay.
With translations bright, in every tongue,
The bridge is clear, let the songs be sung!
From contracts to tokens, we leap and bound,
In the world of Synapse, joy is found! 🐇✨


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

cloudflare-workers-and-pages bot commented Dec 6, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9a375d0
Status: ✅  Deploy successful!
Preview URL: https://b9ecdf70.sanguine-fe.pages.dev
Branch Preview URL: https://fe-syn-docs.sanguine-fe.pages.dev

View logs

Copy link

codecov bot commented Dec 6, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
sdk-router-@synapsecns/sdk-router-esm 255.26kB 609 bytes (0.24%) ⬆️
sdk-router-@synapsecns/sdk-router-cjs 117.55kB 312 bytes (0.27%) ⬆️
explorer-ui-server-cjs* 724.31kB 141.75kB (-16.37%) ⬇️
explorer-ui-client-array-push* 2.17MB 146.63kB (-6.34%) ⬇️
synapse-interface-client-array-push 7.41MB 132.5kB (1.82%) ⬆️
synapse-interface-server-cjs 1.66MB 160.56kB (10.74%) ⬆️
widget-cjs-esm* 271.27kB 2.03kB (-0.74%) ⬇️
docs-bridge-client-array-push* 7.48MB 425.54kB (-5.39%) ⬇️
docs-bridge-server-cjs* 11.83MB 3.05MB (-20.48%) ⬇️
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

Copy link

cloudflare-workers-and-pages bot commented Dec 6, 2024

Deploying sanguine with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9a375d0
Status: ✅  Deploy successful!
Preview URL: https://99d47cfa.sanguine.pages.dev
Branch Preview URL: https://fe-syn-docs.sanguine.pages.dev

View logs

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 (4)
packages/synapse-interface/components/toast/index.tsx (1)

5-5: Consider adding Props interface for future extensibility

Even though the component currently doesn't accept props, it's a good practice to define an empty props interface for future extensibility.

+interface CustomToasterProps {}
-const CustomToaster: React.FC = () => {
+const CustomToaster: React.FC<CustomToasterProps> = () => {
packages/synapse-interface/components/toast/ToastContent.tsx (3)

Line range hint 8-8: Add TypeScript types for component props

The component is missing proper TypeScript type definitions for its props, which could lead to runtime errors.

+interface ToastContentProps {
+  toastData: {
+    id: string;
+    type: 'success' | 'error' | 'loading' | string;
+  };
+  icon?: React.ReactNode;
+  message: string;
+}

-export default function ToastContent({ toastData, icon, message }) {
+export default function ToastContent({ toastData, icon, message }: ToastContentProps) {

Line range hint 9-10: Add type annotations for local variables

The variables borderColor and fancyIcon lack type annotations, which could lead to type-related issues.

-  let borderColor
-  let fancyIcon
+  let borderColor: string
+  let fancyIcon: React.ReactNode | undefined

Line range hint 11-19: Add prop validation and default values

The component should validate the required props and provide default values where appropriate.

+  if (!toastData) {
+    throw new Error('ToastContent: toastData is required');
+  }
+
+  if (!message) {
+    throw new Error('ToastContent: message is required');
+  }

   if (toastData.type === 'success') {
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 49cc5ef and fab9226.

📒 Files selected for processing (2)
  • packages/synapse-interface/components/toast/ToastContent.tsx (1 hunks)
  • packages/synapse-interface/components/toast/index.tsx (2 hunks)
🔇 Additional comments (1)
packages/synapse-interface/components/toast/index.tsx (1)

Line range hint 5-31: LGTM! Type safety improvement

The change to use explicit React.FC type annotation improves type safety.

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

🧹 Outside diff range and nitpick comments (2)
packages/synapse-interface/pages/_app.tsx (2)

Line range hint 63-63: Move GoogleAnalytics component outside PersistGate

The GoogleAnalytics component should be placed outside PersistGate to ensure it captures all page loads, including the initial load when the persisted state is being restored.

-                  <PersistGate loading={null} persistor={persistor}>
-                    <GoogleAnalytics gaId={'G-BBC13LQXBD'} />
+                  <GoogleAnalytics gaId={'G-BBC13LQXBD'} />
+                  <PersistGate loading={null} persistor={persistor}>

Line range hint 63-63: Use environment variable for Google Analytics ID

The Google Analytics ID should be configured through environment variables to support different environments (development, staging, production).

-                    <GoogleAnalytics gaId={'G-BBC13LQXBD'} />
+                    <GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GA_ID} />

Also, add the following to your .env file:

NEXT_PUBLIC_GA_ID=G-BBC13LQXBD
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fab9226 and 9a375d0.

📒 Files selected for processing (2)
  • packages/synapse-interface/components/toast/index.tsx (2 hunks)
  • packages/synapse-interface/pages/_app.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/synapse-interface/components/toast/index.tsx
🔇 Additional comments (1)
packages/synapse-interface/pages/_app.tsx (1)

Line range hint 56-77: Provider hierarchy looks good

The ordering of providers is correct:

  1. WagmiProvider wraps QueryClientProvider
  2. RainbowKitProvider is properly nested within WagmiProvider
  3. Other providers maintain their necessary hierarchy

@@ -52,6 +52,7 @@ function App({ Component, pageProps }: AppProps) {
timeZone="UTC"
messages={pageProps.messages}
>
{/* @ts-ignore */}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Potential issue

Remove @ts-ignore and fix WagmiProvider type issues

The @ts-ignore comment is being used to suppress type checking for the WagmiProvider component. This is a common issue when using the latest version of wagmi, which can be resolved by:

  • Ensuring wagmiConfig is properly typed using Config from wagmi
  • Updating wagmi dependencies if using an older version
  • Using proper type imports from '@wagmi/core'
🔗 Analysis chain

Avoid using @ts-ignore

The TypeScript ignore comment suppresses type checking which could mask potential issues. Consider fixing the underlying type incompatibility with WagmiProvider instead.

Let's check if there are similar patterns in the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for ts-ignore comments to identify potential type issues
rg "@ts-ignore" --type tsx --type ts

Length of output: 64


Script:

#!/bin/bash
# Search for ts-ignore comments using ripgrep without file type filters
rg "@ts-ignore"

Length of output: 1389


Script:

#!/bin/bash
# Let's check the context around the ts-ignore in _app.tsx to understand what's being ignored
rg -B 2 -A 2 "@ts-ignore" packages/synapse-interface/pages/_app.tsx

Length of output: 238

@abtestingalpha abtestingalpha merged commit e871393 into master Dec 6, 2024
36 of 38 checks passed
@abtestingalpha abtestingalpha deleted the fe/syn-docs branch December 6, 2024 19:51
@coderabbitai coderabbitai bot mentioned this pull request Dec 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.

1 participant