Skip to content

feat: default outfit name from item names - #48

Merged
jvsena42 merged 2 commits into
mainfrom
feat/default-outfit-name
Aug 3, 2026
Merged

feat: default outfit name from item names#48
jvsena42 merged 2 commits into
mainfrom
feat/default-outfit-name

Conversation

@jvsena42

@jvsena42 jvsena42 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #43. Saving an outfit without a name previously blocked the save button; now the name is optional and an unnamed outfit falls back to its item names joined by " + " (e.g. Black T-Shirt + Navy Jeans).

The fallback lives in OutfitRepositoryImpl rather than in either UI, so Android and iOS share one implementation — consistent with the project's MVI + Repository split where business logic belongs in repository implementations.

Changes

  • Add getNamesByIds to ClothingItem.sq — one query for all selected items instead of one row read per item. Guarded against empty collections, since SQLDelight expands IN ? to IN (), which SQLite rejects.
  • Add resolveName() to OutfitRepositoryImpl, applied in both createOutfit and updateOutfit, so clearing the name while editing regenerates it. Names follow the selection order; ids with no matching row are skipped.
  • Drop the blank-name guard in OutfitViewModel.createOutfit — at least one selected item is still required.
  • Enable the save button on item selection alone (Compose + SwiftUI) and mark the name hint optional in all four string files (en / pt-BR × Android / iOS).
  • Truncate outfit card titles to one line on both platforms, since a generated name concatenates every item.
  • Update the create-first-outfit journey wording to match the new hint.
  • New OutfitRepositoryImplTest (name preserved, blank/whitespace fallback, selection ordering, missing ids, update path) and two new OutfitViewModelTest cases (blank-name pass-through, empty-selection guard).

Test plan

  • ./gradlew :shared:allTests and ./gradlew :shared:testAndroidHostTest pass
  • ./gradlew :composeApp:assembleDebug builds
  • Manual: Outfits → create outfit → select 2+ items → leave the name empty → save; the card title reads Item A + Item B
  • Manual: open that outfit → edit → clear the name → save; the name regenerates from the current selection
  • Manual: create an outfit with a typed name; the typed name is kept verbatim

Checklist

  • ./gradlew detekt passes
  • Tested on Android
  • Tested on iOS
  • Updated documentation (if applicable)

Note: the iOS simulator test task is skipped on Linux and the Swift changes are unbuilt here — they need Xcode to verify.

🤖 Generated with Claude Code

jvsena42 and others added 2 commits August 2, 2026 21:02
An outfit saved without a name now falls back to its item names joined by
" + ", so the list never shows a blank row. The fallback lives in the
repository rather than in either UI, so Android and iOS get it for free.

Closes #43

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The save button no longer requires a name, the hint marks the field
optional on both platforms, and outfit card titles truncate to one line
since generated names concatenate every item.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jvsena42
jvsena42 merged commit 979510d into main Aug 3, 2026
2 checks passed
@jvsena42
jvsena42 deleted the feat/default-outfit-name branch August 3, 2026 00:13
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.

Set default outfit name when not provided

1 participant