Extract the style tiles from the PosePicker into their own module #37

Merged
matchu merged 2 commits from armin-bot/impress:claude/style-tiles into main 2026-11-17 12:41:28 -08:00
Contributor

The first of four steps toward moving NC Pet Styles out of the pose picker popover and into wardrobe search. This one only moves code: the popover looks and behaves the same.

The style grid's pieces lived privately in PosePicker.js. They now live in WardrobePage/StyleTiles.js, so the search panel can use them next (#38).

What moved, and what's new

  • StyleTile (was StyleOption). New, unused by the popover: optional showLabels (two short lines under the picture) and onDeselect (clicking the selected tile takes it off).
  • StyleTileGroups, the color-grouped grid, with the tile size, gap and sticky-header offset as props. Tile size can be responsive.
  • useStyleHoverPreview, the hover-to-preview rules as a hook: mouse only, the 200ms settle, and ending the preview when the grid hides or unmounts.
  • The naming, matching, grouping and lazy-image helpers, unchanged except for the next point.

One behavior change: the filter matches more words

The style filter now also matches the species name and "nc pet style token". So "nostalgic aisha" finds 51 of Aisha's 143 styles, and "token" finds all of them. To support that, /species/:id/alt-styles.json includes the species (id, name, human name), the same way it already includes the color.

Screenshots

The popover before and after, on a Faerie Aisha. A pixel diff shows only image antialiasing differences.

The Styles tab before (left) and after (right), identical

Testing

  • New controller spec for the species in the alt styles JSON. bundle exec rspec: 4 failures in spec/models/alt_style_spec.rb (canonical_pet_type), which fail the same way on main in my environment.
  • yarn lint and Prettier are clean.
  • In a browser against a local server with public data: the popover renders and filters as before, hover still previews, and the filter words above match as described.

🤖 Generated with Claude Code

https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS

The first of four steps toward moving NC Pet Styles out of the pose picker popover and into wardrobe search. This one only moves code: the popover looks and behaves the same. The style grid's pieces lived privately in `PosePicker.js`. They now live in `WardrobePage/StyleTiles.js`, so the search panel can use them next (#38). ## What moved, and what's new - **`StyleTile`** (was `StyleOption`). New, unused by the popover: optional `showLabels` (two short lines under the picture) and `onDeselect` (clicking the selected tile takes it off). - **`StyleTileGroups`**, the color-grouped grid, with the tile size, gap and sticky-header offset as props. Tile size can be responsive. - **`useStyleHoverPreview`**, the hover-to-preview rules as a hook: mouse only, the 200ms settle, and ending the preview when the grid hides or unmounts. - The naming, matching, grouping and lazy-image helpers, unchanged except for the next point. ## One behavior change: the filter matches more words The style filter now also matches the species name and "nc pet style token". So "nostalgic aisha" finds 51 of Aisha's 143 styles, and "token" finds all of them. To support that, `/species/:id/alt-styles.json` includes the species (id, name, human name), the same way it already includes the color. ## Screenshots The popover before and after, on a Faerie Aisha. A pixel diff shows only image antialiasing differences. ![The Styles tab before (left) and after (right), identical](https://code.openneo.net/attachments/356e768f-7619-4c68-95f5-40484be7e4ce) ## Testing - New controller spec for the species in the alt styles JSON. `bundle exec rspec`: 4 failures in `spec/models/alt_style_spec.rb` (`canonical_pet_type`), which fail the same way on `main` in my environment. - `yarn lint` and Prettier are clean. - In a browser against a local server with public data: the popover renders and filters as before, hover still previews, and the filter words above match as described. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS
Extract the style tiles from the PosePicker into their own module
Some checks failed
CI / rspec (pull_request) Failing after 7m56s
CI / deploy (pull_request) Has been skipped
a2209391ba
The NC Pet Styles grid is moving into wardrobe search, so its pieces need
to work outside the PosePicker's popover. This moves them into
StyleTiles.js, with no visible change to the popover:

- StyleTile (was StyleOption), now with optional labels under the picture
  and an `onDeselect` for clicking the selected style to take it off.
- StyleTileGroups, the color-grouped grid, with the tile size, gap and
  sticky header offset as props.
- useStyleHoverPreview, the hover-to-preview rules as a hook: the settle
  delay, mouse-only, and cleanup when hidden or unmounted.
- The naming, matching, grouping and lazy-image helpers.

The filter also matches the species name and "nc pet style token" now,
so searches like "nostalgic aisha" or "token" find styles. For that, the
alt styles JSON includes the species, like it already does the color.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS
matchu scheduled this pull request to auto merge when all checks succeed 2026-11-17 12:22:34 -08:00
Merge branch 'main' into claude/style-tiles
All checks were successful
CI / rspec (pull_request) Successful in 1m55s
CI / deploy (pull_request) Has been skipped
74fc5d67f9
matchu merged commit f04549004f into main 2026-11-17 12:41:28 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
2 participants
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!37
No description provided.