Commit Graph

4 Commits

Author SHA1 Message Date
egutierrez 87b7ef45ff feat(monitor): Monitor tab as primary landing + errors KPI + recent executions + date filter
Rebrand "Claude Usage" tab to "Monitor" and promote it to first/default tab in
the main TabBar. Monitor is the landing for the reactive loop (construir →
ejecutar → recopilar → analizar → mejorar).

UI additions:
- Local toolbar inside Monitor with date preset combo (1h / 24h / 7d / 30d /
  All), manual Refresh button, and live LED + last-event-ts indicator.
- 5 KPI cards (was 4): added "Errors" derived from COUNT(*) FROM calls WHERE
  success = 0 filtered by the active window.
- New sub-tab "Recent Executions" (first sub-tab) with columns: When,
  Function, Tool, ms, OK (check/X colored), Error class. Backed by calls
  table, sorted by ts DESC, limit 100, filtered by window.
- Violations sub-tab gains "When" column with formatted ts.

Data layer:
- data.h: RecentExecutionRow + window_secs + ws_connected/last_event_ts /
  last_seen_call_id watermark on ClaudeUsageData.
- data_http.{h,cpp}: load_claude_usage_http now takes window_secs and embeds
  ts_filter() in calls/errors/violations queries. total_errors populated.
  recent_executions populated up to 100 rows. New standalone
  load_recent_executions_http() for future WS-driven partial refetch.
- main.cpp: reload_data preserves window_secs across reloads; new
  reload_monitor() does a Monitor-only refetch when the user changes the
  window or clicks Refresh, without re-querying the full registry.

Wiring:
- views.h: draw_monitor + monitor_consume_reload_request() +
  monitor_set_ws_state() exported. draw_claude_usage removed.
- views.cpp: render() consumes monitor_consume_reload_request each frame
  and dispatches reload_monitor().

This is the UI half of issue 0086. The server-side WebSocket endpoint in
sqlite_api and the C++ WS client are next; the LED is wired to
monitor_set_ws_state but stays gray until those land.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:26:29 +02:00
egutierrez ddf8e76ad6 feat(dashboard): functions explorer + top-level tabs + pie chart fit
- Pie charts (Purity, Kind) ahora reciben plot_h explicito para que respeten
  el panel contenedor y no desborden cuando la ventana se reduce.
- Nueva pestana "Explorer": split layout con lista filtrable a la izquierda
  (search por nombre/descripcion + combos lang/domain) y panel de detalle
  a la derecha con tabs Code (read-only multiline), Documentation (selectable
  text), Tests (con dropdown si la funcion tiene varios tests, muestra lang +
  file_path + codigo) y Metadata (id, version, file_path, returns,
  uses_functions, uses_types, params_schema, example, notes).
- Reorganizacion de navegacion: TabBar movido arriba, justo debajo de la
  toolbar. Tabs: Dashboard | Explorer | Projects | Apps | Analysis | Types.
  Cada tab ocupa toda la zona de contenido. Dashboard incluye KPIs + charts
  + tabla de Recent Functions.
- Cache del Explorer (lista de funciones) invalidado en trigger_reload.
- Nuevas funciones HTTP: load_function_detail_http, load_all_functions_http,
  load_unit_tests_http (todas usan /api/databases/registry/query con escape
  defensivo de comilla simple en IDs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 23:13:02 +02:00
egutierrez a466fff71a feat: Settings submenu (Settings.../About...), git column, projects tab
- main.cpp: registrar info About via fn_ui::about_window_set_info
- views.cpp: nueva columna "Git" en la tabla Apps (remote/local/-)
- data.h/cpp + data_http.cpp: AppRow gana repo_url + dir_path
- views.cpp: actions bar (Reindex / + Add / Reload / inbox) y modal Add
- views.cpp: tab Projects con tree + detalle anidado
- data_http.cpp: load_projects_http, load_project_detail_http, http_post_*
- http_client.cpp: SO_RCVTIMEO en Windows como DWORD ms (timeout 5 ms bug)
- CMakeLists: limpieza de srcs duplicados con fn_framework
- app.md: notas operativas y estado actual

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 22:06:31 +02:00
egutierrez 0ef3da3bf5 feat: data layer HTTP — consume sqlite_api en vez de SQLite directo
Nuevo data_http.cpp que obtiene todos los datos del registry via HTTP
POST a sqlite_api (/api/databases/registry/query). Mismas queries SQL
que el data layer SQLite pero ejecutadas remotamente. cpp-httplib como
cliente HTTP, nlohmann/json para parsear respuestas.

CMakeLists.txt actualizado: incluye data_http.cpp, vendor/ en includes,
linkea pthreads (Linux) y ws2_32 (Windows) para sockets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:37:03 +02:00