feat(console): terminal polish — lite/color-coded toggles, dark bg, monospace font
Work through the console items in todo.md: - Lite filter toggles (#5): replace the single hasLogFilters() bool with a ConsoleLogFilterCaps struct so each backend advertises which toggles apply. Full node = daemon/errors/rpc-trace/app; lite = errors-only + app (its diagnostics ring maps to the App/Error channels; the text filter is always shown). Lite previously showed no toggles at all. - Color-coded toggles (#6): each filter checkbox is tinted with its channel's accent color (daemon=blue, errors=red, rpc=secondary, app=teal) via a new channelAccentColor() that also drives the output's left accent bar — one source of truth for channel color. - Darker terminal look (#7): drop the light glass rectangle on the input; both output and input now get a terminal-dark overlay (tabs.console.bg-darken-alpha, default 110) and the input field blends into it (transparent frame bg). - Monospace font (#8): bundle Ubuntu Mono (res/fonts/UbuntuMono-R.ttf, Ubuntu Font License — same family as the existing Ubuntu fonts) via INCBIN, load it at caption size as Type().mono(), and render console output + input in it so pretty-printed JSON columns and terminal text align. Falls back to the proportional caption font if unavailable. Full-node + lite build clean; ctest green; source hygiene clean; sandboxed startup smoke confirms the mono font loads + atlas builds without crashing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,17 @@ struct ConsoleStatusLine {
|
||||
bool pulse = false; // animate the toolbar dot (starting/connecting)
|
||||
};
|
||||
|
||||
// Which log-filter toggles the toolbar should show for a given backend. The full node has a
|
||||
// daemon/xmrig log + an RPC trace; the lite backend has neither (its diagnostics ring maps to
|
||||
// the App/Error channels), so it only wants the errors-only + app-messages toggles.
|
||||
struct ConsoleLogFilterCaps {
|
||||
bool daemon = false; // daemon + xmrig output toggle
|
||||
bool errorsOnly = false; // errors-only toggle
|
||||
bool rpcTrace = false; // RPC method/source trace toggle
|
||||
bool appMessages = false; // app / diagnostics log toggle
|
||||
bool any() const { return daemon || errorsOnly || rpcTrace || appMessages; }
|
||||
};
|
||||
|
||||
class ConsoleCommandExecutor {
|
||||
public:
|
||||
virtual ~ConsoleCommandExecutor() = default;
|
||||
@@ -53,7 +64,8 @@ public:
|
||||
|
||||
// UI-chrome capabilities.
|
||||
virtual bool hasRpcReference() const { return false; } // show the RPC command-reference popup
|
||||
virtual bool hasLogFilters() const { return false; } // show daemon/errors/rpc-trace/app filters
|
||||
// Which log-filter toggles the toolbar should show (default: none).
|
||||
virtual ConsoleLogFilterCaps logFilterCaps() const { return {}; }
|
||||
|
||||
// Print the backend-appropriate `help` output via `add`.
|
||||
virtual void printHelp(const ConsoleAddLineFn& add) = 0;
|
||||
@@ -75,7 +87,8 @@ public:
|
||||
bool pollResult(std::string& result, bool& isError) override;
|
||||
void pollLogLines(const ConsoleAddLineFn& add) override;
|
||||
bool hasRpcReference() const override { return true; }
|
||||
bool hasLogFilters() const override { return true; }
|
||||
// Full node: daemon/xmrig log, errors-only, RPC trace, and app messages.
|
||||
ConsoleLogFilterCaps logFilterCaps() const override { return {true, true, true, true}; }
|
||||
void printHelp(const ConsoleAddLineFn& add) override;
|
||||
ConsoleStatusLine toolbarStatus() const override;
|
||||
|
||||
@@ -99,6 +112,9 @@ public:
|
||||
void submit(const std::string& cmd) override;
|
||||
bool pollResult(std::string& result, bool& isError) override;
|
||||
void pollLogLines(const ConsoleAddLineFn& add) override;
|
||||
// Lite: no daemon log / RPC trace — its diagnostics ring maps to the App + Error
|
||||
// channels, so offer errors-only + app-messages (plus the always-shown text filter).
|
||||
ConsoleLogFilterCaps logFilterCaps() const override { return {false, true, false, true}; }
|
||||
void printHelp(const ConsoleAddLineFn& add) override;
|
||||
std::vector<ConsoleStatusLine> statusLines() const override;
|
||||
ConsoleStatusLine toolbarStatus() const override;
|
||||
|
||||
Reference in New Issue
Block a user