feat: default outfit name from item names - #48
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
OutfitRepositoryImplrather 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
getNamesByIdstoClothingItem.sq— one query for all selected items instead of one row read per item. Guarded against empty collections, since SQLDelight expandsIN ?toIN (), which SQLite rejects.resolveName()toOutfitRepositoryImpl, applied in bothcreateOutfitandupdateOutfit, so clearing the name while editing regenerates it. Names follow the selection order; ids with no matching row are skipped.OutfitViewModel.createOutfit— at least one selected item is still required.create-first-outfitjourney wording to match the new hint.OutfitRepositoryImplTest(name preserved, blank/whitespace fallback, selection ordering, missing ids, update path) and two newOutfitViewModelTestcases (blank-name pass-through, empty-selection guard).Test plan
./gradlew :shared:allTestsand./gradlew :shared:testAndroidHostTestpass./gradlew :composeApp:assembleDebugbuildsItem A + Item BChecklist
./gradlew detektpassesNote: 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