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

refactor: replace neoicon with nuxt icon (2) #11451

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

preschian
Copy link
Member

@preschian preschian commented Mar 3, 2025

Thank you for your contribution to the Koda - Generative Art Marketplace.

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context


updated keywords:

  • icon="chevron-right"
  • icon="chevron-left"
  • icon="chevron-down"
  • icon="circle-info"
  • icon="download"
  • icon="spinner-third"
  • icon="eye"

Summary by CodeRabbit

  • New Features

    • Introduced updated icon rendering and refined responsive layout styling for a more modern look.
    • Enhanced swap and offer workflows with new buttons and improved navigation for collection swaps.
  • Refactor

    • Redesigned collection deletion modals to require explicit user confirmation.
    • Streamlined network support by eliminating less-used blockchain endpoints.
  • Chores

    • Updated localization settings to default to English, reducing multi-language options.
    • Integrated Apollo Client for improved GraphQL data handling and adjusted testing configurations.

Copy link

cloudflare-workers-and-pages bot commented Mar 3, 2025

Deploying koda-art-prod with  Cloudflare Pages  Cloudflare Pages

Latest commit: be2d694
Status: ✅  Deploy successful!
Preview URL: https://a93e2d30.kodaart-production.pages.dev
Branch Preview URL: https://refactor--replace-neo-icon.kodaart-production.pages.dev

View logs

Copy link

coderabbitai bot commented Mar 3, 2025

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

81 files out of 189 files are above the max files limit of 100.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The update introduces widespread refactoring and deprecation efforts. The primary changes include replacing the legacy <Icon> component with a new <KIcon> component across the application, updating container classes from “container is-fluid” to “container-fluid,” and removing all references and support for the IMX chain. Additional changes comprise new components and plugins (e.g. for Apollo Client and swap functionalities), updated GraphQL queries, and major removals in internationalization (i18n) locale files. Numerous type, store, and middleware adjustments have been made to align features with the new assets and routes.

Changes

File(s) / Grouping Change Summary
Icon Component Replacement
(e.g. components/blog/BlogPost.vue, components/carousel/module/CarouselAgnostic.vue, many others)
Replaced legacy <Icon> with new <KIcon> across multiple components. Some components received updated size props, class attribute adjustments, or new attributes (e.g. size="medium", size="small", size="3x") to standardize icon rendering.
Layout Container Class Update
(e.g. components/ExploreLayoutWithSidebar.vue, layouts/default.vue, pages/[prefix]/explore/collectibles.vue)
Changed container classes from "container is-fluid" to "container-fluid", streamlining the grid and layout structure in various views for consistent responsive design.
IMX Chain Removal & Config Updates
(e.g. libs/static/src/chains.ts, libs/static/src/endpoints.ts, stores/identity.ts, plugins/wagmi.client.ts, others)
Removed all references to the IMX chain across configuration objects, endpoints, indexers, type definitions, and services. This includes deletion of IMX entries from constants, mappings, GraphQL endpoints, and related wallet or chain type definitions.
GraphQL & API Query Modifications
(e.g. queries/subsquid/general/collectionByIdMinimalWithRoyalty.graphql, queries/subsquid/general/highestOfferByCollectionId.graphql, etc.)
New fields and queries were added (e.g. a floorPrice field and a new highestOfferByCollectionId query), while an old query (nftByBlockNumber.graphql) was removed and re-implemented in TypeScript. Query execution methods were updated to use direct Apollo client calls and reduce reliance on string literals.
Localization and i18n Updates
(e.g. i18n/locales/en.json modifications, deletion of numerous locale files such as bn.json, cn.json, cz.json, de.json, es.json, etc.)
Several i18n locale files (for Bengali, Chinese, Czech, German, Spanish, French, Indonesian, Italian, Japanese, Korean, Dutch, Ukrainian, etc.) were removed and the English locale was modified. The key confirmDeleteCollection.content was updated and new strings were added under the offer and swap sections. These changes effectively remove localized support for multiple languages, defaulting the UI to English.
New Components, Plugins & Swap Flow Enhancements
(e.g. components/KIcon.vue, components/swap/CreateCollectionSwapButton.vue, pages/how-to-icon.vue, plugins/apollo.client.ts)
Added new components such as <KIcon>, <CreateCollectionSwapButton>, and others. A new Apollo Client plugin (in plugins/apollo.client.ts) has been introduced. Swap functionalities and routing have been enhanced with new computed properties, a revised getSwapStepRouteName function (supporting collection swaps), and updated middleware to validate addresses via isAddress.
Type & Store Adjustments
(e.g. composables/transaction/types.ts, stores/atomicSwaps.ts, stores/preferences.ts, stores/wallet.ts)
Updated types to allow nullable properties for identifiers (e.g. id and sn now can be `string
Miscellaneous Middleware, Tests & Utility Updates
(e.g. middleware/redirects.global.ts, middleware/swap.ts, playwright.config.ts, files in utils/)
Added address validation in middleware using isAddress and refactored swap routing control flow to incorporate collection swap status. Increased Playwright test retries in CI from 1 to 3. Several utility files were updated to remove IMX-related logic, and a new constant/method was added in utils/swap.ts for collection swap route mapping.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant M as Swap Middleware
  participant R as Route Helper (getSwapStepRouteName)
  participant N as Navigation

  U->>M: Initiates swap action
  M->>M: Validate address with isAddress()
  alt valid address
    M->>R: Determine swap step (including isCollectionSwap check)
    R-->>M: Return appropriate route name
    M->>N: Navigate to swap step route
  else invalid address
    M->>N: Navigate to alternative counterparty route
  end
Loading

Possibly related PRs

  • deprecate Immutablex #11444: Updates focus on deprecating the IMX chain and associated functionalities, similar to the chain removal efforts in this PR.

Suggested reviewers

  • Jarsen136
  • hassnian

Poem

In a hop and a skip by the light of the moon,
I’ve refactored our code to a brand new tune,
Leaving old icons behind—KIcon now shines!
Containers are fluid, the chains realigned,
A removal so neat, with routes set just right.
Bugs flee like hares in the gentle night,
A happy code garden for all to delight!


🪧 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 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

netlify bot commented Mar 3, 2025

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit be2d694
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/67d01dd24104c40008349933
😎 Deploy Preview https://deploy-preview-11451--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@preschian preschian marked this pull request as ready for review March 3, 2025 10:49
@preschian preschian requested a review from a team as a code owner March 3, 2025 10:49
@preschian preschian requested review from Jarsen136 and hassnian and removed request for a team March 3, 2025 10:49
Base automatically changed from refactor--replace-NeoIcon to main March 11, 2025 06:18
@preschian preschian marked this pull request as draft March 11, 2025 06:19
@preschian preschian marked this pull request as ready for review March 11, 2025 06:54
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.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 12

🧹 Nitpick comments (21)
i18n/locales/all_lang.json (1)

1-2: Critical Verification: Confirm Intentional Removal of Localization Data

The file now consists solely of an empty JSON object {}. This indicates that all localization data has been removed, in line with the broader refactoring efforts discussed in PR #11451. Please verify that this removal is intentional and that no parts of the application are still dependent on localization keys from this file. If there are dependencies, ensure that fallback mechanisms or alternative localization strategies are in place.

composables/useUserStats.ts (3)

11-20: Consider adding error handling to the Apollo query.

The direct use of Apollo client is cleaner than the previous implementation, but there's no error handling in place. If the query fails, it could cause unhandled exceptions.

- const { data } = await $apolloClient.query({
+ try {
+   const { data } = await $apolloClient.query({
      query: profileStatsByIdRefined,
      variables: {
        id: accountId.value,
        denyList: getDenyList(urlPrefix.value),
      },
      context: {
        endpoint: client.value,
      },
    })
+   
+   const holdingsEvents = data?.invested.filter(
+     event => event.nft.currentOwner === accountId.value,
+   )
+   
+   if (!holdingsEvents) {
+     return
+   }
+   
+   totalSpent.value = Number(getSumOfObjectField(holdingsEvents, 'meta'))
+ } catch (error) {
+   console.error('Error fetching user stats:', error)
+   totalSpent.value = 0
+ }

22-25: Consider adding type annotations for better type safety.

Adding TypeScript interfaces for the query response would improve code maintainability and catch potential issues at compile time.

interface InvestedEvent {
  nft: {
    currentOwner: string
  }
  meta: number
}

interface ProfileStatsResponse {
  invested: InvestedEvent[]
}

// Then use in the code:
const { data } = await $apolloClient.query<{ data: ProfileStatsResponse }>({

26-28: Improve the null check for holdingsEvents.

The current check only verifies if holdingsEvents is falsy, but it should also check for empty arrays to be more robust.

- if (!holdingsEvents) {
+ if (!holdingsEvents || holdingsEvents.length === 0) {
    return
  }
middleware/redirects.global.ts (1)

19-21: Added address validation check

This is a good improvement that adds validation to ensure the address is valid before continuing with formatting and redirection logic. This helps prevent potential errors when working with invalid addresses.

Consider adding a more informative response when an invalid address is detected, such as redirecting to an error page or showing a notification:

if (!isAddress(address)) {
-  return
+  return {
+    name: 'error',
+    query: { message: 'Invalid address format' }
+  }
}
pages/how-to-icon.vue (1)

36-39: Consider improving the string manipulation for size extraction.

The current approach using size.split('-')[1] is somewhat brittle. If the format of the customSize strings changes, this will break.

-<KIcon
-  name="i-mdi:information-slab-circle-outline"
-  :size="size.split('-')[1]"
-/>
+<KIcon
+  name="i-mdi:information-slab-circle-outline"
+  :size="size.replace('fa-', '')"
+/>
components/KIcon.vue (1)

19-26: Consider extracting the size map to a shared utility.

The size mapping defined here could be useful in other components that need to work with icon sizes. Consider moving it to a shared utility file if it might be reused elsewhere.

utils/swap.ts (1)

12-17: Consider merging route maps or adding a shared base.

COLLECTION_SWAP_ROUTE_NAME_STEP_MAP duplicates some naming logic from SWAP_ROUTE_NAME_STEP_MAP. While this is acceptable, consider unifying both maps if the differences are minimal. A single map with small overrides may reduce future maintenance.

components/common/userCart/UserCartModal.vue (1)

16-41: Slot-based body and footer structure is clean.

Utilizing named slots (#body, #action-button-top, and #footer) enhances flexibility. The approach of embedding UserCartSingleItem vs. UserCartMultipleItems is straightforward.

Consider adding minor in-component docs or comments for future contributors, clarifying the differences between single vs. multiple items.

components/swap/banner/CollectionPreview.vue (1)

15-23: Consider adding alt text for accessibility.

While you're using a title attribute, consider adding an alt attribute to improve accessibility for the avatar image.

 <BaseMediaItem
   :src="sanitizeIpfsUrl(collection.meta?.image)"
   :image-component="NuxtImg"
   :sizes="`${imageSize}px`"
   title="User Avatar"
+  alt="Collection avatar for {{collection.name}}"
   class="object-cover overflow-hidden rounded-full h-full w-full !shadow-none"
   inner-class="object-cover"
 />
components/trade/makeOffer/CreateCollectionOfferButton.vue (2)

28-33: Add error handling for GraphQL data fetching.
When querying highestOfferByCollectionId, consider handling potential query retrieval errors or empty results to avoid undefined property access on collectionOfferData.value.offers.

+ if (!collectionOfferData.value?.offers?.length) {
+   // handle empty or error states here
+   return
+ }

63-65: Check for fallback or error state in onCreateCollectionOfferClick.
While onTradeActionClick likely handles user actions gracefully, consider providing user feedback if openOfferModal fails (e.g., store errors).

components/swap/CreateCollectionSwapButton.vue (1)

29-48: Implement try/catch or error handling during createSwap.
When calling swapStore.createSwap, any failure might cause application issues. Consider wrapping the operation in try/catch to provide user feedback on errors.

const onCreateCollectionSwapClick = () => {
-  onTradeActionClick(() => {
+  onTradeActionClick(async () => {
     try {
       const swap = await swapStore.createSwap(collectionId.value!, {
         ...
       })
       navigateToSwap(swap)
     } catch (error) {
       console.error('Failed to create swap:', error)
       // Display or handle error
     }
  })
}
components/items/ItemsGrid/useItemsGrid.ts (2)

189-196: Verify error handling for $apolloClient.query().
Currently, no try/catch or error callback is present. Unhandled exceptions may interrupt the user flow if the request fails.

- const { data: result } = await $apolloClient.query({
+ let result
+ try {
+   const response = await $apolloClient.query({
      query: queryName,
      variables: queryVariables,
      context: { endpoint: client.value },
    })
+   result = response.data
+ } catch (error) {
+   console.error("GraphQL query failed:", error)
+   isFetchingData.value = false
+   isLoading.value = false
+   return false
+ }

199-199: Ensure result contains expected properties before destructuring.
If result is undefined, destructuring may throw an error. Consider a fallback or guard clause.

components/common/ActionModal.vue (1)

133-148: Enhance error handling in submit method.
The try block calls execTransaction() and closeModal() in quick succession. If closeModal() is invoked and execTransaction() fails late, the user might not see an error prompt. Consider a more robust catch flow or success path.

try {
  clearTransaction()
  autoTeleport.value = autoteleport
  if (!autoteleport) {
    await execTransaction()
+   // optionally move closeModal() here, ensuring the transaction succeeded
  }
  closeModal()
} catch (error) {
  warningMessage(error)
}
components/create/Confirm/MintConfirmModal.vue (4)

67-68: Document newly added flags
The optional flags hasRoyalty and hasCappedMaxSupply enhance the type. Consider adding quick doc comments to clarify their intended usage or expected side effects.


107-107: Base network fee initialization
Initializing baseNetworkFee to 0 is a clean approach. Ensure you handle any default fee fallback logic correctly if estimateTransactionFee fails to return a value.


176-185: Refine extra calls multiplier
Incrementing the fee by 1× per extra call is simple and might be adequate, but if calls have varying complexities, a more precise approach could be beneficial.


196-200: Watch effect fee handling
Resetting baseNetworkFee to zero before calling estimateTransactionFee ensures a clean slate. Consider caching the fee or handling offline scenarios to avoid repeated asynchronous calls if performance is a concern.

components/swap/Preview.vue (1)

84-92: Consider updating NeoButton to align with PR objectives

The PR objective mentions replacing neoicon with nuxt icon, but this component still uses NeoButton with icon-pack="fas" and icon-left="plus". Consider updating this to use the nuxt icon approach for consistency.

-            <NeoButton
-              class="h-10 w-[120px]"
-              icon-pack="fas"
-              icon-left="plus"
-              no-shadow
-              :label="$t('add')"
-              :disabled="surchargeDisabled || !amount"
-              @click="addSurcharge"
-            />
+            <NeoButton
+              class="h-10 w-[120px]"
+              no-shadow
+              :label="$t('add')"
+              :disabled="surchargeDisabled || !amount"
+              @click="addSurcharge"
+            >
+              <template #leftIcon>
+                <KIcon icon="plus" />
+              </template>
+            </NeoButton>
🛑 Comments failed to post (12)
plugins/i18n.ts (1)

3-3: 💡 Verification agent

🧩 Analysis chain

Hardcoding locale to 'en' removes user language preferences support

This change replaces dynamic user locale selection with a hardcoded English locale, which seems unrelated to the PR's stated objective of replacing neoicon with nuxt icon. This modification removes the ability for users to view the application in their preferred language, potentially negatively impacting non-English speaking users.

If this is intentional as part of a broader internationalization strategy, consider:

  1. Adding a comment explaining the rationale for this change
  2. Ensuring this aligns with the project's internationalization roadmap
  3. Verifying if this should be in a separate PR focused on i18n changes rather than icon refactoring

🌐 Web query:

What's the recommended approach for handling i18n locale in Nuxt applications?

💡 Result:

The recommended approach for handling internationalization (i18n) in Nuxt applications involves using the official @nuxtjs/i18n module, which provides a robust framework for localization. Here's a structured implementation guide:


Core Configuration

  1. Module Installation
    Add the official module:

    npx nuxi@latest module add i18n
  2. Basic Setup
    Configure locales in nuxt.config.ts:

    export default defineNuxtConfig({
      modules: ['@nuxtjs/i18n'],
      i18n: {
        locales: [
          { code: 'en', iso: 'en-US', name: 'English', file: 'en.json' },
          { code: 'fr', iso: 'fr-FR', name: 'Français', file: 'fr.json' }
        ],
        defaultLocale: 'en',
        langDir: 'locales',
        lazy: true, // Enable lazy-loading
        strategy: 'prefix_except_default' // Routes: /about vs /fr/about
      }
    });

Key Implementation Strategies

1. Routing & URL Strategies

  • prefix_except_default:
    Default language uses no prefix (/about), others use locale codes (/fr/about)[2][5].
  • Custom Domains:
    Assign unique domains per locale (e.g., example.fr for French)[10].

2. Translation Management

  • Lazy-Loading:
    Load translations only when needed to optimize performance[4][16]:
     lazy: true,
     langDir: 'locales', // Folder containing en.json, fr.json, etc.
  • Dynamic Content:
    Fetch translations from APIs/CMS using loadLocaleAsync[12][14]:
     loadLocaleAsync: (locale) => import(`~/locales/${locale}.json`),

3. Language Detection & Switching

  • Automatic Detection:
    Enable browser/cookie-based detection[14]:
     detectBrowserLanguage: {
       useCookie: true,
       cookieKey: 'i18n_redirected'
     },
  • Switcher Component:
    Use composables for dynamic language selection[12][13]:
    <script setup>
    const { locale, locales, setLocale } = useI18n();
    </script>
    
    <template>
      <button 
        v-for="lang in locales"
        :key="lang.code"
        @click="setLocale(lang.code)"
      >
        {{ lang.name }}
      </button>
    </template>

Advanced Features

SEO Optimization

  • Metadata Localization:
    Use useHead with locale-aware values[6][16]:
    useHead({
      title: $t('seo.title'),
      meta: [{ name: 'description', content: $t('seo.description') }]
    });
  • Hreflang Tags:
    Automatically generated by the module for search engines[10].

RTL Support

Configure text direction in locale definitions[15][16]:

locales: [
  { code: 'ar', iso: 'ar-SA', name: 'العربية', dir: 'rtl' }
],

Apply dynamically in templates:

<html :dir="$i18n.localeProperties.dir">

Pluralization & Formatting

Use Vue I18n’s formatters for dates/numbers[7][16]:

// en.json
{
  "date": "{date, date, long}",
  "price": "{value, number, currency}"
}

Best Practices

  • Fallback Locale:
    Define a fallbackLocale to handle missing translations[5][14].
  • Type Safety:
    Use TypeScript for translation keys with defineI18nConfig[6].
  • Testing:
    Mock locales in unit tests and check for missing keys[8].

By following these patterns, you ensure a maintainable, performant i18n implementation that scales with your application’s needs. For complex projects, consider integrating translation management tools like Crowdin or Lokalise[9][16].

Citations:


Urgent: Address Hardcoded Locale in i18n Setup

  • In plugins/i18n.ts (line 3), the code sets app.$nuxt.$i18n.locale.value explicitly to 'en', which removes support for dynamic user locale selection.
  • This change conflicts with our best practices for Nuxt internationalization. The recommended approach is to use the official @nuxtjs/i18n module, which supports dynamic language detection and management.
  • Since the PR’s focus is on icon refactoring, this i18n modification appears out-of-scope. If this change is intentional, please:
    • Add an explanatory comment detailing the rationale.
    • Confirm that this approach aligns with the project’s broader internationalization roadmap.
    • Consider moving i18n changes to a separate PR that fully implements dynamic locale handling.
utils/viem.ts (1)

2-13: ⚠️ Potential issue

Removed IMX chain support

The code has been modified to remove all references to the immutableZkEvm (IMX) chain from both CHAIN_ID_TO_PREFIX and PREFIX_TO_CHAIN mappings, keeping only base and mantle chains.

This change removes support for the IMX chain throughout the application, which is a significant modification not mentioned in the PR description that focused on icon replacement. Removing chain support could impact users who were using this chain. Please confirm if this removal is intentional and coordinate with the team to ensure all related code and documentation is updated consistently.

#!/bin/bash
# Check for other references to IMX chain that might need updating
echo "Searching for any remaining references to IMX chain..."
rg -i "imx|immutable" --type ts --type vue
components/transfer/Transfer.vue (1)

79-83: ⚠️ Potential issue

Icon component replacement looks good but is inconsistent with line 283.

The change from <Icon> to <KIcon> follows the PR objective of replacing neoicon with nuxt icon. The icon name format has been updated to use the MDI icon set.

However, there's still an <Icon> component on line 283 that hasn't been updated to <KIcon>, creating an inconsistency in icon usage within the same file.

Apply this diff to complete the migration:

-            <Icon name="i-mdi:information-slab-circle-outline" />
+            <KIcon name="i-mdi:information-slab-circle-outline" />
📝 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.

-            <Icon name="i-mdi:information-slab-circle-outline" />
+            <KIcon name="i-mdi:information-slab-circle-outline" />
components/transfer/TransferConfirmModal.vue (1)

69-73: ⚠️ Potential issue

Inconsistent icon component replacement pattern.

This file replaces <NeoIcon> with <Icon>, whereas other files in this PR replace <Icon> with <KIcon>. This creates an inconsistency across the codebase.

Based on the PR objective to replace neoicon with nuxt icon, you should be using <KIcon> here:

-            <Icon
-              name="i-mdi:information-slab-circle-outline"
+            <KIcon
+              name="i-mdi:information-slab-circle-outline"
               class="text-base"
             />

Committable suggestion skipped: line range outside the PR's diff.

components/KIcon.vue (1)

8-17: 🛠️ Refactor suggestion

Missing support for custom sizes.

The KIcon component doesn't appear to support custom sizes directly (unlike NeoIcon which has a custom-size prop as seen in the how-to-icon.vue demo). Consider adding this capability for full compatibility with the previous implementation.

withDefaults(
  defineProps<{
    name: string
    size?: 'default' | 'small' | 'medium' | 'large' | '2x' | '3x'
+   customSize?: string
  }>(),
  {
    size: 'default',
  },
)

+// Add handling for customSize in the computed class or in the template
📝 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.

<script setup lang="ts">
withDefaults(
  defineProps<{
    name: string
    size?: 'default' | 'small' | 'medium' | 'large' | '2x' | '3x'
    customSize?: string
  }>(),
  {
    size: 'default',
  },
)
// Add handling for customSize in the computed class or in the template
components/shared/TransactionSteps/TransactionStepsItem.vue (1)

4-8: ⚠️ Potential issue

Be aware of potential animation conflicts

The component now has two animation sources:

  1. The newly added animate-spin Tailwind class
  2. The existing .spinner CSS class with animation: spin 1s linear infinite (lines 164-166)

These may cause conflicting animations on the loading icon.

Consider removing one of the animations:

-        class="spinner text-k-grey animate-spin text-6xl"
+        class="text-k-grey animate-spin text-6xl"

And potentially removing the .spinner class definition if no longer needed elsewhere.

Committable suggestion skipped: line range outside the PR's diff.

components/create/Confirm/PriceItem.vue (1)

12-16: ⚠️ Potential issue

Good transition to the new Icon component, but inconsistent usage throughout the file.

The icon component has been correctly updated from <NeoIcon> to <Icon> with the appropriate property name change from icon="chevron-down" to name="i-mdi:chevron-down" for the fee breakdown toggle.

However, there are still instances of <NeoIcon> at lines 48 and 70 that were not updated. These should also be converted to the new <Icon> component for consistency. The import for NeoIcon in the script section (line 132) should be reviewed as well.

components/migrate/steps/Review.vue (2)

180-181: ⚠️ Potential issue

Inconsistent property usage for Icon component.

This line uses icon="i-mdi:help-circle-outline" while other Icon components in this file use the name property. For consistency, this should be changed to name="i-mdi:help-circle-outline".


235-236: ⚠️ Potential issue

Another instance of inconsistent property usage.

Similar to the previous comment, this line also uses icon="i-mdi:help-circle-outline" instead of the name property. For consistency, this should be changed to name="i-mdi:help-circle-outline".

components/collection/ConfirmDeleteCollectionModal.vue (1)

37-45: 🛠️ Refactor suggestion

Use typed definitions for safer code
Importing Actions and passing them via getAction is good. Consider replacing the collection: any prop with a strongly typed interface to prevent runtime type mismatches.

- defineProps<{
-   getAction: () => Actions
-   collection: any
- }>()
+ import type { CollectionType } from '@/types/Collection' // Example
+ defineProps<{
+   getAction: () => Actions
+   collection: CollectionType
+ }>()
📝 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.

import { NeoCheckbox } from '@kodadot1/brick'
import { sanitizeIpfsUrl } from '@/utils/ipfs'
import type { Actions } from '@/composables/transaction/types'
import type { CollectionType } from '@/types/Collection' // Example

defineEmits(['success'])
defineProps<{
  getAction: () => Actions
  collection: CollectionType
}>()
components/collection/HeroButtonDeleteCollection.vue (1)

20-22: 🛠️ Refactor suggestion

Address the unknown type
Provide a concrete type rather than unknown for collection to ensure transparent usage throughout the component.

- defineProps<{
-   collection: unknown
- }>()
+ import type { CollectionType } from '@/types/Collection'
+ defineProps<{
+   collection: CollectionType
+ }>()
📝 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.

import type { CollectionType } from '@/types/Collection'
defineProps<{
  collection: CollectionType
}>()
components/swap/Preview.vue (1)

150-165: 💡 Verification agent

🧩 Analysis chain

Verify getSwapStepRouteName function availability

The refactored stepDetailsMap now dynamically generates route names based on the swap type, but I don't see the getSwapStepRouteName function imported or defined in this file.


🏁 Script executed:

#!/bin/bash
# Look for getSwapStepRouteName function definition
rg -A 3 "function getSwapStepRouteName" || rg -A 3 "const getSwapStepRouteName"

Length of output: 414


Ensure Correct Import of getSwapStepRouteName in Preview.vue

  • Verified that the utility function getSwapStepRouteName exists in utils/swap.ts.

  • The code snippet in Preview.vue (lines 150-165) uses getSwapStepRouteName without showing an import.

  • Please confirm that the function is correctly imported. If it’s missing, add an import similar to:

    import { getSwapStepRouteName } from '@/utils/swap';

This change will ensure that the dynamic route name generation works as intended without causing runtime errors.

@preschian preschian requested a review from exezbcz March 11, 2025 12:21
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