feat(kotlin-compose): finalize design system + apps + sync sub-repo gitlinks

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 16:30:43 +02:00
parent 42c14fae59
commit a396ee781a
18 changed files with 5285 additions and 57 deletions
@@ -1,14 +1,11 @@
// Playground tables: visor de la funcion table_view_cpp_viz tal cual existe
// hoy en el registry. Iteraremos mejoras encima hasta promover una API v2
// que sustituya a los `ImGui::BeginTable` raw de las apps C++.
// Playground tables: iterador de la fn `data_table` antes de promoverla al
// registry y migrar las apps C++ que hoy usan `ImGui::BeginTable` raw.
#include "app_base.h"
#include "imgui.h"
#include "viz/table_view.h"
#include "core/logger.h"
#include "data_table.h"
#include <cstdio>
#include <string>
#include <vector>
namespace {
@@ -21,48 +18,44 @@ struct Row {
const char* description;
};
// Dataset de muestra inspirado en el registry. Filas reales-ish para
// hacer obvias las limitaciones actuales (sin sort, sin filter, sin
// per-cell render, alto fijo, etc.).
const std::vector<Row>& sample_rows() {
static const std::vector<Row> rows = {
{"filter_slice", "go", "core", "pure", "Filtra slice con predicado"},
{"map_slice", "go", "core", "pure", "Aplica f a cada elemento"},
{"reduce_slice", "go", "core", "pure", "Fold con acumulador"},
{"sma", "py", "finance", "pure", "Simple moving average"},
{"ema", "py", "finance", "pure", "Exponential moving average"},
{"rsi", "py", "finance", "pure", "Relative strength index"},
{"table_view", "cpp", "viz", "pure", "Tabla ImGui actual del registry"},
{"line_plot", "cpp", "viz", "pure", "ImPlot line wrapper"},
{"scatter_plot", "cpp", "viz", "pure", "ImPlot scatter wrapper"},
{"bar_chart", "cpp", "viz", "pure", "ImPlot bar wrapper"},
{"heatmap", "cpp", "viz", "pure", "ImPlot heatmap wrapper"},
{"sqlite_open", "go", "infra", "impure", "Open SQLite con WAL+FK"},
{"http_json_response", "go", "infra", "impure", "Helper JSON response"},
{"http_parse_body", "go", "infra", "impure", "Parse JSON body"},
{"rsync_deploy", "bash", "infra", "impure", "rsync local -> remoto"},
{"systemd_install", "go", "infra", "impure", "Sube unit + enable + start"},
{"systemd_restart", "go", "infra", "impure", "Restart servicio remoto"},
{"jupyter_discover", "py", "notebook", "impure", "Descubre instancias Jupyter"},
{"jupyter_exec", "py", "notebook", "impure", "Ejecuta celda y vuelca output"},
{"docker_pull_image", "go", "infra", "impure", "docker pull con timeout"},
{"graph_force_layout", "cpp", "viz", "pure", "Force-directed CPU"},
{"graph_force_layout_gpu","cpp", "viz", "pure", "Force-directed GPU (compute)"},
{"sql_workbench", "cpp", "core", "impure", "Workbench SQL embebido"},
{"text_editor", "cpp", "core", "impure", "Editor de texto con highlighting"},
{"icon_font", "cpp", "core", "impure", "Carga tabler-icons.ttf"},
{"filter_slice", "go", "core", "pure", "Filtra slice con predicado"},
{"map_slice", "go", "core", "pure", "Aplica f a cada elemento"},
{"reduce_slice", "go", "core", "pure", "Fold con acumulador"},
{"sma", "py", "finance", "pure", "Simple moving average"},
{"ema", "py", "finance", "pure", "Exponential moving average"},
{"rsi", "py", "finance", "pure", "Relative strength index"},
{"table_view", "cpp", "viz", "pure", "Tabla ImGui actual del registry"},
{"line_plot", "cpp", "viz", "pure", "ImPlot line wrapper"},
{"scatter_plot", "cpp", "viz", "pure", "ImPlot scatter wrapper"},
{"bar_chart", "cpp", "viz", "pure", "ImPlot bar wrapper"},
{"heatmap", "cpp", "viz", "pure", "ImPlot heatmap wrapper"},
{"sqlite_open", "go", "infra", "impure", "Open SQLite con WAL+FK"},
{"http_json_response", "go", "infra", "impure", "Helper JSON response"},
{"http_parse_body", "go", "infra", "impure", "Parse JSON body"},
{"rsync_deploy", "bash", "infra", "impure", "rsync local -> remoto"},
{"systemd_install", "go", "infra", "impure", "Sube unit + enable + start"},
{"systemd_restart", "go", "infra", "impure", "Restart servicio remoto"},
{"jupyter_discover", "py", "notebook", "impure", "Descubre instancias Jupyter"},
{"jupyter_exec", "py", "notebook", "impure", "Ejecuta celda y vuelca output"},
{"docker_pull_image", "go", "infra", "impure", "docker pull con timeout"},
{"graph_force_layout", "cpp", "viz", "pure", "Force-directed CPU"},
{"graph_force_layout_gpu","cpp", "viz", "pure", "Force-directed GPU (compute)"},
{"sql_workbench", "cpp", "core", "impure", "Workbench SQL embebido"},
{"text_editor", "cpp", "core", "impure", "Editor de texto con highlighting"},
{"icon_font", "cpp", "core", "impure", "Carga tabler-icons.ttf"},
};
return rows;
}
// Aplanado row-major para alimentar table_view_cpp_viz (firma `const char* const*`).
const char* const* flatten_cells(int& out_rows, int& out_cols) {
const char* const* flatten_cells(int& rows, int& cols) {
static std::vector<const char*> flat;
static bool built = false;
if (!built) {
const auto& rows = sample_rows();
flat.reserve(rows.size() * 5);
for (const auto& r : rows) {
const auto& src = sample_rows();
flat.reserve(src.size() * 5);
for (const auto& r : src) {
flat.push_back(r.name);
flat.push_back(r.lang);
flat.push_back(r.domain);
@@ -71,30 +64,26 @@ const char* const* flatten_cells(int& out_rows, int& out_cols) {
}
built = true;
}
out_rows = static_cast<int>(sample_rows().size());
out_cols = 5;
rows = (int)sample_rows().size();
cols = 5;
return flat.data();
}
} // namespace
void render() {
if (ImGui::Begin("Tables Playground - table_view actual")) {
static data_table::State st;
if (ImGui::Begin("Tables Playground - data_table v0.1")) {
ImGui::TextWrapped(
"Esta es la funcion `table_view_cpp_viz` del registry hoy. "
"Capacidades: borders, sortable (solo indicador, no sort real), "
"rowBg, resizable, scrollY (alto fijo 300px), reorderable. "
"Sin filter, sin selection, sin per-cell render, sin export. "
"Iteraremos mejoras encima de esto.");
"Iteracion 1: sort real al pulsar header, click en celda -> popup operador "
"(=, !=, >, >=, <, <=) -> chip removible. Click derecho header: filter input, "
"conditional color, hide column, show/hide columns.");
ImGui::Separator();
static const char* headers[] = {"name", "lang", "domain", "purity", "description"};
int rows = 0, cols = 0;
const char* const* cells = flatten_cells(rows, cols);
ImGui::Text("Filas: %d Columnas: %d", rows, cols);
ImGui::Spacing();
table_view("##registry_sample", headers, cols, cells, rows);
data_table::render("##registry_sample", headers, cols, cells, rows, st);
}
ImGui::End();
}
@@ -106,8 +95,8 @@ int main() {
.width = 1280,
.height = 800,
.about = {.name = "tables_playground",
.version = "0.1.0",
.description = "Playground para iterar mejoras sobre table_view_cpp_viz antes de promover a registry y migrar apps C++."},
.version = "0.2.0",
.description = "Playground para iterar mejoras sobre table_view antes de promover al registry."},
.log = {.file_path = "tables_playground.log",
.level = static_cast<int>(fn_log::Level::Info)}
}, render);