4#include "absl/strings/str_format.h"
7#include "imgui/imgui.h"
18 const auto cancel_build =
21 if (!build_status.visible && !run_status.visible && build_log.empty() &&
23 ImGui::TextDisabled(tr(
"No workflow output available yet."));
25 tr(
"Run a project build or output reload to populate workflow status "
30 if (build_status.visible) {
32 if (build_status.can_cancel && cancel_build) {
40 if (run_status.visible) {
45 if (!build_log.empty()) {
51 if (ImGui::BeginChild(
"##workflow_output_log", ImVec2(0, 240),
true,
52 ImGuiWindowFlags_HorizontalScrollbar)) {
53 ImGui::TextUnformatted(build_log.c_str());
54 if (ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) {
55 ImGui::SetScrollHereY(1.0f);
61 if (!history.empty()) {
69 for (
size_t i = 0; i < history.size(); ++i) {
80 if (!status.
detail.empty()) {
81 ImGui::TextWrapped(
"%s", status.
detail.c_str());
84 ImGui::TextWrapped(
"%s", status.
output_tail.c_str());
96 const std::string title = absl::StrFormat(
99 if (ImGui::CollapsingHeader(title.c_str(), ImGuiTreeNodeFlags_DefaultOpen)) {
105 if (ImGui::BeginChild(
"##workflow_history_log", ImVec2(0, 120),
true,
106 ImGuiWindowFlags_HorizontalScrollbar)) {
107 ImGui::TextUnformatted(entry.
output_log.c_str());
void DrawStatusCard(const char *fallback_icon, const ProjectWorkflowStatus &status)
void Draw(bool *p_open) override
Draw the panel content.
void DrawHistoryEntry(const ProjectWorkflowHistoryEntry &entry, int index)
#define ICON_MD_PLAY_ARROW
#define ICON_MD_DELETE_SWEEP
std::vector< ProjectWorkflowHistoryEntry > workflow_history()
std::string build_workflow_log()
void ClearWorkflowHistory()
std::function< void()> cancel_build_workflow_callback()
ProjectWorkflowStatus build_workflow_status()
std::function< void()> run_project_workflow_callback()
std::function< void()> start_build_workflow_callback()
ProjectWorkflowStatus run_workflow_status()
WorkflowButtonRect DrawCopyCurrentLogButton(const std::string &build_log)
std::string FormatHistoryTime(std::chrono::system_clock::time_point timestamp)
const char * WorkflowIcon(const ProjectWorkflowStatus &status, const char *fallback_icon)
WorkflowActionRowResult DrawHistoryActionRow(const ProjectWorkflowHistoryEntry &entry, const WorkflowActionCallbacks &callbacks, const WorkflowActionRowOptions &options)
ImVec4 WorkflowColor(ProjectWorkflowState state)
ImVec4 GetTextSecondaryVec4()
ProjectWorkflowStatus status
std::chrono::system_clock::time_point timestamp
ProjectWorkflowState state
std::function< void()> run_project
std::function< void()> start_build