Files
kanban_cpp/data.h
T
agent 255e8dcf71 feat: initial scaffold of kanban_cpp v2 (issue 0130)
Frontend C++ ImGui (main.cpp + 4 paneles) + backend Go (HTTP + SQLite + fsnotify + SSE).
Reusa parse/scan/watch funcs del registry (issue 0130a).
2026-05-22 22:19:47 +02:00

87 lines
2.3 KiB
C++

#pragma once
#include <mutex>
#include <set>
#include <string>
#include <vector>
namespace kanban {
struct Issue {
std::string id;
std::string title;
std::string status;
std::string type;
std::string scope;
std::string priority;
std::vector<std::string> domain;
std::vector<std::string> tags;
std::vector<std::string> depends;
std::vector<std::string> blocks;
std::vector<std::string> related;
std::string flow;
std::string file_path;
bool completed = false;
std::string body; // only filled in detail GET
};
struct Flow {
std::string id;
std::string title;
std::string status;
std::string kind;
std::vector<std::string> tags;
std::string file_path;
std::string body;
};
struct Meta {
std::vector<std::string> statuses;
std::vector<std::string> priorities;
std::vector<std::string> scopes;
std::vector<std::string> types;
};
struct Filters {
std::set<std::string> domains;
std::set<std::string> scopes;
std::set<std::string> priorities;
std::set<std::string> tags;
bool include_completed = false;
};
struct State {
std::mutex mu;
std::string backend_url = "http://127.0.0.1:8487";
std::vector<Issue> issues;
std::vector<Flow> flows;
Meta meta;
Filters filters;
std::string selected_issue_id;
Issue selected_issue_detail;
bool loading = false;
std::string last_error;
long long last_refresh_ns = 0;
};
State& state();
// HTTP operations (block briefly, called from background or coalesced).
bool refresh_issues();
bool refresh_flows();
bool refresh_meta();
bool refresh_issue_detail(const std::string& id);
bool patch_issue_status(const std::string& id, const std::string& new_status);
bool patch_issue_fields(const std::string& id, const std::string& json_partial);
// Background SSE subscription (no-op if already started).
void start_sse();
void stop_sse();
// Filters helpers.
bool passes_filters(const Issue& iss);
std::vector<std::string> collect_domains();
std::vector<std::string> collect_tags();
} // namespace kanban