Skip to content

feat(mqtt): show internal publish topics in Publish Buttons settings tab#3251

Merged
ten9876 merged 4 commits into
aethersdr:mainfrom
K5PTB:feat/mqtt-publish-info-panel
May 29, 2026
Merged

feat(mqtt): show internal publish topics in Publish Buttons settings tab#3251
ten9876 merged 4 commits into
aethersdr:mainfrom
K5PTB:feat/mqtt-publish-info-panel

Conversation

@K5PTB

@K5PTB K5PTB commented May 28, 2026

Copy link
Copy Markdown
Contributor

Closes #3249.

Summary

The Subscriptions tab already has an Internal AetherSDR Topics group box listing topics AetherSDR subscribes to automatically. The Publish Buttons tab had no equivalent, leaving aethersdr/cw/decode — published for every decoded CW character since #3216 — undiscoverable without reading source.

  • Adds a matching read-only group box to the bottom of the Publish Buttons tab; label text is mouse-selectable for copy-paste into subscriber configs
  • Adds internalMqttPublishTopics() to MqttSettings.h/.cpp alongside the existing internalMqttSubscriptionTopics() for a machine-readable topic list
  • Extracts the hardcoded "aethersdr/cw/decode" string into inline constexpr QLatin1String kCwDecodeTopic in MqttSettings.h; the publish call in MainWindow and the new settings panel now share the same definition — addressing the minor observation from the feat(mqtt): publish CW decoded text to aethersdr/cw/decode #3216 review

Files changed

File Change
src/core/MqttSettings.h kCwDecodeTopic constant + internalMqttPublishTopics() declaration
src/core/MqttSettings.cpp internalMqttPublishTopics() implementation
src/gui/MqttSettingsDialog.cpp Group box added to Publish Buttons tab
src/gui/MainWindow.cpp Publish call uses kCwDecodeTopic

Test plan

  • Build clean (macOS, no warnings from changed files)
  • MQTT settings dialog → Publish Buttons tab shows Internal AetherSDR Topics group box with aethersdr/cw/decode
  • Label text is mouse-selectable
  • Subscriptions tab unchanged
  • No behavior change — UI only

🤖 Generated with Claude Code

K5PTB and others added 3 commits May 28, 2026 16:29
Mirrors the "Internal AetherSDR Topics" group box already present in
the Subscriptions tab — adds an equivalent read-only panel to the bottom
of the Publish Buttons tab listing aethersdr/cw/decode with its payload
format and rx-flag description.

Adds internalMqttPublishTopics() to MqttSettings for a machine-readable
topic list alongside the existing internalMqttSubscriptionTopics().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nfo panel

Addresses the minor observation from the aethersdr#3216 review — factors out
"aethersdr/cw/decode" into an inline constexpr QLatin1String in
MqttSettings.h so the call site in MainWindow and the new settings
dialog info panel share the same definition and can't drift.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove payload example and rx-flag description from the group box;
keep it minimal to match the style of the Subscriptions tab.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@K5PTB K5PTB requested a review from a team as a code owner May 28, 2026 22:30

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice symmetric addition — discoverability fix is well-targeted and the kCwDecodeTopic extraction tidies up the #3216 loose end. Thanks @K5PTB.

One concrete suggestion:

Use internalMqttPublishTopics() in the GUI to fully mirror the Subscriptions tab.

src/gui/MqttSettingsDialog.cpp:166-173 (existing Subscriptions panel) renders via:

.arg(internalMqttSubscriptionTopics().join(QStringLiteral("\n")))

But the new Publish panel hardcodes the single topic instead of going through the function it just introduced:

.arg(QLatin1String(kCwDecodeTopic))

You added internalMqttPublishTopics() precisely so callers can enumerate without touching the dialog — but then the dialog doesn't enumerate. Suggest:

auto* pubInternalText = new QLabel(
    tr("Published automatically whenever MQTT is connected; these topics are not user-configurable:\n%1")
        .arg(internalMqttPublishTopics().join(QStringLiteral("\n"))));

That way next time something like kCwDecodeTopic gets added (aethersdr/audio/level, whatever), it shows up in the dialog automatically — same future-proofing the Subscriptions tab already has. It also keeps the two panels visually parallel in the source, which matches how they read in the UI.

Rest LGTM:

  • inline constexpr QLatin1String kCwDecodeTopic in the header is correct C++20 — single ODR-safe definition, no link issues.
  • The MainWindow.cpp swap to QString(kCwDecodeTopic) preserves the original semantics (was QStringLiteral, now an implicit QLatin1String → QString conversion at the publish call; both produce the same on-the-wire topic).
  • Scope is tight, no behavior change beyond the new read-only label, no AppSettings/RAII concerns.

No blockers — the function-vs-constant nit is the only thing worth a follow-up commit if you agree.


🤖 aethersdr-agent · cost: $3.4008 · model: claude-opus-4-7

jensenpat
jensenpat previously approved these changes May 29, 2026

@jensenpat jensenpat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Paul for the MQTT dictionary. Do me a favor, please ask your agent to set up SSH commit signing for Github so I can speed up merging your fixes. Cheers

…tin1 at publish site

- Dialog label now mirrors the subscribe-side pattern by calling
  internalMqttPublishTopics().join("\n"). The function was declared
  but unused; this makes future topic additions a one-line change to
  MqttSettings.cpp instead of touching the dialog wiring too.
- Publish callsite swapped to QString::fromLatin1(kCwDecodeTopic) to
  avoid the implicit Latin1 → UTF-16 conversion via the QString(QLatin1String)
  constructor every CW decode.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@K5PTB

K5PTB commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

@jensenpat

Thanks Paul for the MQTT dictionary. Do me a favor, please ask your agent to set up SSH commit signing for Github so I can speed up merging your fixes. Cheers

Done. I'm new to using GitHub, so I didn't know about this.

@ten9876 ten9876 merged commit 45ecdbd into aethersdr:main May 29, 2026
5 checks passed
@K5PTB K5PTB deleted the feat/mqtt-publish-info-panel branch May 29, 2026 15:24
G6PWY-Chris pushed a commit to G6PWY-Chris/AetherSDR that referenced this pull request Jun 22, 2026
…tab (aethersdr#3251)

Closes aethersdr#3249.

## Summary

The Subscriptions tab already has an **Internal AetherSDR Topics** group
box listing topics AetherSDR subscribes to automatically. The Publish
Buttons tab had no equivalent, leaving `aethersdr/cw/decode` — published
for every decoded CW character since aethersdr#3216 — undiscoverable without
reading source.

- Adds a matching read-only group box to the bottom of the Publish
Buttons tab; label text is mouse-selectable for copy-paste into
subscriber configs
- Adds `internalMqttPublishTopics()` to `MqttSettings.h/.cpp` alongside
the existing `internalMqttSubscriptionTopics()` for a machine-readable
topic list
- Extracts the hardcoded `"aethersdr/cw/decode"` string into `inline
constexpr QLatin1String kCwDecodeTopic` in `MqttSettings.h`; the publish
call in `MainWindow` and the new settings panel now share the same
definition — addressing the minor observation from the aethersdr#3216 review

## Files changed

| File | Change |
|---|---|
| `src/core/MqttSettings.h` | `kCwDecodeTopic` constant +
`internalMqttPublishTopics()` declaration |
| `src/core/MqttSettings.cpp` | `internalMqttPublishTopics()`
implementation |
| `src/gui/MqttSettingsDialog.cpp` | Group box added to Publish Buttons
tab |
| `src/gui/MainWindow.cpp` | Publish call uses `kCwDecodeTopic` |

## Test plan

- [x] Build clean (macOS, no warnings from changed files)
- [x] MQTT settings dialog → Publish Buttons tab shows **Internal
AetherSDR Topics** group box with `aethersdr/cw/decode`
- [x] Label text is mouse-selectable
- [x] Subscriptions tab unchanged
- [x] No behavior change — UI only

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Jeremy Fielder <kk7gwy@aethersdr.com>
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.

feat(mqtt): show internal publish topics in Publish Buttons settings tab

3 participants