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

Labeling bugs #16882

Merged
merged 5 commits into from
Mar 3, 2025
Merged

Labeling bugs #16882

merged 5 commits into from
Mar 3, 2025

Conversation

komret
Copy link
Contributor

@komret komret commented Feb 6, 2025

1st commit:

Fixes alignment.

before:
Screenshot 2025-02-28 at 17 51 57
after:
Screenshot 2025-02-28 at 17 51 47

2nd commit:

Code cleanup, also was necessary after the first commit.

3rd commit:

Resolve #16069

4th commit:

before:
Screenshot 2025-02-28 at 16 28 47
after:
Screenshot 2025-02-28 at 16 28 29

5th commit:

Click doesn't propagate and checkbox is not checked.

before:

Screen.Recording.2025-02-28.at.18.11.20.mov

after:

Screen.Recording.2025-02-28.at.18.12.22.mov

@komret komret added bug Something isn't working as expected labelling Naming of transactions and accounts labels Feb 6, 2025
Copy link

coderabbitai bot commented Feb 6, 2025

Walkthrough

This pull request updates two components. In the MetadataLabeling component, new spacing imports are introduced, and styling properties are adjusted—such as adding left text alignment, modifying gap sizes, and removing conditional margin logic from various buttons. The event handling is streamlined by always stopping propagation without referencing an edit-active flag. In the UtxoSelection component, an import for the Text component is added and pixel units are explicitly used in the gap properties for styled elements. The component’s state mapping is extended to include address labels alongside output labels, and the UTXO address is now rendered using the MetadataLabeling component wrapped in a Text component. These changes modify styling rules, update import dependencies, and adjust how metadata and addresses are processed within the components.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5c8b991 and 48b517a.

📒 Files selected for processing (2)
  • packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx (5 hunks)
  • packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoSelection.tsx (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: e2e-test-suite-web (@group=other)
  • GitHub Check: run-desktop-tests (@group=passphrase, trezor-user-env-unix)
  • GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (9)
packages/suite/src/views/wallet/send/Options/BitcoinOptions/CoinControl/UtxoSelectionList/UtxoSelection/UtxoSelection.tsx (4)

6-6: Good addition of the Text component import.

Added the Text component from @trezor/components to properly wrap text content, which is used later in the component for the address display.


37-37: Fix: Added proper px units to gap properties.

Explicitly adding the 'px' unit to gap properties ensures consistent spacing across different browsers and prevents potential styling issues.

Also applies to: 45-45


177-177: Enhancement: Added address labels to component state.

Including addressLabels alongside outputLabels from the selector enhances the component's functionality by providing access to address-specific metadata for display purposes.


250-261: Improved address display with metadata labeling.

The address display now properly leverages the MetadataLabeling component for better UX, allowing users to see labels associated with addresses. This change fixes the issue where address labels weren't being displayed.

The implementation correctly:

  • Uses Text component with appropriate typography style
  • Passes the address and its label to MetadataLabeling
  • Sets disabled state to prevent editing directly from this view
  • Preserves the original address as fallback display
packages/suite/src/components/suite/labeling/MetadataLabeling/MetadataLabeling.tsx (5)

7-7: Good: Added spacingsPx import.

Importing spacingsPx from the theme ensures consistent spacing values throughout the application according to design system guidelines.


26-26: Fixed: Added explicit left text alignment.

Setting text-align to left ensures consistent text alignment across the application regardless of parent container properties, fixing alignment issues mentioned in the PR.


66-68: Improved: Simplified ActionButton styling.

Removed unnecessary conditional margin-left logic based on value visibility, which simplifies the component and makes the styling more consistent. This is a good cleanup.


90-90: Enhancement: Added proper gap between label container elements.

Using gap with spacingsPx.sm creates consistent spacing between elements in the LabelContainer, improving the visual layout and alignment of the component.


414-414: Fixed: Ensure click events don't propagate.

Always stopping event propagation on the LabelContainer prevents unwanted parent element click events from firing when interacting with the labeling component, fixing the checkbox issue mentioned in the PR where clicks weren't properly registering.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai 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.

@komret komret force-pushed the feat/coin-control-address-label branch from e2ea915 to b0d1249 Compare February 28, 2025 16:40
@komret komret force-pushed the feat/coin-control-address-label branch from b0d1249 to 48b517a Compare February 28, 2025 17:20
@komret komret marked this pull request as ready for review February 28, 2025 17:24
@komret komret merged commit bda230c into develop Mar 3, 2025
29 checks passed
@komret komret deleted the feat/coin-control-address-label branch March 3, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected labelling Naming of transactions and accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address label not showing in the coin control section
2 participants