Skip to content

feat: optional checkbox mode for shopping list (list view) - #1139

Open
sourdusk wants to merge 1 commit into
TomBursch:mainfrom
sourdusk:feat/checkbox-list-mode
Open

sourdusk wants to merge 1 commit into
TomBursch:mainfrom
sourdusk:feat/checkbox-list-mode

Conversation

@sourdusk

Copy link
Copy Markdown

What

Adds an opt-in Checkboxes in list view setting (Settings → Shopping list section, only visible when list view is enabled).

  • Each shopping list row gets a leading checkbox. Tap the checkbox → item is removed (same optimistic remove as tap-to-remove mode).
  • Tap the row → opens the item page, i.e. exactly what a long-press does today.

Why

Tap-to-remove makes removing fast but hides item details behind a long-press, which is hard to discover. This mode gives both affordances distinct, visible targets: checkbox to check off, row to inspect.

Implementation notes

  • New shoppingListCheckboxMode preference (SettingsCubit/SettingsState), default false — no behavior change unless enabled.
  • SelectableButtonListTile gains onCheckboxPressed; when set, the leading slot renders an unchecked Checkbox. Confirm-mode's selected check icon still takes precedence.
  • Passed through ShoppingItemWidgetSliverItemGridListSliverCategoryItemGridListSliverShopinglistItemView; only wired in the shopping list page.
  • Row-tap = item page falls back to the existing null-onPressed fallback in SliverItemGridList (the same path a long-press uses), so no duplicated navigation logic.
  • Recent items and search results are intentionally unchanged (they're add-flows, not check-off flows).
  • Grid view unaffected (tiles have no leading slot).
  • l10n: new keys in app_en.arb only ( untranslated-key placeholders: en ).

Testing

  • flutter analyze — no new issues (2 pre-existing warnings in untouched files)
  • flutter test — all 16 tests pass

Adds an opt-in setting that shows a leading checkbox on each shopping
list row when list view is enabled. Tapping the checkbox removes the
item (same optimistic remove as tap-to-remove); tapping the row opens
the item page, matching the existing long-press behavior.
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