feat(table-node): DuckDB foundation + render colapsado (issue 0010)
- tableview.{h,cpp}: capa C sobre DuckDB v1.1.3.
* tableview_smoke_test (SELECT 42).
* tableview_count (con sql_filter opcional).
* tableview_page (LEFT JOIN sobre ops.entities via ATTACH para flag promoted).
* tableview_create (inserta entidad type_ref='Table' con metadata pointer).
* tableview_refresh_counts (lee Table entities, count cada DuckDB y cachea
por user_data hash).
* tableview_resolve_path (rel a dirname(ops_db) o absoluto).
- AppState::table_node_counts cache, refrescado tras load_input y mutaciones.
- views_table_overlay: rectangulo redondeado overlay ("Table N") encima
de cada nodo type_ref='Table'. Sigue camara via cam_x/cam_y/zoom.
- main.cpp:
* --test-duckdb <path> smoke (SELECT 42).
* --test-tableview <path> bulk test (1M rows count + page offset).
* Refresh de counts tras load + reload_after_mutation.
* Llamada a views_table_overlay despues de graph_labels_draw.
- CMakeLists.txt: link DuckDB::DuckDB + duckdb_copy_runtime.
Smoke tests:
- 1M rows count + page(offset=500k, limit=10) en 0.65 s end-to-end.
- Operations.db con un nodo Table apuntando a duckdb 1M filas: refresh
reporta correctamente "1 tables, 1000000 total rows".
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
#include "types_registry.h"
|
||||
#include "entity_ops.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <unordered_map>
|
||||
|
||||
struct GraphData;
|
||||
struct GraphViewportState;
|
||||
|
||||
@@ -137,6 +140,11 @@ struct AppState {
|
||||
std::vector<std::string> insp_tag_suggestions;
|
||||
std::vector<std::string> insp_type_options;
|
||||
|
||||
// ---- Table node (issue 0010) ------------------------------------------
|
||||
// Cache de conteo de filas por nodo Table indexado por user_data hash.
|
||||
// Refrescado tras load_input y tras mutaciones que afecten a Tables.
|
||||
std::unordered_map<uint64_t, int64_t> table_node_counts;
|
||||
|
||||
// ---- Table view (issue 0004) -------------------------------------------
|
||||
// Vista tabular dockeable. Tabs por type_ref del grafo activo + opcional
|
||||
// "All". Click selecciona el nodo en el viewport (mismo flujo que el
|
||||
@@ -243,6 +251,15 @@ EntityRecord views_inspector_build_record(const AppState& app);
|
||||
// al cambiar de proyecto.
|
||||
void views_inspector_clear_draft(AppState& app);
|
||||
|
||||
// ---- Table node overlay (issue 0010) ------------------------------------
|
||||
|
||||
// Dibuja un overlay rectangulo redondeado sobre cada nodo `Table` del grafo
|
||||
// con etiqueta "Table · N rows" leyendo de app.table_node_counts. Llamar
|
||||
// despues de graph_viewport(...) — usa GetItemRectMin/Max + GetWindowDrawList
|
||||
// del item viewport. No interactua con eventos; el hit-testing del nodo
|
||||
// sigue usandolo el viewport circular de fondo.
|
||||
void views_table_overlay(AppState& app);
|
||||
|
||||
// ---- Table view (issue 0004) --------------------------------------------
|
||||
|
||||
// Renderiza el panel "Table". Lee de app.table_rows; el caller ya ha hecho el
|
||||
|
||||
Reference in New Issue
Block a user