feat: wire sse_client_cpp_core for live updates from /api/boards/issues/stream
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user