-
Notifications
You must be signed in to change notification settings - Fork 129
qt: Copy txid by clicking bubbles in block view #225
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
base: 29.x-knots
Are you sure you want to change the base?
Conversation
1440000bytes
commented
Oct 17, 2025
|
Hmm, seems like it would be better to open a transaction-view dialog with more information. Maybe a right-click menu with copy txid to clipboard (I think we have that elsewhere too?) |
I thought about this earlier but found it worse in UX. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this been tested on X11 systems where middle-click paste is expected to work?
| const auto tx = gi ? gi->data(0).value<CTransactionRef>() : CTransactionRef(); | ||
| if (tx) { | ||
| QString txid = QString::fromStdString(tx->GetHash().ToString()); | ||
| QApplication::clipboard()->setText(txid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use GUIUtil::setClipboard() instead of direct clipboard access using the helper in guiutil.cpp:904 since this current implementation doesn't support X11 Selection clipboard (the helper handles both modes)
For reference: transactionview.cpp:467 uses GUIUtil::copyEntryData() which calls setClipboard()
| #endif | ||
| QToolTip::showText(event_global_pos, tr("Copied: %1").arg(txid), this, {}, -1); | ||
|
|
||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This return skips QGraphicsView::mousePressEvent(event) (line 107) which could break panning/selection/other interactions when clicking on the transaction bubbles. Consider only returning if you don't want other mouse handling.
| return QGraphicsView::viewportEvent(event); | ||
| } | ||
|
|
||
| void ScalingGraphicsView::mousePressEvent(QMouseEvent * const event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left-click behavior is inconsistent with rest of the UI
- For reference,
transactionview.cpp:155uses right-click context menu: "Copy transaction &ID" - @luke-jr suggestion about existing UX patterns
- (right-click for actions, left-click for selection)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not using bubbles anywhere else in the UI. It is a better UX to just click and copy the transaction id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing is whether there is an indicator for the user to know this functionality exists (click and copy the transaction id).
| #else | ||
| const QPoint event_global_pos = event->globalPos(); | ||
| #endif | ||
| QToolTip::showText(event_global_pos, tr("Copied: %1").arg(txid), this, {}, -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intended behavior for the -1 value? Permanent until mouse moves?
Consider using a timed duration (such as 2000ms) for better tooltip timeout UX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 is default and I tried other values from 2000 to 100000 but they didn't work as expected.
3a176cb to
74508f6
Compare