Skip to content

feat(applet): HLTH antenna health applet — rebased onto PR #3150 button-bar refactor#3153

Merged
ten9876 merged 2 commits into
mainfrom
auto/hlth-on-buttonbar
May 25, 2026
Merged

feat(applet): HLTH antenna health applet — rebased onto PR #3150 button-bar refactor#3153
ten9876 merged 2 commits into
mainfrom
auto/hlth-on-buttonbar

Conversation

@ten9876
Copy link
Copy Markdown
Collaborator

@ten9876 ten9876 commented May 25, 2026

Summary

Rebased version of @jensenpat's #3133 onto PR #3150's customisable button-bar architecture. Same HealthApplet.{h,cpp} source verbatim from #3133 (zero changes to applet code) — this PR is purely the AppletPanel integration delta that adapts to PR #3150's new BarButton registry + favorites/drawer model.

Depends on #3150 — currently targets fix/button-bar. Once #3150 merges to main, this PR's base will be retargeted to main and the diff will collapse to just the HLTH integration touchpoints.

What changed vs #3133

Three integration touchpoints adjusted; HealthApplet itself untouched:

  1. makeEntry() callsite routes through m_drawer / m_drawerLayout (the new drawer layout from feat(bar): customizable button bar — favorites + push-down drawer #3150), matching every other drawer-resident applet's pattern. PR feat(bar): customizable button bar — favorites + push-down drawer #3150's registerBarButton() inside makeEntry() handles bar-button registration automatically — no manual btnRow2 plumbing required.

  2. Default position moved from index 4 (between TX and PHNE) to after MTR in the drawer:

    "RX", "TUN", "AMP", "TX", "PHNE", "P/CW", "EQ", "WAVE", "TXDSP",
    "CAT", "DAX", "TCI", "IQ", "MTR", "HLTH", "AG", "SS"

    With the new 5-button favorites row, putting HLTH at index 4 would push PHNE out of favorites and surprise shipping users. Operators who want HLTH up top can drag it via the right-click Favorites picker.

  3. CMakeLists.txtsrc/gui/HealthApplet.cpp added to GUI_SOURCES.

Credit

Commit attribution stays with @jensenpat as the HealthApplet author. This PR exists only so the HLTH work doesn't have to wait on the contributor doing a manual rebase after #3150 lands — they're welcome to keep #3133 open if they'd prefer to do the rebase themselves.

Review of HLTH itself

The applet code is well-built — appreciated zero hardcoded colours (every paint and stylesheet call reads from ThemeManager), clean paint-method separation, visibility-gated 20 Hz timer, three-tier meter source priority (amp → TGXL tuner → radio TX), and EWMA + recent-window variance detection.

One small consistency note for a follow-up: HLTH uses widget->setStyleSheet(theme.resolve(...)) (~8 sites) instead of theme.applyStyleSheet(widget, ...). That's the pattern PR #3144 swept across the rest of the codebase to make widgets inspector-discoverable. A two-line conversion would let the Phase 5 inspector find HLTH labels. Tiny follow-up — not blocking this PR.

Test plan

🤖 Generated with Claude Code

@ten9876 ten9876 requested review from a team as code owners May 25, 2026 18:25
Base automatically changed from fix/button-bar to main May 25, 2026 18:28
…n-bar refactor)

Rebases @jensenpat's PR #3133 onto the customisable button-bar
architecture introduced in PR #3150.  HealthApplet.{h,cpp} are
preserved verbatim from PR #3133; the integration changes are the
delta that lets the new BarButton registry + favorites/drawer model
own placement.

Changes vs PR #3133 originally targeted at main:

* Default placement moved from position 4 (between TX and PHNE,
  inside the new favorites zone) to after MTR in the drawer.
  Reasoning: HLTH is a diagnostic, not an every-tune control —
  putting it in favorites by default would push PHNE out of the
  5-button favorites row and surprise shipping users.  Operators
  who want HLTH in favorites can right-click any bar button →
  Favorites picker → drag HLTH up.
* makeEntry() call uses m_drawer / m_drawerLayout (the new drawer
  layout from PR #3150), matching the convention every other
  drawer-resident applet now uses.
* Bar-button registration is automatic via PR #3150's
  registerBarButton() inside makeEntry() — no manual btnRow1/2
  routing needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ten9876 ten9876 force-pushed the auto/hlth-on-buttonbar branch from 29e7818 to c31210e Compare May 25, 2026 18:30
…sion

Three review fixes from PR #3153:

1. MainWindow wiring (blocker) — HealthApplet was registered in the
   AppletPanel drawer but never given a MeterModel.  Without setMeterModel()
   the three signal connections in HealthApplet::setMeterModel never form,
   bestSnapshot() always returns invalid, and the applet renders permanently
   as IDLE / "RF IDLE".  Adds the canonical wiring pair next to MeterApplet's:
     m_appletPanel->healthApplet()->setMeterModel(&m_radioModel.meterModel());
     m_appletPanel->healthApplet()->setPowerScale(maxW, ampActive);   // updatePowerScale lambda

2. Inspector-discoverability — convert the ~8 setStyleSheet(theme.resolve())
   call sites in HealthApplet to ThemeManager::applyStyleSheet(widget, template)
   so the labels and pills register in the Phase 5 inspector reverse-map
   (PR #3144's sweep pattern).  labelStyle/pillStyle helpers now return
   unresolved {{token}} templates; new applyLabelStyle/applyPillStyle wrappers
   route through applyStyleSheet.

3. Tighten the disconnect in HealthApplet::setMeterModel — replace the broad
   disconnect(m_model, nullptr, this, nullptr) with explicit named-signal
   disconnects so any unrelated connections to the same model survive.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ten9876 ten9876 merged commit c03ca6c into main May 25, 2026
5 checks passed
@ten9876 ten9876 deleted the auto/hlth-on-buttonbar branch May 25, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants