Skip to content

chore: enable maintenenace#1294

Merged
jjramirezn merged 2 commits intopeanut-walletfrom
fix/maintainance-setup
Oct 7, 2025
Merged

chore: enable maintenenace#1294
jjramirezn merged 2 commits intopeanut-walletfrom
fix/maintainance-setup

Conversation

@kushagrasarathe
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Oct 7, 2025

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

Project Deployment Preview Comments Updated (UTC)
peanut-wallet Building Building Preview Comment Oct 7, 2025 1:23pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 7, 2025

Walkthrough

Globalizes a Banner component across key layouts, simplifies maintenance banner logic to config-driven behavior, removes route-based maintenance config and the UnderMaintenance component, adds a disabled prop to DirectSendQr and uses it in WalletNavigation based on maintenance config, and updates middleware to use the new underMaintenance.config.

Changes

Cohort / File(s) Summary
Layout integrations (Banner mounting)
src/app/(mobile-ui)/layout.tsx, src/app/(setup)/layout.tsx, src/app/[...recipient]/payment-layout-wrapper.tsx
Import and render the shared Banner component within main content areas; remove prior inline banner logic where applicable; no changes to existing layout logic.
Banner system updates
src/components/Global/Banner/MaintenanceBanner.tsx, src/components/Global/Banner/index.tsx
Simplify MaintenanceBanner to always render a generic warning banner; remove pathname/route checks. Update Banner index to use underMaintenance.config flags, drop per-path logic, and suppress beta feedback banner on / and /setup.
Maintenance config refactor
src/config/routesUnderMaintenance.ts, src/config/underMaintenance.config.ts
Delete route-based maintenance config module. Add new underMaintenance.config with enableFullMaintenance and enableMaintenanceBanner booleans as the single source of truth.
Middleware wiring
src/middleware.ts
Replace hardcoded maintenance flag with maintenanceConfig.enableFullMaintenance; preserve allowlist and redirect behavior when enabled.
DirectSend QR disablement
src/components/Global/DirectSendQR/index.tsx, src/components/Global/WalletNavigation/index.tsx
Add disabled?: boolean prop to DirectSendQr and pass it through to the button. In MobileNav, set disabled={underMaintenanceConfig.enableFullMaintenance}.
UnderMaintenance removal
src/components/Global/UnderMaintenance/index.tsx, src/components/index.ts
Remove UnderMaintenance component and its re-export from the public components index.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • jjramirezn
  • Hugo0

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title “chore: enable maintenenace” is related to the overall changes around maintenance mode but contains a spelling error and is too generic to clearly convey the scope of the refactor and banner updates introduced in this pull request. Please correct the typo in “maintenance” and revise the title to clearly reflect the main changes, for example “chore: enable maintenance mode with global banner and configuration flags.”
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description Check ❓ Inconclusive No pull request description was provided, leaving reviewers without context about the extensive updates to the maintenance configuration, banner component, layout files, and middleware. Please add a concise description summarizing the primary changes, such as the introduction of the underMaintenance.config file, global banner integration into various layouts, and middleware adjustments for maintenance mode.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/maintainance-setup

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.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Oct 7, 2025
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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c6e5de9 and df006c8.

📒 Files selected for processing (12)
  • src/app/(mobile-ui)/layout.tsx (2 hunks)
  • src/app/(setup)/layout.tsx (2 hunks)
  • src/app/[...recipient]/payment-layout-wrapper.tsx (2 hunks)
  • src/components/Global/Banner/MaintenanceBanner.tsx (1 hunks)
  • src/components/Global/Banner/index.tsx (2 hunks)
  • src/components/Global/DirectSendQR/index.tsx (2 hunks)
  • src/components/Global/UnderMaintenance/index.tsx (0 hunks)
  • src/components/Global/WalletNavigation/index.tsx (2 hunks)
  • src/components/index.ts (0 hunks)
  • src/config/routesUnderMaintenance.ts (0 hunks)
  • src/config/underMaintenance.config.ts (1 hunks)
  • src/middleware.ts (1 hunks)
💤 Files with no reviewable changes (3)
  • src/components/index.ts
  • src/components/Global/UnderMaintenance/index.tsx
  • src/config/routesUnderMaintenance.ts
🧰 Additional context used
🧬 Code graph analysis (7)
src/app/(setup)/layout.tsx (1)
src/components/Global/Banner/index.tsx (1)
  • Banner (11-25)
src/components/Global/Banner/MaintenanceBanner.tsx (1)
src/components/Global/Banner/index.tsx (1)
  • MaintenanceBanner (47-47)
src/components/Global/DirectSendQR/index.tsx (1)
src/components/Global/Icons/Icon.tsx (1)
  • IconName (64-125)
src/app/[...recipient]/payment-layout-wrapper.tsx (1)
src/components/Global/Banner/index.tsx (1)
  • Banner (11-25)
src/app/(mobile-ui)/layout.tsx (1)
src/components/Global/Banner/index.tsx (1)
  • Banner (11-25)
src/components/Global/Banner/index.tsx (1)
src/components/Global/Banner/MaintenanceBanner.tsx (1)
  • MaintenanceBanner (3-5)
src/components/Global/WalletNavigation/index.tsx (1)
src/components/Global/DirectSendQR/index.tsx (1)
  • DirectSendQr (172-480)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Deploy-Preview
🔇 Additional comments (12)
src/components/Global/DirectSendQR/index.tsx (1)

177-177: LGTM! Clean addition of the disabled prop.

The disabled prop is properly typed, has a sensible default value, and is correctly passed through to the underlying Button component. This enables the button to be disabled during maintenance mode.

Also applies to: 183-183, 410-410

src/components/Global/Banner/MaintenanceBanner.tsx (1)

3-5: LGTM! Good simplification.

Removing the pathname-based logic and always rendering the same maintenance message is consistent with the config-driven maintenance approach. The parent Banner component now controls when to render this component based on the maintenance config.

src/components/Global/WalletNavigation/index.tsx (1)

4-4: LGTM! Correct integration of maintenance mode.

The DirectSendQr button in the mobile navigation is now correctly disabled when full maintenance mode is enabled. This prevents users from accessing the QR scanner functionality during maintenance.

Also applies to: 85-88

src/app/(mobile-ui)/layout.tsx (1)

20-20: LGTM! Banner centralization improves maintainability.

Moving the banner rendering to a dedicated Banner component centralizes the maintenance and feedback banner logic, making it easier to manage across different layouts.

Also applies to: 108-109

src/app/[...recipient]/payment-layout-wrapper.tsx (1)

8-8: LGTM! Consistent banner integration.

The Banner component is rendered consistently with other layouts, ensuring maintenance and feedback banners appear appropriately across the payment flows.

Also applies to: 30-32

src/app/(setup)/layout.tsx (1)

9-9: LGTM! Banner integration in setup layout.

The Banner component is correctly integrated into the setup layout. Note that while the feedback banner won't display on the /setup path (as per the Banner component's logic), the maintenance banner will still show when maintenance mode is enabled, which appears intentional.

Also applies to: 23-28

src/middleware.ts (1)

4-4: LGTM! Middleware correctly uses the config-driven approach.

The middleware now uses maintenanceConfig.enableFullMaintenance instead of a hardcoded flag, making maintenance mode easier to control. The allowed paths (landing page, support, and maintenance page) remain accessible during full maintenance, which is appropriate.

Also applies to: 9-23

src/config/underMaintenance.config.ts (1)

1-19: LGTM! Excellent documentation and clear interface.

The maintenance configuration is well-documented with clear explanations of both maintenance modes and their intended use cases. The interface is simple and the default export pattern is appropriate.

Also applies to: 21-24, 31-31

src/components/Global/Banner/index.tsx (4)

6-6: LGTM!

The import change aligns with the new config-driven maintenance approach, simplifying the maintenance logic.


20-21: LGTM!

The early return logic clearly suppresses the beta FeedbackBanner on the root and setup pages, which is appropriate.


23-23: LGTM!

The comment update accurately describes when the beta feedback banner is displayed.


15-18: Maintenance banner logic validated
underMaintenanceConfig exports both boolean flags, and per its documentation both modes render the same MaintenanceBanner.

@jjramirezn jjramirezn merged commit 416cfc4 into peanut-wallet Oct 7, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants