Preparing search index...

    Function buildShoppingSections

    • Splits a shopping list into the categories still to buy and a flat list of purchased items.

      Purchased items are kept out of the category sections entirely so the working list only ever shows what is left: the screen renders them in a collapsed block at the end, where they stay reachable to undo a mistaken tap. Sections follow the supplied categories order and empty ones are dropped. Items in each section and in the purchased list are sorted alphabetically by name.

      Parameters

      Returns ShoppingListView

      The sections to render and the purchased items to collapse away.