3#include "absl/strings/str_format.h"
6#include "imgui/imgui.h"
17 const auto cancel_build =
20 if (!build_status.visible && !run_status.visible && build_log.empty() &&
22 ImGui::TextDisabled(
"No workflow output available yet.");
24 "Run a project build or output reload to populate workflow status and logs.");
28 if (build_status.visible) {
30 if (build_status.can_cancel && cancel_build) {
38 if (run_status.visible) {
43 if (!build_log.empty()) {
49 if (ImGui::BeginChild(
"##workflow_output_log", ImVec2(0, 240),
true,
50 ImGuiWindowFlags_HorizontalScrollbar)) {
51 ImGui::TextUnformatted(build_log.c_str());
52 if (ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) {
53 ImGui::SetScrollHereY(1.0f);
59 if (!history.empty()) {
67 for (
size_t i = 0; i < history.size(); ++i) {
79 if (!status.
detail.empty()) {
80 ImGui::TextWrapped(
"%s", status.
detail.c_str());
83 ImGui::TextWrapped(
"%s", status.
output_tail.c_str());
93 const std::string title = absl::StrFormat(
96 if (ImGui::CollapsingHeader(title.c_str(), ImGuiTreeNodeFlags_DefaultOpen)) {
102 if (ImGui::BeginChild(
"##workflow_history_log", ImVec2(0, 120),
true,
103 ImGuiWindowFlags_HorizontalScrollbar)) {
104 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