From ce1fde4fdb5272f5f862bd170950ea80aed03a52 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Fri, 17 Jul 2026 20:27:55 +0200 Subject: [PATCH] fix(admin): field label/value overlap and scrollbar-clipped freq digit Long field labels ("Flood advert interval (h)", "Frequency (MHz)") were ellipsized to nearly the full row width with no reserve for the value column, so a label could run under/through the value or digit editor on the row currently being edited. Only rows showing an inline value now reserve room before valCol(); other rows keep the full width as before. Separately, the Frequency digit editor (4 int + 3 dec digits, needed for Admin's wider 150-2500 MHz range vs Repeater's 3-digit range) drew all 8 digits flush to the screen edge, landing the thousandths digit exactly under a visible scrollbar's reserve column. Shifted left by that reserve, matching the plain-value branch's existing scrollbar-aware positioning. Co-Authored-By: Claude Sonnet 5 --- examples/companion_radio/ui-new/AdminScreen.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/examples/companion_radio/ui-new/AdminScreen.h b/examples/companion_radio/ui-new/AdminScreen.h index 0bc5cacf..6a692f52 100644 --- a/examples/companion_radio/ui-new/AdminScreen.h +++ b/examples/companion_radio/ui-new/AdminScreen.h @@ -447,10 +447,21 @@ public: drawList(display, n, _row_sel, _row_scroll, [&](int i, int y, bool sel, int reserve) { drawRowSelection(display, y, sel, reserve); const AdminField& f = fieldAt(_tab, i); - display.drawTextEllipsized(2, y, display.width() - 4 - reserve, f.label); - if (_value_editing && sel) { // the row whose typed editor is currently open + bool show_val = _value_editing && sel; // the row whose typed editor is currently open + // Leave room for the value column on the row currently showing one, so a + // long label (e.g. "Flood advert interval (h)") can't run under/through + // the value being edited -- only rows without an inline value get the + // full row width. + int label_max = show_val ? display.valCol() - 4 : display.width() - 4 - reserve; + display.drawTextEllipsized(2, y, label_max, f.label); + if (show_val) { if (f.kind == FK_RADIO_FREQ) { - _freq_ed.render(display, display.valCol(), y); + // valCol() reserves exactly the 8-char width this editor draws (4 + // int + '.' + 3 dec), so with no margin to spare, a visible + // scrollbar's reserve column would otherwise swallow the last + // (thousandths) digit -- shift left to stay clear of it, same as + // the plain-value branch below. + _freq_ed.render(display, display.valCol() - reserve, y); } else { char val[16]; formatEditValue(val, sizeof(val));