Skip to content

Add right-click copy to Track Details tables#903

Open
dhingora-amd wants to merge 1 commit into
mainfrom
dhingora/track-details-copy
Open

Add right-click copy to Track Details tables#903
dhingora-amd wants to merge 1 commit into
mainfrom
dhingora/track-details-copy

Conversation

@dhingora-amd

Copy link
Copy Markdown
Contributor

Motivation

The Track Details tab had no way to copy its values. The Event Details
tab already supports right-click copy on its tables, so Track Details
was inconsistent and users couldn't easily grab a track's info or its
computed stats. This brings Track Details to parity.

Technical Details

Track Details rows now support a right-click context menu with "Copy Row
Data" / "Copy Cell Data", each raising the standard copy notification —
matching the Event Details tab.

  • Applies to both the topology/track info tables and the computed stats
    rows (queue utilization, and counter min/max/mean/stddev).
  • Reuses the shared right-click hitbox and copy-menu scaffolding in
    gui_helpers (RenderRowHitbox, PositionCell,
    CaptureCellRightClick, BeginCellContextMenu,
    AddCopyRowCellMenuItems) added in Make Event Details table right-click hitboxes consistent and dedupe scaffolding #877, so no copy/menu/notification
    logic is duplicated.
  • Each table is given a unique id so its context-menu popup is distinct,
    and the stats rows share a single CellMenuTarget via an offset row
    index. Existing cell elide/expand behavior is preserved.

Track Details rows now support right-click Copy Row Data / Copy Cell Data with copy notifications, matching the Event Details tab. Works on both the topology/track info tables and the computed stats rows (queue utilization, counter min/max/mean/stddev).

Co-authored-by: Cursor <cursoragent@cursor.com>

void
TrackDetails::RenderTable(InfoTable& table, const AnalysisTrackStatistics* stats)
TrackDetails::RenderTable(InfoTable& table, const char* table_id,
row_cells.push_back(cell.needs_format ? cell.formatted
: cell.data);
}
AddCopyRowCellMenuItems(row_cells.data(), cols, m_cell_menu.column);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the copy row case, this AddCopyRowCellMenuItems and whatever InfiniteScrollTable uses should use the same seperator.

Currently InfiniteScrollTable are comma seperated, but AddCopyRowCellMenuItems is space sepearted.

}
}

const std::string ctx_menu_id = std::string(table_id) + "_ctx";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to build this string id. You can just define a constant id because there will only be one active at a time. It looks like this is the only user of table_id parameter, so that could be removed.

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.

3 participants