fix: hoodie/sweater are outerwear, add long sleeve shirt subcategory - #55
Merged
Conversation
subcategoriesFor() filed HOODIE under TOP while CapsuleWardrobe maps the same subcategory to OUTERWEAR, so the "Navy zip-up hoodie" gap suggestion pre-filled a category/subcategory pair the Outerwear dropdown never offered. SWEATER moves along with it so both layering pieces sit in the same category. Migration 2.sqm re-maps rows already saved as TOP + HOODIE/SWEATER. SubcategoryTest guards the invariant that every subcategory belongs to exactly one category and that capsule suggestions agree with it. Closes #51 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Closes #41 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
Fixes two
Subcategoryissues.#51 —
subcategoriesFor()filedHOODIEunderCategory.TOP, whileCapsuleWardrobe.ktmaps the same subcategory toCategory.OUTERWEAR. Tapping the "Navy zip-up hoodie" gap suggestion pre-filled the add-item sheet with Outerwear + Hoodie, but the Outerwear dropdown never offered Hoodie — so the pre-filled value could not be re-selected, and on Android changing the category cleared it outright.SWEATERmoves along with it so both layering pieces sit in the same category.#41 — adds
LONG_SLEEVE_SHIRTunderCategory.TOP.Reordering the enum constants is safe: subcategories are persisted as enum name strings in a
TEXTcolumn, and nothing in the codebase readsSubcategory.entriesor ordinals.Changes
Subcategory.kt—SWEATER/HOODIEmoved to the// OUTERWEARblock and tosubcategoriesFor(Category.OUTERWEAR); newLONG_SLEEVE_SHIRTconstant underTOP, afterDRESS_SHIRTmigrations/2.sqmre-maps already-saved rows:UPDATE clothingItem SET category = 'OUTERWEAR' WHERE subcategory IN ('HOODIE', 'SWEATER');, with SQLDelightversionbumped 2 → 3 (same pattern as theDRESS→TOPfixup in1.sqm)AiPrompts.SUBCATEGORY_VALUESupdated — it is a hardcoded duplicate of the enum, so without this the model would never suggest the new subcategorySubcategory.displayName()gains aLONG_SLEEVE_SHIRTbranch; branches reordered to match the enumvalues/strings.xml,values-pt-rBR/strings.xml,en.lproj/Localizable.strings,pt-BR.lproj/Localizable.strings("Long sleeve shirt" / "Camisa manga longa")SubcategoryTestguards the invariant that broke here: every subcategory belongs to exactly one category, and everycapsuleWardrobeSuggestionsentry's subcategory is valid for itsmappedCategoryNo Swift changes were needed — iOS calls the same
SubcategoryKt.subcategoriesFor(category:)and derives its localization key fromsubcategory.name.lowercased(), so both changes flow through automatically.Test plan
./gradlew :shared:allTests— passes, including the newSubcategoryTest./gradlew :composeApp:assembleDebug— passes (proves the exhaustivedisplayName()whencompiles)Checklist
./gradlew detektpassesCloses #51
Closes #41
🤖 Generated with Claude Code