Skip to content

Gate dial/call buttons on call-link readiness#179

Open
quad341 wants to merge 3 commits into
mainfrom
builder/tincan-k5q7c-call-link-ready
Open

Gate dial/call buttons on call-link readiness#179
quad341 wants to merge 3 commits into
mainfrom
builder/tincan-k5q7c-call-link-ready

Conversation

@quad341

@quad341 quad341 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

The title-bar dial button and the per-conversation call button (thread header) now also gate on whether the phone's call link is actually ready to place a call, not just whether call setup succeeded. Previously, there was a brief window after call setup completed but before the underlying voice-call manager had actually bound where both buttons would appear enabled — tapping dial in that window risked a silent RuntimeError rather than a clean failure. Now there's a third disabled state: while the link isn't ready, both buttons show "Call link not ready — make sure your iPhone is nearby with Bluetooth on." with a matching accessible description, using the same disabled visual style already used for the other gated states.

Why built this way

The new flag defaults to False (conservative) rather than assumed-ready — the opposite default direction from the existing call_setup_ready flag, because a false positive here risks a silent dial() crash rather than just an unnecessary banner. Precedence matters: if call_setup_ready is false, that state still wins over the new link-not-ready state, since it reflects a more fundamentally broken condition.

Review notes

  • New branch inserted into the existing three-way _sync_call_state gating logic in both tincan_gui/main.py (title-bar button) and tincan_gui/thread_view.py (ThreadHeader.set_call_button) — reuses the existing disabled style and tooltip pattern, no new visual language.
  • Deliberately no new banner — this is meant to read as a transient, self-healing condition.
  • Also closes a pre-existing accessibility gap on both buttons: setAccessibleDescription is now paired with the existing tooltip, matching the precedent already used elsewhere (IncomingCallDialog.disable_answer).
  • The flag is intentionally left out of the two hardcoded fallback dicts used while GetStatus() is transiently unavailable, so the conservative default applies during exactly the window where the live state can't be verified either way.

Test plan

  • Full suite: pytest (headless) — 2478 passed, 1 skipped (pre-existing, unrelated to this change), 0 failed
  • 15 dedicated regression tests for the new three-way gating logic (disabled+tooltip+a11y, default-False-when-absent, disconnect reset, setup-ready-beats-link-ready precedence)
  • ruff check clean on all changed files
  • Release gate: release-gates/call-link-ready-k5q7c-gate.md

Bead: tincan-k5q7c

quad341 and others added 3 commits July 13, 2026 11:53
…rrent main (tincan-k5q7c)

Deploy gate for the originally reviewed commit (d7b2fe6, tincan-wcqn2)
failed: its merge-base was 27 commits behind origin/main and collided
with main's independently-added group-conversation plumbing plus an
unrelated ANCS constants change that had already shipped separately.

Reconciles by hand onto current origin/main instead of rebasing the
stale branch:
- call_link_ready gate re-applied inside _sync_call_state /
  _apply_capabilities in their current shape, preserving
  _current_is_group / set_group_mode untouched.
- Drops the stale ANCS_EXT_ADV_BUG/ANCS_EXPERIMENTAL_REQUIRED commit,
  which main already carries independently under different values.
- Adds the setAccessibleDescription pairing on ThreadHeader's call
  button (main.py's dial button already had it).
- Fixes a comment that mischaracterized call_link_ready as SCO/audio
  link state; it actually reflects CallController's VoiceCallManager
  modem binding (noted non-blocking in review).
- Updates test_dial_button_enabled_when_call_setup_ready's arrange
  step to also hold call_link_ready=True, matching the new second
  gating precondition (call_link_ready defaults False).

New-logic coverage remains deferred to tincan-piiml per the original
review. Full suite: 2463 passed, 1 skipped. ruff clean on changed
files.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…n-piiml)

Covers all 5 acceptance criteria: disabled state + tooltip/a11y copy when
call_link_ready is False, default-False when the key is absent (opposite
direction from call_setup_ready), _on_daemon_disconnected reset, and
precedence (call_setup_ready=False wins over call_link_ready=False).

Written against the already-merged tincan-uuia9 implementation per the
build-gated ordering documented in docs/plans/tincan-bhij3-wire-call-link-ready.md.
15/15 pass; mutation-tested by temporarily flipping the call_link_ready
default to confirm the AC2 tests fail under that regression.

Co-Authored-By: Claude Sonnet 5 <[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.

1 participant