Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .agents/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -939,13 +939,18 @@ counter) for the track, then renders an `InfoTable`.
### `Annotations` and `StickyNote`

- `AnnotationsManager` (`rocprofvis_annotations.{h,cpp}`) - holds the
list of `StickyNote`s, the popup state for adding/editing, and the
visibility flag. Persisted via `AnnotationsManagerProjectSettings`.
list of `StickyNote`s and the visibility flag, creates new notes
inline via `CreateStickyNote`, and removes user-deleted notes via
`RemoveNotesPendingDelete`. Persisted via
`AnnotationsManagerProjectSettings`.
- `StickyNote` (`rocprofvis_stickynote.{h,cpp}`) - one note. Carries
position (time + y_offset), size, text/title, and view-range
metadata. `Render(draw_list, window_pos, tpt)`,
`HandleResize(...)`, `HandleDrag(...)`. Edit handled via
`kStickyNoteEdited` event.
metadata. `Render(draw_list, window_pos, tpt)` and `HandleDrag(...)`
drag the timeline anchor (minimized or expanded), and the timeline
auto-scrolls when the anchor nears a viewport edge. The expanded note
is a floating window with an inline-editable title (click to edit) and
body; `BeginInlineEdit()` opens a freshly created note focused for
typing.
- `AnnotationView` (`rocprofvis_annotation_view.{h,cpp}`) - the
sub-tab in `AnalysisView` that lists notes and lets the user
select/hide them.
Expand Down Expand Up @@ -1227,7 +1232,7 @@ EventManager::GetInstance()->AddEvent(
same-frame ordering with the dispatcher.
- Use the typed `RocEvent` subclasses in `rocprofvis_events.h`:
`NavigationEvent`, `TrackDataEvent`, `TableDataEvent`,
`StickyNoteEvent`, `ScrollToTrackEvent`, `TabEvent`,
`ScrollToTrackEvent`, `TabEvent`,
`TrackSelectionChangedEvent`, `TimeRangeSelectionChangedEvent`,
`EventSelectionChangedEvent`, `EventHighlightChangedEvent`,
`RangeEvent`, `RequestProgressUpdateEvent`,
Expand All @@ -1244,7 +1249,7 @@ The full list is in `rocprofvis_events.h`. Examples used widely:
`kTimelineTrackSelectionChanged`, `kTimelineTimeRangeChanged`,
`kTimelineEventSelectionChanged`, `kTimelineEventHighlightChanged`,
`kHandleUserGraphNavigationEvent`, `kTrackMetadataChanged`,
`kStickyNoteEdited`, `kFontSizeChanged`, `kSetViewRange`,
`kFontSizeChanged`, `kSetViewRange`,
`kGoToTimelineSpot`, `kTimeFormatChanged`, `kTopologyChanged`,
`kRequestProgressUpdate`. Compute-only:
`kComputeWorkloadSelectionChanged`,
Expand Down Expand Up @@ -1824,7 +1829,7 @@ For fast lookup. Each entry: class -> file -> one-line role.
- `RocEvent`, `RocEvents` (enum), `RocEventType` (enum) ->
`rocprofvis_events.h`.
- Typed events in same file: `NavigationEvent`, `TrackDataEvent`,
`TableDataEvent`, `StickyNoteEvent`, `ScrollToTrackEvent`,
`TableDataEvent`, `ScrollToTrackEvent`,
`TabEvent`, `TrackSelectionChangedEvent`,
`TimeRangeSelectionChangedEvent`, `EventSelectionChangedEvent`,
`EventHighlightChangedEvent`, `RangeEvent`,
Expand Down
44 changes: 38 additions & 6 deletions src/view/src/rocprofvis_annotation_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "rocprofvis_annotation_view.h"
#include "icons/rocprovfis_icon_defines.h"
#include "rocprofvis_data_provider.h"
#include "rocprofvis_event_manager.h"
#include "rocprofvis_events.h"
#include "rocprofvis_settings_manager.h"
#include "rocprofvis_utils.h"
Expand Down Expand Up @@ -38,13 +40,15 @@ AnnotationView::Render()
0.5f);
ImGui::TextDisabled("No annotations.");
}
else if(ImGui::BeginTable("StickyNotesTable", 4,
else if(ImGui::BeginTable("StickyNotesTable", 5,
ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV |
ImGuiTableFlags_RowBg | ImGuiTableFlags_Resizable |
ImGuiTableFlags_SizingStretchProp))
{
ImGui::TableSetupColumn("Title");
ImGui::TableSetupColumn("Text");
ImGui::TableSetupColumn("Track", ImGuiTableColumnFlags_WidthFixed,
ImGui::GetFontSize() * 10.0f);
ImGui::TableSetupColumn("Time", ImGuiTableColumnFlags_WidthFixed,
ImGui::GetFontSize() * 12.0f);
ImGui::TableSetupColumn("Visible", ImGuiTableColumnFlags_WidthFixed,
Expand Down Expand Up @@ -93,7 +97,8 @@ AnnotationView::Render()
{
m_selected_note_id = note.GetID();
auto event = std::make_shared<NavigationEvent>(
note.GetVMinX(), note.GetVMaxX(), note.GetYOffset(), true);
note.GetVMinX(), note.GetVMaxX(), note.GetYOffset(), true,
note.GetTrackId());
EventManager::GetInstance()->AddEvent(event);
}
ImGui::PopStyleVar();
Expand All @@ -111,19 +116,46 @@ AnnotationView::Render()
ElidedText(note_preview.c_str(), ImGui::GetContentRegionAvail().x);
ImGui::PopID();

// Track column: the bound track's display name, or a placeholder
// for unbound legacy notes. Match the Text column's vertical offset
// so ElidedText lines up with the other columns.
ImGui::TableNextColumn();
ImGui::SetCursorPosY(ImGui::GetCursorPosY() +
ImGui::GetStyle().FramePadding.y);
const std::string track_name =
m_data_provider.DataModel().BuildTrackName(note.GetTrackId());
// Binding finalizes on drop; grey the column and keep the value.
const bool note_dragging = note.IsDragging();
if(note_dragging) ImGui::BeginDisabled();
if(track_name.empty())
{
ImGui::TextDisabled("Unbound");
}
else
{
ImGui::PushID("note_track");
ElidedText(track_name.c_str(), ImGui::GetContentRegionAvail().x);
Comment thread
dhingora-amd marked this conversation as resolved.
ImGui::PopID();
}
if(note_dragging) ImGui::EndDisabled();

// Time column
ImGui::TableNextColumn();
ImGui::AlignTextToFramePadding();
time_label = nanosecond_to_formatted_str(note.GetTimeNs(), time_format,
true);
ImGui::TextUnformatted(time_label.c_str());

// Visibility column
// Visibility column. When the bound track is hidden the note is
// force-hidden on the timeline, so disable (grey out) the toggle.
ImGui::TableNextColumn();
bool visible = note.IsVisible();
std::string checkbox_id = "##visible_" + std::to_string(note.GetID());
bool visible = note.IsVisible();
const bool track_hidden = note.IsTrackHidden();
std::string checkbox_id = "##visible_" + std::to_string(note.GetID());
if(track_hidden) ImGui::BeginDisabled();
ImGui::Checkbox(checkbox_id.c_str(), &visible);
if(visible != note.IsVisible()) note.SetVisibility(visible);
if(track_hidden) ImGui::EndDisabled();
if(!track_hidden && visible != note.IsVisible()) note.SetVisibility(visible);

ImGui::PopID();
}
Expand Down
Loading
Loading