Skip to content

feat(ios): label-aware local search and synced label edits - #595

Merged
OrellBuehler merged 1 commit into
mainfrom
feat/label-ios
Sep 5, 2026
Merged

feat(ios): label-aware local search and synced label edits#595
OrellBuehler merged 1 commit into
mainfrom
feat/label-ios

Conversation

@OrellBuehler

Copy link
Copy Markdown
Owner

Summary

Fifth of five label PRs (server → MCP → web → Android → iOS). Builds on #591. Written blind (Linux); the iOS build job is the compile gate.

  • Label-aware local search. FoodRepository.searchLocal and the search field's recent/favorites filter rank name → English label → brand, mirroring the server; queries fold through LabelNormalizer, a port of the server's normalizeLabel. LocalFood.labels already existed, so no store migration.
  • Synced label edits. SyncOperation.setFoodLabels (typeName, affectedTable/Id, temp-id remap, summary) + SyncManager case calling BissbilanzAPI.setFoodLabels (PUT /api/foods/{id}/labels, decoded as {labels, dropped} exactly as the server sends it, so the op is never silently dropped). FoodRepository.setLabels patches the row optimistically, then queues.
  • UI. Labels section in the food edit form (add via text field, remove per row, normalized on add, 20 cap); create and edit both persist labels. L10n strings en/de.

Test plan

  • Unit tests added (label-tier local search, optimistic write + queued PUT drain, temp-id remap) — iOS unit tests are not run in CI, so please run them in Xcode
  • bun run security clean
  • iOS Build & Test job green
  • On device: add labels offline, reconnect, confirm the PUT drains; search "bread" against a German-named labelled food in airplane mode

🤖 Generated with Claude Code

- searchLocal and the search-field filter rank name, then English label,
  then brand, mirroring the server; queries fold through LabelNormalizer,
  a port of the server's normalizeLabel
- SyncOperation.setFoodLabels with API call, temp-id remap and sync case;
  FoodRepository.setLabels writes the row optimistically then queues it
- labels section in the food edit form (normalized on add, 20 cap)
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Playwright E2E Results

✅ All tests passed

Download screenshots & report

@OrellBuehler
OrellBuehler merged commit 9e3df68 into main Sep 5, 2026
17 of 19 checks passed
@OrellBuehler
OrellBuehler deleted the feat/label-ios branch September 5, 2026 09:24
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.

1 participant