Skip to content

[ux] Fix CWX Live toggle and Send action#2122

Merged
ten9876 merged 1 commit intoten9876:mainfrom
jensenpat:aether/cwx-live-toggle-send
Apr 28, 2026
Merged

[ux] Fix CWX Live toggle and Send action#2122
ten9876 merged 1 commit intoten9876:mainfrom
jensenpat:aether/cwx-live-toggle-send

Conversation

@jensenpat
Copy link
Copy Markdown
Collaborator

@jensenpat jensenpat commented Apr 28, 2026

Summary

  • Make the CWX Live button a true toggle so operators can turn live keying back off.
  • Make the CWX Send button submit the current input when Live is off, matching the existing Enter key behavior.
  • Turn Live off when entering Setup, and make Send exit Live without duplicate-sending text that may already have been keyed character-by-character.
  • Add a focused cwx_panel_test harness covering Live toggling, Send-click submission, Enter submission, and Live exit safety.
  • Matches SmartSDR Windows tested behavior.

Root Cause

The CWX bottom bar treated Send, Live, and Setup as mutually exclusive mode buttons. Clicking Live always forced the model into live mode, so a second click could not turn it off. The Send button only selected send mode instead of sending the current buffer, while Enter already sent the buffer from the input event path.

Testing

  • cmake --build build -- -j10
  • ./build/cwx_panel_test

👨🏼‍💻 Generated with OpenAI Codex (GPT-5.5 Pro 4/23) and tested by @jensenpat

@jensenpat jensenpat changed the title Fix CWX Live toggle and Send action [ux] Fix CWX Live toggle and Send action Apr 28, 2026
@jensenpat jensenpat marked this pull request as ready for review April 28, 2026 03:34
Copy link
Copy Markdown
Contributor

@aethersdr-agent aethersdr-agent Bot left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, @jensenpat — the Live toggle fix and the Send-click behavior are solid improvements that match what operators expect from SmartSDR.

Overall: Looks good. The logic is clean, the test coverage is focused and useful, and the scope is tight. A few observations:

Things I like

  • Live toggle via clicked(bool on) — simple and correct. The old code always forced live-on; passing the toggled state through to setLive(on) is the right fix.
  • Send-while-live safety — checking wasLive before calling sendBuffer() avoids double-sending text that was already keyed character-by-character. Good edge case handling.
  • QSignalBlocker in setModel() and liveChanged — prevents re-entrant toggling when syncing UI state from the model. This is the right pattern.
  • Test harness — the cwx_panel_test exercises the key scenarios (toggle off, send-when-not-live, enter-key, no-duplicate-send-while-live, setup-exits-live). Practical and readable.

Minor items (non-blocking)

  1. m_sendBtn is no longer checkable — the PR removes setCheckable(true) and setChecked(true) from the Send button, which is correct since it's now an action button rather than a mode toggle. Just worth noting that any external code checking m_sendBtn->isChecked() would break, but I don't see any such callers in the codebase.

  2. sendBuffer() null safety — the sendBuffer() path already guards on !m_model, so the Send-click lambda's call to sendBuffer() when !wasLive is safe. Good.

  3. Test doesn't use CTest/QTest — the test uses a custom report() harness rather than QTest or CTest integration. This is fine for a focused panel test, and it matches the existing cw_sidetone_test pattern in the CMakeLists. If the project moves toward CTest registration in the future, these could be wrapped, but that's not a concern for this PR.

  4. CMakeLists scope — the new test target links CwxPanel.cpp and CwxModel.cpp directly rather than linking against a shared library. This matches how cw_sidetone_test and meter_model_test are already set up, so it's consistent with project conventions.

No blocking issues found. Nice work matching the SmartSDR Windows behavior here.

@ten9876 ten9876 merged commit 84af002 into ten9876:main Apr 28, 2026
5 checks passed
@jensenpat jensenpat deleted the aether/cwx-live-toggle-send branch April 29, 2026 04:53
ten9876 added a commit that referenced this pull request Apr 29, 2026
Community-driven release.  WAVE Phase 2 visualization (#2124),
DAX-aware TCI multi-stream routing for FlexRadio firmware 4.2.18
(#2140), TCXO frequency-offset calibration (#2119), VFO marker
tri-state UX (#2141), v4.2.18 discovery beacon parsing (#2138).
Bug fixes from the community: r8b heap corruption (#2114, NF0T),
serial PTT triple-fix (#2125, chibondking), slice-audio mute on
band change (#2128, jensenpat), CWX Live toggle (#2122, jensenpat),
connect-radio dialog polish (#2121, jensenpat).

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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