Skip to content

Add row groups to item scanning - #1020

Merged
enaboapps merged 2 commits into
mainfrom
feat/row-groups-scan
Oct 11, 2026
Merged

enaboapps merged 2 commits into
mainfrom
feat/row-groups-scan

Conversation

@enaboapps

@enaboapps enaboapps commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1019.

Summary

  • New Item scanning choice: Rows, groups, then items sits between Groups, then items and One item at a time. It can be set as the shared default or for one area (menus, keyboard, mouse panel).
  • Splitting, as Android's Group Scan (RowGroupingPolicy) does: a row of 7 or more items becomes round(√n) groups, between 2 and 4, with at least 2 items each, sized evenly with larger groups first. For example, 10 keys split 4, 3, 3. Shorter rows scan as before. Android's gap-aware cut is left out because panel keys have no gaps.
  • Scanning order: row, then group, then item. Groups are identified scan_tree groups, so their highlight survives the keyboard replacing its rows.
  • Panels:
    • The keyboard and mouse panel highlight the whole group with the row style and show "Select a group".
    • After a group's last item, Back to groups highlights the group and returns to it. After a row's last group, Back to rows works as before.
  • Menus: they have at most three columns, so they never split.

Settings compatibility

Local settings file. The choice is stored as pattern: "grouped" plus a new rowGroups boolean, not a new pattern value. Versions rc.17 to rc.23 only drop unknown values of panelSize, nextScan and startFrom. An unknown pattern would make them reset every scan preference to defaults.

  • Older versions ignore rowGroups and read the pattern as Groups, then items.
  • Existing settings are unchanged: rowGroups defaults to off. An area with its own pattern saved without rowGroups has no row groups.
  • Choosing an area's default clears both values. Point scanning ignores row groups.
  • Unknown pattern or rowGroups values are now dropped on their own when settings are read; the other scan settings are kept.

Settings sync. Synced documents must round-trip exactly, so portable_settings::SCHEMA_VERSION goes from 2 to 3.

  • upgrade_v2 reads version 2 documents with rowGroups: false and every area following the shared choice. Version 1 documents upgrade through both steps.
  • Builds on version 2 report a version 3 document as Update required rather than invalid. They never overwrite it.
  • As with the version 1 to 2 bump, a merge base saved by an older build doesn't cause an upload by itself.

Validation

  • npm run prediction-model, npm run lint, npm test (294 passed), npm run build
  • cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test (746 passed)
  • New tests:
    • scan_items: split sizes for lengths 0 to 60, row→group→item traversal, Back to groups and Back to rows, reverse direction, no splitting in linear or plain grouped scanning, highlight surviving replace_rows.
    • scan_preferences: saving, reading and inheritance, and older-version and unknown-value compatibility.
    • portable_settings:
      • Version 2 upgrade, rejecting a version 2 document that already has rowGroups, and rejecting a version 3 document that lacks it.
      • A version 2 merge base still loads.
      • The synced scanPreferences key set is pinned.
    • settings_sync: updating from version 1 or 2 uploads nothing until something changes.
    • scan_keyboard: QWERTY statuses and highlighted tile counts.
    • PointScan.test.tsx: the three-way choice, per-area override, Use default, and card summaries.
  • Not yet tried with a real switch on Windows or macOS.

🤖 Generated with Claude Code

A third Item scanning choice, Rows, groups, then items, splits any row
of seven or more items into two to four balanced groups, as Android's
Group Scan does, so scanning goes row, then group, then item. Panels
highlight the whole group and offer Back to groups after its last item.

Row groups are saved as a separate rowGroups value beside the pattern,
so versions without them still read the pattern and keep every other
scan setting. Closes #1019.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enaboapps enaboapps added this to the v1.0.0-rc.24 milestone Oct 11, 2026
Synced documents must round-trip exactly, so the new rowGroups keys
broke sync with version 2 documents in both directions. Version 2
documents now upgrade with row groups off and areas following the
shared choice, and older builds ask to be updated instead of reporting
invalid settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enaboapps
enaboapps marked this pull request as ready for review October 11, 2026 17:58
@enaboapps
enaboapps merged commit ab3fc71 into main Oct 11, 2026
6 checks passed
@enaboapps
enaboapps deleted the feat/row-groups-scan branch October 11, 2026 19:01
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.

Add row groups to item scanning

2 participants