feat(graph_explorer): adopta convencion local_files/

Sustituye paths hardcodeados (graph_explorer.db, graph_explorer.ini,
projects/) por resolutores que apuntan a <exe_dir>/local_files/.

- project_manager: k_projects_dir y k_settings_file pasan a ser
  helpers projects_root() / settings_path() que llaman a
  fn::local_path internamente. Layout en disco documentado en el
  comentario de cabecera del .h.
- main.cpp: el modo legacy y el fallback de jobs_init usan
  fn::local_path('graph_explorer.db') en lugar de relativo al cwd.

Junto al cambio del framework (commit f102aba9), graph_explorer
se distribuye con su carpeta limpia: solo .exe + duckdb.dll +
TTFs + enrichers/ + runtime/. Todo el estado del usuario vive
en local_files/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-03 00:33:08 +02:00
parent 2d8aafea34
commit 7a055809c2
3 changed files with 47 additions and 22 deletions
+22 -11
View File
@@ -7,23 +7,34 @@
// contiene sus propios `operations.db`, `types.yaml` y `graph_explorer.db`
// (layouts). El usuario crea proyectos, los nombra y conmuta entre ellos.
//
// Layout en disco:
// Layout en disco (issue: convencion local_files):
//
// <exe_dir>/
// graph_explorer.ini # last_active + recent (gestionado aqui)
// projects/
// default/
// operations.db # bootstrap con DDL completo
// types.yaml # copia editable; semilla = ./examples/types.yaml o embed
// graph_explorer.db # layouts del proyecto
// caso_X/
// ...
// graph_explorer.exe
// enrichers/, runtime/, *.ttf, ... (read-only, distribuibles)
// local_files/ (escribibles, per-PC)
// imgui.ini, app_settings.ini (gestionados por fn_framework)
// graph_explorer.ini # last_active + recent
// projects/
// default/
// operations.db
// types.yaml
// graph_explorer.db # layouts del proyecto
// caso_X/
// ...
namespace ge {
constexpr const char* k_projects_dir = "projects";
// Helpers que resuelven a <exe_dir>/local_files/... via fn::local_path.
// Las constantes solo guardan el basename relativo a local_files/.
constexpr const char* k_projects_subdir = "projects";
constexpr const char* k_default_project = "default";
constexpr const char* k_settings_file = "graph_explorer.ini";
constexpr const char* k_settings_basename = "graph_explorer.ini";
// Devuelven paths absolutos resueltos contra local_files/ (creando la
// carpeta si no existe). Sustituyen el uso directo de los constexpr.
const char* projects_root(); // <exe>/local_files/projects
const char* settings_path(); // <exe>/local_files/graph_explorer.ini
struct ProjectPaths {
std::string root_dir; // <exe>/projects/<slug>/