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): improve maintenance event template, remove Metis pause #2328

Merged
merged 5 commits into from
Mar 21, 2024

Conversation

bigboydiamonds
Copy link
Collaborator

@bigboydiamonds bigboydiamonds commented Mar 20, 2024

Improving the process for throwing up maintenance components (Banners, Bridge Pause, Bridge Warning, Event Countdown Progress Bar) quickly when we need to pause Bridge.

Created a MaintenanceEvent component that makes it easier to update for new maintenance events, with required components already installed onto Bridge pages.

To spin up new Maintenance notifications around the Bridge experience, next time we just need to update these start/end times and messages to be shown in Banner, Warning, and Event Countdown Progress Bar.

Summary by CodeRabbit

  • New Features
    • Introduced new maintenance event management functionality, including banners and countdown progress bars.
  • Enhancements
    • Updated the Ecotone Fork event with new chain constants, adjusted dates, and banner content.
    • Enhanced logic to handle bridging pauses for Optimism and Base chains during upgrades.
    • Replaced Ecotone Fork-specific components with generic maintenance event components for better flexibility and maintenance handling.

801eabea661ccd42a5e5c8e08d846f107770ee85: synapse-interface preview link

Copy link
Contributor

coderabbitai bot commented Mar 20, 2024

Walkthrough

The updates primarily shift focus from the specific Ecotone Fork event to a more general maintenance event handling within the Synapse interface. This includes changing constants for blockchain chains, adjusting event dates, and updating related content. Additionally, the logic now accommodates a bridging pause for the Optimism and Base chains, and the interface components have been updated to reflect a broader scope of maintenance events.

Changes

Files Summary
.../EcotoneForkUpgrade.tsx & .../index.tsx Shifted from METIS to OPTIMISM and BASE chains, updated Ecotone Fork event dates, content, and IDs; replaced EcotoneForkUpgradeBanner with MaintenanceBanner.
.../Maintenance/Events/template/MaintenanceEvent.tsx Introduced functionality for managing maintenance events, including display components and utilities for maintenance status.
.../state-managed-bridge/index.tsx Shifted to use maintenance event components over Ecotone fork-specific components.

🐰✨
Changes abound, the code does hop,
From Ecotone's fields to maintenance stop.
With banners unfurled, and dates anew,
We bridge through worlds, from old to new.
🌉➡️🔧
In Optimism and Base, we pause with care,
A rabbit's touch in the code we share.
🐾🌿

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>.
    • Generate unit-tests 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 tests 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

Deploying sanguine with  Cloudflare Pages  Cloudflare Pages

Latest commit: 54ca9db
Status: ✅  Deploy successful!
Preview URL: https://b0b91292.sanguine.pages.dev
Branch Preview URL: https://fe-abstract-maintenance.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.

Review Status

Actionable comments generated: 0

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 1fd2528 and 54ca9db.
Files selected for processing (4)
  • packages/synapse-interface/components/Maintenance/Events/example/EcotoneForkUpgrade.tsx (5 hunks)
  • packages/synapse-interface/components/Maintenance/Events/template/MaintenanceEvent.tsx (1 hunks)
  • packages/synapse-interface/pages/index.tsx (2 hunks)
  • packages/synapse-interface/pages/state-managed-bridge/index.tsx (4 hunks)
Additional comments: 12
packages/synapse-interface/pages/index.tsx (1)
  • 6-6: The import and usage of MaintenanceBanner are correctly implemented.
packages/synapse-interface/components/Maintenance/Events/template/MaintenanceEvent.tsx (4)
  • 25-46: The MaintenanceBanner component correctly utilizes the getCountdownTimeStatus and useIntervalTimer hooks to manage its visibility based on the maintenance schedule. The implementation follows React best practices.
  • 49-77: The MaintenanceWarningMessage component correctly determines whether to display a warning message based on the current chain IDs and the maintenance schedule. It properly uses conditional rendering to return null when no warning is necessary.
  • 79-103: The useMaintenanceCountdownProgress hook correctly provides state and components related to the maintenance countdown progress bar. It uses the isChainIncluded utility function to determine applicability based on the current chain IDs.
  • 112-114: The isChainIncluded utility function is correctly implemented to check for the inclusion of specific chain IDs within a given list. This function is essential for determining the applicability of maintenance messages and actions across different chains.
packages/synapse-interface/components/Maintenance/Events/example/EcotoneForkUpgrade.tsx (4)
  • 22-27: The updated constants for the Ecotone Fork event correctly reflect the new dates. This change aligns with the PR's objective to update the maintenance event system.
  • 40-46: The banner content has been appropriately updated to mention the Optimism and Base chains, providing clear communication about the maintenance event.
  • 63-74: The logic for determining whether to display the warning message based on the Optimism and Base chains is correctly implemented. This ensures that users are adequately informed about the maintenance event.
  • 108-125: The useEcotoneForkCountdownProgress hook has been correctly updated to handle the bridging pause for the Optimism and Base chains during the upgrade. This change supports the PR's goal of enhancing the maintenance notification system.
packages/synapse-interface/pages/state-managed-bridge/index.tsx (3)
  • 89-91: The integration of MaintenanceWarningMessage and useMaintenanceCountdownProgress into the StateManagedBridge component is correctly implemented. This update aligns with the PR's objective to standardize maintenance notifications.
  • 525-528: The usage of useMaintenanceCountdownProgress to manage the display of the maintenance countdown progress bar and to determine if the bridge is paused is correctly implemented. This enhances the user experience by providing clear and dynamic maintenance notifications.
  • 605-605: The conditional rendering of MaintenanceWarningMessage based on the maintenance event's pending status is correctly implemented. This ensures that users are only shown relevant warnings.

@aureliusbtc aureliusbtc merged commit b9b84a2 into master Mar 21, 2024
38 of 40 checks passed
@aureliusbtc aureliusbtc deleted the fe/abstract-maintenance branch March 21, 2024 09:38
@trajan0x trajan0x mentioned this pull request Mar 21, 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