Add TNF status tooltip#2789
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a TNF status-bar tooltip that shows the current tracking notch filters from TnfModel, including empty-state handling and refreshed tooltip contents when TNFs change.
Changes:
- Added TNF frequency/depth formatting helpers and rich HTML tooltip construction.
- Handles TNF indicator tooltip events with current model state.
- Refreshes TNF tooltip text on TNF changes/removals and disconnect reset.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| std::sort(filters.begin(), filters.end(), [](const TnfEntry& lhs, const TnfEntry& rhs) { | ||
| if (std::abs(lhs.freqMhz - rhs.freqMhz) > 0.000001) { | ||
| return lhs.freqMhz < rhs.freqMhz; | ||
| } | ||
| return lhs.id < rhs.id; |
There was a problem hiding this comment.
Addressed in the amended commit. The tooltip sorting now compares a rounded-Hz key first and uses the TNF id only as the tie-breaker, so the comparator is a strict weak ordering while preserving stable frequency ordering.
14b7670 to
4d4396d
Compare
4d4396d to
27d6b85
Compare
There was a problem hiding this comment.
Nice scoped enhancement — thanks @rfoust. Implementation cleanly mirrors the existing buildNetworkTooltip pattern at src/gui/MainWindow.cpp:5824, including the live-refresh on the help event and the cached fallback on tnfChanged/tnfRemoved/disconnect. No protocol or model-side surprises.
I checked the comparator after the amend — tnfFrequencyHz rounds to an integral Hz key and the lambda falls through to lhs.id < rhs.id as the tie-breaker, so it is a proper strict weak ordering. Copilot's concern is resolved.
A couple of minor, non-blocking observations:
formatTnfDepthusesstd::clamp(depthDb, 1, 3)inside the switch, so thedefault:arm is unreachable. Either drop the clamp and letdefaulthandle out-of-range values, or dropdefault— the current shape is mildly redundant. Not worth a second push on its own.- The tooltip refreshes on per-TNF add/change/remove but not on
TnfModel::globalEnabledChanged. The current rendering doesn't surface the global enable state anyway, so this is fine as-is; if you ever extend the header to show "TNFs globally disabled," wire that signal in too.
Looks good to me as a status-bar polish PR.
|
Claude here — landed at 05:55 UTC. Three contributions today, Robbie! 🎉 Clean follow-up to your panadapter and waterfall-rate work earlier — TNF management was previously opaque from the status bar, you'd see "TNF" lit up but had no way to know what filters were actually active without opening the panadapter overlay. The implementation parallels the existing `buildNetworkTooltip` pattern (file-scope helpers, file-scope event filter handling) and the design choices show good attention to detail:
Today's tally for you: #2780 → cherry-picked into #2786 (panadapter layout/floating persistence + macOS GPU lifecycle), #2783 (Ctrl-drag waterfall rate control), and now #2789 (TNF status tooltip). Three substantive UX wins across spectrum management, waterfall control, and status-bar discoverability. Great day. 73, Jeremy KK7GWY & Claude (AI dev partner) |
Summary
Adds a hover tooltip to the TNF indicator in the bottom status bar. The tooltip lists the current tracking notch filters with their band, frequency, width, depth, and whether each filter is persistent or temporary. If the radio has no TNF filters, the tooltip shows a simple empty-state message.
Implementation
MainWindowhelpers to format TNF frequency/depth values and build a rich Qt tooltip fromTnfModel.QEvent::ToolTipon the existing TNF status-barQLabelso hover always reflects the current model state.Validation
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfocmake --build build --parallelI did not launch the app after compiling, per request.
Maintainer Notes
This touches
src/gui/MainWindow.cppbecause the TNF status-bar label and event filter live there. The PR intentionally avoids broader UI restructuring or TNF model changes.