fix(verifier): label editable fields by hint, not the typed value

an editable field's own text is its transient content; prefer the hint
so the field is named by purpose and the label stays stable.
This commit is contained in:
pj committed 2026-07-13 08:21:49 +05:30
1 parent 9845b89173
commit b65b8373e6
2 files changed
+26

No files matched your search

+7
View File
@@ -581,6 +581,13 @@ func buildNodeIndex(tree *hierarchy.Tree) map[*hierarchy.Element]*hierarchy.Node
// case that fixes empty-text Compose buttons whose word lives on a child), then
// its class as a last resort.
func visibleLabel(element *hierarchy.Element, nodeIndex map[*hierarchy.Element]*hierarchy.Node) string {
// An editable field's own text is the transient typed value ("1"); its hint
// names its purpose ("Amount") and stays stable, so prefer the hint there.
if element.Editable {
if hint := element.Attributes["hintText"]; hint != "" {
return truncateLabel(hint)
}
}
if element.Text != "" {
return truncateLabel(element.Text)
}