Skip to content

feat(gui): Pretty Monero transaction history#470

Merged
binarybaron merged 1 commit intomasterfrom
feat/pretty-monero-history
Jul 18, 2025
Merged

feat(gui): Pretty Monero transaction history#470
binarybaron merged 1 commit intomasterfrom
feat/pretty-monero-history

Conversation

@binarybaron
Copy link
Copy Markdown

@binarybaron binarybaron commented Jul 18, 2025

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 18, 2025

Walkthrough

A new Monero transaction UI is introduced, replacing the previous table-based transaction history with a date-grouped list and a new TransactionItem component. The AmountWithUnit family of components now supports custom styling and tooltip disabling. The theme is extended with a "tiny" button size and palette tint colors. The Monero submodule is updated.

Changes

File(s) Change Summary
monero-sys/monero Updated subproject commit reference to a newer version.
src-gui/src/renderer/components/other/Units.tsx Enhanced AmountWithUnit, MoneroAmount, and PiconeroAmount with custom style props and tooltip disabling.
src-gui/src/renderer/components/pages/monero/components/ConfirmationsBadge.tsx Added new ConfirmationsBadge component for visualizing transaction confirmations.
src-gui/src/renderer/components/pages/monero/components/TransactionHistory.tsx Replaced table-based transaction list with date-grouped sections and TransactionItem usage.
src-gui/src/renderer/components/pages/monero/components/TransactionItem.tsx Introduced new TransactionItem component for displaying transaction summaries and actions.
src-gui/src/renderer/components/pages/monero/components/WalletOverview.tsx Disabled tooltip for unlocked balance display using PiconeroAmount.
src-gui/src/renderer/components/theme.tsx Extended theme: added tint to palette, new "tiny" button size, and updated error/success color definitions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TransactionHistory
    participant TransactionItem
    participant ConfirmationsBadge
    participant BlockchainExplorer

    User->>TransactionHistory: View transactions
    TransactionHistory->>TransactionItem: Render each transaction (grouped by date)
    TransactionItem->>ConfirmationsBadge: Display confirmation status
    User->>TransactionItem: Open menu
    TransactionItem->>User: Show options (Copy TXID, View in Explorer)
    User->>TransactionItem: Select "View in Explorer"
    TransactionItem->>BlockchainExplorer: Open transaction details
Loading

Possibly related PRs

  • feat(gui): Monero wallet #442: Updates the monero-sys/monero subproject to add wallet listener classes and Rust FFI bindings, which is directly relevant to the Monero submodule update in this PR.

Poem

In the warren where Monero hops,
New lists bloom and old tables drop.
With badges bright and menus neat,
Each transaction is now a treat!
Tiny buttons, tints anew—
The rabbit cheers this stylish view!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

cursor[bot]

This comment was marked as outdated.

@binarybaron
Copy link
Copy Markdown
Author

bugbot run

Copy link
Copy Markdown

@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 (6)
src-gui/src/renderer/components/theme.tsx (1)

193-195: Consider differentiating success.tint colors between themes.

The success color tint is identical (#4caf50) for both light and dark themes, while error colors have different tints. This might reduce visual distinction in different theme contexts.

Consider using a lighter tint for the dark theme:

     success: {
       main: "#4caf50",
-      tint: "#4caf50",
+      tint: "#70c491",
     },
src-gui/src/renderer/components/pages/monero/components/ConfirmationsBadge.tsx (1)

22-37: Remove unnecessary fragment wrapper.

The fragment wrapper around the label JSX is redundant and can be simplified.

-    const label = (
-      <>
-        <Box
-          sx={{
-            display: "flex",
-            flexDirection: "row",
-            alignItems: "end",
-            gap: 0.4,
-          }}
-        >
-          <Typography variant="body2" sx={{ fontWeight: "bold" }}>
-            {confirmations}
-          </Typography>
-          <Typography variant="caption">/10</Typography>
-        </Box>
-      </>
-    );
+    const label = (
+      <Box
+        sx={{
+          display: "flex",
+          flexDirection: "row",
+          alignItems: "end",
+          gap: 0.4,
+        }}
+      >
+        <Typography variant="body2" sx={{ fontWeight: "bold" }}>
+          {confirmations}
+        </Typography>
+        <Typography variant="caption">/10</Typography>
+      </Box>
+    );
src-gui/src/renderer/components/pages/monero/components/TransactionItem.tsx (2)

81-91: Simplify the minus sign display logic.

The current implementation uses grid positioning and opacity to conditionally show a minus sign, which is complex and may be confusing.

Consider a more straightforward approach:

-          <Typography
-            variant="h6"
-            sx={{
-              opacity: !isIncoming ? 1 : 0,
-              gridArea: "1 / 1",
-              fontWeight: "bold",
-              ...amountStyles,
-            }}
-          >
-
-          </Typography>
+          {!isIncoming && (
+            <Typography
+              variant="h6"
+              sx={{
+                gridArea: "1 / 1",
+                fontWeight: "bold",
+                ...amountStyles,
+              }}
+            >
+
+            </Typography>
+          )}

136-139: Add error handling for clipboard operations.

The clipboard write operation can fail in certain browser contexts or due to permissions.

           onClick={() => {
-            navigator.clipboard.writeText(transaction.tx_hash);
-            setMenuAnchorEl(null);
+            navigator.clipboard.writeText(transaction.tx_hash).catch((err) => {
+              console.error("Failed to copy transaction ID:", err);
+            });
+            setMenuAnchorEl(null);
           }}
src-gui/src/renderer/components/other/Units.tsx (1)

40-47: Consider performance implications of inline Box components.

Using Box components with inline display for styling adds DOM elements and may impact performance in lists with many amount displays.

Consider using Typography components with component="span" instead:

-      <Box sx={{ display: "inline", ...amountStyles }}>
-        {amount != null ? amount.toFixed(fixedPrecision) : "?"}
-      </Box>{" "}
-      <Box sx={{ display: "inline", ...labelStyles }}>
-        {unit}
-        {parenthesisText != null ? ` (${parenthesisText})` : null}
-      </Box>
+      <Typography component="span" sx={amountStyles}>
+        {amount != null ? amount.toFixed(fixedPrecision) : "?"}
+      </Typography>{" "}
+      <Typography component="span" sx={labelStyles}>
+        {unit}
+        {parenthesisText != null ? ` (${parenthesisText})` : null}
+      </Typography>
src-gui/src/renderer/components/pages/monero/components/TransactionHistory.tsx (1)

1-1: Remove unused import.

The Paper import from Material-UI is not used in this component.

-import { Typography, Box, Paper } from "@mui/material";
+import { Typography, Box } from "@mui/material";
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c1c4557 and e4d3833.

📒 Files selected for processing (7)
  • monero-sys/monero (1 hunks)
  • src-gui/src/renderer/components/other/Units.tsx (6 hunks)
  • src-gui/src/renderer/components/pages/monero/components/ConfirmationsBadge.tsx (1 hunks)
  • src-gui/src/renderer/components/pages/monero/components/TransactionHistory.tsx (1 hunks)
  • src-gui/src/renderer/components/pages/monero/components/TransactionItem.tsx (1 hunks)
  • src-gui/src/renderer/components/pages/monero/components/WalletOverview.tsx (1 hunks)
  • src-gui/src/renderer/components/theme.tsx (4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src-gui/src/renderer/components/other/Units.tsx (1)
src-gui/src/utils/conversionUtils.ts (1)
  • piconerosToXmr (14-16)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor BugBot
🔇 Additional comments (11)
monero-sys/monero (1)

1-1: Submodule bump—double-check downstream build & ABI surface

The pointer change itself is trivial, but the new Monero core commit may introduce breaking ABI or consensus changes.
Please ensure:
• CI runs git submodule update --init --recursive so the new revision is actually fetched.
monero-sys still compiles (Cargo/CMake) without additional flags.
• FFI surface (extern "C" symbols) used by the GUI hasn’t changed—run your integration tests.

If everything passes, the bump is good to merge.

src-gui/src/renderer/components/pages/monero/components/WalletOverview.tsx (1)

75-75: Clean implementation of the new tooltip control feature.

The addition of disableTooltip prop effectively leverages the enhanced PiconeroAmount component functionality to improve the UI experience for balance display.

src-gui/src/renderer/components/theme.tsx (1)

21-30: Well-structured palette extension for enhanced theming.

The addition of the optional tint property to PaletteColor and PaletteColorOptions interfaces provides good flexibility for semantic color variations.

src-gui/src/renderer/components/pages/monero/components/ConfirmationsBadge.tsx (1)

7-50: Well-implemented confirmation badge with clear visual states.

The component effectively communicates confirmation status through appropriate color coding and progressive disclosure. The logic properly handles the three confirmation states with suitable Material-UI components.

src-gui/src/renderer/components/pages/monero/components/TransactionItem.tsx (1)

26-155: Well-structured transaction item with comprehensive functionality.

The component effectively displays transaction information with proper direction indicators, amount styling, and interactive features. The menu implementation provides useful transaction exploration capabilities.

src-gui/src/renderer/components/other/Units.tsx (3)

13-15: Excellent enhancement to component flexibility.

The addition of styling props (labelStyles, amountStyles) and tooltip control (disableTooltip) significantly improves the reusability and customization of the amount display components.

Also applies to: 22-24


38-48: Well-implemented conditional rendering with styling support.

The refactored content structure cleanly separates the styled elements and provides proper conditional tooltip wrapping. The use of Box components with display: "inline" maintains the inline layout while enabling styling.


111-113: Consistent prop propagation through component hierarchy.

The new props are properly propagated through MoneroAmount and PiconeroAmount to AmountWithUnit, maintaining a clean component interface.

Also applies to: 129-131, 195-197, 209-211

src-gui/src/renderer/components/pages/monero/components/TransactionHistory.tsx (3)

13-17: Well-structured interface definition.

The TransactionGroup interface is well-defined with clear property names and appropriate types for the date grouping functionality.


29-38: Efficient transaction grouping implementation.

The date grouping logic is well-implemented using lodash and dayjs. The approach of grouping by date and sorting within groups provides a good user experience for transaction history.

Note: For large transaction datasets, consider implementing pagination or virtualization if performance becomes a concern.


40-60: Clean and well-structured rendering implementation.

The component rendering logic is well-organized with:

  • Proper use of Material-UI components and styling system
  • Clear visual hierarchy with date headers and transaction lists
  • Appropriate use of flexbox for responsive layout
  • Correct key props for React reconciliation
  • Good semantic structure for accessibility

The refactor from table-based to grouped list layout significantly improves the user experience.

Comment on lines +107 to +119
{
props: { size: "tiny" },
style: {
fontSize: "0.75rem",
fontWeight: 500,
padding: "4px 8px",
minHeight: "24px",
minWidth: "auto",
lineHeight: 1.2,
textTransform: "none",
borderRadius: "4px",
},
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove duplicate "tiny" button size styling.

The "tiny" button size is defined in both styleOverrides.sizeTiny (lines 64-73) and variants array. This duplication can cause confusion and maintenance issues.

-        {
-          props: { size: "tiny" },
-          style: {
-            fontSize: "0.75rem",
-            fontWeight: 500,
-            padding: "4px 8px",
-            minHeight: "24px",
-            minWidth: "auto",
-            lineHeight: 1.2,
-            textTransform: "none",
-            borderRadius: "4px",
-          },
-        },

The styling in styleOverrides.sizeTiny is sufficient for the "tiny" button size functionality.

📝 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
{
props: { size: "tiny" },
style: {
fontSize: "0.75rem",
fontWeight: 500,
padding: "4px 8px",
minHeight: "24px",
minWidth: "auto",
lineHeight: 1.2,
textTransform: "none",
borderRadius: "4px",
},
},
🤖 Prompt for AI Agents
In src-gui/src/renderer/components/theme.tsx between lines 107 and 119, the
"tiny" button size styling is duplicated in the variants array while it is
already defined in styleOverrides.sizeTiny (lines 64-73). Remove the entire
"tiny" size variant block from the variants array to avoid duplication and rely
solely on the styleOverrides.sizeTiny definition for the "tiny" button size
styling.

Comment on lines +62 to +64
p: 0.5,
backgroundColor: "grey.800",
borderRadius: "100%",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Replace hardcoded background color with theme-aware color.

The hardcoded grey.800 background color won't adapt to theme changes and may not provide sufficient contrast in light mode.

-            backgroundColor: "grey.800",
+            backgroundColor: "action.selected",

This uses a theme-aware color that adapts to both light and dark themes.

📝 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
p: 0.5,
backgroundColor: "grey.800",
borderRadius: "100%",
p: 0.5,
backgroundColor: "action.selected",
borderRadius: "100%",
🤖 Prompt for AI Agents
In src-gui/src/renderer/components/pages/monero/components/TransactionItem.tsx
around lines 62 to 64, replace the hardcoded backgroundColor "grey.800" with a
theme-aware color from the theme palette. Use the theme object or a hook like
useTheme to access colors that adapt to light and dark modes, ensuring proper
contrast and consistency with the current theme.

@binarybaron binarybaron merged commit 1ad4bca into master Jul 18, 2025
4 of 31 checks passed
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Button Styling Redundancy Causes Conflicts

The "tiny" button size has duplicate styling definitions. It is defined in both MuiButton.styleOverrides.sizeTiny (existing) and as a new variant in MuiButton.variants (props: { size: "tiny" }). This redundancy can cause styling conflicts and unpredictable behavior. The variant approach is preferred for consistency.

src-gui/src/renderer/components/theme.tsx#L106-L120

},
{
props: { size: "tiny" },
style: {
fontSize: "0.75rem",
fontWeight: 500,
padding: "4px 8px",
minHeight: "24px",
minWidth: "auto",
lineHeight: 1.2,
textTransform: "none",
borderRadius: "4px",
},
},
],

Fix in CursorFix in Web


Bug: Clipboard and Explorer Fail on Null Transactions

The TransactionItem component is missing null checks for transaction.tx_hash before attempting to copy it to the clipboard or pass it to getMoneroTxExplorerUrl for the "View on Explorer" action. This can lead to navigator.clipboard.writeText() failing and getMoneroTxExplorerUrl() receiving null/undefined values, as these menu actions are now always available without validating tx_hash.

src-gui/src/renderer/components/pages/monero/components/TransactionItem.tsx#L135-L147

<MenuItem
onClick={() => {
navigator.clipboard.writeText(transaction.tx_hash);
setMenuAnchorEl(null);
}}
>
<Typography>Copy Transaction ID</Typography>
</MenuItem>
<MenuItem
onClick={() => {
open(getMoneroTxExplorerUrl(transaction.tx_hash, isTestnet()));
setMenuAnchorEl(null);
}}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

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.

2 participants