Skip to content

Add txid and explorer link in tx details page#368

Open
louisinger wants to merge 1 commit intoArkLabsHQ:masterfrom
louisinger:explorer-link
Open

Add txid and explorer link in tx details page#368
louisinger wants to merge 1 commit intoArkLabsHQ:masterfrom
louisinger:explorer-link

Conversation

@louisinger
Copy link
Copy Markdown
Contributor

@louisinger louisinger commented Jan 18, 2026

image

@altafan @Kukks please review

Summary by CodeRabbit

  • New Features
    • Transaction history now displays Ark transaction IDs with direct links to the Ark explorer, enabling enhanced transaction tracking and verification.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

This PR propagates an ArkTxid field through the web interface layer. The field is added to the Transfer struct, populated in the handlers, and passed as a parameter through template components (ReceivedTxTable, SentTxTable, SwappedTxTable) where it conditionally renders transaction ID display with an explorer link.

Changes

Cohort / File(s) Summary
Type Definition
internal/interface/web/types/transfers.go
Added ArkTxid field to Transfer struct with JSON tag for serialization.
Handler Logic
internal/interface/web/handlers.go
Updated toTransfer to populate ArkTxid from the transaction object.
Template Components (Definitions)
internal/interface/web/templates/components/feeTable.templ, internal/interface/web/templates/components/feeTable_templ.go
Added arkTxid parameter to ReceivedTxTable, SentTxTable, and SwappedTxTable signatures. Conditional rendering added: when arkTxid is non-empty, displays truncated Tx ID and explorer link to https://arkade.space/tx/{arkTxid}.
Template Usage
internal/interface/web/templates/components/tx.templ, internal/interface/web/templates/components/tx_templ.go
Updated calls to ReceivedTxTable and SentTxTable to pass ArkTxid as fourth argument.
Styling
internal/interface/web/static/styles.css
Minor CSS formatting adjustment with no semantic changes.
Build
go.mod
Dependency version update.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • altafan

Poem

🐰 With whiskers twitched and nose held high,
We thread the ArkTxid through the sky,
From handler's grasp to template's care,
Each table now knows what we share.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding transaction ID and explorer link display to the transaction details page.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/interface/web/templates/components/feeTable_templ.go (1)

644-708: Guard against short txid slices to avoid panic.

arkTxid[:12] panics when len(arkTxid) < 12, which will break rendering for short/invalid IDs. Add a length-safe truncation (and apply the same change in SentTxTable).

🐛 Suggested fix (apply in the .templ source and regenerate)
- if arkTxid != "" {
-   templ_7745c5c3_Err = tableLine("Tx ID", arkTxid[:12]+"...").Render(ctx, templ_7745c5c3_Buffer)
+ if arkTxid != "" {
+   displayTxid := arkTxid
+   if len(displayTxid) > 12 {
+     displayTxid = displayTxid[:12] + "..."
+   }
+   templ_7745c5c3_Err = tableLine("Tx ID", displayTxid).Render(ctx, templ_7745c5c3_Buffer)
🤖 Fix all issues with AI agents
In `@internal/interface/web/static/styles.css`:
- Line 1: The generated CSS contains duplicate properties (e.g., repeated
-webkit-text-decoration and outline in selectors like html,:host and focus
rules) causing lint failures; either update the CSS generation pipeline to
remove duplicate declarations (dedupe output for selectors such as html,:host,
a, and input:focus) or mark these built assets as excluded/generated in the lint
configuration so Biome ignores internal/interface/web/static/styles.css;
implement the fix by changing the source/postcss/tailwind generator to
deduplicate properties or by adding an exception rule in the linter config to
skip generated CSS files.

In `@internal/interface/web/templates/components/feeTable.templ`:
- Around line 142-147: The code slices arkTxid with arkTxid[:12] which will
panic if arkTxid is shorter than 12 chars; update the template to use a safe
truncation (e.g., a helper function safeTruncate(s, n) or inline min-length
check) when rendering the Tx ID and explorer link text so you only take up to
len(arkTxid) characters, and apply the same fix to the second occurrence around
the explorer block (the other instance at the later block referenced in the
comment); ensure you update the references where arkTxid[:12] is used and call
the safeTruncate helper (or use a conditional slice using min(len,12)) instead.
♻️ Duplicate comments (1)
internal/interface/web/templates/components/feeTable_templ.go (1)

761-825: Same txid slice safety issue as in ReceivedTxTable.

@tableLine("Tx ID", arkTxid[:12] + "...")
<div class="flex justify-between mb-2">
<p class="text-white/50 uppercase">explorer</p>
<a href={"https://arkade.space/tx/" + arkTxid} target="_blank" rel="noopener noreferrer" class="text-blue hover:underline">View</a>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hardcoded...

Copy link
Copy Markdown
Contributor

@Kukks Kukks left a comment

Choose a reason for hiding this comment

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

Needs to be a sane default + config option not hardcoded in the views

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 19, 2026

👋 @louisinger@Kukks requested changes on this PR over a month ago. Is this still in progress, or has it been superseded?

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 19, 2026

Review: Add txid and explorer link in tx details page

Clean UX improvement — surfaces the Ark transaction ID and a direct link to arkade.space/tx in the transaction detail views.

What changed:

  • Transfer type gains ArkTxid field, populated from tx.ArkTxid in toTransfer()
  • ReceivedTxTable and SentTxTable templ components now accept arkTxid and conditionally render a truncated ID + explorer link
  • CSS rebuilt with new hover:underline utility

Looks good, minor notes:

  1. Hardcoded explorer URL (https://arkade.space/tx/): works for mainnet, but would break for testnet/signet transactions. Worth considering making this configurable or deriving from the server network, though acceptable for v1.

  2. Truncation safety: arkTxid[:12] will panic if arkTxid is non-empty but shorter than 12 chars. The if arkTxid != "" guard protects against empty strings, but a malformed txid could still cause issues. Low risk since txids from the SDK should always be 64-char hex, but a length check would be defensive.

  3. text-blue class: used on the explorer link but not visible in the Tailwind config shown in the diff — might render as default text color if text-blue isn't defined in the theme. Worth verifying it's in the Tailwind palette or using text-orange to match the app's existing accent color.

No security concerns. Cross-repo note: this pairs well with the arkd indexer work that makes Ark txids available through the SDK.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 21, 2026

👋 @louisinger@Kukks had change requests on this one from back in January. The last commit was over 2 months ago. Is this still on the roadmap, or has it been superseded by other work?

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 24, 2026

Hey @louisinger@Kukks requested changes on this PR about 6 weeks ago and there's been no update since. Still planning to address this? Happy to help if needed.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 25, 2026

👋 Hey @louisinger — friendly nudge! Kukks requested changes back on Feb 11. Is this PR still active? Let us know if there's anything blocking progress.

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 28, 2026

Hey @louisinger@Kukks requested changes on this back on Feb 11 and it hasn't been updated since (~45 days). Still on your radar?

@Kukks
Copy link
Copy Markdown
Contributor

Kukks commented Mar 28, 2026

Superseded by #385 — rebased onto current master, resolved conflicts, and addressed review feedback (configurable explorer URL, safe txid truncation).

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 30, 2026

Hey @louisinger — just a friendly check-in. This PR has been waiting since @Kukks's CHANGES_REQUESTED on Feb 11 (48 days). The ask was: make the explorer URL a sane default + config option rather than hardcoding it in views. Is this still on your radar?

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 31, 2026

Hey @louisinger — this has had a CHANGES_REQUESTED review from @Kukks since Feb 11 with no update to the branch since Jan 18. Is this still on your radar, or has it been superseded by other work?

@arkanaai
Copy link
Copy Markdown
Contributor

arkanaai bot commented Mar 31, 2026

👋 Hey @louisinger — friendly nudge! Kukks requested changes back on Feb 11 (needs to be a sane default + config option, not hardcoded in the views). This has been open for ~7 weeks. Are you still planning to address this, or should we close it in favor of the newer #385? Let us know!

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