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

fix: add memo to tx info modal #147

Closed
wants to merge 1 commit into from
Closed

fix: add memo to tx info modal #147

wants to merge 1 commit into from

Conversation

chalabi2
Copy link
Collaborator

@chalabi2 chalabi2 commented Dec 9, 2024

fixes #140

Summary by CodeRabbit

  • New Features

    • Added optional memo fields to transaction and transaction group interfaces for enhanced transaction details.
    • Introduced conditional rendering in the transaction info modal to display associated memos.
  • Bug Fixes

    • Improved handling of transaction messages to include memo fields in formatted outputs.

Copy link
Contributor

coderabbitai bot commented Dec 9, 2024

Walkthrough

The pull request introduces optional memo properties to the Transaction and TransactionGroup interfaces in the historyBox.tsx file, allowing for additional transaction information. It also modifies the TxInfoModal component to conditionally render the memo when available. Additionally, the useQueries.ts file is updated to include the memo in formatted transaction messages. These changes enhance the data structure and presentation of transaction details without altering existing functionalities.

Changes

File Path Change Summary
components/bank/components/historyBox.tsx Added optional memo property to Transaction and TransactionGroup interfaces.
components/bank/modals/txInfo.tsx Added conditional rendering for memo in TxInfoModal to display transaction memo if available.
hooks/useQueries.ts Updated _formatMessage and transformTransactions functions to include memo in transaction messages.

Assessment against linked issues

Objective Addressed Explanation
Add memo to Tx detail modal (#140)

Possibly related PRs

Suggested labels

render

Suggested reviewers

  • fmorency

Poem

In the land of transactions, so bright and so merry,
A memo was added, oh what a new cherry!
With details now flowing, like a stream in the glen,
Our history box sparkles, again and again!
So hop with delight, let the info expand,
For each little memo, a treasure so grand! 🐇✨


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

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 26.66667% with 11 lines in your changes missing coverage. Please review.

Project coverage is 57.02%. Comparing base (215915e) to head (989e6db).

Files with missing lines Patch % Lines
hooks/useQueries.ts 0.00% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
- Coverage   57.05%   57.02%   -0.03%     
==========================================
  Files         145      145              
  Lines       14419    14433      +14     
==========================================
+ Hits         8227     8231       +4     
- Misses       6192     6202      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@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

🧹 Outside diff range and nitpick comments (1)
hooks/useQueries.ts (1)

808-811: Add test coverage for memo handling

The new memo handling code lacks test coverage. Consider adding tests for:

  • Memo extraction from transaction body
  • Memo propagation through message transformation
  • Different transaction types with memos

Would you like me to help create test cases for the memo functionality?

Also applies to: 823-823

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 808-811: hooks/useQueries.ts#L808-L811
Added lines #L808 - L811 were not covered by tests

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 215915e and 989e6db.

📒 Files selected for processing (3)
  • components/bank/components/historyBox.tsx (1 hunks)
  • components/bank/modals/txInfo.tsx (1 hunks)
  • hooks/useQueries.ts (8 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
hooks/useQueries.ts

[warning] 717-717: hooks/useQueries.ts#L717
Added line #L717 was not covered by tests


[warning] 732-732: hooks/useQueries.ts#L732
Added line #L732 was not covered by tests


[warning] 742-742: hooks/useQueries.ts#L742
Added line #L742 was not covered by tests


[warning] 752-752: hooks/useQueries.ts#L752
Added line #L752 was not covered by tests


[warning] 773-773: hooks/useQueries.ts#L773
Added line #L773 was not covered by tests


[warning] 783-783: hooks/useQueries.ts#L783
Added line #L783 was not covered by tests


[warning] 808-811: hooks/useQueries.ts#L808-L811
Added lines #L808 - L811 were not covered by tests


[warning] 823-823: hooks/useQueries.ts#L823
Added line #L823 was not covered by tests

🔇 Additional comments (3)
components/bank/components/historyBox.tsx (1)

16-16: LGTM: Interface changes for memo support

The optional memo fields are correctly added to both interfaces, maintaining backward compatibility while enabling memo support.

Also applies to: 24-24

hooks/useQueries.ts (1)

717-717: LGTM: Consistent memo handling across message types

The memo field is consistently added to all transaction types in the _formatMessage function.

Also applies to: 732-732, 742-742, 752-752, 773-773, 783-783

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 717-717: hooks/useQueries.ts#L717
Added line #L717 was not covered by tests

components/bank/modals/txInfo.tsx (1)

93-97: LGTM: Clean implementation of memo display

The memo display is well-implemented:

  • Uses existing InfoItem component for consistent UI
  • Properly handles optional memo with conditional rendering
  • Logical placement at the bottom of the modal

@fmorency
Copy link
Contributor

Superseded by #140

@fmorency fmorency closed this Dec 10, 2024
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.

Add memo to Tx detail modal
2 participants