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

Close #[issue_id] #1135

Open
wants to merge 1 commit into
base: testnet
Choose a base branch
from
Open

Close #[issue_id] #1135

wants to merge 1 commit into from

Conversation

Daveside9
Copy link

@Daveside9 Daveside9 commented Mar 22, 2025

Close: #1099

Summary by CodeRabbit

  • New Features

    • Introduced an option for users to cancel their subscriptions directly on the dedicated page.
  • Styles

    • Refined the appearance and interactions for the new cancellation option.
  • Chores

    • Upgraded the underlying framework dependency to a newer major release for improved performance and features.

Copy link

vercel bot commented Mar 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app-starknet-id ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 22, 2025 9:50am

Copy link

vercel bot commented Mar 22, 2025

@Daveside9 is attempting to deploy a commit to the LFG Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Mar 22, 2025

Walkthrough

This pull request updates the Next.js dependency in the project by bumping its version in the package.json file from "^14.2.3" to "^15.2.3". Additionally, it enhances the subscription page by adding a new Cancel Subscription button within the AutoRenewalPage component in pages/subscription.tsx, along with corresponding CSS styling in styles/search.module.css to ensure proper layout and visual behavior.

Changes

File(s) Summary
package.json Updated the Next.js dependency from "^14.2.3" to "^15.2.3".
pages/subscription.tsx, styles/search.module.css Added a new Cancel Subscription button in the subscription page and its associated CSS classes (.cancelContainer, .cancelButton, and hover state).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AutoRenewalPage
    User->>AutoRenewalPage: Navigate to subscription page
    AutoRenewalPage-->>User: Render subscription details with Cancel Subscription button
    User->>AutoRenewalPage: Click "Cancel Subscription" button
    AutoRenewalPage-->>User: Initiate cancellation process
Loading

Suggested labels

❌ Change request

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.

npm warn config production Use --omit=dev instead.
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/next
npm error dev next@"^15.2.3" from the root project
npm error peer next@">=14.0" from [email protected]
npm error node_modules/next-axiom
npm error dev next-axiom@"^1.9.1" from the root project
npm error
npm error Could not resolve dependency:
npm error peer next@"^8.1.1-canary.54 || ^9.0.0 || ^10.0.0-0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0" from [email protected]
npm error node_modules/nextjs-cors
npm error dev nextjs-cors@"^2.1.2" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/next
npm error peer next@"^8.1.1-canary.54 || ^9.0.0 || ^10.0.0-0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0" from [email protected]
npm error node_modules/nextjs-cors
npm error dev nextjs-cors@"^2.1.2" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /.npm/_logs/2025-03-22T09_49_58_002Z-eresolve-report.txt
npm error A complete log of this run can be found in: /.npm/_logs/2025-03-22T09_49_58_002Z-debug-0.log

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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 generate docstrings to generate docstrings for this 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

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: 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 b1cbcfd and 7e916be.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json (1 hunks)
  • pages/subscription.tsx (1 hunks)
  • styles/search.module.css (1 hunks)
🔇 Additional comments (2)
package.json (1)

40-40:

❓ Verification inconclusive

Verify compatibility with Next.js 15

You've updated Next.js from version 14 to 15, which is a major version upgrade that might include breaking changes. This could impact your application functionality.


🌐 Web query:

What are the breaking changes in Next.js 15 compared to Next.js 14?

💡 Result:

Next.js 15 introduces several breaking changes compared to version 14, requiring careful migration. Here are the key updates developers need to address:

Breaking Changes

1. Asynchronous Request APIs

  • cookies(), headers(), draftMode, and searchParams are now asynchronous[4][11][12]
// Before (v14)
const cookieStore = cookies();
const token = cookieStore.get('token');

// After (v15)
const cookieStore = await cookies();
const token = cookieStore.get('token');

This change affects authentication flows like Auth0's getSession[12]

2. Caching Semantics Overhaul

  • fetch requests and client navigations no longer cached by default
  • Explicit cache control required via no-store or force-cache[4][7][13]
// v15 requires explicit caching
fetch(url, { cache: 'force-cache' }); 

3. React 19 Requirement

  • Minimum React version upgraded to 19 RC
  • useFormState deprecated in favor of useActionState[7][11]

4. Image Handling Changes

  • Removed squoosh in favor of sharp (requires manual installation)
  • Default Content-Disposition changed to attachment[7][9]

5. Form Component Migration

  • New <Form> component replaces previous form handling
  • Requires updating form actions and client-side navigation[4][7]
// v15 Form component
import { Form } from 'next/form';
<Form action="/search">{/* Inputs */}</Form>

6. Security Updates

  • Server Actions now use unguessable IDs
  • Dead code elimination removes unused server actions[4][7]

Migration Strategy

  1. Use Codemods

    npx @next/codemod@canary upgrade latest

    Automates 80%+ of breaking changes[7][11]

  2. Update Dependencies

    npm install next@latest react@rc react-dom@rc
  3. Address Key Areas:

    • Convert synchronous API calls to async/await
    • Add explicit cache control to fetch requests
    • Migrate image processing to sharp
    • Update form components and authentication flows

Note: While Next.js 15 contains breaking changes, most App Router users won't be affected[7]. The migration focuses on:

  • Async API conversion
  • Cache strategy adjustments
  • Dependency updates
  • Security hardening

Developers should test extensively after upgrading, particularly around authentication flows and data fetching patterns. The React 19 upgrade also requires verifying hook usage and state management[11][13].

Citations:


Action: Verify Next.js 15 Migration Impacts

The updated Next.js version (^15.2.3) introduces several breaking changes compared to version 14. Please ensure that your codebase addresses these key areas before fully upgrading:

  • API Adjustments: Asynchronous changes for cookies(), headers(), draftMode, and searchParams. Confirm that any synchronous calls are updated with await.
  • Caching Behavior: Explicit cache control is now required for fetch requests. Review areas where caching behavior might have been implicitly relied upon.
  • React Upgrade: Next.js 15 now requires at least React 19 RC. Verify that your project and its dependencies conform to this requirement.
  • Image Handling: The migration from squoosh to sharp may require manual installation and adjustments.
  • Form Component Changes: If your application uses form components, ensure you update to the new <Form> component and adapt your form actions accordingly.
  • Security Updates: New handling of server actions (including unguessable IDs and dead code elimination) should be evaluated, especially in authentication flows.

Consider running the recommended codemod (npx @next/codemod@canary upgrade latest) to automate most migration tasks and then manually review any areas that need fine-tuning.

styles/search.module.css (1)

299-319: Style implementation looks good

The styling for the cancel button is appropriate with a red background indicating a destructive action, and the hover state provides good user feedback.

Consider adding a media query for better responsiveness on smaller screens:

.cancelButton {
  background: #d83a3a;
  color: white;
  font-weight: bold;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
}

.cancelButton:hover {
  background: #b52e2e;
}

+@media (max-width: 768px) {
+  .cancelButton {
+    width: 100%;
+    max-width: 280px;
+  }
+}

Comment on lines +12 to +16

{/* Cancel Subscription Button */}
<div className={styles.cancelContainer}>
<button className={styles.cancelButton}>Cancel Subscription</button>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add functionality to the Cancel Subscription button

The Cancel Subscription button has been added but doesn't have any onClick handler to actually perform the cancellation action.

<div className={styles.cancelContainer}>
-  <button className={styles.cancelButton}>Cancel Subscription</button>
+  <button 
+    className={styles.cancelButton}
+    onClick={() => handleCancelSubscription()}
+    aria-label="Cancel Subscription"
+  >
+    Cancel Subscription
+  </button>
</div>

Also, consider adding a confirmation dialog before canceling since this is a destructive action.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{/* Cancel Subscription Button */}
<div className={styles.cancelContainer}>
<button className={styles.cancelButton}>Cancel Subscription</button>
</div>
{/* Cancel Subscription Button */}
<div className={styles.cancelContainer}>
<button
className={styles.cancelButton}
onClick={() => handleCancelSubscription()}
aria-label="Cancel Subscription"
>
Cancel Subscription
</button>
</div>

Copy link
Collaborator

@Marchand-Nicolas Marchand-Nicolas left a comment

Choose a reason for hiding this comment

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

It's not on the right page.
It should be on the /identities page.

You'll need to wait for the others issues mentioned here to be merged #1100

Please mint a testnet domain here https://sepolia.app.starknet.id/ so that you can test

@Marchand-Nicolas Marchand-Nicolas added the ❌ Change request Change requested from reviewer label Mar 23, 2025
@Daveside9
Copy link
Author

It's not on the right page. It should be on the /identities page.

You'll need to wait for the others issues mentioned here to be merged #1100

Please mint a testnet domain here https://sepolia.app.starknet.id/ so that you can test

okay will fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❌ Change request Change requested from reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New "subscription button" - Add a new cancel button when subscription is active
2 participants