Skip to content

fix: hoodie/sweater are outerwear, add long sleeve shirt subcategory - #55

Merged
jvsena42 merged 2 commits into
mainfrom
fix/subcategory-hoodie-and-long-sleeve
Aug 3, 2026
Merged

fix: hoodie/sweater are outerwear, add long sleeve shirt subcategory#55
jvsena42 merged 2 commits into
mainfrom
fix/subcategory-hoodie-and-long-sleeve

Conversation

@jvsena42

@jvsena42 jvsena42 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes two Subcategory issues.

#51subcategoriesFor() filed HOODIE under Category.TOP, while CapsuleWardrobe.kt maps the same subcategory to Category.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. SWEATER moves along with it so both layering pieces sit in the same category.

#41 — adds LONG_SLEEVE_SHIRT under Category.TOP.

Reordering the enum constants is safe: subcategories are persisted as enum name strings in a TEXT column, and nothing in the codebase reads Subcategory.entries or ordinals.

Changes

  • Subcategory.ktSWEATER/HOODIE moved to the // OUTERWEAR block and to subcategoriesFor(Category.OUTERWEAR); new LONG_SLEEVE_SHIRT constant under TOP, after DRESS_SHIRT
  • New migrations/2.sqm re-maps already-saved rows: UPDATE clothingItem SET category = 'OUTERWEAR' WHERE subcategory IN ('HOODIE', 'SWEATER');, with SQLDelight version bumped 2 → 3 (same pattern as the DRESSTOP fixup in 1.sqm)
  • AiPrompts.SUBCATEGORY_VALUES updated — it is a hardcoded duplicate of the enum, so without this the model would never suggest the new subcategory
  • Android Subcategory.displayName() gains a LONG_SLEEVE_SHIRT branch; branches reordered to match the enum
  • All four localization files updated and reordered: values/strings.xml, values-pt-rBR/strings.xml, en.lproj/Localizable.strings, pt-BR.lproj/Localizable.strings ("Long sleeve shirt" / "Camisa manga longa")
  • New SubcategoryTest guards the invariant that broke here: every subcategory belongs to exactly one category, and every capsuleWardrobeSuggestions entry's subcategory is valid for its mappedCategory

No Swift changes were needed — iOS calls the same SubcategoryKt.subcategoriesFor(category:) and derives its localization key from subcategory.name.lowercased(), so both changes flow through automatically.

Test plan

  • ./gradlew :shared:allTests — passes, including the new SubcategoryTest
  • ./gradlew :composeApp:assembleDebug — passes (proves the exhaustive displayName() when compiles)
  • Migration check: on the previous build, save an item as Top + Hoodie, then install this build over it and confirm it reads Outerwear + Hoodie with no crash on open
  • Gaps screen → tap "Navy zip-up hoodie" → the add sheet pre-fills Outerwear + Hoodie, and the subcategory dropdown now offers Hoodie as a selectable option (the Hoodie should be an outerwear subcategory, not a top #51 symptom)
  • Add-item sheet → category Top → dropdown lists "Long sleeve shirt"; select, save, reopen the item detail and confirm the label renders rather than a raw key
  • Switch to pt-BR and confirm "Camisa manga longa", and that Moletom/Suéter now appear under Casacos

Checklist

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

Closes #51
Closes #41

🤖 Generated with Claude Code

jvsena42 and others added 2 commits August 3, 2026 09:18
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>
@jvsena42
jvsena42 enabled auto-merge August 3, 2026 12:22
@jvsena42
jvsena42 merged commit d8ab078 into main Aug 3, 2026
2 checks passed
@jvsena42
jvsena42 deleted the fix/subcategory-hoodie-and-long-sleeve branch August 3, 2026 12:27
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.

Hoodie should be an outerwear subcategory, not a top Add long sleeves shirt subcategory

1 participant