qt: Peers tab polish — NetNodeId column, drop Sync Height widget, Copy Address right-click #15

Closed
opened 2026-06-06 22:58:20 +00:00 by dobbscoin · 1 comment
dobbscoin commented 2026-06-06 22:58:20 +00:00

Follow-up to #13. Two small Qt-only refinements to the Peers tab. Pure src/qt/* patch — no daemon code, no consensus impact, freeze-cliff-safe.

Update: the original issue draft included a third sub-feature — "drop the Sync Height widget." On closer inspection of src/qt/forms/rpcconsole.ui, the Sync Height widget was never added in #13 in the first place (the tab_peers widget jumps from row 5 / Starting Height to row 7 / Ban Score, skipping the row-6 Sync Height pair entirely). Nothing to drop. Scope reduced to the two items below. The real Sync Height work — backporting pindexBestKnownBlock so the field can be populated and the widgets re-added — is tracked in #18.

1. Add NetNodeId column

Top table currently shows Address / Subversion / Ping. Add a 4th column NodeId exposing CNodeStats.nodeid (the internal NodeId typedef from src/net.h:58).

Why it matters:

  • Lets the operator correlate a row in the table to the same peer in getpeerinfo JSON output, log lines (Misbehaving:, etc.) and the per-peer detail pane
  • Cheap to add — single new column entry in PeerTableModel::ColumnIndex, plus header / data switch / sort handling

Implementation:

  • src/qt/peertablemodel.h: extend enum ColumnIndex to include NetNodeId
  • src/qt/peertablemodel.cpp: add header label, data() case, NodeLessThan::operator() case
  • src/qt/rpcconsole.cpp::setClientModel: add setColumnWidth(PeerTableModel::NetNodeId, NETNODEID_COLUMN_WIDTH) and the corresponding entry in the ColumnWidths enum in rpcconsole.h (~50 px is plenty)

~20 LOC.

2. Add Copy Address right-click context menu

When the user right-clicks a row in the peer table, show a small QMenu with a Copy Address action that pushes stats->nodeStats.addrName to QApplication::clipboard().

Pure Qt; no backend touch. Foundation for the future Disconnect / Ban menu items in the companion issues — adding the menu plumbing here makes those follow-ups smaller.

Implementation:

  • src/qt/rpcconsole.h: declare QMenu *contextMenu; member, showMenu(const QPoint&) slot, copyAddress() slot
  • src/qt/rpcconsole.cpp:
    • In setClientModel(): set ui->peerWidget->setContextMenuPolicy(Qt::CustomContextMenu), construct contextMenu, add Copy Address action, connect customContextMenuRequested(QPoint) → showMenu(QPoint)
    • Implement showMenu(QPoint pos) to map the position to a peer and exec() the menu
    • Implement copyAddress() reading the current selection's addrName and writing to QApplication::clipboard()

~25 LOC.

What this isn't

  • Not consensus-changing, not network-protocol-changing, not touching Offeringsd's code path at all
  • The fleet's headless miners don't link Qt; safe to land any time, even during the freeze window
  • Disconnect-from-Peers-tab is a separate issue (#16, uses the same context menu plumbing landed here)
  • Ban support is a much larger separate issue (#17) — OFF has no banlist infrastructure today
  • Sync Height is its own separate epic (#18) — needs backend pindexBestKnownBlock tracking

Reference behavior

  • (BOB) / dobbscoin-source/src/qt/peertablemodel.{cpp,h} — model + NetNodeId column pattern
  • (BOB) / dobbscoin-source/src/qt/rpcconsole.cpp::showMenu — right-click menu pattern
  • src/qt/rpcconsole.cpp:264::setClientModel — wiring point for the column width + context menu setup

The guest list now has badge numbers and copy buttons. Iä Iä.

Follow-up to #13. Two small Qt-only refinements to the Peers tab. Pure `src/qt/*` patch — **no daemon code, no consensus impact, freeze-cliff-safe**. > **Update:** the original issue draft included a third sub-feature — "drop the Sync Height widget." On closer inspection of `src/qt/forms/rpcconsole.ui`, the Sync Height widget was **never added in #13** in the first place (the `tab_peers` widget jumps from row 5 / Starting Height to row 7 / Ban Score, skipping the row-6 Sync Height pair entirely). Nothing to drop. Scope reduced to the two items below. The real Sync Height work — backporting `pindexBestKnownBlock` so the field can be populated and the widgets re-added — is tracked in #18. ## 1. Add NetNodeId column Top table currently shows `Address / Subversion / Ping`. Add a 4th column `NodeId` exposing `CNodeStats.nodeid` (the internal `NodeId` typedef from `src/net.h:58`). Why it matters: - Lets the operator correlate a row in the table to the same peer in `getpeerinfo` JSON output, log lines (`Misbehaving:`, etc.) and the per-peer detail pane - Cheap to add — single new column entry in `PeerTableModel::ColumnIndex`, plus header / data switch / sort handling Implementation: - `src/qt/peertablemodel.h`: extend `enum ColumnIndex` to include `NetNodeId` - `src/qt/peertablemodel.cpp`: add header label, `data()` case, `NodeLessThan::operator()` case - `src/qt/rpcconsole.cpp::setClientModel`: add `setColumnWidth(PeerTableModel::NetNodeId, NETNODEID_COLUMN_WIDTH)` and the corresponding entry in the `ColumnWidths` enum in `rpcconsole.h` (~50 px is plenty) ~20 LOC. ## 2. Add Copy Address right-click context menu When the user right-clicks a row in the peer table, show a small `QMenu` with a **Copy Address** action that pushes `stats->nodeStats.addrName` to `QApplication::clipboard()`. Pure Qt; no backend touch. Foundation for the future Disconnect / Ban menu items in the companion issues — adding the menu plumbing here makes those follow-ups smaller. Implementation: - `src/qt/rpcconsole.h`: declare `QMenu *contextMenu;` member, `showMenu(const QPoint&)` slot, `copyAddress()` slot - `src/qt/rpcconsole.cpp`: - In `setClientModel()`: set `ui->peerWidget->setContextMenuPolicy(Qt::CustomContextMenu)`, construct `contextMenu`, add `Copy Address` action, connect `customContextMenuRequested(QPoint)` → `showMenu(QPoint)` - Implement `showMenu(QPoint pos)` to map the position to a peer and `exec()` the menu - Implement `copyAddress()` reading the current selection's `addrName` and writing to `QApplication::clipboard()` ~25 LOC. ## What this isn't - **Not consensus-changing**, **not network-protocol-changing**, **not touching `Offeringsd`'s code path** at all - The fleet's headless miners don't link Qt; safe to land any time, even during the freeze window - Disconnect-from-Peers-tab is a separate issue (#16, uses the same context menu plumbing landed here) - Ban support is a much larger separate issue (#17) — OFF has no banlist infrastructure today - Sync Height is its own separate epic (#18) — needs backend `pindexBestKnownBlock` tracking ## Reference behavior - (BOB) / `dobbscoin-source/src/qt/peertablemodel.{cpp,h}` — model + NetNodeId column pattern - (BOB) / `dobbscoin-source/src/qt/rpcconsole.cpp::showMenu` — right-click menu pattern - `src/qt/rpcconsole.cpp:264::setClientModel` — wiring point for the column width + context menu setup --- *The guest list now has badge numbers and copy buttons. Iä Iä.*
dobbscoin closed this issue 2026-06-06 23:05:01 +00:00
dobbscoin commented 2026-06-06 23:31:45 +00:00

Tested end-to-end on the merge commit (e9f1c5f):

  • Linux x86_64 (local Qt5 build, stripped): NodeId column renders as the first column of the peers table, right-aligned, sortable. Right-clicking a row pops the context menu; Copy address pushes the peer's addrName (e.g. 185.197.251.40:48146) to the system clipboard cleanly.
  • Windows x86_64 (CI artifact from windows-build-depends.yml, Qt 5.15.16 / GCC 13-posix): same — column + menu behave identically.

Scope correction noted on the issue: the third sub-feature ("drop Sync Height widget") was a no-op because the widgets were never added to src/qt/forms/rpcconsole.ui in the original #13 port (row 6 of tab_peers / gridLayout_3 was skipped). Real Sync Height surfacing is tracked under #18 (pindexBestKnownBlock backport, parked until post-Codex).

The right-click context menu plumbing is now the foundation for:

  • #16 (Disconnect Node right-click) — Qt-only, can land any time
  • #17 (Ban Node right-click) — needs the banlist module to be built first, post-Codex

Closing on next sync via the closes #15 trailer in e9f1c5f.


The guest list now has badge numbers and a copy button. Iä Iä.

Tested end-to-end on the merge commit (`e9f1c5f`): - **Linux x86_64** (local Qt5 build, stripped): `NodeId` column renders as the first column of the peers table, right-aligned, sortable. Right-clicking a row pops the context menu; **Copy address** pushes the peer's `addrName` (e.g. `185.197.251.40:48146`) to the system clipboard cleanly. - **Windows x86_64** (CI artifact from `windows-build-depends.yml`, Qt 5.15.16 / GCC 13-posix): same — column + menu behave identically. Scope correction noted on the issue: the third sub-feature ("drop Sync Height widget") was a no-op because the widgets were never added to `src/qt/forms/rpcconsole.ui` in the original #13 port (row 6 of `tab_peers / gridLayout_3` was skipped). Real Sync Height surfacing is tracked under #18 (`pindexBestKnownBlock` backport, parked until post-Codex). The right-click context menu plumbing is now the foundation for: - **#16** (Disconnect Node right-click) — Qt-only, can land any time - **#17** (Ban Node right-click) — needs the banlist module to be built first, post-Codex Closing on next sync via the `closes #15` trailer in `e9f1c5f`. --- *The guest list now has badge numbers and a copy button. Iä Iä.*
Sign in to join this conversation.
No labels
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
SubGeniusFinance/Offerings-to-Cthulhu#15
No description provided.