Skip to content

Feat/app dialog#650

Merged
olgakup merged 13 commits intofeat/collapse-networks-menufrom
feat/app-dialog
Mar 27, 2025
Merged

Feat/app dialog#650
olgakup merged 13 commits intofeat/collapse-networks-menufrom
feat/app-dialog

Conversation

@olgakup
Copy link
Contributor

@olgakup olgakup commented Mar 27, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a consistent modal dialog interface for deposits, asset and NFT details, network selection, and swap views.
  • UI Enhancements

    • Streamlined fee and token selection interactions for a smoother user experience.
    • Improved tooltip positioning for clearer guidance during QR code interactions.
  • Style

    • Updated image rendering to maintain aspect ratios, ensuring consistent visuals across various components.

@coderabbitai
Copy link

coderabbitai bot commented Mar 27, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (3)
  • main
  • develop
  • devop/vite-migrate

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

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

Walkthrough

The changes refactor several Vue components to streamline state management and UI interactions. Multiple components now use Vue’s two-way data binding (v-model) to control visibility—replacing conditional rendering and explicit close event handlers. The updates affect fee selection, token/assets selection, and various dialog-based interfaces. In addition, several components receive minor styling improvements via the addition of the object-fit: contain; CSS property. A new <app-dialog> component has been introduced and integrated into multiple views, replacing ad hoc modal implementations.

Changes

File(s) Change Summary
packages/.../bitcoin/ui/send-transaction/index.vue,
packages/.../ethereum/ui/eth-verify-transaction.vue,
packages/.../ethereum/ui/send-transaction/index.vue,
packages/.../swap/views/swap-best-offer/index.vue,
packages/.../transaction-fee/index.vue
Replaced :show-fees prop with v-model="isOpenSelectFee"; removed @close-popup event handling for fee selection.
packages/.../ethereum/ui/send-transaction/index.vue,
packages/.../kadena/ui/send-transaction/index.vue,
packages/.../polkadot/ui/send-transaction/index.vue,
packages/.../solana/ui/send-transaction/index.vue,
packages/.../assets-select-list/index.vue,
packages/.../swap/components/swap-network-select/network-select-list.vue
Replaced v-show/v-if with v-model for token selection visibility; removed explicit close event listeners.
packages/.../app-dialog/index.vue,
packages/.../asset-detail-view/index.vue,
packages/.../assets-select-list/index.vue,
packages/.../deposit/index.vue,
packages/.../nft-detail-view/index.vue,
packages/.../swap/components/swap-network-select/network-select-list.vue
Introduced a new <app-dialog> component and restructured views to use it for modal dialogs; state managed via defineModel and v-model.
packages/.../tooltip/index.vue Added a new isBottomLeft prop and updated tooltip positioning logic and styles.
packages/.../network-assets/components/network-assets-item.vue,
packages/.../network-nfts/components/network-nfts-item.vue,
packages/.../network-nfts/index.vue
Switched from conditional rendering (v-if) to v-model binding for detail views; removed explicit close event handlers.
packages/.../ethereum/ui/send-transaction/components/send-token-select.vue,
packages/.../accounts-header/components/header-accounts.vue,
packages/.../assets-select-list/components/assets-select-list-item.vue,
packages/.../network-assets/components/custom-evm-token.vue
Added object-fit: contain; CSS property to image elements for improved scaling and aspect ratio maintenance.
packages/.../swap/index.vue Replaced conditional visibility directives with v-model binding for network and asset selection lists; updated event listener binding to use custom events.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ParentComponent
    participant AppDialog

    User->>ParentComponent: Initiate action (e.g., open deposit)
    ParentComponent->>AppDialog: Set model = true (via v-model)
    AppDialog->>User: Render modal dialog
    User->>AppDialog: Click backdrop/close button
    AppDialog->>ParentComponent: Emit "close:dialog" event
    ParentComponent->>AppDialog: Set model = false (via v-model)
Loading

Possibly related PRs

Suggested reviewers

  • NickKelly1
  • gamalielhere

🪧 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 Mar 27, 2025

💼 Build Files
chrome: enkrypt-chrome-8d588c83.zip
firefox: enkrypt-firefox-8d588c83.zip

💉 Virus total analysis
chrome: 8d588c83
firefox: 8d588c83

@olgakup
Copy link
Contributor Author

olgakup commented Mar 27, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Mar 27, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 2

🧹 Nitpick comments (10)
packages/extension/src/ui/action/views/network-nfts/components/network-nfts-item.vue (1)

134-142: Consider adding object-fit property for image display

The image display could be improved by adding object-fit: contain; to ensure images maintain their aspect ratio. According to the AI summary, this property was added to similar components in other files but appears to be missing here.

  img {
    max-width: 140%;
    max-height: 140%;
+   object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
  }
packages/extension/src/ui/action/views/nft-detail-view/index.vue (1)

143-179: Consider removing unused CSS.

The CSS styles for .nft-detail-view__container, .nft-detail-view__overlay, and .nft-detail-view__close appear to be unused now that the implementation uses the AppDialog component.

-  &__container {
-    width: 800px;
-    height: 600px;
-    left: 0;
-    top: 0px;
-    position: fixed;
-    z-index: 105;
-    display: flex;
-    box-sizing: border-box;
-    justify-content: center;
-    align-items: center;
-    flex-direction: row;
-  }

-  &__overlay {
-    background: rgba(0, 0, 0, 0.32);
-    width: 100%;
-    height: 100%;
-    left: 0px;
-    top: 0px;
-    position: absolute;
-    z-index: 106;
-  }

-  &__close {
-    position: absolute;
-    top: 8px;
-    right: 8px;
-    border-radius: 8px;
-    cursor: pointer;
-    transition: background 300ms ease-in-out;
-    font-size: 0;

-    &:hover {
-      background: @black007;
-    }
-  }
packages/extension/src/ui/action/components/app-dialog/index.vue (4)

67-72: Consider enhancing the dialog with keyboard accessibility.

The dialog correctly implements two-way binding with defineModel and properly closes via the close button. However, it lacks keyboard accessibility - users should be able to press Escape to close the dialog.

const closeDialog = () => {
  model.value = false;
  emit('close:dialog');
};

+// Add keyboard event listener to close dialog on Escape key press
+onMounted(() => {
+  const handleKeydown = (e: KeyboardEvent) => {
+    if (e.key === 'Escape' && model.value) {
+      closeDialog();
+    }
+  };
+  window.addEventListener('keydown', handleKeydown);
+  onUnmounted(() => {
+    window.removeEventListener('keydown', handleKeydown);
+  });
+});

92-133: Consider making the dialog height more flexible.

The dialog has a fixed height of 600px, which might not be optimal for all content sizes. Consider making this a prop or using a more flexible approach based on content.

.app-dialog {
-  height: 600px;
+  max-height: 600px;
  top: 0px;
  position: fixed;
  z-index: 105;
  display: none;
  box-sizing: border-box;
  align-items: center;
  flex-direction: row;
  padding: 16px;
  transition: opacity 0.3s ease;

134-154: Optimize the scroll behavior.

Using overflow-y: scroll will always show scrollbars in some browsers even when not needed. Consider using auto instead for better user experience.

  &__wrap {
    background: @white;
    box-shadow:
      0px 0.5px 5px rgba(0, 0, 0, 0.039),
      0px 3.75px 11px rgba(0, 0, 0, 0.19);
    border-radius: 12px;
    position: relative;
    z-index: 107;
-    overflow-y: scroll;
+    overflow-y: auto;
    max-height: 100%;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;

28-49: Add ARIA attributes for better accessibility.

The dialog should include ARIA attributes to ensure it's accessible to screen readers.

<div v-if="model" :class="[defaultClass, { show: model }]" 
+  role="dialog" 
+  aria-modal="true"
+  aria-labelledby="dialog-title"
>
  <div class="app-dialog__overlay" @click="closeDialog" />
  <div
    class="app-dialog__wrap"
    :class="[{ show: model }]"
    :style="dialogStyle"
  >
    <a class="app-dialog__close" @click="closeDialog" 
+      aria-label="Close dialog"
    >
      <close-icon />
    </a>

    <slot />
  </div>
</div>
packages/extension/src/ui/action/views/deposit/index.vue (1)

114-126: Consider simplifying the prop-to-state synchronization.

The component uses a watcher to synchronize the showDeposit prop with the local openDialog state. This pattern works but creates redundant reactivity. Consider using a computed property with a getter and setter instead.

- const openDialog = ref(false);
- const toggleDialog = () => {
-   emit('toggle:deposit');
- };
- watch(
-   () => props.showDeposit,
-   () => {
-     openDialog.value = props.showDeposit;
-   },
- );

+ const openDialog = computed({
+   get: () => props.showDeposit,
+   set: (value) => {
+     if (!value) {
+       emit('toggle:deposit');
+     }
+   }
+ });
+ const toggleDialog = () => {
+   emit('toggle:deposit');
+ };
packages/extension/src/ui/action/views/assets-select-list/index.vue (2)

124-132: Consider harmonizing the close event handling approach.

The component currently has two mechanisms for closing: the close() function emits a 'close' event, and the component also uses defineModel for two-way binding. This dual approach might be confusing. Consider standardizing on one approach.

const close = () => {
  emit('close', false);
+  model.value = false;
};

/** -------------------
 * Dialog
 * ------------------- */
const model = defineModel<boolean>();

138-141: Clean up commented code.

There's a commented out height property that should be removed for cleaner code.

.assets-select-list {
  width: 100%;
-  // height: 568px;
packages/extension/src/ui/action/views/transaction-fee/index.vue (1)

104-111: Simplify the dialog closing logic.

The component has redundant event handling for closing - it both emits an event and modifies the model value. Consider standardizing this approach.

const closepopup = () => {
  emit('closePopup');
  if (props.isPopup) {
    model.value = false;
  }
};
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ea04df2 and 1e9d84d.

📒 Files selected for processing (24)
  • packages/extension/src/providers/bitcoin/ui/send-transaction/index.vue (1 hunks)
  • packages/extension/src/providers/ethereum/ui/eth-verify-transaction.vue (1 hunks)
  • packages/extension/src/providers/ethereum/ui/send-transaction/components/send-token-select.vue (1 hunks)
  • packages/extension/src/providers/ethereum/ui/send-transaction/index.vue (2 hunks)
  • packages/extension/src/providers/kadena/ui/send-transaction/index.vue (1 hunks)
  • packages/extension/src/providers/polkadot/ui/send-transaction/index.vue (1 hunks)
  • packages/extension/src/providers/solana/ui/send-transaction/index.vue (1 hunks)
  • packages/extension/src/ui/action/components/accounts-header/components/header-accounts.vue (2 hunks)
  • packages/extension/src/ui/action/components/app-dialog/index.vue (1 hunks)
  • packages/extension/src/ui/action/components/tooltip/index.vue (4 hunks)
  • packages/extension/src/ui/action/views/asset-detail-view/index.vue (5 hunks)
  • packages/extension/src/ui/action/views/assets-select-list/components/assets-select-list-item.vue (1 hunks)
  • packages/extension/src/ui/action/views/assets-select-list/index.vue (4 hunks)
  • packages/extension/src/ui/action/views/deposit/index.vue (4 hunks)
  • packages/extension/src/ui/action/views/network-assets/components/custom-evm-token.vue (1 hunks)
  • packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue (2 hunks)
  • packages/extension/src/ui/action/views/network-assets/index.vue (1 hunks)
  • packages/extension/src/ui/action/views/network-nfts/components/network-nfts-item.vue (1 hunks)
  • packages/extension/src/ui/action/views/network-nfts/index.vue (2 hunks)
  • packages/extension/src/ui/action/views/nft-detail-view/index.vue (3 hunks)
  • packages/extension/src/ui/action/views/swap/components/swap-network-select/network-select-list.vue (2 hunks)
  • packages/extension/src/ui/action/views/swap/index.vue (1 hunks)
  • packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue (1 hunks)
  • packages/extension/src/ui/action/views/transaction-fee/index.vue (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: buildAll
🔇 Additional comments (45)
packages/extension/src/providers/ethereum/ui/send-transaction/components/send-token-select.vue (1)

78-78: Improved image display with object-fit: contain

Adding the object-fit: contain property ensures that the token image will maintain its aspect ratio while fitting within the circular container. This prevents image distortion that could occur with the default stretch behavior and creates a more polished look for token icons of different dimensions.

packages/extension/src/ui/action/views/network-assets/components/custom-evm-token.vue (1)

410-410: Improved token image display consistency

Adding object-fit: contain ensures that token icons maintain their aspect ratio within the circular container, preventing distortion. This change is consistent with similar updates to image styling in other components, creating a unified visual presentation across the application.

packages/extension/src/ui/action/views/swap/components/swap-network-select/network-select-list.vue (4)

2-20: Refactored to use the new app-dialog component

The component has been refactored to use the app-dialog component instead of a direct div container, which improves reusability and consistency across the application. The dialog now uses Vue's two-way binding with v-model="model" to control its visibility state, which simplifies the parent-child component interaction.


29-29: Added AppDialog import

Importing the AppDialog component to support the template changes.


46-46: Added defineModel for two-way binding

Using Vue's defineModel for creating a reactive property that can be bound with v-model from parent components. This simplifies state management by reducing the need for custom event handling for opening/closing the dialog.


53-53: Updated class name to match component purpose

Changed the class name from assets-select-list to network-select-list to better reflect the component's specific purpose. This improves code readability and maintainability.

packages/extension/src/ui/action/views/assets-select-list/components/assets-select-list-item.vue (1)

98-98: Improved token image display

Adding object-fit: contain to the image ensures that token icons maintain their aspect ratio within the container, preventing distortion. This change is part of a consistent update to image styling across multiple components in the application.

packages/extension/src/ui/action/views/network-assets/index.vue (1)

51-51: Improved event handling pattern

Changed from a prop to an event listener which better reflects the component communication pattern in Vue. This follows best practices where props flow down and events flow up in the component hierarchy.

packages/extension/src/ui/action/views/network-nfts/index.vue (3)

41-41: Using v-model for better state management

Switching to Vue's two-way data binding with v-model for controlling the detail view's visibility state is a good approach. This simplifies the component communication pattern and aligns with Vue best practices.


159-159: Added new reactive state for detail view visibility

Creating a dedicated reactive reference for visibility state is a good pattern that provides better control over the component's display state.


162-164: Enhanced toggle logic for detail view

The conditional logic ensures the detail view is automatically shown when an NFT item is selected, which improves user experience.

packages/extension/src/providers/ethereum/ui/eth-verify-transaction.vue (2)

104-105: Improved state management with v-model

Replaced the :show-fees prop with v-model binding for better two-way data binding, which aligns with the broader refactoring effort across components to streamline visibility state management.


108-109: Simplified attribute binding

Changed from a bound property :is-popup="true" to the static attribute is-popup, which is more concise when dealing with boolean props that are always true.

packages/extension/src/ui/action/components/accounts-header/components/header-accounts.vue (2)

68-68: Improved tooltip positioning

Added is-bottom-left property to the QR code tooltip to ensure proper positioning, which enhances user experience by making the tooltip more accessible and visible.


252-252: Enhanced image display with object-fit

Added object-fit: contain to ensure the network icon maintains its aspect ratio while fitting within its container, preventing image distortion and improving visual presentation.

packages/extension/src/providers/bitcoin/ui/send-transaction/index.vue (1)

82-88: Improved dialog state management using v-model

The change to use v-model for the transaction fee component improves the code by leveraging Vue's two-way data binding, which simplifies the template and makes the state management more idiomatic.

This approach is more maintainable than using separate :show-fees prop and @close-popup event handlers as it reduces boilerplate code while maintaining the same functionality.

packages/extension/src/ui/action/views/swap/index.vue (3)

85-89: Enhanced component interaction with v-model binding

Replacing conditional rendering and explicit event handlers with v-model for the network select list improves code readability and maintainability. The two-way data binding creates a cleaner pattern for managing the visibility state.


91-95: Consistent state management pattern applied

The v-model implementation for the assets-select-list follows the same pattern as other components, creating a more consistent approach to managing UI state throughout the application.


97-103: Simplified component interaction pattern

The change to use v-model for the second assets-select-list completes the pattern for all select components in this view. These changes collectively reduce the verbosity of the template and make state management more intuitive.

packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue (1)

62-68: Standardized fee view interaction pattern

Using v-model for the transaction fee view is consistent with the pattern applied in other components across the application. This approach creates a unified way to handle dialog visibility while simplifying the template code.

packages/extension/src/ui/action/views/network-nfts/components/network-nfts-item.vue (1)

26-32: Improved NFT detail view state management

The change to use v-model for the NFT detail view implements the same improved pattern found in other dialog components. This standardizes how visibility state is managed across the application while leveraging Vue's two-way data binding.

packages/extension/src/ui/action/components/tooltip/index.vue (3)

44-47: Good addition of the isBottomLeft prop for enhanced tooltip positioning.

This new prop adds more flexibility to the tooltip positioning system, allowing tooltips to be displayed at the bottom-left of target elements.


93-99: Implementation for bottom-left positioning looks correct.

The logic follows the same pattern as existing position handlers, calculating the left and top positions based on the target element's bounding rectangle.


212-216: Good implementation of the CSS for bottom-left positioning.

The CSS implementation follows the same pattern as other positioning classes, ensuring consistent tooltip behavior.

packages/extension/src/providers/solana/ui/send-transaction/index.vue (1)

56-57: Good refactoring to use v-model for token selection visibility.

Replacing v-show with v-model simplifies the component interaction by leveraging Vue's two-way binding capabilities. This removes the need for the explicit @close event handler, making the code more maintainable.

packages/extension/src/providers/polkadot/ui/send-transaction/index.vue (1)

55-56: Good refactoring to use v-model for token selection visibility.

Similar to the Solana implementation, this change simplifies component interaction by using Vue's two-way data binding instead of manual event handling for visibility toggling.

packages/extension/src/ui/action/views/nft-detail-view/index.vue (3)

2-3: Great refactoring to use AppDialog component.

Replacing the custom dialog implementation with a reusable component improves code maintainability and provides a consistent UI experience. Using v-model for dialog visibility aligns with modern Vue patterns.

Also applies to: 38-38


50-51: Properly imported AppDialog component.

Correctly imported the new component that's being used in the template.


104-105: Good use of Vue 3's defineModel API.

Using defineModel<boolean>() is an elegant way to implement two-way binding for the dialog's visibility state.

packages/extension/src/providers/ethereum/ui/send-transaction/index.vue (2)

61-61: Improved state management with v-model

The change from v-show="isOpenSelectToken" to v-model="isOpenSelectToken" leverages Vue's two-way data binding, allowing the assets-select-list component to both read and modify the visibility state. This simplifies the component interaction by removing the need for explicit event handling to toggle visibility.


102-102: Consistent approach to dialog visibility with v-model

Similar to the token selection, changing the transaction-fee-view from using :show-fees prop to v-model="isOpenSelectFee" creates a consistent pattern for managing component visibility. This change removes the need for explicit event handlers like @close-popup and streamlines state management.

packages/extension/src/providers/kadena/ui/send-transaction/index.vue (1)

57-57: Consistent implementation of v-model binding

Changing from v-show="isOpenSelectToken" to v-model="isOpenSelectToken" aligns with the broader architectural changes across the application. This provides a more consistent way to manage dialog visibility state and eliminates the need for manual event handling through @close="toggleSelectToken".

packages/extension/src/ui/action/views/asset-detail-view/index.vue (4)

2-3: Refactored to use app-dialog component

The previous custom dialog implementation has been replaced with a reusable <app-dialog> component. This standardizes the dialog interface, reduces code duplication, and provides consistent dialog behavior across the application.

Also applies to: 62-63


78-79: Added import for AppDialog component

The addition of the AppDialog import supports the template changes and aligns with the application's move toward more standardized UI components.


143-143: Added defineModel for two-way binding

The addition of defineModel<boolean>() enables seamless two-way binding with parent components through the v-model directive. This follows Vue 3's composition API best practices for component state management.


183-183: Improved image rendering with object-fit

Adding object-fit: contain; ensures that token icons maintain their proper aspect ratio while fitting within their container. This prevents distortion of images and improves the overall visual quality of the UI.

packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue (2)

52-52: Updated to use v-model binding for detail view

Changing from v-if="isDetail" to v-model="isDetail" for the asset-detail-view component establishes two-way data binding. This eliminates the need for the explicit @close:popup="toggleDetail" event handler, as the component can now directly update the parent's state.


230-230: Enhanced image display with object-fit property

Adding object-fit: contain; to the token icons ensures they display properly within their circular container while maintaining their aspect ratio. This creates consistent and visually appealing token representations throughout the application.

packages/extension/src/ui/action/components/app-dialog/index.vue (2)

1-20: Overall good implementation of a reusable modal dialog component.

The teleport usage is excellent for avoiding z-index issues, and the transition handling provides a smooth user experience. The component correctly uses a backdrop that can be clicked to close the dialog.


25-49: Great documentation for the component.

The documentation is thorough and includes usage examples, which is excellent for maintainability. The warning about pinia store dependency is helpful.

packages/extension/src/ui/action/views/deposit/index.vue (2)

2-8: Good integration of the app-dialog component.

The app-dialog is well-implemented with appropriate width, centering, and event handling. The use of v-model for dialog visibility is a clean approach.


155-155: Good use of object-fit for logo.

The addition of object-fit: contain to the logo is a good improvement to prevent image distortion.

packages/extension/src/ui/action/views/assets-select-list/index.vue (1)

2-8: Good implementation of the app-dialog component.

The component successfully integrates the app-dialog and correctly handles dialog closing through the @close:dialog event.

packages/extension/src/ui/action/views/transaction-fee/index.vue (2)

2-8: Clever use of dynamic component rendering.

The component intelligently decides whether to render as a regular div or as an app-dialog based on the isPopup prop. This allows for reuse in different contexts.


137-172: Good styling adaptation for popup mode.

The component properly adjusts its styling based on whether it's displayed as a popup or not. The transitions create a smooth experience.

Comment on lines +152 to +154
if (props.isBottomRight) {
return { 'left-bottom': true, visible: visible.value };
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Warning: Incorrect class assignment for bottom-right positioning.

There appears to be a mismatch in the class naming. When checking for props.isBottomRight, it's returning a class named 'left-bottom' which doesn't match the semantic meaning.

-  if (props.isBottomRight) {
-    return { 'left-bottom': true, visible: visible.value };
-  }
+  if (props.isBottomRight) {
+    return { 'right-bottom': true, visible: visible.value };
+  }
+  if (props.isBottomLeft) {
+    return { 'left-bottom': true, visible: visible.value };
+  }
📝 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
if (props.isBottomRight) {
return { 'left-bottom': true, visible: visible.value };
}
if (props.isBottomRight) {
return { 'right-bottom': true, visible: visible.value };
}
if (props.isBottomLeft) {
return { 'left-bottom': true, visible: visible.value };
}

Comment on lines +116 to +131
.popup {
width: 10%;
height: 100%;
position: absolute;
position: fixed;
left: 0;
top: 0;
z-index: 101;
display: none;
align-items: center;
flex-direction: row;
padding: 16px;

&.show {
display: block;
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the popup width styling.

The popup width is set to 10%, which seems unusually narrow and likely incorrect for this UI component.

.popup {
-  width: 10%;
+  width: 100%;
  height: 100%;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 101;
  display: none;
  align-items: center;
  flex-direction: row;
  padding: 16px;

  &.show {
-    display: block;
+    display: flex;
  }
}
📝 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
.popup {
width: 10%;
height: 100%;
position: absolute;
position: fixed;
left: 0;
top: 0;
z-index: 101;
display: none;
align-items: center;
flex-direction: row;
padding: 16px;
&.show {
display: block;
}
}
.popup {
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
z-index: 101;
display: none;
align-items: center;
flex-direction: row;
padding: 16px;
&.show {
display: flex;
}
}

@olgakup olgakup merged commit 72e4f11 into feat/collapse-networks-menu Mar 27, 2025
4 checks passed
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.

3 participants