Someone cleared out their wardrobe at the end of the season — a few jumpers going to charity, a coat that no longer fitted, some shoes. Sensible, and exactly what a wardrobe app should support.

Then their outfit history had holes in it. Outfits from March that had used one of those jumpers were gone. Days on the calendar were empty. Six months of records, removed by a decision about a jumper.

Deleting a row is not deleting a thing

The data model is ordinary. Garments in one table, outfits in another, a join table connecting them. An outfit references the garments it contains.

Delete a garment and those references point at nothing. Something has to give, and the options are all bad in different ways:

Cascade the delete. The outfits that used the garment go too. This is what we had, and it produces the holes.

Refuse the delete. The garment cannot be removed while any outfit references it. Technically clean and hostile — the user is told they cannot tidy their wardrobe because of something they did in March.

Null the reference. The outfit survives with a gap where a garment used to be, and the record is now a lie: it shows a two-item outfit that was actually three.

None of these are right, because the premise is wrong. The user was not asking to erase the garment from history. They were saying it is no longer in the wardrobe. Those are different statements and we had only one operation for both.

Archive is the operation people meant

Removing a garment now archives it. The record stays; it is marked as no longer owned, drops out of the closet views and the filters, and remains available to everything that references it.

Outfit history is intact. An outfit from March shows what it contained, and the garment that is gone is shown as gone rather than silently omitted. That is more informative than either alternative — you can see what you wore, and you can see that part of it is no longer in the wardrobe.

Permanent deletion still exists, as a separate and deliberate action from the archive, with the consequences stated: this removes the item and the outfit records that depend on it. Some people genuinely want that — an item they would rather not have a record of — and it should be possible. It should not be what happens when you tidy your wardrobe.

There is also a confirmation before removal now, showing the item detail and how many outfits reference it. "This appears in fourteen outfits" is exactly the information you need to make the decision, and it was the information the app had and was not showing.

Photos are the other half

Archiving a garment means keeping its photo, which is where the space goes.

Archived items keep a smaller image rather than the full one. The garment is not being shown in a closet view any more; it appears at thumbnail size in old outfits. Keeping a full-resolution photograph of a jumper that went to charity two years ago is not a good use of a phone.

This is a one-way operation and we say so at the point of archiving. If you might get the item back — something lent out, something in long-term storage rather than gone — the app has a separate "not currently available" state that keeps everything intact.

The thumbnail cache also needed attention. Archiving changes what a garment looks like in the app, and a cache keyed only by item id happily served the old rendering. Cache keys now include the item's state, which is the sort of bug that is obvious once you have seen it and invisible until then.

What history is actually for

Reworking deletion meant looking properly at the history and calendar views, which had been a byproduct of saving outfits rather than something designed.

The useful observation: looking at what you wore is a completely different question from looking at what you own.

The closet answers what is available. History answers what you actually reach for, and the answer is usually narrower than anyone expects. Most people wear a small fraction of what they own, and the fraction is not the one they would name if asked.

What it surfaces:

The items doing the work. Often a small number of pieces appear in most of a week's outfits. Useful when deciding what to replace, and useful for knowing what is worth spending on.

Combinations you repeat without noticing. These are usually your best outfits — you converged on them without deciding to.

Things that never appear. Owned, in the closet, never worn. Worth knowing at the point where you are deciding what to keep.

Seasonal edges. When you actually started wearing the coat, as opposed to when you thought you did. Useful the following year for the changeover.

The calendar view is for the second-order version of the same thing: what did I wear last time I saw these people, what did I wear to the last event like this. Small, and it is a genuine reason to record outfits rather than only plan them.

What we deliberately do not do with it

We do not surface unworn items as a nagging list, and we thought about it. The honest version of that feature is a screen listing things you feel slightly guilty about owning, which is not what a wardrobe app should be.

We do not compute a wear-per-item cost. It is easy, it is the kind of number people ask for, and it turns getting dressed into an optimisation problem.

And there are no streaks, targets, or scores. History is a record. What you do with it is yours.

Cleaning up without regretting it

One category at a time. Tops, then shoes, then outerwear. Wholesale reorganisation is how mistakes happen and how the session becomes exhausting.

Open the detail before removing. Similar photographs at thumbnail size are easy to mix up, and this is where the wrong item gets removed.

Look at the history first. If something appears in fourteen outfits, it is doing more work than you remembered.

Archive rather than delete. Unless you specifically want the record gone.

Fix the record before blaming the garment. An item you never find might have a bad photo, the wrong category, or a name that means nothing to you. That is a data problem wearing a wardrobe problem's clothes.

Stop after a manageable group. The closet does not need to be finished today.