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

feat(suite): add guide link to the destination tag #16847

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

izmy
Copy link
Contributor

@izmy izmy commented Feb 5, 2025

Description

Added a guide link to the destination tag input and to the receive modal info box.

Related Issue

Resolve #16842

Screenshots:

Screenshot 2025-02-05 at 15 28 37 Screenshot 2025-02-05 at 15 26 41

@izmy izmy self-assigned this Feb 5, 2025
Copy link

coderabbitai bot commented Feb 5, 2025

Walkthrough

The pull request introduces guide link functionality to two components: ConfirmValueModal and DestinationTag. In both components, a new method, handleOpenGuide, is added to handle click events that open a guide related to destination tags. The modal now imports a Link component to wrap guide text, and the destination tag options include a new button within a layout row to trigger the guide. Additionally, a new localization message DESTINATION_TAG_GUIDE_LINK is added with the default value "What is this?" This change standardizes the user interaction for accessing guidance on destination tags, ensuring that clicking the link or button opens the corresponding guide via the useGuideOpenNode hook.

Assessment against linked issues

Objective Addressed Explanation
Correct XRP receive flow banner UI by replacing the <a> tag with a guide trigger and updating the copy to include contextual guidance [#16842]

Possibly related PRs

  • Crowdin translations update #16812: The changes in the main PR are related to the addition of a new message entry for a guide link in the messages.ts file, which aligns with the localization updates in the retrieved PR that also modifies the messages.ts file, although they address different content.
  • feat(suite): add address confirm to send modal #16734: The changes in the main PR are related to the addition of the handleOpenGuide method and the useGuideOpenNode hook in the ConfirmValueModal component, which parallels the introduction of the same method and hook in the DestinationTag component of the retrieved PR.

Suggested labels

translations

Suggested reviewers

  • MiroslavProchazka
  • komret
  • tomasklim

🪧 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. (Beta)
  • @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

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx (1)

24-24: Consider extracting the guide path as a constant.

The guide path is hardcoded in the handler. For better maintainability and reusability, consider extracting it to a constants file.

+const DESTINATION_TAG_GUIDE_PATH = '/3_send-and-receive/transactions-in-depth/destination-tags.md';
+
 const handleOpenGuide = (e: React.MouseEvent<HTMLButtonElement>) => {
     e.stopPropagation();
-    openNodeById('/3_send-and-receive/transactions-in-depth/destination-tags.md');
+    openNodeById(DESTINATION_TAG_GUIDE_PATH);
 };

Also applies to: 55-58

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7f0b3c and a0c3511.

📒 Files selected for processing (3)
  • packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/ConfirmValueModal.tsx (5 hunks)
  • packages/suite/src/support/messages.ts (1 hunks)
  • packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/suite/src/support/messages.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: build-web
  • GitHub Check: Setup and Cache Dependencies
  • GitHub Check: build-web
  • GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (4)
packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx (2)

4-4: LGTM!

The import changes are minimal and correctly organized, adding only the necessary components and hooks for the new guide link functionality.

Also applies to: 9-9


62-71: LGTM!

The layout changes are well-structured:

  • Row component provides proper spacing and alignment
  • Button uses appropriate variant and size for consistency
  • Translation ID is correctly used for internationalization
packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/ConfirmValueModal.tsx (2)

10-10: LGTM!

The import changes are minimal and correctly organized, adding only the necessary components and hooks for the new guide link functionality.

Also applies to: 24-24


138-152: LGTM!

The layout changes are well-structured:

  • Link component uses appropriate variant and typography style
  • Translation component correctly uses values prop for dynamic content
  • Event handler is properly bound

@izmy izmy force-pushed the feat/ripple-dt-guide-link branch from a0c3511 to 89045f2 Compare February 5, 2025 14:35
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx (1)

65-74: Consider improving button accessibility.

While the layout is well-structured, consider enhancing accessibility by:

  1. Adding an aria-label to the button for screen readers
  2. Evaluating if the "tiny" size provides sufficient touch target area
 <Button
   variant="tertiary"
   type="button"
   size="tiny"
+  aria-label={translationString('DESTINATION_TAG_GUIDE_LINK')}
   onClick={handleOpenGuide}
 >
   <Translation id="DESTINATION_TAG_GUIDE_LINK" />
 </Button>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0c3511 and 89045f2.

📒 Files selected for processing (3)
  • packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/ConfirmValueModal.tsx (5 hunks)
  • packages/suite/src/support/messages.ts (1 hunks)
  • packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/suite/src/components/suite/modals/ReduxModal/ConfirmValueModal/ConfirmValueModal.tsx
  • packages/suite/src/support/messages.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: build-web
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: Setup and Cache Dependencies
  • GitHub Check: build-web
  • GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (2)
packages/suite/src/views/wallet/send/Options/RippleOptions/DestinationTag.tsx (2)

4-4: LGTM! Clean imports and well-structured constant definition.

The imports and constant definition are well-organized and follow the project's conventions.

Also applies to: 9-9, 13-14


27-27: LGTM! Well-implemented event handler with proper typing.

The guide opening functionality is well-implemented with proper event handling and type safety.

Also applies to: 58-61

@MiroslavProchazka
Copy link
Contributor

Merge it 🙏

@mroz22 mroz22 merged commit 07d9da1 into develop Feb 5, 2025
30 checks passed
@mroz22 mroz22 deleted the feat/ripple-dt-guide-link branch February 5, 2025 16:13
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.

XRP receive flow has incorrect copy in banner
5 participants