Skip to content

Make HUNT and CQ mutually exclusive#160

Merged
patrickrb merged 3 commits into
devfrom
feat/hunt-cq-toggle
Jun 8, 2026
Merged

Make HUNT and CQ mutually exclusive#160
patrickrb merged 3 commits into
devfrom
feat/hunt-cq-toggle

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

What

HUNT (auto-answer CQ) and the CQ button were independent controls, so both could be active at the same time — the confusing "crossover" between the two modes.

This makes them mutually exclusive in TxStrip:

  • HUNT on → the CQ button greys out (0.4 alpha) and stops responding to taps.
  • Running CQ (isActivated) → the HUNT pill greys out and stops responding to taps.
  • STOP returns to the neutral state where either mode can be selected again.

The && !huntEnabled / && !isActivated guards keep edge cases sane: if a QSO auto-starts while hunting, STOP still works and HUNT stays toggleable.

Testing

Built and installed on the Pixel 8 (gradlew.bat installDebug → BUILD SUCCESSFUL).

🤖 Generated with Claude Code

HUNT (auto-answer CQ) and the CQ button were independent, so both could
be active at once. Disable each while the other is selected: the CQ
button greys out and stops responding while HUNT is on, and the HUNT
pill greys out while you're actively running CQ. Pressing STOP returns
to the neutral state where either mode can be chosen again.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.37%. Comparing base (86e5518) to head (a55a2fc).
⚠️ Report is 13 commits behind head on dev.

Files with missing lines Patch % Lines
...kotlin/radio/ks3ckc/ft8us/ui/components/TxStrip.kt 0.00% 20 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##               dev    #160      +/-   ##
==========================================
+ Coverage     6.23%   6.37%   +0.13%     
- Complexity     669     678       +9     
==========================================
  Files          267     268       +1     
  Lines        30629   30841     +212     
  Branches      4774    4824      +50     
==========================================
+ Hits          1911    1967      +56     
- Misses       28577   28732     +155     
- Partials       141     142       +1     
Files with missing lines Coverage Δ
...kotlin/radio/ks3ckc/ft8us/ui/components/TxStrip.kt 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the TxStrip Compose UI to prevent users from entering conflicting transmit modes by making HUNT (auto-answer CQ) and CQ mutually exclusive, reducing confusing overlap between “running CQ” and “hunting”.

Changes:

  • Disable (grey out + ignore taps) the HUNT pill while isActivated is true (unless HUNT is already on).
  • Disable (grey out + ignore taps) the CQ button while HUNT is enabled (unless isActivated is true so STOP still works).
  • Adjust background/text colors to visually reflect disabled vs active states.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 160 to 164
modifier = Modifier
.clip(RoundedCornerShape(6.dp))
.background(huntBg)
.clickable { onToggleHunt() }
.then(if (huntDisabled) Modifier else Modifier.clickable { onToggleHunt() })
.padding(horizontal = 8.dp, vertical = 4.dp),
Comment on lines 195 to 202
modifier = Modifier
.clip(RoundedCornerShape(8.dp))
.background(buttonBg)
.clickable { if (isActivated) onStop() else onCallCQ() }
.then(
if (cqDisabled) Modifier
else Modifier.clickable { if (isActivated) onStop() else onCallCQ() }
)
.padding(horizontal = 18.dp, vertical = 9.dp),
patrickrb and others added 2 commits June 8, 2026 14:41
Address Copilot review on PR #160. The mutual-exclusion disable was done
by dropping the .clickable modifier entirely when a button shouldn't be
tappable, which also strips its button accessibility semantics -- TalkBack
sees no control at all rather than a disabled one.

Switch both the HUNT pill and the CQ/STOP button to
clickable(enabled = !disabled). Taps are ignored exactly as before, but
the control stays exposed to assistive tech as a disabled button. Also
simpler than the .then(if … else …) it replaces.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@patrickrb patrickrb merged commit 55c4243 into dev Jun 8, 2026
4 checks passed
@patrickrb patrickrb deleted the feat/hunt-cq-toggle branch June 8, 2026 20:01
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