feat: wire sse_client_cpp_core for live updates from /api/boards/issues/stream

This commit is contained in:
agent
2026-05-18 20:05:14 +02:00
parent 264c5939f3
commit 4f5e9f6fbe
16 changed files with 726 additions and 44 deletions
+8
View File
@@ -5,10 +5,15 @@
#pragma once
#include "data.h"
#include <mutex>
#include <string>
namespace kanban_cpp {
// Shared app state passed to every panel. Owned by main.cpp.
// `mu` guards cards/columns/backend_ok/last_refresh_*/sse_status — refresh_data
// corre en thread aparte y el SSE callback tambien lo hace, ambos escriben a
// traves del mismo mutex.
struct AppState {
ClientConfig cfg;
std::vector<Card> cards;
@@ -16,6 +21,9 @@ struct AppState {
std::string last_refresh_error;
int64_t last_refresh_ts = 0;
bool backend_ok = false;
// SSE live status: "connecting" | "connected" | "disconnected" | "error: <msg>"
std::string sse_status = "connecting";
std::mutex mu;
};
void draw_board (AppState& s, bool* p_open);