Skip to content

Comments

fix: cgid and ff#670

Merged
kvhnuke merged 2 commits intodevelopfrom
fix/cgid-and-ff
Apr 15, 2025
Merged

fix: cgid and ff#670
kvhnuke merged 2 commits intodevelopfrom
fix/cgid-and-ff

Conversation

@kvhnuke
Copy link
Contributor

@kvhnuke kvhnuke commented Apr 14, 2025

Summary by CodeRabbit

  • New Features

    • Added a CoinGecko ID to the COTI network for improved integration with external services.
  • Improvements

    • Enhanced onboarding and wallet reset flows to ensure the window closes only after onboarding is completed, providing a smoother user experience.
  • Chores

    • Updated the extension version to 2.5.1.

@coderabbitai
Copy link

coderabbitai bot commented Apr 14, 2025

Walkthrough

This set of changes updates the openOnboard utility function to return the promise from Browser.tabs.create, allowing its callers to handle the asynchronous result. UI components that invoke openOnboard are updated to await or handle this promise before closing the window, ensuring the window only closes after onboarding is complete. Additionally, the COTI network configuration is updated to include a coingeckoID property. The package version for @enkryptcom/extension is incremented from 2.5.0 to 2.5.1.

Changes

File(s) Summary
packages/extension/package.json Incremented version from 2.5.0 to 2.5.1.
packages/extension/src/libs/utils/open-onboard.ts Modified the function to return the promise from Browser.tabs.create instead of not returning anything.
packages/extension/src/ui/action/App.vue
packages/extension/src/ui/action/views/reset-wallet/index.vue
Updated to handle the promise from openOnboard(), closing the window only after onboarding completes.
packages/extension/src/providers/ethereum/networks/coti.ts Added coingeckoID: 'coti' property to the COTI network configuration object.

Sequence Diagram(s)

sequenceDiagram
    participant UI_Component
    participant openOnboard
    participant Browser

    UI_Component->>openOnboard: Call openOnboard()
    openOnboard->>Browser: tabs.create({ url: 'onboard.html' })
    Browser-->>openOnboard: Promise resolves when tab is created
    openOnboard-->>UI_Component: Return Promise
    UI_Component->>UI_Component: .then(() => window.close())
Loading

Possibly related PRs

  • enkryptcom/enKrypt#600: Also updates the version in the same package, showing a similar maintenance change.
  • enkryptcom/enKrypt#630: Involves enhancements to openOnboard and asynchronous flow, related to the changes in promise handling and UI updates.
  • enkryptcom/enKrypt#631: Modifies how openOnboard is used and handled, focusing on promise handling and initialization checks.

Suggested reviewers

  • NickKelly1
  • gamalielhere

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ 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 plan to trigger planning for file edits and PR creation.
  • @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.

@github-actions
Copy link

github-actions bot commented Apr 14, 2025

💼 Build Files
chrome: enkrypt-chrome-8543146c.zip
firefox: enkrypt-firefox-8543146c.zip

💉 Virus total analysis
chrome: 8543146c
firefox: 8543146c

Copy link

@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

🧹 Nitpick comments (1)
packages/extension/src/ui/action/App.vue (1)

299-301: Good improvement to async handling!

Adding a .then() handler to properly wait for the onboarding tab to be created before closing the window is a good improvement. This ensures the window only closes after the onboarding process has started, providing a better user experience.

However, consider adding error handling to handle cases where tab creation might fail:

-openOnboard().then(() => {
+openOnboard().then(() => {
   window.close();
+}).catch((error) => {
+  console.error('Failed to open onboarding tab:', error);
+  // Could show an error message to the user before closing
+  window.close();
 });
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between caeaeef and 8543146.

📒 Files selected for processing (5)
  • packages/extension/package.json (1 hunks)
  • packages/extension/src/libs/utils/open-onboard.ts (1 hunks)
  • packages/extension/src/providers/ethereum/networks/coti.ts (1 hunks)
  • packages/extension/src/ui/action/App.vue (1 hunks)
  • packages/extension/src/ui/action/views/reset-wallet/index.vue (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: buildAll
  • GitHub Check: test
  • GitHub Check: test
🔇 Additional comments (4)
packages/extension/src/libs/utils/open-onboard.ts (1)

11-11: Now returning the promise from Browser.tabs.create

This is a good improvement as it allows callers to properly handle the asynchronous nature of tab creation. Returning the promise enables proper flow control for actions that should occur after the tab is successfully created.

packages/extension/package.json (1)

3-3: Version bump from 2.5.0 to 2.5.1 looks appropriate

The increment in patch version follows semantic versioning principles for backward-compatible bug fixes and minor changes, which aligns with the nature of the changes in this PR.

packages/extension/src/ui/action/views/reset-wallet/index.vue (1)

71-73: Improved flow by closing window only after onboarding tab creation completes

This change properly handles the Promise returned by the updated openOnboard() function, ensuring the window only closes after the onboarding tab is successfully created. This prevents potential race conditions and improves user experience.

packages/extension/src/providers/ethereum/networks/coti.ts (1)

18-18: Added CoinGecko ID for COTI network

Adding the coingeckoID property enables integration with CoinGecko's API for retrieving price data and other information for the COTI network. The ID 'coti' appears to be correct based on CoinGecko's naming conventions.

@kvhnuke kvhnuke merged commit 35a2cd2 into develop Apr 15, 2025
4 of 5 checks passed
@kvhnuke kvhnuke deleted the fix/cgid-and-ff branch April 15, 2025 18:01
@coderabbitai coderabbitai bot mentioned this pull request Apr 15, 2025
@coderabbitai coderabbitai bot mentioned this pull request Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants