Skip to content

fix(ui): let Space tick package rows on macOS and have VoiceOver say so - #29

Merged
Timtam merged 3 commits into
Timtam:mainfrom
math65:fix/macos-space-toggles-packages
Oct 6, 2026
Merged

Timtam merged 3 commits into
Timtam:mainfrom
math65:fix/macos-space-toggles-packages

Conversation

@math65

@math65 math65 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #28.

What was wrong

On macOS the packages list is a wxDataViewCtrl whose checkbox column only changes on a click. VoiceOver sends one for VO+Space while the user is interacting with the list, but a plain Space reached no handler at all. So unless you knew to interact first, nothing could be ticked from the keyboard, which is what xogium hit.

What changed

  • Space ticks the selected row (package, configuration step or group). It runs the exact same toggle as a click: the model's set_value body moved into a shared closure that both call. Disabled rows are left alone, as with a click.
  • VoiceOver says the new state. A toggle made from code gives VoiceOver nothing to read, because the row it's on is rebuilt behind it. A small voiceover module posts NSAccessibilityAnnouncementRequestedNotification with "Checked" / "Unchecked" (new keys in all five locales). It builds the dictionary with CoreFoundation's toll-free bridged types, so there are no Objective-C runtime calls and no new crates.
  • The toggle column's state is read through one helper, packages_tree_toggle_state, which also replaces the four copies of the group aggregate in get_value. Most of the diff's line count is that closure moving and being re-indented.

Testing

Validated on macOS with VoiceOver (fr-FR): Space on packages, groups and a disabled row; VO+Space while interacting still toggles once and isn't doubled. cargo fmt, cargo clippy -p rabbit-ui-wxdragon --features gui (no new warnings) and cargo test are clean locally.

Windows is untouched: all of this sits in the non-Windows DataView path, apart from the two locale keys.

Heads-up: this will conflict with #27 (the UI crate split), since it edits the DataView page and model. Happy to rebase whichever lands second.

🤖 Generated with Claude Code

On macOS the packages list is a wxDataViewCtrl whose checkbox column only
changes on a click. VoiceOver sends one for VO+Space while interacting with
the list, but a plain Space reached no handler at all, so a keyboard user
could not tick anything (Timtam#28).

Space on the selected row now runs the same toggle as a click: the
model's set_value body moved into a shared closure that both call, and
the toggle column's state is read through one helper, which also replaces
the four copies of the group aggregate in get_value. Disabled rows are
left alone, as with a click.

A toggle made from code gives VoiceOver nothing to read, because the row
it is on is rebuilt behind it. A small voiceover module posts
NSAccessibilityAnnouncementRequestedNotification with the row's new state
("Checked" / "Unchecked", in all five locales). It uses CoreFoundation's
toll-free bridged types, so no Objective-C runtime calls or new crates.

Fixes Timtam#28

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Timtam and others added 2 commits October 6, 2026 08:58
main split the UI crate into modules (Timtam#27) after this branch was made, so
its changes to lib.rs and wx_app.rs are carried into the modules the code
moved to:

- The voiceover module is declared in the new lib.rs, and the two new
  strings join WizardText in wizard/model.rs and wizard/text.rs.
- The Mac package list changes (the shared toggle, its state helper, the
  Space key handler and the model's new return type) go into
  wx_app/packages_page/dataview.rs. That module is gated as a whole, so
  the per-item cfg(not(target_os = "windows")) lines are dropped.

A three-way comparison of every item (base, this branch, main, merged)
found nothing lost on either side. dataview.rs only builds on macOS, so it
was also type-checked on Windows by pointing the package page at it for
the check: no errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The module split (Timtam#27) gave dataview.rs its own imports, and six of them
were never used there: two Enter key codes the Windows-side widgets use,
and four functions the toggle code calls with crate:: paths or doesn't
call at all. macOS builds only warned about them, but they hid any new
warning in the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Timtam
Timtam merged commit 1ca9bd2 into Timtam:main Oct 6, 2026
5 checks passed
Timtam added a commit to math65/rabbit that referenced this pull request Oct 6, 2026
main now has the UI crate split (Timtam#27) and Timtam#29 as merged there, so this
branch's own changes to wx_app.rs are carried into the modules the code
moved to:

- The announce helper and its priority go into wx_app/globals.rs, made
  crate-visible because the progress page, the version check and the Mac
  package list all call it.
- The announcements land in wx_app/progress_ui.rs, wx_app/version_check.rs
  and wx_app/packages_page/dataview.rs; the toggle's new return type drops
  the per-item cfg, as the whole module is macOS-only.
- choice_shown_note moves next to its only caller in dataview.rs: in
  widgets.rs it was dead code on Windows, and it had been placed between
  set_optional_choice_shown and that function's doc comment.

A three-way comparison of every item (base, this branch, main, merged)
found nothing lost. dataview.rs was also type-checked on Windows by
pointing the package page at it: no errors, no warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

unable to use checkboxes on MacOS

2 participants