Skip to content

material: a BackButton and a DataTable's checkboxes are named from the localizations - #3290

Merged
vanyastaff merged 3 commits into
mainfrom
claude/project-thread-5mrv8h
Dec 1, 2026
Merged

vanyastaff merged 3 commits into
mainfrom
claude/project-thread-5mrv8h

Conversation

@vanyastaff

@vanyastaff vanyastaff commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

The end-of-test audit of the material test migration found two unnamed controls. Screen readers heard them as a bare button and bare checkboxes. Both are now named from the ambient WidgetsLocalizations, read where the control is built, the same way #3264 named a chip's delete button.

  • BackButton reads WidgetsLocalizations::back_button_label ("Back"). Flutter 3.50.1 shows this string, MaterialLocalizations.backButtonTooltip, as the tooltip. Flutter's text-selection toolbar reads the same string for its back button, so one FLUI string serves both, and its doc now says so.
  • DataTable: the heading checkbox reads select_all_button_label ("Select all"), and each data row's checkbox reads the new select_row_label(row) ("Select row N", 1-based below the heading). Flutter 3.50.1's _buildCheckbox leaves both unnamed, so this goes beyond Flutter. The label is a Semantics around the checkbox inside the cell's container, so it names the checkbox's own node.

Changes

  • flui-widgets: WidgetsLocalizations::select_row_label(&self, row: usize) -> String is a new required method. It is implemented in DefaultWidgetsLocalizations, GlobalWidgetsLocalizations (forwarding) and the test impls. The doc of select_all_button_label covers the table heading, and the doc of back_button_label covers a page's back button.
  • flui-material: a crate-private ambient_strings(ctx, read) replaces the hand-written maybe_of plus English fallback from chip.rs. BackButton, Chip, FilterChip and DataTable read through it. The same pattern is open-coded in about ten places in flui-widgets; moving those into one shared form is a separate change.
  • Tests:
    • New: app_bar::a_back_button_is_named_in_the_ambient_language and data_table::the_checkboxes_are_named_in_the_ambient_language, each in English and German.
    • Changed: icon_face's BackButton row and every data_table test end with t.finish() instead of expecting the Unnamed findings. data_table's tests read the checkbox names first.
    • Changed: the implied back button is tapped by its name "Back", and the select-all checkbox by "Select all".
    • The German test localizations move from chip.rs into tests/common (in_german) with Flutter's German strings: "Zurück", "Alle auswählen", "Löschen". "Zeile N auswählen" is ours, since Flutter has no such string.
  • Records:

Expectations

No baseline changed: FLUI_PERF_BASELINE=check cargo test --locked -p flui-material --test perf passes. The tests that expected Unnamed findings now expect none, because the old expectation recorded the defect this PR fixes.

typos.toml gains one extend-ignore-re entry, the exact phrase Alle auswählen: it is Flutter's German selectAllButtonLabel, which the tests install to check that a name follows the locale, and typos reads Alle as an English misspelling. The entry matches only that phrase, so Alle elsewhere is still checked (typos 1.50.3 passes locally).

Test plan

  • cargo test --locked -p flui-material -p flui-widgets: all green.
  • cargo clippy --locked -p flui-material -p flui-widgets -p flui-cupertino --all-targets -- -D warnings is clean.
  • cargo fmt --all --check is clean.
  • cargo check --locked --workspace --all-targets is clean.
  • Broken on purpose, each restored:
    • the BackButton icon without its label fails icon_face's glyph test, tapping_the_implied_back_button_pops_the_route and a_back_button_is_named_in_the_ambient_language;
    • select_row_label(row_index) (0-based) fails five data_table tests.

Platforms: headless only; no native path changed.

Review

Read at head 1046e26 (base 2b71e11), review-before-merge with tier: "sonnet" (this PR is tests, records and a small fix): seven readers (records, tests, obligations, unwinding, boundaries, seams, rules) and a judge. The judge confirmed three nits and rejected nothing; none was left unaccounted for.

  1. No table mixes a selectable row with one without on_select_changed (data_table.rs:834). Fixed in 5f3aab7: the_checkboxes_are_named_in_the_ambient_language now has a middle row without a handler, so the disabled checkbox's name and the 1-based numbering across a mixed table (Select row 2, Select row 3) are read in every language. Class: every case in this PR that names a control is read through the case a user can reach; the BackButton tests already cover the override and the implied-pop paths.
  2. GlobalWidgetsLocalizations::select_row_label has no test (global_widgets_localizations.rs:165). Fixed in 5f3aab7: the same test runs the table under GlobalWidgetsLocalizationsDelegate with an en locale. A hand mutation of the forwarder (row + 1) fails it with "English under the global delegate: each checkbox is named". The other forwarders in that file are untested in the same way. That gap predates this PR and is not widened here.
  3. ambient_strings::ambient_strings repeats its module path (ambient_strings.rs:15). Fixed in 5f3aab7: the function is localized, called as localized(ctx, WidgetsLocalizations::back_button_label).

The fixes are tests and a crate-private rename, so no second round was run on them.

Also after the read: 08793e0 adds the typos.toml entry described under Expectations. CI's checks job was red on 1046e26 because typos read Alle as a misspelling.

https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ


Generated by Claude Code

…e localizations

BackButton reads WidgetsLocalizations::back_button_label (Flutter's
backButtonTooltip). A table's heading checkbox reads
select_all_button_label and each row's the new select_row_label, where
Flutter leaves both unnamed. The package reads its strings through one
ambient_strings helper, and the German test localizations move to
tests/common for every test that reads a localized name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
The localized-string helper is named localized, so its path no longer repeats its module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
@vanyastaff
vanyastaff merged commit 6a8dfa5 into main Dec 1, 2026
19 checks passed
@vanyastaff
vanyastaff deleted the claude/project-thread-5mrv8h branch December 1, 2026 01:50
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.

2 participants