chore: auto-commit (4 archivos)
- app.md - appicon.ico - views.cpp - work_tab.cpp Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+127
-60
@@ -8,6 +8,8 @@
|
||||
#include "core/page_header.h"
|
||||
#include "core/empty_state.h"
|
||||
#include "core/badge.h"
|
||||
#include "data_table/data_table.h"
|
||||
#include "core/data_table_types.h"
|
||||
#include "nlohmann/json.hpp"
|
||||
|
||||
#include <chrono>
|
||||
@@ -231,37 +233,64 @@ void draw_work_tab() {
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
// Flows table
|
||||
// Flows table — migrado a data_table::render (issue 0107g)
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, fn_tokens::colors::text_muted);
|
||||
ImGui::TextUnformatted("Flows");
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
if (ImGui::BeginTable("##flows_work", 8,
|
||||
ImGuiTableFlags_RowBg | ImGuiTableFlags_Borders |
|
||||
ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_Resizable)) {
|
||||
ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_WidthFixed, 50.0f);
|
||||
ImGui::TableSetupColumn("Name");
|
||||
ImGui::TableSetupColumn("Pattern", ImGuiTableColumnFlags_WidthFixed, 110.0f);
|
||||
ImGui::TableSetupColumn("Status", ImGuiTableColumnFlags_WidthFixed, 90.0f);
|
||||
ImGui::TableSetupColumn("Risk", ImGuiTableColumnFlags_WidthFixed, 70.0f);
|
||||
ImGui::TableSetupColumn("Accept", ImGuiTableColumnFlags_WidthFixed, 60.0f);
|
||||
ImGui::TableSetupColumn("DoD", ImGuiTableColumnFlags_WidthFixed, 60.0f);
|
||||
ImGui::TableSetupColumn("UserFace", ImGuiTableColumnFlags_WidthFixed, 70.0f);
|
||||
ImGui::TableHeadersRow();
|
||||
{
|
||||
static data_table::State g_st_flows;
|
||||
static std::vector<std::string> g_back_flows;
|
||||
static std::vector<const char*> g_ptrs_flows;
|
||||
|
||||
std::string buf;
|
||||
for (auto& f : g_data.flows) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn(); ImGui::TextUnformatted(f.id.c_str());
|
||||
ImGui::TableNextColumn(); ImGui::TextUnformatted(f.name.c_str());
|
||||
ImGui::TableNextColumn(); ImGui::TextUnformatted(f.pattern.empty() ? "-" : f.pattern.c_str());
|
||||
ImGui::TableNextColumn(); ImGui::TextUnformatted(f.status.c_str());
|
||||
ImGui::TableNextColumn(); ImGui::TextUnformatted(f.risk.c_str());
|
||||
ImGui::TableNextColumn(); ImGui::Text("%d%%", f.acceptance_pct);
|
||||
ImGui::TableNextColumn(); ImGui::Text("%d%%", f.dod_pct);
|
||||
ImGui::TableNextColumn(); ImGui::Text("%d%%", f.user_facing_pct);
|
||||
g_back_flows.clear();
|
||||
std::string tmp_buf;
|
||||
for (const auto& f : g_data.flows) {
|
||||
g_back_flows.push_back(f.id);
|
||||
g_back_flows.push_back(f.name);
|
||||
g_back_flows.push_back(f.pattern.empty() ? "-" : f.pattern);
|
||||
g_back_flows.push_back(f.status);
|
||||
g_back_flows.push_back(f.risk);
|
||||
g_back_flows.push_back(std::to_string(f.acceptance_pct) + "%");
|
||||
g_back_flows.push_back(std::to_string(f.dod_pct) + "%");
|
||||
g_back_flows.push_back(std::to_string(f.user_facing_pct) + "%");
|
||||
}
|
||||
ImGui::EndTable();
|
||||
g_ptrs_flows.clear();
|
||||
for (const auto& s : g_back_flows) g_ptrs_flows.push_back(s.c_str());
|
||||
|
||||
data_table::TableInput tbl;
|
||||
tbl.name = "flows_work";
|
||||
tbl.headers = {"ID", "Name", "Pattern", "Status", "Risk", "Accept", "DoD", "UserFace"};
|
||||
tbl.types = {
|
||||
data_table::ColumnType::String, data_table::ColumnType::String,
|
||||
data_table::ColumnType::String, data_table::ColumnType::String,
|
||||
data_table::ColumnType::String, data_table::ColumnType::String,
|
||||
data_table::ColumnType::String, data_table::ColumnType::String,
|
||||
};
|
||||
tbl.cells = g_ptrs_flows.empty() ? nullptr : g_ptrs_flows.data();
|
||||
tbl.rows = (int)g_data.flows.size();
|
||||
tbl.cols = 8;
|
||||
|
||||
tbl.column_specs.resize(tbl.cols);
|
||||
for (int i = 0; i < tbl.cols; i++) tbl.column_specs[i].id = tbl.headers[i];
|
||||
// Status → CategoricalChip
|
||||
tbl.column_specs[3].renderer = data_table::CellRenderer::CategoricalChip;
|
||||
tbl.column_specs[3].chips = {
|
||||
{"activo", "#22c55e"}, {"done", "#22c55e"},
|
||||
{"in-progress","#f59e0b"}, {"bloqueado","#ef4444"},
|
||||
{"pendiente", "#a3a3a3"},
|
||||
};
|
||||
// Risk → CategoricalChip
|
||||
tbl.column_specs[4].renderer = data_table::CellRenderer::CategoricalChip;
|
||||
tbl.column_specs[4].chips = {
|
||||
{"alta", "#ef4444"}, {"high", "#ef4444"},
|
||||
{"media", "#f59e0b"}, {"medium", "#f59e0b"},
|
||||
{"baja", "#22c55e"}, {"low", "#22c55e"},
|
||||
};
|
||||
|
||||
ImGui::BeginChild("##flows_work_host", ImVec2(-1, 220));
|
||||
data_table::render("##flows_work_dt", {tbl}, g_st_flows, nullptr);
|
||||
ImGui::EndChild();
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
@@ -269,43 +298,81 @@ void draw_work_tab() {
|
||||
ImGui::TextUnformatted("Top issues (priority alta, not done)");
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
if (ImGui::BeginTable("##top_issues_work", 7,
|
||||
ImGuiTableFlags_RowBg | ImGuiTableFlags_Borders |
|
||||
ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_Resizable)) {
|
||||
ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_WidthFixed, 70.0f);
|
||||
ImGui::TableSetupColumn("Title");
|
||||
ImGui::TableSetupColumn("Type", ImGuiTableColumnFlags_WidthFixed, 80.0f);
|
||||
ImGui::TableSetupColumn("Domain", ImGuiTableColumnFlags_WidthFixed, 140.0f);
|
||||
ImGui::TableSetupColumn("Status", ImGuiTableColumnFlags_WidthFixed, 90.0f);
|
||||
ImGui::TableSetupColumn("Deps", ImGuiTableColumnFlags_WidthFixed, 110.0f);
|
||||
ImGui::TableSetupColumn("Prio", ImGuiTableColumnFlags_WidthFixed, 60.0f);
|
||||
ImGui::TableHeadersRow();
|
||||
// Top issues table — migrado a data_table::render (issue 0107g)
|
||||
// Nota: la columna Deps original tenia colores condicionales (verde/amber segun deps_resolved).
|
||||
// Mapeado a CategoricalChip: "-" (gris), "OK" (verde), "blocked" (amber).
|
||||
{
|
||||
static data_table::State g_st_issues;
|
||||
static std::vector<std::string> g_back_issues;
|
||||
static std::vector<const char*> g_ptrs_issues;
|
||||
|
||||
std::string buf;
|
||||
for (auto& i : g_data.top_issues) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn(); ImGui::TextUnformatted(i.id.c_str());
|
||||
ImGui::TableNextColumn(); ImGui::TextUnformatted(i.title.c_str());
|
||||
ImGui::TableNextColumn(); ImGui::TextUnformatted(i.type.c_str());
|
||||
ImGui::TableNextColumn(); ImGui::TextUnformatted(join_domain(i.domain, buf));
|
||||
ImGui::TableNextColumn(); ImGui::TextUnformatted(i.status.c_str());
|
||||
ImGui::TableNextColumn();
|
||||
if (i.depends.empty()) {
|
||||
ImGui::TextUnformatted("-");
|
||||
} else if (i.deps_resolved) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, fn_tokens::colors::success);
|
||||
ImGui::TextUnformatted("OK");
|
||||
ImGui::PopStyleColor();
|
||||
} else {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, fn_tokens::colors::warning);
|
||||
ImGui::Text("blocked");
|
||||
ImGui::PopStyleColor();
|
||||
g_back_issues.clear();
|
||||
std::string dom_buf;
|
||||
for (const auto& iss : g_data.top_issues) {
|
||||
g_back_issues.push_back(iss.id);
|
||||
g_back_issues.push_back(iss.title);
|
||||
g_back_issues.push_back(iss.type);
|
||||
// domain: join con coma
|
||||
dom_buf.clear();
|
||||
for (size_t k = 0; k < iss.domain.size(); ++k) {
|
||||
if (k) dom_buf += ",";
|
||||
dom_buf += iss.domain[k];
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, prio_color(i.priority));
|
||||
ImGui::TextUnformatted(i.priority.c_str());
|
||||
ImGui::PopStyleColor();
|
||||
g_back_issues.push_back(dom_buf);
|
||||
g_back_issues.push_back(iss.status);
|
||||
// deps: mostrar "-" / "OK" / "blocked"
|
||||
if (iss.depends.empty()) {
|
||||
g_back_issues.push_back("-");
|
||||
} else if (iss.deps_resolved) {
|
||||
g_back_issues.push_back("OK");
|
||||
} else {
|
||||
g_back_issues.push_back("blocked");
|
||||
}
|
||||
g_back_issues.push_back(iss.priority);
|
||||
}
|
||||
ImGui::EndTable();
|
||||
g_ptrs_issues.clear();
|
||||
for (const auto& s : g_back_issues) g_ptrs_issues.push_back(s.c_str());
|
||||
|
||||
data_table::TableInput tbl;
|
||||
tbl.name = "top_issues_work";
|
||||
tbl.headers = {"ID", "Title", "Type", "Domain", "Status", "Deps", "Prio"};
|
||||
tbl.types = {
|
||||
data_table::ColumnType::String, data_table::ColumnType::String,
|
||||
data_table::ColumnType::String, data_table::ColumnType::String,
|
||||
data_table::ColumnType::String, data_table::ColumnType::String,
|
||||
data_table::ColumnType::String,
|
||||
};
|
||||
tbl.cells = g_ptrs_issues.empty() ? nullptr : g_ptrs_issues.data();
|
||||
tbl.rows = (int)g_data.top_issues.size();
|
||||
tbl.cols = 7;
|
||||
|
||||
tbl.column_specs.resize(tbl.cols);
|
||||
for (int i = 0; i < tbl.cols; i++) tbl.column_specs[i].id = tbl.headers[i];
|
||||
// Status → CategoricalChip
|
||||
tbl.column_specs[4].renderer = data_table::CellRenderer::CategoricalChip;
|
||||
tbl.column_specs[4].chips = {
|
||||
{"pendiente", "#a3a3a3"},
|
||||
{"in-progress", "#f59e0b"},
|
||||
{"bloqueado", "#ef4444"},
|
||||
{"completado", "#22c55e"},
|
||||
};
|
||||
// Deps → CategoricalChip (verde OK / amber blocked / gris -)
|
||||
tbl.column_specs[5].renderer = data_table::CellRenderer::CategoricalChip;
|
||||
tbl.column_specs[5].chips = {
|
||||
{"OK", "#22c55e"},
|
||||
{"blocked", "#f59e0b"},
|
||||
{"-", "#a3a3a3"},
|
||||
};
|
||||
// Prio → CategoricalChip
|
||||
tbl.column_specs[6].renderer = data_table::CellRenderer::CategoricalChip;
|
||||
tbl.column_specs[6].chips = {
|
||||
{"alta", "#ef4444"}, {"high", "#ef4444"},
|
||||
{"media", "#f59e0b"}, {"medium", "#f59e0b"},
|
||||
{"baja", "#22c55e"}, {"low", "#22c55e"},
|
||||
};
|
||||
|
||||
ImGui::BeginChild("##top_issues_work_host", ImVec2(-1, -1));
|
||||
data_table::render("##top_issues_work_dt", {tbl}, g_st_issues, nullptr);
|
||||
ImGui::EndChild();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user