Skip to content

feat: add memo to transaction history#829

Open
overbit wants to merge 3 commits intosolana-foundation:masterfrom
overbit:memo-tx-history
Open

feat: add memo to transaction history#829
overbit wants to merge 3 commits intosolana-foundation:masterfrom
overbit:memo-tx-history

Conversation

@overbit
Copy link
Contributor

@overbit overbit commented Jan 27, 2026

Description

This pull request enhances the transaction history UI by adding support for displaying transaction memos, improving the user experience with memo truncation and tooltips, and updating layout variables for better responsiveness. The most important changes are grouped below:

Transaction History Table Enhancements

  • Added a new "Memo" column to the transaction history table in TransactionHistoryCard.tsx, displaying memos for each transaction if available.
  • Updated the transaction row mapping to include signatureInfo and render memos using the new MemoField component. [1] [2]

Memo Display Improvements

  • Introduced the MemoField component, which cleans up memo text, truncates long memos, and shows the full memo in a tooltip on hover. Also allows users to copy the memo easily.

Layout and Responsiveness

  • Added a new xxl container width variable in the SCSS layout configuration to support larger screens.

Type of change

  • Bug fix
  • New feature
  • Protocol integration
  • Documentation update
  • Other (please describe):

Screenshots

Screenshot 2026-01-27 at 11 49 31

Testing

No additional RPC calls where implemented so testing was just about simple manual tests on different screen resolutions

Related Issues

Closes: #828

Checklist

  • My code follows the project's style guidelines
  • I have added tests that prove my fix/feature works
  • All tests pass locally and in CI
  • I have updated documentation as needed
  • I have run build:info script to update build information
  • CI/CD checks pass
  • I have included screenshots for protocol screens (if applicable)
  • For security-related features, I have included links to related information

Additional Notes

@vercel
Copy link

vercel bot commented Jan 27, 2026

@overbit is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Greptile Overview

Greptile Summary

This PR adds transaction memo display functionality to the transaction history table, improving visibility of transaction metadata.

Key Changes:

  • Added new "Memo" column to transaction history table displaying memos from ConfirmedSignatureInfo
  • Implemented MemoField component with memo cleaning (removes [n] length prefixes), truncation at 25 characters, hover tooltips for full text, and copy functionality
  • Added xxl breakpoint (1400px) to SCSS variables for better large screen responsiveness

Issues Found:

  • Line 77 contains redundant condition check (signatureInfo.memo && signatureInfo.memo) that should be simplified to use optional chaining

Confidence Score: 4/5

  • This PR is safe to merge with one minor syntax fix needed
  • The implementation is straightforward and follows existing patterns in the codebase. The MemoField component is well-designed with proper truncation and tooltip functionality. The only issue is a redundant condition check on line 77 that should be fixed to prevent potential runtime errors if signatureInfo is undefined. The SCSS change is minimal and safe. No security concerns or breaking changes identified.
  • Fix the redundant condition in app/components/account/history/TransactionHistoryCard.tsx:77

Important Files Changed

Filename Overview
app/components/account/history/TransactionHistoryCard.tsx Added memo column with MemoField component for display and truncation; redundant condition check found on line 77
app/scss/dashkit/_variables.scss Added xxl breakpoint (1400px) to container max-widths for better large screen support

Sequence Diagram

sequenceDiagram
    participant User
    participant TransactionHistoryCard
    participant useAccountHistory
    participant Connection
    participant MemoField
    
    User->>TransactionHistoryCard: Views account page
    TransactionHistoryCard->>useAccountHistory: Fetch account history
    useAccountHistory->>Connection: getSignaturesForAddress(pubkey)
    Connection-->>useAccountHistory: ConfirmedSignatureInfo[] (includes memo field)
    useAccountHistory->>TransactionHistoryCard: Returns transaction history
    TransactionHistoryCard->>TransactionHistoryCard: Map transactions to rows
    TransactionHistoryCard->>TransactionHistoryCard: Extract signatureInfo.memo
    alt memo exists
        TransactionHistoryCard->>MemoField: Render with memo text
        MemoField->>MemoField: Clean memo (remove [n] prefix)
        MemoField->>MemoField: Truncate if > 25 chars
        MemoField-->>User: Display truncated memo with copy icon
        User->>MemoField: Hover over truncated memo
        MemoField-->>User: Show full memo in tooltip
    else no memo
        TransactionHistoryCard-->>User: Display "---"
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile


function MemoField({ memo }: { memo: string }) {
const [showTooltip, setShowTooltip] = React.useState(false);
const truncateLength = 25;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have this at the props with 25 as the default value?

function MemoField({ memo }: { memo: string }) {
const [showTooltip, setShowTooltip] = React.useState(false);
const truncateLength = 25;
// Remove memo length like "[15] " from the memo for display (handles all occurrences)
Copy link
Contributor

Choose a reason for hiding this comment

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

In the newer master, we have a rule to explicitly state the reason for regexps. That line would fail after merging.

I propose something like:

// eslint-disable-next-line no-restricted-syntax -- Solana RPC prepends `[length] ` to memo strings in getSignaturesForAddress responses; strip for display 

const [showTooltip, setShowTooltip] = React.useState(false);
const truncateLength = 25;
// Remove memo length like "[15] " from the memo for display (handles all occurrences)
const cleanMemo = memo.replace(/\[\d+\]\s*/g, '').trim();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need to replace all the occurrences in the Memo? What if this [N] format is selected by anyone for verification, for example

onMouseOut={() => setShowTooltip(false)}
style={{ cursor: isTruncated ? 'pointer' : 'default' }}
>
<Copyable text={cleanMemo}>
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: Why not to allow copying the original memo?

</>
)}

<td>{signatureInfo.memo ? <MemoField memo={signatureInfo.memo} /> : '---'}</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the memo is grey to match the other columns, but --- is white. I suppose it is better to use the same styles

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.

[Feature Request] Add Memo to transactions history

2 participants