Skip to content

Handle adding duplicate items: allow separate item for unpacked, merge when packed #2

@dralan71

Description

@dralan71

Originally issue #6 in dralan71/luggage-tracker

Overview

Currently, when adding a new item (via quick add or add item), if the item already exists, the quantity simply increases. However, to improve usability:

  • If the newly added item matches an existing item that is already packed, it should be added as a separate unpacked item.
  • When the new unpacked item is marked as packed, it should automatically merge with the existing packed item, updating the quantity accordingly and leaving only one packed item card.

Example:

  • You have "socks" (quantity: 5, packed) in your list.
  • You use quick add to add another "socks" item (quantity: 1, unpacked by default).
  • The new "socks" item appears as a separate unpacked card.
  • After physically packing the new socks and toggling them as packed in the app, the two "socks" items should merge into one card with quantity 6, packed.

Tasks

  • Update the item addition logic to allow duplicate items as separate cards if one is already packed.
  • Implement merging logic so that when an unpacked duplicate is marked as packed, it merges with the already packed item.
  • Ensure the UI reflects these changes clearly and intuitively.
  • Test for edge cases, such as bulk adds and rapid toggling between packed/unpacked.

Expected Outcome

Users can add more of an item even if it is already packed, and merging occurs automatically upon packing, streamlining item management.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions