Repository navigation
fix(harmonyos): label snapshot nodes with their visible text - #4926
Conversation
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 68bf549. The verdict and the full list are in the summary comment.
|
This head (68bf549) conflicts with |
ArkUI reports a control's words outside the control. A `Toggle` answers with its resource id
(`entry_toggle_usb_debug`) and no text; the words on the screen ("USB debugging") are a sibling
`Text` of the row container, and every such container reports the same `id`
(`SwitchMenuComponent`). An icon-only `Button` answers with neither. The mapping had nowhere to
take the words from, so `label` fell through to the id and `snapshot -i` printed
`entry_toggle_usb_debug` (#4906).
Read them off the control's row: the nearest container that holds the control and no other
control, which is the settings row of a `Toggle` and the title bar of a back `Button`. A control
that holds another control takes no label, because those words are the nested control's own and
both would answer one selector. Borrowed text has to contain a letter, so the clock digits and
padding blanks ArkUI also reports stay out of labels while a node's own `value` keeps reporting
them unchanged. The resource id stays the node's `identifier`, and a node's own accessibility
description still wins.
That fixes #4907 at this site. The back button carried no label of its own, so its press fell
through to the nearest label in the whole capture, which was the merged status-bar window's
`StatusBarBridgeView`, 136 px above it. The title bar now names the button, so the press reports
"Developer options" and that fallback never runs. A control whose row renders no words still
reports none, which is what a press on one should say.
Two passes over the captured tree, so no capture pays for it twice. Live-verified on a nova 14
(OpenHarmony 6.1.1) in Settings > Developer options.
A screen holding exactly one control made every ancestor of that control, up to and including the capture root, a "container with one control". An icon-only FAB whose nearest words were hundreds of pixels away therefore read the first words of the whole document — the headline — as its own label, and `find`/`label="<headline>"` matched the button as well as the headline's own `Text`. The row assignment was inherited by every node below a one-control container too, so an unclickable icon wrapper inside a clickable title bar borrowed the title bar's first words from a branch it does not sit in. Read each node's row from its own ancestors instead of inheriting one, and hold a container to a row's own size: it counts as the control's row only when the control's parsed bounds sit inside it and it stands no taller than four times the control. Both already-shaped rows survive that bound — across the real captures the container around a leaf control reaches at most 3.5 times its height — while the column and screen containers above a lone control reach ten or more. The settings rows still answer "USB debugging" and the back button still answers "Developer options"; a lone control on a full-height page now reports no label at all.
This comment has been minimized.
This comment has been minimized.
d58def2 to
3b3f24c
Compare
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
packages/platform-harmonyos/src/snapshot.ts:76 |
🆕 Row height bound of 4x silently drops labels on rows taller than 4x a small control |
1 finding below minor hidden (user_settings.min_severity).
Reviewed with this repository's own Sentinel configuration (d6767e0910fc).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 3b3f24c. The verdict and the full list are in the summary comment.
|
The code at 3b3f24c is ready, and the 16 checks are green with none failing. Not blocking: Not verified here: tests were not run locally, the live device transcript comes from the PR body, how Both earlier inline threads no longer apply, so they can be resolved. The lone-control-on-a-full-screen-page thread is fixed by the row height bound and its test: #4926 (comment). The thread on the 4x bound dropping labels on tall rows is benign, because a dropped label matches base behavior: #4926 (comment). |
* fix(harmonyos): label snapshot nodes with their visible text
ArkUI reports a control's words outside the control. A `Toggle` answers with its resource id
(`entry_toggle_usb_debug`) and no text; the words on the screen ("USB debugging") are a sibling
`Text` of the row container, and every such container reports the same `id`
(`SwitchMenuComponent`). An icon-only `Button` answers with neither. The mapping had nowhere to
take the words from, so `label` fell through to the id and `snapshot -i` printed
`entry_toggle_usb_debug` (#4906).
Read them off the control's row: the nearest container that holds the control and no other
control, which is the settings row of a `Toggle` and the title bar of a back `Button`. A control
that holds another control takes no label, because those words are the nested control's own and
both would answer one selector. Borrowed text has to contain a letter, so the clock digits and
padding blanks ArkUI also reports stay out of labels while a node's own `value` keeps reporting
them unchanged. The resource id stays the node's `identifier`, and a node's own accessibility
description still wins.
That fixes #4907 at this site. The back button carried no label of its own, so its press fell
through to the nearest label in the whole capture, which was the merged status-bar window's
`StatusBarBridgeView`, 136 px above it. The title bar now names the button, so the press reports
"Developer options" and that fallback never runs. A control whose row renders no words still
reports none, which is what a press on one should say.
Two passes over the captured tree, so no capture pays for it twice. Live-verified on a nova 14
(OpenHarmony 6.1.1) in Settings > Developer options.
* fix(harmonyos): bound a control's borrowed row to a row's own size
A screen holding exactly one control made every ancestor of that control, up to and including the
capture root, a "container with one control". An icon-only FAB whose nearest words were hundreds of
pixels away therefore read the first words of the whole document — the headline — as its own label,
and `find`/`label="<headline>"` matched the button as well as the headline's own `Text`. The row
assignment was inherited by every node below a one-control container too, so an unclickable icon
wrapper inside a clickable title bar borrowed the title bar's first words from a branch it does not
sit in.
Read each node's row from its own ancestors instead of inheriting one, and hold a container to a
row's own size: it counts as the control's row only when the control's parsed bounds sit inside it
and it stands no taller than four times the control. Both already-shaped rows survive that bound —
across the real captures the container around a leaf control reaches at most 3.5 times its height —
while the column and screen containers above a lone control reach ten or more. The settings rows
still answer "USB debugging" and the back button still answers "Developer options"; a lone control
on a full-height page now reports no label at all.
…ck#4926) * fix(harmonyos): label snapshot nodes with their visible text ArkUI reports a control's words outside the control. A `Toggle` answers with its resource id (`entry_toggle_usb_debug`) and no text; the words on the screen ("USB debugging") are a sibling `Text` of the row container, and every such container reports the same `id` (`SwitchMenuComponent`). An icon-only `Button` answers with neither. The mapping had nowhere to take the words from, so `label` fell through to the id and `snapshot -i` printed `entry_toggle_usb_debug` (callstack#4906). Read them off the control's row: the nearest container that holds the control and no other control, which is the settings row of a `Toggle` and the title bar of a back `Button`. A control that holds another control takes no label, because those words are the nested control's own and both would answer one selector. Borrowed text has to contain a letter, so the clock digits and padding blanks ArkUI also reports stay out of labels while a node's own `value` keeps reporting them unchanged. The resource id stays the node's `identifier`, and a node's own accessibility description still wins. That fixes callstack#4907 at this site. The back button carried no label of its own, so its press fell through to the nearest label in the whole capture, which was the merged status-bar window's `StatusBarBridgeView`, 136 px above it. The title bar now names the button, so the press reports "Developer options" and that fallback never runs. A control whose row renders no words still reports none, which is what a press on one should say. Two passes over the captured tree, so no capture pays for it twice. Live-verified on a nova 14 (OpenHarmony 6.1.1) in Settings > Developer options. * fix(harmonyos): bound a control's borrowed row to a row's own size A screen holding exactly one control made every ancestor of that control, up to and including the capture root, a "container with one control". An icon-only FAB whose nearest words were hundreds of pixels away therefore read the first words of the whole document — the headline — as its own label, and `find`/`label="<headline>"` matched the button as well as the headline's own `Text`. The row assignment was inherited by every node below a one-control container too, so an unclickable icon wrapper inside a clickable title bar borrowed the title bar's first words from a branch it does not sit in. Read each node's row from its own ancestors instead of inheriting one, and hold a container to a row's own size: it counts as the control's row only when the control's parsed bounds sit inside it and it stands no taller than four times the control. Both already-shaped rows survive that bound — across the real captures the container around a leaf control reaches at most 3.5 times its height — while the column and screen containers above a lone control reach ten or more. The settings rows still answer "USB debugging" and the back button still answers "Developer options"; a lone control on a full-height page now reports no label at all.
* fix(harmonyos): label snapshot nodes with their visible text
ArkUI reports a control's words outside the control. A `Toggle` answers with its resource id
(`entry_toggle_usb_debug`) and no text; the words on the screen ("USB debugging") are a sibling
`Text` of the row container, and every such container reports the same `id`
(`SwitchMenuComponent`). An icon-only `Button` answers with neither. The mapping had nowhere to
take the words from, so `label` fell through to the id and `snapshot -i` printed
`entry_toggle_usb_debug` (#4906).
Read them off the control's row: the nearest container that holds the control and no other
control, which is the settings row of a `Toggle` and the title bar of a back `Button`. A control
that holds another control takes no label, because those words are the nested control's own and
both would answer one selector. Borrowed text has to contain a letter, so the clock digits and
padding blanks ArkUI also reports stay out of labels while a node's own `value` keeps reporting
them unchanged. The resource id stays the node's `identifier`, and a node's own accessibility
description still wins.
That fixes #4907 at this site. The back button carried no label of its own, so its press fell
through to the nearest label in the whole capture, which was the merged status-bar window's
`StatusBarBridgeView`, 136 px above it. The title bar now names the button, so the press reports
"Developer options" and that fallback never runs. A control whose row renders no words still
reports none, which is what a press on one should say.
Two passes over the captured tree, so no capture pays for it twice. Live-verified on a nova 14
(OpenHarmony 6.1.1) in Settings > Developer options.
* fix(harmonyos): bound a control's borrowed row to a row's own size
A screen holding exactly one control made every ancestor of that control, up to and including the
capture root, a "container with one control". An icon-only FAB whose nearest words were hundreds of
pixels away therefore read the first words of the whole document — the headline — as its own label,
and `find`/`label="<headline>"` matched the button as well as the headline's own `Text`. The row
assignment was inherited by every node below a one-control container too, so an unclickable icon
wrapper inside a clickable title bar borrowed the title bar's first words from a branch it does not
sit in.
Read each node's row from its own ancestors instead of inheriting one, and hold a container to a
row's own size: it counts as the control's row only when the control's parsed bounds sit inside it
and it stands no taller than four times the control. Both already-shaped rows survive that bound —
across the real captures the container around a leaf control reaches at most 3.5 times its height —
while the column and screen containers above a lone control reach ten or more. The settings rows
still answer "USB debugging" and the back button still answers "Developer options"; a lone control
on a full-height page now reports no label at all.
Summary
ArkUI reports a control's words outside the control. A
Toggleanswers with its resource id and no text; the string on the screen is a siblingTextof the row container, and every such container reports the sameid(SwitchMenuComponent). The mapping had nowhere to take the words from, solabelfell through to the id (#4906).It now reads them off the control's row: the nearest container that holds the control and no other control. That is the settings row of a
Toggle, and the title bar of a backButton. A control holding another control takes no label — those words are the nested control's own, and both would answer one selector. Borrowed text must contain a letter, so the clock digits and padding blanks ArkUI also reports stay out of labels while a node's ownvaluereports them unchanged. The resource id stays theidentifier.That fixes #4907 at this site: the unlabeled back button's press fell through to the nearest label in the whole capture, the merged status-bar window's
StatusBarBridgeView, 136 px above it. The title bar now names the button.Fixes #4906
Fixes #4907
Before / after
snapshot -ion Settings > Developer options:Validation
pnpm lint,pnpm typecheck,pnpm format,pnpm check:layering,pnpm run check:package,npx vitest run --project unit-core(all green)0.22, pass here4UQ9K25710015363), branch CLI, isolated home:Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.