Skip to content

fix(ios): keep the generated password stable and unclipped at large text sizes - #1435

Merged
rjzondervan merged 3 commits into
developmentfrom
fix/ios-generator-audit-clipping
Nov 3, 2026
Merged

rjzondervan merged 3 commits into
developmentfrom
fix/ios-generator-audit-clipping

Conversation

@rjzondervan

Copy link
Copy Markdown
Member

Fixes the flaky iOS accessibility audit (AccessibilityAuditUITests.testMainScreensPassTheAccessibilityAudit, ios job in mobile-e2e.yml). It failed on 2 of the last 14 completed runs with one finding, for example https://github.com/ConductionNL/keepiq/actions/runs/41620851934/job/125865873362:

generator: textClipped: Text clipped [type 48, id 'generated', label 'bye9WijRiJHHye']

Cause

  1. The value was squeezed. The generated value shared one HStack with a Spacer, the regenerate button and Copy/Use. At accessibility text sizes the buttons grow and push the value into a narrow column, and a random password has no word break to wrap at.
  2. The value changed on every redraw. GeneratorView.body called tryGenerate directly, so a Dynamic Type change during the audit, or the toast after Copy, drew a new password. That also caused a user-facing bug: right after Copy, the screen could show a different password from the one just copied.

Changes

  • Generator:
    • The value is kept in @State. A new one is generated on first appearance, when a setting or the organisation policy changes, and when regenerate is tapped. It now stays the same when you return to the tab, as on Android (GeneratorScreen.kt).
    • At accessibility sizes the row becomes a VStack: the value on its own full-width line, the buttons below. This is the AnyLayout pattern FieldRow already uses.
  • One-time code row (TotpRow): the same layout switch.
  • Wrapping (FieldRow.breakableLongRuns):
    • Inside a run of more than 10 characters without a space or hyphen, a zero-width space after each character lets the text wrap anywhere.
    • Shorter runs keep their natural breaks. The longest word in eff-large.txt is 9 letters, so passphrase words stay whole.
    • Applied to the generated value and to a shown masked value in FieldRow. Only the drawn text changes: Copy, Use, VoiceOver (accessibilityLabel) and the UI tests' labels keep the raw value.
  • No audit exclusion added.

Checks run

  • Pre-push adversarial review. Nothing blocking. It confirmed:

    • Copy and Use act on the raw value in every path;
    • the label and identifier sit on the same element, with no combined parent;
    • every UI-test reader of generated matches on the label;
    • every generator setting still regenerates.

    Its nit (passphrases wrapping mid-word) is fixed in 1fde5ef.

  • Flake measurement over the last 40 mobile-e2e.yml runs. Of the 14 iOS jobs that ran to the end, 2 failed on this finding and 8 on the PasskeyUITests failure that test(review): #1349 make the iOS passkey UI test pass with passkeys on logins #1432 fixes. Every generated value was 14 characters in a monospaced font, so the width of the value is not what triggers it.

  • not run: the iOS build and UI tests, since there is no macOS here. This PR's mobile-e2e.yml run and a few manual re-runs on the branch are the proof. Because the flake was about 1 in 7, one green run is not enough.

🤖 Generated with Claude Code

rjzondervan and others added 2 commits November 3, 2026 13:34
…ext sizes

The accessibility audit (AccessibilityAuditUITests, the generator screen)
sometimes fails with one textClipped finding on the 'generated' text, e.g.
https://github.com/ConductionNL/keepiq/actions/runs/41620851934/job/125865873362

Measured over the last 40 mobile-e2e runs: 14 ios jobs completed (the rest
were cancelled), 2 of them (about 1 in 7) had this finding, on
'wr5gv4qEUUnjXK' and 'bye9WijRiJHHye'. Every value is 14 characters of
letters and digits (the default settings) in a monospaced font, so every
value has the same width: the value itself does not decide the outcome.
The other failing ios jobs failed on PasskeyUITests, with 0 audit issues.

Two causes:
- The row put the value, the regenerate button and Copy/Use side by side.
  At the accessibility text sizes the buttons grow and squeeze the value
  into a narrow column, and a password has no word break to wrap at.
- The value was generated inside body, so every redraw (a Dynamic Type
  change during the audit, the toast after Copy) showed a new password.
  The audit can measure one value and find another, and the user could
  copy one value and then see a different one.

The value now lives in state and is made on appear, on a change of the
settings or the policy, and on regenerate. At the accessibility sizes the
row lays out as a VStack (value on its own full-width line, buttons in a
row below), as FieldRow already does, and the drawn value carries a
zero-width space after every character so it wraps anywhere; the
accessibility label, identifier, 44 pt targets and button actions stay.

Same class: a shown password in FieldRow now wraps anywhere too, and the
one-time code row puts its countdown and Copy under the code at the
accessibility sizes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hrases

breakableAnywhere put a zero-width space after every character of every
value, so a generated passphrase (Lantern-Orbit-...) and a shown password
with spaces or hyphens wrapped mid-word, even at normal text sizes.

One helper, breakableLongRuns, now used by the generator and FieldRow:
the value is split at whitespace and hyphens (its natural breaks), and
only a run of more than 10 characters gets a zero-width space after every
character. A random password (one long run) still wraps anywhere at the
largest sizes; a passphrase keeps its words whole, as EFF words are at
most 9 letters plus an optional digit. Chosen over a passphrase flag in
the generator plus a whitespace/hyphen test in FieldRow because one rule
covers both places, and also a passphrase whose separator is not a break
character. The accessibility labels and Copy/Use keep the raw value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ 17986d0

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 661/661
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ⏭️ not run for this diff — no file in this diff matches the code globs, and none carries a source extension — the heavy tier has nothing to decide about it.
Newman ✅ 177/177 · 20 skipped
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-11-03 13:08 UTC

Download the full PDF report from the workflow artifacts.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ 070cf91

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 661/661
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ⏭️ not run for this diff — no file in this diff matches the code globs, and none carries a source extension — the heavy tier has nothing to decide about it.
Newman ✅ 177/177 · 20 skipped
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-11-03 14:26 UTC

Download the full PDF report from the workflow artifacts.

@rjzondervan
rjzondervan merged commit 6de1da3 into development Nov 3, 2026
58 checks passed
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.

1 participant