feat(console): left-edge channel accent bar (replaces inline log prefixes)

Each line gets a `channel` inferred in addLine() from its color and any
"[daemon]"/"[xmrig]"/"[app]"/"[rpc]" prefix, which is then stripped. renderOutput draws
a thin colored bar in the existing left margin (padX) per line — node log (blue), mining
(amber), app (teal), rpc (secondary), command (accent), error (red). Drawn in the margin
so it never touches the text layout or selection; filtering is unaffected (it keys off
color, not the prefix).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-01 16:30:43 -05:00
parent e9121fe49e
commit e0d6d6bc4d
2 changed files with 51 additions and 4 deletions

View File

@@ -88,11 +88,16 @@ public:
static ImU32 COLOR_RPC;
private:
// Line source, for the left-edge channel accent bar. Inferred in addLine() from the
// color + any "[daemon]"/"[xmrig]"/"[app]" prefix (which is then stripped).
enum Channel { CH_NONE = 0, CH_COMMAND, CH_INFO, CH_ERROR, CH_RPC, CH_DAEMON, CH_XMRIG, CH_APP };
struct ConsoleLine {
std::string text;
ImU32 color;
int channel = CH_NONE;
};
void addCommandResult(const std::string& cmd, const std::string& result, bool is_error = false);
// Format + color a completed command result (JSON-aware) into console lines.
void addFormattedResult(const std::string& result, bool is_error);