refactor(console): phase 0 — remove dead code + fix channel/arg bugs
Zero-behavior-change cleanup ahead of the console refactor: - Delete dead API/members: addCommandResult (unused), handleSelection (declared, no def), isAutoScrollEnabled (no callers), and scroll_to_bottom_ (written 8× but never read) with all its writes. - Drop the unused screenToTextPos `line_height` parameter (+ 4 call sites) and the unused `segEnd` local — clears the two -Wunused warnings. - Remove the toolbar filter checkboxes' dead `static bool s_prev_*` change-detectors, whose only effect was setting the dead scroll_to_bottom_. - Fix the console_new_lines format/arg mismatch (format takes one %d; the call passed a spurious plural-suffix arg). - Fix the channel/color incoherence: a "[daemon] error:" line kept red text but got a blue daemon bar — the prefix no longer downgrades an error channel. - Delete 11 orphaned lite_console_* i18n keys left over from the console merge (keep lite_console_help_passthrough). Full-node + lite build clean, ctest green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -52,11 +52,6 @@ public:
|
||||
* @brief Clear console output
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* @brief Check if auto-scroll is enabled
|
||||
*/
|
||||
bool isAutoScrollEnabled() const { return auto_scroll_; }
|
||||
|
||||
// Scanline effect toggle (set from settings)
|
||||
static bool s_scanline_enabled;
|
||||
@@ -98,7 +93,6 @@ private:
|
||||
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);
|
||||
void renderStatusHeader(ConsoleCommandExecutor& exec);
|
||||
@@ -108,7 +102,6 @@ private:
|
||||
void renderCommandsPopup();
|
||||
|
||||
// Selection helpers
|
||||
void handleSelection();
|
||||
std::string getSelectedText() const;
|
||||
void clearSelection();
|
||||
|
||||
@@ -117,7 +110,7 @@ private:
|
||||
int line = -1;
|
||||
int col = 0;
|
||||
};
|
||||
TextPos screenToTextPos(ImVec2 screen_pos, float line_height) const;
|
||||
TextPos screenToTextPos(ImVec2 screen_pos) const;
|
||||
bool isPosBeforeOrEqual(const TextPos& a, const TextPos& b) const;
|
||||
TextPos selectionStart() const; // Returns the earlier of sel_anchor_ and sel_end_
|
||||
TextPos selectionEnd() const; // Returns the later of sel_anchor_ and sel_end_
|
||||
@@ -127,7 +120,6 @@ private:
|
||||
int history_index_ = -1;
|
||||
char input_buffer_[4096] = {0};
|
||||
bool auto_scroll_ = true;
|
||||
bool scroll_to_bottom_ = false;
|
||||
float scroll_up_cooldown_ = 0.0f; // seconds to wait before re-enabling auto-scroll
|
||||
int new_lines_since_scroll_ = 0; // new lines while scrolled up (for indicator)
|
||||
// (log-ingestion cursors + result queue moved to the ConsoleCommandExecutor)
|
||||
|
||||
Reference in New Issue
Block a user