fix(mobile): scope exact-label semantics to mention text

Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
Logan Johnson
2026-09-05 17:58:24 -04:00
parent 8489373925
commit 4e0054ff39

View File

@@ -868,14 +868,11 @@ class _MentionMd extends InlineMd {
RegExp(r'\(([0-9a-f]{64})\)'),
(m) => '(${m[1]!.substring(0, 8)}…${m[1]!.substring(60)})',
);
final pill = Semantics(
label: fullLabel,
excludeSemantics: true,
child: _MentionPill(
label: visibleLabel,
isAgent: isAgent,
textStyle: config.style,
),
final pill = _MentionPill(
label: visibleLabel,
semanticsLabel: fullLabel,
isAgent: isAgent,
textStyle: config.style,
);
return WidgetSpan(
@@ -890,11 +887,13 @@ class _MentionMd extends InlineMd {
class _MentionPill extends StatelessWidget {
final String label;
final String? semanticsLabel;
final bool isAgent;
final TextStyle? textStyle;
const _MentionPill({
required this.label,
this.semanticsLabel,
required this.isAgent,
this.textStyle,
});
@@ -941,7 +940,7 @@ class _MentionPill extends StatelessWidget {
offset: const Offset(0, -Grid.quarter),
child: Text('@', style: style),
),
Text(label, style: style),
Text(label, style: style, semanticsLabel: semanticsLabel),
],
),
);