Skip to content

feat(cwx): add right-click context menu to CWX history bubbles#2752

Merged
ten9876 merged 1 commit into
aethersdr:mainfrom
NF0T:feat/cwx-history-context-menu
May 16, 2026
Merged

feat(cwx): add right-click context menu to CWX history bubbles#2752
ten9876 merged 1 commit into
aethersdr:mainfrom
NF0T:feat/cwx-history-context-menu

Conversation

@NF0T

@NF0T NF0T commented May 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Right-clicking any message bubble in the CWX history panel now shows a context menu with two actions: Resend and Clear History
  • Resend re-queues the bubble's text via CwxModel::send(), creating a new history entry with a fresh timestamp — matching SmartSDR CWX behavior
  • Clear History removes all bubble widgets from the history scroll area, leaving the layout's stretch spacer intact

Implementation

CwxBubble gains a text() accessor. CwxPanel::eventFilter() is extended to intercept QEvent::ContextMenu on bubble objects via dynamic_cast (same translation unit — no Q_OBJECT / MOC change needed). Each bubble receives installEventFilter(this) on creation, covering both the normal sendBuffer() path and the new resendText() path.

No changes to CwxModel or any other file.

Behavior note

Resend carries no mode guard, consistent with the existing sendBuffer() / Send button path which also sends unconditionally. Whether cwx send should be blocked outside CW/CWL modes is an open question that applies equally to all CWX send paths. This is intentionally deferred — it can be addressed holistically in a future CWX improvements pass rather than introduced inconsistently on this path alone.

Test plan

  • Right-click a history bubble → context menu appears with Resend and Clear History
  • Resend → new bubble added to history with current timestamp; message queued to radio
  • Clear History → all bubbles removed; history area is empty
  • Right-click with no history present → no crash (no bubbles = no event filter targets)
  • Normal send (Enter / Send button) still works and bubbles remain right-clickable after Resend

🤖 Generated with Claude Code

Right-clicking any CwxBubble in the CWX history scroll area now shows
a context menu with two actions:

  Resend       — re-queues the bubble's text via CwxModel::send(),
                 creating a new history entry with a fresh timestamp.
  Clear History — removes all bubble widgets from the history layout,
                 leaving the stretch spacer intact.

Implementation notes:
- CwxBubble gains a text() accessor; CwxPanel::eventFilter() is
  extended to intercept QEvent::ContextMenu on bubble objects via
  dynamic_cast (same TU, no Q_OBJECT / MOC change needed).
- Each bubble gets installEventFilter(this) on creation (sendBuffer
  and resendText paths).
- Menu styling matches the existing #1a2a3a dark theme.

No mode guard is added to Resend. This is intentional — it follows
the established pattern of sendBuffer() (Enter / Send button), which
also sends unconditionally. Whether cwx send should be blocked outside
CW/CWL mode is an open question that applies equally to all CWX send
paths and is tracked for a future CWX improvements pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@NF0T NF0T requested review from jensenpat and ten9876 as code owners May 16, 2026 19:52
@ten9876 ten9876 merged commit fb63520 into aethersdr:main May 16, 2026
5 checks passed
@ten9876

ten9876 commented May 16, 2026

Copy link
Copy Markdown
Collaborator

Claude here — landed at 22:26 UTC. Thanks Ryan, that's three contributions today! 🎉

Smooth implementation — using dynamic_cast instead of MOC because CwxBubble is in the same translation unit is the kind of choice that makes the diff small without sacrificing safety, and the stretch-spacer-at-index-0 comment (with the matching count > 1 loop in clearHistory) makes the invariant explicit for future readers. Style sheet matches the existing context-menu pattern over in SpectrumWidget.cpp — consistent rather than novel.

The decision to defer the mode guard ("send outside CW/CWL?") is also right — it applies equally to every CWX send path, so handling it consistently in a future pass beats introducing it on only one of them.

Three PRs today (#2745, #2747, #2752), three different code paths, three clean landings. Stellar day of contributions.

73, Jeremy KK7GWY & Claude (AI dev partner)

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