Skip to content

Speak "Sound ahead" instead of "Sound from your ahead" - #3

Merged
costajohnt merged 3 commits into
mainfrom
claude/repo-audit-cleanup-qlitxv
Oct 10, 2026
Merged

costajohnt merged 3 commits into
mainfrom
claude/repo-audit-cleanup-qlitxv

Conversation

@costajohnt

@costajohnt costajohnt commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Unlabeled speech announcements built "Sound from your \(word)", so a centred source was spoken as "Sound from your ahead". Each direction bucket now has its own full localized sentence. The new direction-0 test also found that a first sound that is centred and unlabeled was never announced at all; that is fixed too.

Changes

  • Shared/DirectionLabel.swift: new spokenSentence(direction:) returning "Sound from your far left", "Sound from your left", "Sound ahead", "Sound from your right", "Sound from your far right" (same bucket boundaries as spokenPhrase).
  • SoundCompass/Services/SpeechAnnouncer.swift:
    • The no-label branch uses spokenSentence. The labelled form ("car horn ahead") is unchanged.
    • The repeat filter compared against lastDirection = 0 / lastLabel = nil before anything had been announced, so a first sound at direction 0 with no label matched that empty state and was dropped. lastDirection is now optional (nil = nothing announced yet) so the first sound always speaks.
  • SoundCompass/Intents/SoundCompassIntents.swift: the Announce Direction intent had the same "Sound from your ahead." bug; it now uses spokenSentence too (and is localized as a side effect).
  • Localizable.strings (en, es): replaced the "Sound from your %@" key with the five sentence keys. Spanish output is the same as before ("Sonido delante", "Sonido a la izquierda", ...).
  • Tests: SpeechAnnouncerTests.testCenteredPhraseWithoutLabelIsGrammatical (direction 0, label nil, expects "Sound ahead"; failed in CI before the announcer fix), testFarRightPhraseWithoutLabel (empty label), and DirectionLabelTests.testSpokenSentenceBuckets.
  • .github/workflows/soundcompass.yml: the iOS job failed before building because the macos-15 runner image now defaults to Xcode 16.4, which has no iPhone 17 Pro simulator. The job now selects the newest non-beta Xcode on the runner and resolves the simulator by UDID, preferring iPhone 17 Pro and falling back to any available iPhone.

Testing

  • Swift cannot be built in this environment; GitHub Actions is the gate: iOS build and test (SoundCompass-iOS, 123 tests) and the watchOS build.

Fixes #2

Unlabeled announcements interpolated the bare direction word into
"Sound from your %@", so a centred source was spoken as "Sound from your
ahead". Add DirectionLabel.spokenSentence with one localized sentence per
bucket (English and Spanish), use it in SpeechAnnouncer and the Announce
Direction intent, and cover direction 0 without a label in tests.

Fixes #2
The macos-15 runner image now defaults to Xcode 16.4, which has no iPhone
17 Pro simulator, so the iOS test job failed before building. Select the
newest non-beta Xcode on the runner and resolve the simulator by UDID,
preferring iPhone 17 Pro and falling back to any available iPhone.
The repeat filter compared against lastDirection = 0 and lastLabel = nil
before anything had been announced, so a first sound at direction 0 with
no label matched the empty state and was silently dropped. Track "no
announcement yet" as nil so the first sound always speaks.
@costajohnt
costajohnt merged commit ac1eb3d into main Oct 10, 2026
3 of 4 checks passed
@costajohnt
costajohnt deleted the claude/repo-audit-cleanup-qlitxv branch October 10, 2026 14:32
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.

Spoken announcement says "Sound from your ahead" for centered, unlabeled sounds

2 participants