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
126 changes: 84 additions & 42 deletions .agents/UI.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ set(VIEW_FILES
src/view/src/rocprofvis_timeline_track_options.cpp
src/view/src/rocprofvis_track_topology.cpp
src/view/src/rocprofvis_track_details.cpp
src/view/src/rocprofvis_project_item.cpp
src/view/src/rocprofvis_project.cpp
src/view/src/rocprofvis_multi_track_table.cpp
src/view/src/rocprofvis_event_search.cpp
Expand Down
5 changes: 5 additions & 0 deletions src/app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,11 @@ main(int argc, char** argv)
// If the user inputted a filepath open it here.
rocprofvis_view_open_files({ cli_parser.GetOptionValue("file") });
}
else
{
// No file argument: reopen the previous session.
rocprofvis_view_restore_session();
}

ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);

Expand Down
24 changes: 12 additions & 12 deletions src/app/test/app_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "imgui_te_context.h"
#include "imgui.h"
#include "rocprofvis_appwindow.h"
#include "rocprofvis_project.h"
#include "rocprofvis_project_item.h"
#include "rocprofvis_trace_view.h"
#include "rocprofvis_timeline_selection.h"
#include "rocprofvis_analysis_view.h"
Expand Down Expand Up @@ -37,7 +37,7 @@ namespace
TraceView* GetTraceViewOrSkip(ImGuiTestContext* ctx)
{
AppWindow* app = AppWindow::GetInstance();
Project* project = app->GetCurrentProject();
ProjectItem* project = app->GetCurrentItem();
// A null project means the db never opened (a real regression); fail hard.
// A non-null project of the wrong view type is an expected wrong-db skip.
IM_CHECK_RETV(project != nullptr, nullptr);
Expand All @@ -53,7 +53,7 @@ namespace
ComputeView* GetComputeViewOrSkip(ImGuiTestContext* ctx)
{
AppWindow* app = AppWindow::GetInstance();
Project* project = app->GetCurrentProject();
ProjectItem* project = app->GetCurrentItem();
IM_CHECK_RETV(project != nullptr, nullptr);
ComputeView* cv = dynamic_cast<ComputeView*>(project->GetView().get());
if (cv == nullptr)
Expand Down Expand Up @@ -2034,16 +2034,16 @@ void RegisterAppTests(ImGuiTestEngine* e)
// Open DB_A; afterward its project must exist.
app->OpenFile(db_a);
ctx->Yield(3);
IM_CHECK(app->GetProject(id_a) != nullptr);
IM_CHECK(app->GetItem(id_a) != nullptr);

// Open DB_B as a second, active tab so the later switch back to DB_A is
// actually observable.
app->OpenFile(db_b);
ctx->Yield(3);
IM_CHECK(app->GetProject(id_b) != nullptr);
IM_CHECK(app->GetCurrentProject() != nullptr);
if (app->GetCurrentProject() == nullptr) return;
IM_CHECK(app->GetCurrentProject()->GetID() == id_b);
IM_CHECK(app->GetItem(id_b) != nullptr);
IM_CHECK(app->GetCurrentItem() != nullptr);
if (app->GetCurrentItem() == nullptr) return;
IM_CHECK(app->GetCurrentItem()->GetID() == id_b);

// Write a temp .rpv pointing at DB_A by absolute path, so it resolves
// back to DB_A's id no matter where the .rpv lives. Escape the path so
Expand All @@ -2068,12 +2068,12 @@ void RegisterAppTests(ImGuiTestEngine* e)

// Opening the .rpv must switch back to the existing DB_A tab instead of
// opening a duplicate.
IM_CHECK(app->GetCurrentProject() != nullptr);
if (app->GetCurrentProject() == nullptr) return;
IM_CHECK(app->GetCurrentProject()->GetID() == id_a);
IM_CHECK(app->GetCurrentItem() != nullptr);
if (app->GetCurrentItem() == nullptr) return;
IM_CHECK(app->GetCurrentItem()->GetID() == id_a);

// No project should be keyed at the .rpv path itself.
IM_CHECK(app->GetProject(rpv_path.string()) == nullptr);
IM_CHECK(app->GetItem(rpv_path.string()) == nullptr);

// Remove the temp .rpv and dismiss the dedup popup so it can't cover
// later tests. tab_guard restores the tab set on scope exit.
Expand Down
4 changes: 4 additions & 0 deletions src/view/inc/rocprofvis_view_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ rocprofvis_view_destroy();
void
rocprofvis_view_open_files(const std::vector<std::string>& file_paths);

// Reopens the previous session (saved on last shutdown). No-op if none was saved.
void
rocprofvis_view_restore_session();

void
rocprofvis_view_set_fullscreen_state(bool is_fullscreen);

Expand Down
12 changes: 6 additions & 6 deletions src/view/src/rocprofvis_annotations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ namespace RocProfVis
{
namespace View
{
AnnotationsManagerProjectSettings::AnnotationsManagerProjectSettings(
AnnotationsManagerProjectItemSettings::AnnotationsManagerProjectItemSettings(
const std::string& project_id, AnnotationsManager& annotations_view)
: ProjectSetting(project_id)
: ProjectItemSetting(project_id)
, m_annotations_manager(annotations_view)

{}

AnnotationsManagerProjectSettings::~AnnotationsManagerProjectSettings() {}
AnnotationsManagerProjectItemSettings::~AnnotationsManagerProjectItemSettings() {}

void
AnnotationsManagerProjectSettings::FromJson()
AnnotationsManagerProjectItemSettings::FromJson()
{
m_annotations_manager.Clear();
std::vector<jt::Json>& annotation_vec =
Expand Down Expand Up @@ -77,7 +77,7 @@ AnnotationsManagerProjectSettings::FromJson()
}

void
AnnotationsManagerProjectSettings::ToJson()
AnnotationsManagerProjectItemSettings::ToJson()
{
const std::vector<StickyNote>& notes = m_annotations_manager.GetStickyNotes();
m_settings_json[JSON_KEY_ANNOTATIONS] = jt::Json();
Expand All @@ -104,7 +104,7 @@ AnnotationsManagerProjectSettings::ToJson()
}

bool
AnnotationsManagerProjectSettings::Valid() const
AnnotationsManagerProjectItemSettings::Valid() const
{
// Check that "annotations" exists and is an array
if(!m_settings_json.contains(JSON_KEY_ANNOTATIONS) ||
Expand Down
10 changes: 5 additions & 5 deletions src/view/src/rocprofvis_annotations.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "imgui.h"
#include "rocprofvis_data_provider.h"
#include "rocprofvis_project.h"
#include "rocprofvis_project_item.h"
#include "rocprofvis_stickynote.h"
#include <string>
#include <vector>
Expand All @@ -19,12 +19,12 @@ constexpr double INVALID_TIME_NS = std::numeric_limits<double>::lowest();

class AnnotationsManager;

class AnnotationsManagerProjectSettings : public ProjectSetting
class AnnotationsManagerProjectItemSettings : public ProjectItemSetting
{
public:
AnnotationsManagerProjectSettings(const std::string& project_id,
AnnotationsManagerProjectItemSettings(const std::string& project_id,
AnnotationsManager& annotations_view);
~AnnotationsManagerProjectSettings() override;
~AnnotationsManagerProjectItemSettings() override;

void ToJson() override;
void FromJson();
Expand Down Expand Up @@ -57,7 +57,7 @@ class AnnotationsManager
private:
std::vector<StickyNote> m_sticky_notes;
bool m_show_annotations;
AnnotationsManagerProjectSettings m_project_settings;
AnnotationsManagerProjectItemSettings m_project_settings;
};

} // namespace View
Expand Down
Loading
Loading