Skip to content

flui-material: buttons and selection controls run on the scenario tester; Switch, Radio and a chip's delete button can be named - #3264

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

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

Conversation

@vanyastaff

@vanyastaff vanyastaff commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

TP6 of the testing platform (ADR-0400): flui-material's buttons and selection controls run on flui_testing::scenario::Tester, and the spec splits the crate's 42 test files into three areas (TP6 here, TP7 surfaces, lists, fields, theme and progress, TP8 navigation, dialogs, app and transitions).

Reworked onto ADR-0407 (#3269): a control is named the way an application names it, by Semantics::new().label(..) around it, which names the control's own node. This branch no longer adds a naming builder of its own.

Changes

  • checkbox, radio, switch, elevated_button, floating_action_button, chip and icon_button moved whole. icon_button::a_toggle_cross_fades_to_its_selected_icon reads the opacity of each RenderAnimatedOpacity through Frame::read_all::<RenderAnimatedOpacity, f64> and drops its #[expect(deprecated)].
  • No test wraps a root scope, each ends with t.finish(), and the end's audit finds no unnamed control.
  • Naming: the switch, radio and checkbox tests and the toggle rows of toggles_and_chips_are_one_node_with_their_state and material_controls_publish_their_identifier wrap the toggle in a Semantics label and find it by that name (find::text). No test of the area calls Checkbox::semantic_label, which ADR-0407 §2's follow-up deletes. In the identifier test the toggle's identifier stays on the node it shares with the label (ADR-0407 §3).
  • Not added after all: Switch::semantic_label, Radio::semantic_label and the ControlNames type (src/control_names.rs). Checkbox, Switch and Radio are as on main.
  • A chip's delete button is named by the localized tooltip text. WidgetsLocalizations::delete_button_tooltip is a new required method ("Delete" in DefaultWidgetsLocalizations, delegated by GlobalWidgetsLocalizations and by the German test impl in flui-widgets' page_view.rs), and Flutter 3.50.1 names this button with MaterialLocalizations.deleteButtonTooltip. Chip and FilterChip read it from the ambient Localizations where the delete icon is built, so nothing is stored on the view. The delete button belongs to the chip, so no Semantics an application writes can name it. No delete_button_label builder.
  • Records: the chip bullets join changelog.d/claude-project-thread-5mrv8h.md, and -control-names.md is gone. TP6's state and evidence in docs/plans/specs/testing-platform/tasks.md are rewritten. The ADR-0400 bullet in docs/gaps.md drops the cross-fade exception and the read Frame lacked.

Expectations

No perf baseline changed: flui-material's perf and the facade's perf scenarios pass under FLUI_PERF_BASELINE=check, with the baseline files untouched. The delete button's name is read from the localizations when the chip builds, so the chip view stores nothing for it.

Claims restated, each in its test's doc:

  • A disabled toggle reads disabled and no Focus.
  • A radio's state reads as selected.
  • A disabled switch's swallowed tap reads as disabled plus a refused try_tap.
  • The FAB's slot is the button node's rect.
  • Switch and icon-button motion runs on the window's frame clock.
  • The toggle rows are named by a Semantics label around them.
  • "A bare control invents no label" is its own test: a_bare_toggle_invents_no_label_and_the_audit_names_it.

Test plan

  • cargo test --locked -p flui-material --tests: 8 + 23 + 12 passed. clippy --all-targets -D warnings and cargo fmt --all --check are clean.
  • FLUI_PERF_BASELINE=check on flui-material's perf: 12 passed. The facade's perf scenarios (--features flui/material,flui/cupertino,flui/native,flui/serde --test perf): 9 passed. No baseline file touched.
  • flui-widgets: the localization and page_view tests of the lib and of widgets_it, and clippy -p flui-widgets --all-targets -D warnings.
  • Usage counter: over the area 80 → 0, over the crate 640 → 560. ADR-0400 mod lines in tests/main.rs: 22 → 18.
  • Broken on purpose at this head, each restored, each failing its test:
    • the checkbox's next_value → the tristate cycle test;
    • the localized name not passed to the delete icon → five chip tests. A chip that is only mounted and finished fails the end's audit with Unnamed on the delete button ("this button has no accessible name").
    • the ambient localizations ignored, so the name is always English "Delete" → the German row of a_chip_names_its_delete_button_from_the_localizations;
    • Switch as a container, so the label forms a node of its own → the switch tests, the checkbox table and named_by_semantics, through the test's end;
    • IconButton without SymbolEffect::replace → the cross-fade test ("one icon at rest");
    • the replace effect not drawing the outgoing icon → the cross-fade test ("both icons mid-fade: [0.5]").
  • Wall time of material_it (E1), measured before the rework: 379 → 359 ms on default threads, 1 017 → 1 121 ms on one thread (1.10×).

Review

Read at 04661e6 (the reworked change, whole diff against main): review-before-merge, tier sonnet, seven lenses and a judge, none missing. Answers, fixed in c0d0f6d:

  • Important. tasks.md TP4 still named the icon_button cross-fade test among the #[expect(deprecated)] users and denied a read of a field of several render objects (a document that states what the code does not do). Fixed: the test and the read are gone from the TP4 list. Frame::read_all is that read, and the test uses it.
  • Nit. TP6 evidence said the seven files hold no old form, but chip.rs keeps one SignalProbe, whose replacement is not built. Fixed: the evidence names the forms the counter covers and that one SignalProbe user.
  • Nit. The Flutter citation in delete_button_tooltip broke its code span across a line. Fixed.
  • Nit. A new required trait method was filed only under Added. Fixed: a BREAKING bullet under Changed for outside implementors.
  • Nit, not fixed here. GlobalWidgetsLocalizations' forwarders are unpinned. The new one is like every other forwarder: none has a test. That belongs to a table test of all forwarders, which is a follow-up.
  • Nit, not fixed here. children_of is duplicated between cupertino and material tests/common. The next PR (TP7) moves it into flui_testing::scenario::tree and deletes both copies.

The fix is docs only, so there is no second round.

https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ


Generated by Claude Code

Each toggle and chip row names its control as an application would, since
the end's audit refuses an unnamed one, and clicks it through semantics.act.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
The toggle motion reads the frame's draw list on the window's clock, the
motion policy goes through Tester::platform, and a control without a label
of its own is named as an application names it (common::named).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…ntic_label

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
The toggles of the selection-control tests are named by their own
semantic_label; the common tree reads (children_of, nodes_below_window)
serve the node-shape claims.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
The cross-fade test stays on the widget harness: no frame read gives a
field of each of several render objects of one type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
A tap that the test places itself (a chip's body clear of its delete
icon, a disabled chip) goes to the window through Tester::perform; the
delete buttons are named by delete_button_label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…its view

Switch, Radio, Chip and FilterChip hold their names as
Option<Box<ControlNames>>, so the labels they gained cost an unnamed
control no inline size: the perf baselines hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…on the scenario tester

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…mes exactly its node

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…nd the bare-toggle audit case

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…the new builders are listed as added

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…the head does

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
Main's rule names a control's own node from a Semantics label around it,
so the builders and the ControlNames type this branch added for that go:
Switch::semantic_label and Radio::semantic_label are removed, Checkbox,
Switch and Radio keep main's fields, and src/control_names.rs is deleted.
Chip::delete_button_label and FilterChip's stay, held in a field of their
own: the delete button is the chip's, so no Semantics an application
writes can name it.

The tests that named a toggle through semantic_label wrap it in
Semantics::new().label(..) as an application does and find it by that
name, Checkbox's included. icon_button's cross-fade test reads each
RenderAnimatedOpacity through Frame::read_all and leaves the old harness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…tton moved whole

The TP6 state and evidence, the ADR-0400 bullet in docs/gaps.md and the
changelog no longer name the removed builders or ControlNames; the chip
delete-button bullets join the branch's changelog fragment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
WidgetsLocalizations gains delete_button_tooltip ("Delete" by default,
Flutter 3.50.1's MaterialLocalizations.deleteButtonTooltip), and Chip and
FilterChip read it from the ambient Localizations where the delete icon
is built. The delete_button_label builders and their fields go, so a chip
view stores nothing for the name and its byte baselines stay where they
were.

The chip tests find the delete button as "Delete", and
a_chip_names_its_delete_button_from_the_localizations reads it as
"Löschen" under a German delegate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…ions

The changelog adds WidgetsLocalizations::delete_button_tooltip and says the
delete button is named by the localized tooltip text; the TP6 state and
evidence drop delete_button_label and the baseline rise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…t and chip.rs's SignalProbe

The new localization method is listed as breaking for outside implementors,
and its Flutter citation keeps the path in one code span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EqfW4DyGdFu4cM4nUks6cZ
…alizations

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