Back to Blocks

Claude Terminal

Loading...

Task Details
PXL-722Backlog
High

🏷️ Fix duplicate short names for foods

b2-heradata

Ensures each food gets a unique short name so they're easier to tell apart.


> Technical Details

Overview

Update the short name calculation logic to account for foods throughout the entire day, not just within individual meals. This ensures that short names remain unique across all meals in a day, preventing duplicate short names that could cause confusion.

Current Behavior

The short name calculation currently only ensures uniqueness within a single meal. If the same food appears in multiple meals throughout the day, it may receive the same short name in different meals, which can lead to ambiguity.

Expected Behavior

Short names should be calculated by considering all foods across all meals in the day. When a food appears multiple times throughout the day (across different meals), the short name algorithm should generate unique identifiers that distinguish between these instances.

Technical Context
  • This affects the short name generation algorithm used for food items in meal displays
  • Need to modify the scope of uniqueness checking from meal-level to day-level
  • Consider performance implications when checking uniqueness across larger datasets (all foods in a day vs. foods in a single meal)
  • Ensure the changes maintain backward compatibility with existing short name display logic
Acceptance Criteria
  • Short name calculation considers all foods across all meals in the day
  • No duplicate short names exist for different food items within the same day
  • Short names remain concise and readable while maintaining uniqueness
  • Performance remains acceptable even for days with many meals/foods
  • Existing tests are updated to reflect day-level uniqueness requirements
  • New tests added to verify cross-meal uniqueness
Related

Extracted from PXL-705

Build instruction: Use -destination 'platform=iOS Simulator,name=iPhone 17 Pro' when building this project

Comments (1)
Ahmed Khalaf
Ahmed KhalafJan 11, 2026, 1:40 PM

Additional Bug Discovered During Testing

While testing the short name fix, discovered a separate issue:

Moving meal item during sync reverts the change when sync completes

When a user moves a meal item to another meal while a sync operation is ongoing, the move operation completes visually but then gets immediately reverted when the sync operation finishes. The sync operation overwrites the local change with the server state.

This is a data consistency/conflict resolution issue - local changes made during sync should take precedence or be merged correctly.


This should be split into a separate task if not directly related to short names.

Created Dec 12, 2025, 5:58 PM | Updated Feb 6, 2026, 11:11 AM