b9716a7cd6
Snapshot de WIP acumulado de sesiones previas antes de merge wave 1 del flow 0008 (kanban_cpp + agent_runner_api + DoD schema). Incluye: - dev/flows/0008-kanban-cpp-and-agent-workflows.md - dev/issues/0112-0119*.md (7 sub-issues) - WIP previo en cmd/fn/doctor.go, registry/*, modules/, cpp/, etc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4.4 KiB
4.4 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path, framework, params, output
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | framework | params | output | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| data_table_drill | function | cpp | viz | 1.0.0 | impure | void data_table::drill_into(State& st, int from_stage, const std::string& col_name, const std::string& value, const std::vector<std::string>& prev_input_headers) | Drill-down stack + UI breadcrumb para la tabla TQL. Gestiona el arbol de navegacion de stages: drill_into anade un filtro Op::Eq al stage previo y avanza al nivel de detalle, draw_stage_breadcrumb dibuja los botones de navegacion (< back, > forward, ^ up) y el selector de stages activo. Sub-funcion extraida de modules/data_table/data_table.cpp (issue 0107c). |
|
|
|
false | error_go_core |
|
false | cpp/functions/viz/data_table_drill.cpp | imgui |
|
Void. Mutates st.stages[target].filters, st.active_stage, st.drill_back, st.drill_forward. |
Documentacion
Sub-funcion que encapsula la logica de drill-down de la tabla TQL. El drill-down permite al usuario hacer right-click en una celda de una columna breakout (stage > 0) y "entrar" al detalle del grupo seleccionado anadiendo un filtro al stage previo.
Funciones publicas
| Funcion | Uso |
|---|---|
make_drill_filter(col_idx, value) |
Helper: crea Filter{col_idx, Op::Eq, value}. |
apply_drill_step(st, step) |
Inserta step.added en st.stages[step.target_stage].filters y actualiza st.active_stage. |
undo_drill_step(st, step) |
Invierte apply_drill_step: elimina el filtro y restaura st.active_stage. |
drill_up(st) |
Decrementa st.active_stage en 1 (sin crear entry en el undo stack). |
drill_into(st, from, col, val, hdrs) |
API publica: compone make_drill_filter + apply_drill_step + graba en drill_back + limpia drill_forward. |
draw_stage_breadcrumb(st) |
UI: botones < > ^ + combo de stages. |
Invariante del stack
st.drill_back: historial de drill steps (undo). Cadadrill_intoagrega al final.st.drill_forward: pasos deshecho (redo). Se limpia en cadadrill_intonueva.drill_upNO agrega al stack — es un atajo que no se puede rehacer.
Ejemplo
// En el cell popup de una celda de breakout col (stage > 0):
if (ImGui::MenuItem(lbl)) {
data_table::drill_into(st, active_stage,
cur_headers[col], cell_value,
input_headers_active);
ImGui::CloseCurrentPopup();
}
// Breadcrumb al inicio del area de chrome:
if (chrome_visible) {
data_table::draw_stage_breadcrumb(st);
}
Cuando usarla
drill_into se llama desde el popup de celda en data_table_grid_cpp_viz cuando el usuario hace right-click en una columna breakout. draw_stage_breadcrumb se llama una vez por frame en el area de chrome antes de los chips.
Gotchas
drill_intorequierefrom_stage > 0. Sifrom_stage <= 0la funcion retorna sin hacer nada (no hay stage previo).col_namedebe existir enprev_input_headers; si no se encuentra, la funcion retorna sin efecto (el filter no se anade).apply_drill_stepyundo_drill_stepmodificanst.stages[step.target_stage].filterspor posicion (filter_pos). Hay un riesgo de corrupcion si los filtros del stage cambian entre apply y undo por otra via. El design actual asume que el caller no muta los filtros del stage target fuera de este API.draw_stage_breadcrumbdibuja los botones en linea horizontal; si el area es muy estrecha (< 120px) los botones solapan. El caller debe asegurar suficiente ancho o usarImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ...).