From 8312a842c1a3fbbc76650092b06c64a060c3d534 Mon Sep 17 00:00:00 2001 From: Harley Richardson Date: Tue, 17 Feb 2026 19:21:36 +0000 Subject: [PATCH] Fix duplicate role name when aria-roledescription is present When an element has aria-roledescription (e.g. Discord messages use 'Message'), _generateRoleName was adding both the roledescription AND the standard localized role name (e.g. 'article'). This resulted in the role being announced twice. The aria-roledescription attribute is intended to replace the standard role name, not supplement it. Return early after adding the roledescription to match Orca's behavior. --- src/cthulhu/scripts/web/speech_generator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cthulhu/scripts/web/speech_generator.py b/src/cthulhu/scripts/web/speech_generator.py index b420214..11b57f2 100644 --- a/src/cthulhu/scripts/web/speech_generator.py +++ b/src/cthulhu/scripts/web/speech_generator.py @@ -560,6 +560,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator): if roledescription: result = [roledescription] result.extend(self.voice(speech_generator.SYSTEM, obj=obj, **args)) + # aria-roledescription replaces the standard role name, so return + # early to avoid announcing both (e.g. "Message" + "article"). + return result role = args.get('role', AXObject.get_role(obj)) roleSoundPresentation = cthulhu.cthulhuApp.settingsManager.getSetting('roleSoundPresentation')