2. Expose choice, disabled state and review status
The assistance choice is a real Checkbox, not a coloured circle with a click handler. It supplies checked and disabled state through Fission's normal semantics. The optional instructions remain a labelled multiline input.
The declared order is also the task order: name, instructions, assistance, prepare and review. Do not visually move controls into a different order and then expect an accessibility adapter to infer the intended sequence.
{"id":"fission-tabs-1","tabs":[{"index":0,"label":"src/app.rs","value":"src-app-rs"}]}
{"id":"fission-tabs-1","index":0,"label":"src/app.rs","value":"src-app-rs"}
use fission::prelude::*;
fission_component! {
pub PickupDetails<()> {
state {
name: String = String::new(),
attempted: bool = false,
reviewing: bool = false,
instructions: String = String::new(),
assistance: bool = false,
}
}
view(draft, _state, cx) {
let tokens = &cx.view.env().theme.tokens;
let invalid_name = draft.attempted && draft.name.trim().chars().count() < 2;
} =>
SafeArea(
child: Scroll(
child: Container(
child: SemanticsRegion(
identifier: Some("pickup-details".to_string()),
label: Some(cx.tr("pickup.title")),
child: Column(gap: tokens.spacing.m, children: [
Text(cx.tr("pickup.title")).size(tokens.typography.heading2_size),
Text(cx.tr("pickup.context")),
FormControl(
label: Some(cx.tr("pickup.name")),
helper: Some(cx.tr("pickup.name_help")),
error: if invalid_name {
Some(cx.tr("pickup.invalid_name"))
} else { None },
required: true,
child: TextInput(
read_only: draft.reviewing,
bind: draft.name,
semantics_identifier: "pickup.name".to_string(),
),
),
TextInput(
label: Some(cx.tr("pickup.instructions").into()),
helper_text: Some(cx.tr("pickup.instructions_help").into()),
multiline: true,
read_only: draft.reviewing,
bind: draft.instructions,
semantics_identifier: "pickup.instructions".to_string(),
),
Checkbox(
label: Some(cx.tr("pickup.assistance")),
checked: draft.assistance,
disabled: draft.reviewing,
bind(on_toggle): to(draft.assistance),
semantics_identifier: "pickup.assistance".to_string(),
),
Button(
child: Text(cx.tr("pickup.prepare")),
key: "prepare-pickup",
disabled: draft.reviewing,
on_press: reduce {
draft.attempted = true;
if draft.name.trim().chars().count() >= 2 {
draft.reviewing = true;
}
},
).semantics_identifier("pickup.prepare"),
if draft.reviewing {
Column(gap: tokens.spacing.s, children: [
SemanticsRegion(
identifier: Some("pickup.review-status".to_string()),
label: Some(cx.tr("pickup.status_label")),
value: Some(cx.tr("pickup.prepared")),
child: Text(cx.tr("pickup.prepared")),
),
Button(
child: Text(cx.tr("pickup.edit")),
key: "edit-pickup",
on_press: reduce { draft.reviewing = false; },
).semantics_identifier("pickup.edit"),
])
},
]),
),
).padding_all(tokens.spacing.l),
),
)
}
{"id":"fission-tabs-1"}
Enter a name and instructions, select assistance and prepare the details. The checkbox should retain its checked state whilst becoming disabled for review; Edit should restore interaction without changing the values.
The status region carries a label and value for inspection. This example does not claim that changing generic text automatically causes a live announcement. Confirm what the actual native screen reader exposes rather than treating a visible status as proof.
Show the app previewHide the app preview
Show the app preview
Hide the app preview