Skip to content

Conversation

@Dargon789
Copy link
Owner

@Dargon789 Dargon789 commented Jan 4, 2026

Summary by Sourcery

Add Nebula chat support for swap and approval actions with shared transaction handling, alongside dependency upgrades and new GitHub Pages workflows.

New Features:

  • Introduce Nebula swap and approve transaction cards with dedicated layouts and Storybook stories.
  • Extend Nebula chat to handle structured action messages for signing transactions and swaps, including new swap intent data types.

Bug Fixes:

  • Handle optional transaction value fields and strengthen parsing and typing of Nebula action payloads from the chat API and streaming responses.
  • Improve error logging when processing malformed Nebula action messages instead of silently ignoring failures.

Enhancements:

  • Refactor transaction status, hash display, and sending logic into shared utilities and hooks reused by execute and swap transaction components.
  • Simplify Nebula chat message rendering via a dedicated RenderMessage component and remove legacy fallback transaction handling.
  • Tweak Nebula transaction card layouts and button spacing for more consistent and constrained UI presentation.

Build:

  • Upgrade various app and package dependencies including linting, bundler, SDK, UI, and search libraries across portal, dashboard, wallet UI, playground, and core packages.

CI:

  • Add GitHub Actions workflows for building and deploying Next.js, Jekyll, and static sites to GitHub Pages.

Deployment:

  • Introduce GitHub Pages deployment workflows to publish built artifacts from different site types.

Tests:

  • Add Storybook coverage for Nebula swap and approve transaction cards and update existing Nebula execute transaction and chat stories to the new action-based message model.

Chores:

  • Add changeset entries documenting dependency upgrades and the new Nebula swap and approve UI changes.

Dargon789 and others added 23 commits April 20, 2025 22:31
Snyk has created this PR to upgrade nextjs-toploader from 1.6.12 to 3.8.16.

See this package in npm:
nextjs-toploader

See this project in Snyk:
https://app.snyk.io/org/dargon789/project/a19f499f-38be-44a8-b151-119edbfc95d2?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade shiki from 1.27.0 to 3.2.1.

See this package in npm:
shiki

See this project in Snyk:
https://app.snyk.io/org/dargon789/project/a19f499f-38be-44a8-b151-119edbfc95d2?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade flexsearch from 0.7.43 to 0.8.143.

See this package in npm:
flexsearch

See this project in Snyk:
https://app.snyk.io/org/dargon789/project/a19f499f-38be-44a8-b151-119edbfc95d2?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade @walletconnect/sign-client from 2.19.1 to 2.19.2.

See this package in npm:
@walletconnect/sign-client

See this project in Snyk:
https://app.snyk.io/org/dargon789/project/b2aa4281-7627-443a-bbf2-b110a878f4b9?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade @coinbase/wallet-sdk from 4.3.0 to 4.3.2.

See this package in npm:
@coinbase/wallet-sdk

See this project in Snyk:
https://app.snyk.io/org/dargon789/project/b2aa4281-7627-443a-bbf2-b110a878f4b9?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade @typescript-eslint/parser from 7.14.1 to 8.29.1.

See this package in npm:
@typescript-eslint/parser

See this project in Snyk:
https://app.snyk.io/org/dargon789/project/55409c6b-2ed0-4583-b8cd-a5bcabfd7aaa?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade tailwindcss from 3.4.17 to 4.1.3.

See this package in npm:
tailwindcss

See this project in Snyk:
https://app.snyk.io/org/dargon789/project/55409c6b-2ed0-4583-b8cd-a5bcabfd7aaa?utm_source=github&utm_medium=referral&page=upgrade-pr

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Bumps [@radix-ui/react-hover-card](https://github.com/radix-ui/primitives) from 1.1.7 to 1.1.11.
- [Changelog](https://github.com/radix-ui/primitives/blob/main/release-process.md)
- [Commits](https://github.com/radix-ui/primitives/commits)

---
updated-dependencies:
- dependency-name: "@radix-ui/react-hover-card"
  dependency-version: 1.1.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@chakra-ui/cli](https://github.com/chakra-ui/chakra-ui) from 2.5.6 to 3.16.1.
- [Release notes](https://github.com/chakra-ui/chakra-ui/releases)
- [Commits](https://github.com/chakra-ui/chakra-ui/compare/@chakra-ui/system@2.5.6...@chakra-ui/cli@3.16.1)

---
updated-dependencies:
- dependency-name: "@chakra-ui/cli"
  dependency-version: 3.16.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the npm_and_yarn group with 1 update in the /packages/thirdweb directory: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 6.2.6 to 6.2.7
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.2.7/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.2.7
  dependency-type: direct:development
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
* [NEB-69] Nebula: Add UI for Swap and Approve transactions

* Create happy-dodos-reflect.md

Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>

---------

Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: Manan Tank <manantankm@gmail.com>
Snyk has created this PR to upgrade @aws-sdk/credential-providers from 3.592.0 to 3.806.0.

See this package in npm:
@aws-sdk/credential-providers

See this project in Snyk:
https://app.snyk.io/org/dargon789/project/b2aa4281-7627-443a-bbf2-b110a878f4b9?utm_source=github&utm_medium=referral&page=upgrade-pr
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 4, 2026

Reviewer's Guide

Refactors Nebula chat transaction handling to support generic action messages including swaps/approvals, centralizes transaction sending/status UI, and upgrades several dependencies and CI workflows, while adding Storybook coverage and GitHub Pages workflows.

Sequence diagram for Nebula transaction and swap execution via useTxSetup

sequenceDiagram
  actor User
  participant Chats
  participant RenderMessage
  participant ExecuteTransactionCard
  participant SwapTransactionCard
  participant useTxSetup
  participant useSendTransaction
  participant Blockchain

  User->>Chats: sendMessage("swap 0.1 ETH to USDC")
  Chats->>promptNebula: promptNebula(params)
  promptNebula-->>Chats: ChatStreamedResponse(event action, type sign_swap, data NebulaSwapData)
  Chats->>Chats: setMessages([...,{type action,subtype sign_swap}])
  Chats->>RenderMessage: RenderMessage(message sign_swap)
  RenderMessage-->>SwapTransactionCard: render swap UI

  User->>SwapTransactionCard: click TransactionButton
  SwapTransactionCard->>useTxSetup: sendTx(tx,onTxSettled)
  useTxSetup->>useSendTransaction: mutateAsync(tx)
  useTxSetup->>useTxSetup: setStatus(type sending)
  useSendTransaction-->>useTxSetup: submittedReceipt(transactionHash)
  useTxSetup->>useTxSetup: setStatus(type confirming,txHash)
  useTxSetup->>Blockchain: waitForReceipt(submittedReceipt)
  Blockchain-->>useTxSetup: confirmReceipt(transactionHash)
  useTxSetup->>useTxSetup: setStatus(type confirmed,txHash)
  useTxSetup-->>SwapTransactionCard: onTxSettled(txHash)

  note over User,SwapTransactionCard: Same flow is reused by ExecuteTransactionCard

  User->>ExecuteTransactionCard: click TransactionButton
  ExecuteTransactionCard->>useTxSetup: sendTx(tx,onTxSettled)
  useTxSetup->>useSendTransaction: mutateAsync(tx)
  useSendTransaction-->>useTxSetup: submittedReceipt
  useTxSetup->>Blockchain: waitForReceipt
  Blockchain-->>useTxSetup: confirmReceipt
  useTxSetup-->>ExecuteTransactionCard: onTxSettled(txHash)
  ExecuteTransactionCard-->>Chats: sendMessage(getTransactionSettledPrompt(txHash))
Loading

Class diagram for Nebula chat actions, transactions, and swap cards

classDiagram
  class NebulaTxData {
    +number chainId
    +string data
    +string to
    +string value
  }

  class NebulaSwapData {
    +string action
    +NebulaSwapTransaction transaction
    +NebulaSwapToken to
    +NebulaSwapToken from
    +NebulaSwapIntent intent
  }

  class NebulaSwapTransaction {
    +number chainId
    +string to
    +string data
  }

  class NebulaSwapToken {
    +string address
    +string amount
    +number chain_id
    +number decimals
    +string symbol
  }

  class NebulaSwapIntent {
    +string amount
    +number destinationChainId
    +string destinationTokenAddress
    +number originChainId
    +string originTokenAddress
    +string receiver
    +string sender
  }

  class ChatMessage {
  }

  class AssistantMessage {
    +"assistant" type
    +string text
  }

  class PresenceMessage {
    +"presence" type
    +string[] texts
  }

  class ErrorMessage {
    +"error" type
    +string text
  }

  class ActionMessage {
    +"action" type
    +string subtype
    +NebulaTxData data
    +NebulaSwapData data
  }

  class Chats {
    +ChatMessage[] messages
    +RenderMessage(message,isMessagePending,client,sendMessage)
  }

  class RenderMessage {
    +RenderMessage(message,isMessagePending,client,sendMessage)
  }

  class ExecuteTransactionCard {
    +NebulaTxData txData
    +ThirdwebClient client
    +onTxSettled(txHash)
  }

  class ExecuteTransactionCardLayout {
    +NebulaTxData txData
    +ThirdwebClient client
    +TxStatus status
    +setStatus(status)
    +sendTx(tx,onTxSettled)
    +onTxSettled(txHash)
  }

  class SwapTransactionCard {
    +NebulaSwapData swapData
    +ThirdwebClient client
    +onTxSettled(txHash)
  }

  class SwapTransactionCardLayout {
    +NebulaSwapData swapData
    +ThirdwebClient client
    +TxStatus status
    +setStatus(status)
    +sendTx(tx)
  }

  class ApproveTransactionCard {
    +NebulaSwapData swapData
    +ThirdwebClient client
  }

  class ApproveTransactionCardLayout {
    +NebulaSwapData swapData
    +ThirdwebClient client
    +TxStatus status
    +setStatus(status)
    +sendTx(tx)
  }

  class TxStatus {
    +"idle" type
    +"sending" type
    +"confirming" type
    +"confirmed" type
    +"failed" type
    +string txHash
  }

  class TxStatusRow {
    +TxStatus status
  }

  class TxHashRow {
    +number chainId
    +string txHash
  }

  class useTxSetup {
    +TxStatus status
    +setStatus(status)
    +sendTx(tx,onTxSettled)
  }

  class promptNebula {
    +promptNebula(params)
  }

  class ChatStreamedResponse {
    +"action" event
    +"sign_transaction" type
    +"sign_swap" type
    +NebulaTxData data
    +NebulaSwapData data
  }

  class ChatPageContent {
    +handleNebulaPrompt(params)
  }

  ChatMessage <|-- AssistantMessage
  ChatMessage <|-- PresenceMessage
  ChatMessage <|-- ErrorMessage
  ChatMessage <|-- ActionMessage

  NebulaSwapData *-- NebulaSwapTransaction
  NebulaSwapData *-- NebulaSwapToken : from
  NebulaSwapData *-- NebulaSwapToken : to
  NebulaSwapData *-- NebulaSwapIntent

  Chats o-- ChatMessage
  Chats ..> RenderMessage
  RenderMessage ..> ExecuteTransactionCard
  RenderMessage ..> SwapTransactionCard
  RenderMessage ..> ApproveTransactionCard

  ExecuteTransactionCard o-- ExecuteTransactionCardLayout
  ExecuteTransactionCardLayout ..> TxStatus
  ExecuteTransactionCardLayout ..> TxStatusRow
  ExecuteTransactionCardLayout ..> TxHashRow
  ExecuteTransactionCardLayout ..> useTxSetup

  SwapTransactionCard o-- SwapTransactionCardLayout
  ApproveTransactionCard o-- ApproveTransactionCardLayout

  SwapTransactionCardLayout ..> TxStatus
  SwapTransactionCardLayout ..> TxStatusRow
  SwapTransactionCardLayout ..> TxHashRow
  SwapTransactionCardLayout ..> useTxSetup

  ApproveTransactionCardLayout ..> TxStatus
  ApproveTransactionCardLayout ..> TxStatusRow
  ApproveTransactionCardLayout ..> TxHashRow
  ApproveTransactionCardLayout ..> useTxSetup

  TxStatusRow ..> TxStatus
  TxHashRow ..> NebulaTxData

  useTxSetup ..> TxStatus

  promptNebula ..> ChatStreamedResponse
  ChatStreamedResponse ..> NebulaTxData
  ChatStreamedResponse ..> NebulaSwapData

  ChatPageContent ..> ChatMessage
  ChatPageContent ..> promptNebula
  ChatPageContent ..> ChatStreamedResponse
Loading

File-Level Changes

Change Details Files
Refactor ExecuteTransactionCard to reuse shared transaction status logic and support optional value, delegating actual send logic to a reusable hook.
  • Replace inline TxStatus union, send logic, and status/hash rendering with imports from new Swap/common utilities
  • Introduce sendTx callback prop so ExecuteTransactionCard delegates transaction submission to shared hook
  • Guard value display and prepareTransaction value argument when txData.value is undefined
  • Adjust layout spacing (max width, padding) and status/button pending logic to use shared status types
apps/dashboard/src/app/nebula-app/(app)/components/ExecuteTransactionCard.tsx
Extend Nebula chat model to handle generic action messages for signing transactions and swaps, and remove nullable transaction fallback path.
  • Change NebulaTxData.value to be optional to align with non-value transactions
  • Replace ChatMessage "send_transaction" variant with discriminated "action" variants for sign_transaction and sign_swap, carrying NebulaTxData and NebulaSwapData
  • Extract RenderMessage helper to render assistant, presence, error, and action subtypes including ExecuteTransactionCard and new swap/approve cards
  • Remove ExecuteTransactionCardWithFallback and InvalidTxData Storybook story since tx data is now required and validated earlier
apps/dashboard/src/app/nebula-app/(app)/components/Chats.tsx
apps/dashboard/src/app/nebula-app/(app)/components/Chats.stories.tsx
Add Nebula swap domain model and wire sign_transaction/sign_swap events through the chat API and UI state handling.
  • Introduce NebulaSwapData type describing swap/approval transaction, token, and intent data
  • Update promptNebula stream handler to parse sign_transaction into NebulaTxData and sign_swap into NebulaSwapData, emitting structured action events
  • Extend ChatStreamedResponse and ChatStreamedEvent types to cover sign_swap
  • Update ChatPageContent and handleNebulaPrompt to map streamed sign_transaction and sign_swap events into ChatMessage action variants instead of legacy send_transaction
apps/dashboard/src/app/nebula-app/(app)/api/chat.ts
apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx
Introduce reusable swap and approval cards plus shared transaction utilities for Nebula actions, including Storybook coverage.
  • Create SwapTransactionCard and ApproveTransactionCard components that display token/chain details, use the shared transaction status hook, and call prepareTransaction with swap transaction data
  • Add TokenRow helper to render token amounts (using toTokens) with chain icon and metadata
  • Introduce Swap/common utilities providing TxStatus type, TxStatusRow, TxHashRow, and useTxSetup hook that encapsulates useSendTransaction, pay modal theming, tracking events, and waitForReceipt sequencing
  • Add SwapCards.stories Storybook file to showcase swap/approve cards across TxStatus states
apps/dashboard/src/app/nebula-app/(app)/components/Swap/SwapCards.tsx
apps/dashboard/src/app/nebula-app/(app)/components/Swap/common.tsx
apps/dashboard/src/app/nebula-app/(app)/components/Swap/SwapCards.stories.tsx
Adjust TransactionButton layout spacing for slightly tighter label/icon alignment.
  • Reduce gap between children in inner span from gap-3 to gap-2
apps/dashboard/src/components/buttons/TransactionButton.tsx
Update Storybook wiring for ExecuteTransactionCard to use shared TxStatus type and new required sendTx prop.
  • Import TxStatus from Swap/common instead of local type
  • Pass a no-op async sendTx into ExecuteTransactionCardLayout in the story variant
  • Update Storybook title to reflect new Nebula/actions namespace
apps/dashboard/src/app/nebula-app/(app)/components/ExecuteTransactionCard.stories.tsx
Upgrade multiple runtime and dev dependencies across apps and packages per Snyk recommendations.
  • Bump portal dependencies: flexsearch, nextjs-toploader, shiki plus dev eslint major version
  • Upgrade thirdweb package deps: @coinbase/wallet-sdk, @walletconnect/sign-client and dev @aws-sdk/credential-providers and vite
  • Update wallet-ui dev tooling versions: @typescript-eslint/parser, eslint, tailwindcss
  • Bump dashboard dependency @radix-ui/react-hover-card and dev @chakra-ui/cli
  • Upgrade eslint to v9 in playground-web
apps/portal/package.json
packages/thirdweb/package.json
apps/wallet-ui/package.json
apps/dashboard/package.json
apps/playground-web/package.json
pnpm-lock.yaml
Add GitHub Pages deployment workflows for Next.js, Jekyll, and static sites, along with changeset entries documenting the updates.
  • Introduce nextjs.yml workflow to build and deploy a Next.js site via GitHub Pages
  • Add jekyll-gh-pages.yml workflow for Jekyll deployments
  • Add static.yml workflow for generic static content deployment
  • Create changeset files to record patch releases for thirdweb, dashboard, portal, wallet-ui, playground-web, and a fake scoped package, including Nebula swap/approve UI change
.github/workflows/nextjs.yml
.github/workflows/jekyll-gh-pages.yml
.github/workflows/static.yml
.changeset/fluffy-rats-jog.md
.changeset/happy-dodos-reflect.md
.changeset/seven-goats-move.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist
Copy link

Summary of Changes

Hello @Dargon789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Nebula chat application by integrating robust support for cryptocurrency swap and approval transactions, complete with dedicated UI components. It also includes a substantial refactoring of transaction management to promote code reusability and maintainability. Concurrently, several key dependencies across the project have been updated to their latest versions, ensuring the application remains current and secure.

Highlights

  • Nebula Swap & Approve UI: Introduced new UI components and backend support for handling 'Swap' and 'Approve' transactions within the Nebula chat application, enhancing its interactive capabilities.
  • Transaction Handling Refactor: Refactored the core transaction processing logic in Nebula, centralizing common functionalities into reusable components and a custom hook (useTxSetup) for improved maintainability and consistency.
  • Dependency Upgrades: Performed numerous dependency upgrades across various applications and packages, including @radix-ui/react-hover-card, @chakra-ui/cli, eslint, flexsearch, nextjs-toploader, shiki, @typescript-eslint/parser, tailwindcss, @coinbase/wallet-sdk, @walletconnect/sign-client, @aws-sdk/credential-providers, and vite.
  • Changeset Additions: Added multiple changeset files (fluffy-rats-jog.md, happy-dodos-reflect.md, seven-goats-move.md) to document the patches and features introduced in this pull request for various packages.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/jekyll-gh-pages.yml
    • .github/workflows/nextjs.yml
    • .github/workflows/static.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 security issue, 4 other issues, and left some high level feedback:

Security issues:

  • Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (link)

General comments:

  • In NebulaSwapData the action field is typed as a generic string but your UI only handles specific values like "approval" and swap actions, so tightening this to a string union (e.g. 'sell' | 'approval') would make the message handling safer and easier to reason about.
  • The useTxSetup hook in Swap/common.tsx always tracks analytics under the execute_transaction action, even for swaps and approvals; consider allowing the caller to pass a context or label so that analytics can distinguish between execute, swap, and approve flows.
  • The new GitHub Pages workflows (nextjs.yml, jekyll-gh-pages.yml, static.yml) assume a single-package setup with npm/yarn at the repo root and a single Next.js app, which may not match this monorepo/pnpm layout—if these are meant to be used, wiring them to the actual app directories and package manager will likely be necessary.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `NebulaSwapData` the `action` field is typed as a generic `string` but your UI only handles specific values like `"approval"` and swap actions, so tightening this to a string union (e.g. `'sell' | 'approval'`) would make the message handling safer and easier to reason about.
- The `useTxSetup` hook in `Swap/common.tsx` always tracks analytics under the `execute_transaction` action, even for swaps and approvals; consider allowing the caller to pass a context or label so that analytics can distinguish between execute, swap, and approve flows.
- The new GitHub Pages workflows (`nextjs.yml`, `jekyll-gh-pages.yml`, `static.yml`) assume a single-package setup with `npm/yarn` at the repo root and a single Next.js app, which may not match this monorepo/pnpm layout—if these are meant to be used, wiring them to the actual app directories and package manager will likely be necessary.

## Individual Comments

### Comment 1
<location> `apps/dashboard/src/app/nebula-app/(app)/components/ExecuteTransactionCard.tsx:145` </location>
<code_context>
                   data: txData.data,
                   to: txData.to,
-                  value: BigInt(txData.value),
+                  value: txData.value ? BigInt(txData.value) : undefined,
                 });

</code_context>

<issue_to_address>
**suggestion (bug_risk):** Guard the `value` conversion explicitly against `undefined` rather than generic truthiness.

`txData.value ? BigInt(txData.value) : undefined` relies on truthiness and will treat any falsy-but-valid value as `undefined`. Given the type is `string | undefined`, it’s safer and clearer to check explicitly:

```ts
value: txData.value !== undefined ? BigInt(txData.value) : undefined,
```
</issue_to_address>

### Comment 2
<location> `apps/dashboard/src/app/nebula-app/(app)/components/Swap/common.tsx:130-139` </location>
<code_context>
-    },
-  });
   const chain = useV5DashboardChain(txData.chainId);
-  const trackEvent = useTrack();
   const account = useActiveAccount();

</code_context>

<issue_to_address>
**suggestion:** Differentiate analytics events for swaps vs. generic transactions or make the action configurable.

`useTxSetup` always sends `action: "execute_transaction"` with no chain-specific metadata, but it’s now used for both simple sends and swap/approval flows. That makes these flows indistinguishable in analytics and drops the previously tracked `chainId` context.

Recommend either:
- Accepting an `analyticsContext` (e.g. `action`, optional `chainId`, and maybe `flow: "swap" | "approval" | "send"`), or
- At least parameterizing the `action` string so swap-related flows aren’t lumped into a generic "execute_transaction" event.

Suggested implementation:

```typescript
export type TxAnalyticsContext = {
  /**
   * Analytics "action" name, e.g. "execute_transaction", "swap", "approval".
   * If omitted, callers should fall back to the existing "execute_transaction" default.
   */
  action?: string;
  /**
   * Optional chain identifier for analytics. Allows restoring the previously
   * tracked chainId context independently of txData/chain hooks.
   */
  chainId?: number | string;
  /**
   * High-level flow name for analytics segmentation.
   * e.g. "swap" | "approval" | "send"
   */
  flow?: "swap" | "approval" | "send" | (string & {});
};

export function useTxSetup(analyticsContext?: TxAnalyticsContext) {
  const [status, setStatus] = useState<TxStatus>({ type: "idle" });
  const { theme } = useTheme();

  const sendTransaction = useSendTransaction({
    payModal: {
      theme: getSDKTheme(theme === "light" ? "light" : "dark"),
    },
  });


export type TxStatus =
  | {
      type: "idle";
    }
  | {
      type: "sending";
    }
  | {
      type: "confirming";
      txHash: string;

```

To fully implement the analytics behavior you described, you should also:

1. Re-introduce `const trackEvent = useTrack();` in this hook if it was removed, or ensure whatever tracking hook is used is available inside `useTxSetup`.
2. Find the code inside `useTxSetup` where the analytics event is fired (currently hardcoding `action: "execute_transaction"` and omitting chain-specific metadata) and update it to something like:
   - `const action = analyticsContext?.action ?? "execute_transaction";`
   - `const flow = analyticsContext?.flow;`
   - `const analyticsChainId = analyticsContext?.chainId ?? txData.chainId ?? chain?.id;`
   - Then call `trackEvent` with these values, e.g. `trackEvent("execute_transaction", { action, flow, chainId: analyticsChainId, ...otherProps });`
3. Update all call sites of `useTxSetup`:
   - For swap flows: `useTxSetup({ action: "swap_execute_transaction", flow: "swap", chainId: txData.chainId });`
   - For approvals: `useTxSetup({ action: "approval_execute_transaction", flow: "approval", chainId: txData.chainId });`
   - For simple sends: either omit the argument or explicitly pass `{ action: "execute_transaction", flow: "send", chainId }` for clarity.
These changes will ensure swap/approval/send flows are distinguishable in analytics and restore chainId context while maintaining backward-compatible defaults.
</issue_to_address>

### Comment 3
<location> `.changeset/fluffy-rats-jog.md:9` </location>
<code_context>
+"wallet-ui": patch
+---
+
+compare feat: upgrade fix and bug merge.
</code_context>

<issue_to_address>
**suggestion (typo):** The description sentence is grammatically unclear; consider rephrasing for readability.

The phrase "compare feat: upgrade fix and bug merge" is hard to understand and may confuse readers. Please rephrase it to clearly describe what is being compared or what this patch does (for example, "Compare feature upgrade fixes and bug merges" or a more specific summary).
</issue_to_address>

### Comment 4
<location> `.changeset/seven-goats-move.md:5` </location>
<code_context>
+"wallet-ui": patch
+---
+
+compare feat: upgrade fix and bug merge.
</code_context>

<issue_to_address>
**suggestion (typo):** The description sentence is grammatically unclear; consider rephrasing for readability.

The phrase "compare feat: upgrade fix and bug merge" is ambiguous. Please reword it to clearly state what this patch does (e.g., whether it upgrades fixes, merges bug fixes, or something else).
</issue_to_address>

### Comment 5
<location> `apps/dashboard/src/app/nebula-app/(app)/components/Swap/SwapCards.stories.tsx:35` </location>
<code_context>
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
</code_context>

<issue_to_address>
**security (generic-api-key):** Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

*Source: gitleaks*
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for swap and approve transactions in the Nebula chat feature, involving significant refactoring to share transaction handling logic across different action types. It also includes several dependency upgrades. My review focuses on the new transaction flows, data parsing safety, and UI consistency. The refactoring to centralize transaction logic is well-done, but there are opportunities to improve data validation, enhance user-facing error handling, and ensure consistent behavior across different transaction types.

Repository owner deleted a comment from vercel bot Jan 4, 2026
@Dargon789 Dargon789 merged commit 23fb8c3 into main Jan 4, 2026
8 of 10 checks passed
@Dargon789 Dargon789 deleted the snyk-upgrade-2451c960a1220c888a18dfa29f7786c7 branch January 4, 2026 12:49
@Dargon789 Dargon789 restored the snyk-upgrade-2451c960a1220c888a18dfa29f7786c7 branch January 4, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants