From 320ab4ae3a4347059031dc2adb2313d5fd330325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 28 Sep 2026 03:24:15 -0400 Subject: [PATCH] =?UTF-8?q?T42d=20Misc=20=C2=B7=20Asking=20and=20learning?= =?UTF-8?q?=20passes=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The poll's mark and its row's selector share one binding. --- TASKS.md | 4 +++- src/misc/poll.rs | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/TASKS.md b/TASKS.md index 26868e8..380428a 100644 --- a/TASKS.md +++ b/TASKS.md @@ -143,7 +143,7 @@ Per-component lines live in `tasks/`. Tags there: - [x] T42a Misc · Time — `tasks/ch31-43.md` - [x] T42b Misc · Numbers — `tasks/ch31-43.md` - [x] T42c Misc · Codes and checks — `tasks/ch31-43.md` -- [ ] T42d Misc · Asking and learning — `tasks/ch31-43.md` +- [x] T42d Misc · Asking and learning — `tasks/ch31-43.md` - [ ] T42e Misc · Terms and notices — `tasks/ch31-43.md` - [ ] T42f Misc · Web — `tasks/ch31-43.md` - [ ] T42g Misc · Export and import — `tasks/ch31-43.md` @@ -454,3 +454,5 @@ Per-component lines live in `tasks/`. Tags there: | T42b | 2 | PASS | | | T42c | 1 | FAIL | a verdict or a new ask disabled Verify while it held focus, so focus fell to the root; Enter handed a second answer over during the check; a passed field kept its ring and caret | | T42c | 2 | PASS | three claims untested; tests for focus after an answer and a resting pass added in the pass commit | +| T42d | 1 | FAIL | a pointer's untick disabled Submit while it held focus, so focus fell to the root; six claims untested; radio labels ran past a 280px box | +| T42d | 2 | PASS | the poll's mark and its selector now share one binding | diff --git a/src/misc/poll.rs b/src/misc/poll.rs index 03e7aca..3b9e7ba 100644 --- a/src/misc/poll.rs +++ b/src/misc/poll.rs @@ -127,8 +127,9 @@ impl RenderOnce for Poll { _ => *votes as f32 / total as f32, }; let percent = format::percent(share as f64, 0, false); + let marked = ix == voted; div() - .debug_selector(|| match ix == voted { + .debug_selector(|| match marked { true => format!("poll-{label}-{percent}-voted"), false => format!("poll-{label}-{percent}"), }) @@ -147,7 +148,7 @@ impl RenderOnce for Poll { .text_color(colors.fg) .child(Ellipsis::new(label.clone())), ) - .when(ix == voted, |row| { + .when(marked, |row| { row.child( Icon::new(IconName::CircleCheck) .size(IconSize::Sm)