Add token items for NC Pet Styles #28

Merged
matchu merged 1 commit from armin-bot/impress:claude/style-token-items into main 2026-11-16 19:25:05 -08:00
Contributor

People have long asked to search for NC Pet Style "token" items and add them to their lists. Tokens aren't wearable, so they never show up in modeling data, and we've had no rows for them.

It turns out we already have what we need: a style's ID is its token's item ID (it's the oii the Styling Studio gives us, and itemdb matches tokens to our styles the same way), and the Styling Studio import already records the token's name and thumbnail on the style.

What this does

  • Creates token items from labeled alt styles. Whenever a labeled AltStyle is saved, we create or update an Item with the same ID, using the style's full name and thumbnail. That covers the Styling Studio import, the support edit form, and any future source of labels. The item's "first seen" date is the style's.
  • Tokens count as fully modeled and have no compatible bodies, so they stay out of wardrobe search (which always filters by fit) and out of auto-modeling.
  • Adds an is:style search filter (and -is:style).
  • Adds rake alt_styles:sync_token_items to backfill.

Tokens are ordinary items otherwise, so lists, trades, the item API, NC trade values and the newest-items lists pick them up with no further changes.

Things to know

  • The style is the source of truth for the token's name and thumbnail; edits made on the item's own edit form get overwritten the next time the style is saved.
  • We don't know tokens' real descriptions, so it's stored blank. (The item page PR writes one for display.)
  • If an item with a style's ID already exists and has wearable assets, we skip it and log a warning rather than overwrite it. I don't expect this to ever happen.
  • Unlabeled styles get no token until they're labeled.
  • I didn't block tokens from being added to outfits by ID; they'd just show no layers, like any item that doesn't fit.
  • Impress 2020 reads the items table directly. I haven't checked how its item page and search treat a row with no assets.

After deploying

bin/rails alt_styles:sync_token_items

Testing

Model specs cover creation, renaming, the wearable-ID guard, modeling status and search. I also ran the backfill task and loaded the item page, trades page, JSON and search against a seeded style in dev.

🤖 Generated with Claude Code

https://claude.ai/code/session_014PWWd1ky1PrtZvpAv7vhe6

People have long asked to search for NC Pet Style "token" items and add them to their lists. Tokens aren't wearable, so they never show up in modeling data, and we've had no rows for them. It turns out we already have what we need: a style's ID *is* its token's item ID (it's the `oii` the Styling Studio gives us, and itemdb matches tokens to our styles the same way), and the Styling Studio import already records the token's name and thumbnail on the style. ## What this does - **Creates token items from labeled alt styles.** Whenever a labeled `AltStyle` is saved, we create or update an `Item` with the same ID, using the style's full name and thumbnail. That covers the Styling Studio import, the support edit form, and any future source of labels. The item's "first seen" date is the style's. - **Tokens count as fully modeled** and have no compatible bodies, so they stay out of wardrobe search (which always filters by fit) and out of auto-modeling. - **Adds an `is:style` search filter** (and `-is:style`). - **Adds `rake alt_styles:sync_token_items`** to backfill. Tokens are ordinary items otherwise, so lists, trades, the item API, NC trade values and the newest-items lists pick them up with no further changes. ## Things to know - The style is the source of truth for the token's name and thumbnail; edits made on the item's own edit form get overwritten the next time the style is saved. - We don't know tokens' real descriptions, so it's stored blank. (The item page PR writes one for display.) - If an item with a style's ID already exists *and has wearable assets*, we skip it and log a warning rather than overwrite it. I don't expect this to ever happen. - Unlabeled styles get no token until they're labeled. - I didn't block tokens from being added to outfits by ID; they'd just show no layers, like any item that doesn't fit. - Impress 2020 reads the `items` table directly. I haven't checked how its item page and search treat a row with no assets. ## After deploying ```bash bin/rails alt_styles:sync_token_items ``` ## Testing Model specs cover creation, renaming, the wearable-ID guard, modeling status and search. I also ran the backfill task and loaded the item page, trades page, JSON and search against a seeded style in dev. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014PWWd1ky1PrtZvpAv7vhe6
Add token items for NC Pet Styles
All checks were successful
CI / rspec (pull_request) Successful in 3m25s
CI / deploy (pull_request) Has been skipped
ec77ead038
Each Pet Style has a "token" item on Neopets.com, which people want to
search for and add to their trade lists. Tokens aren't wearable, so we
never see them in modeling data. But a style's ID *is* its token's item
ID, and the Styling Studio import already tells us the token's name and
thumbnail, so we can create the item ourselves.

Now, whenever a labeled alt style is saved, we create or update an Item
with the same ID. Tokens count as fully modeled, don't fit any pet (so
they stay out of wardrobe search), and can be filtered with `is:style`.

The Styling Studio import saves every style it sees, so it will create
tokens going forward. To backfill the rest after deploying, run
`rake alt_styles:sync_token_items`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PWWd1ky1PrtZvpAv7vhe6
matchu merged commit 8bbcd63ba1 into main 2026-11-16 19:25:05 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OpenNeo/impress!28
No description provided.