Show matching NC Pet Styles on a shelf above item search results #43

Merged
matchu merged 2 commits from armin-bot/impress:claude/style-shelf into main 2026-11-18 09:53:01 -08:00
Contributor

Step 4 of the NC Pet Styles plan: when an item search matches some styles, a shelf above the results shows them. This replaces the blue "check the emotion picker" hint.

Screenshots

Searching "nostalgic": an "NC Pet Styles · 51 matches" shelf with one row of seven tiles and "See all 51", above the item results. One tile is hovered, and previewed on the pet.

Phone width The shelf at phone width, with four tiles, above the item results

What changes for users

  • The shelf shows how many styles match, one row of them (pet's color first), and See all N, which switches to the NC Pet Styles search with the same text and puts focus in the field.
  • Tiles work like the grid: click to wear or take off, and rest the mouse to preview.
  • Keyboard: Down from the search field goes to the shelf, then Down again to the items, and Up goes back the same way. Left and Right move along the shelf without wrapping.
  • When it shows: only on page 1, after a pause in typing like the item results. It's hidden if a zone, NP, PB or own/want filter rules styles out. An NC filter keeps it.
  • Matching is on word starts, here and in the full grid. "red" finds Red styles, but not names that merely contain "red". This keeps "See all N" equal to what the grid shows.

Under the hood

  • SearchResults does the style matching itself, so it knows whether there's a shelf. With one, firstSearchResultRef goes on the shelf's worn (or first) tile, and the first item and the shelf point at each other for Up and Down.
  • StyleShelf renders only as many tiles as fit. It measures before the first paint and follows resizes with a ResizeObserver, so no tile is hidden from the keyboard.
  • matchesQuery in StyleTiles.js now always matches word starts.
  • Removed SearchNCStylesHint and getSearchNCStylesMessage.

Testing

yarn lint and Prettier are clean. In Chromium against a local server with public data (Faerie Aisha, 143 styles):

  • "nostalgic" → 51 matches, 7 tiles at desktop width, 5 when narrower, 4 on a phone. "faerie" → 13; "token" → 143; "hat" and "zzz" → no shelf.
  • The shelf's count matches the full grid's for "red" (2), "or" (1), "e" (9) and "nost" (51).
  • Hovering previews; clicking wears; clicking again takes it off.
  • See all (by mouse, and by Enter) switches to styles mode with "nostalgic" kept, and focuses the field.
  • No shelf with the NP filter; shelf with the NC filter.
  • Keyboard: field → shelf → first item and back; Left on the first tile and Right on the last stay put without wearing anything.

A fresh-eyes review pass found the wrapping arrow keys, the mismatched counts, the lost focus after See all, and a one-frame flash of extra tiles. All are fixed in the last commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS

Step 4 of the NC Pet Styles plan: when an item search matches some styles, a shelf above the results shows them. This replaces the blue "check the emotion picker" hint. ## Screenshots ![Searching "nostalgic": an "NC Pet Styles · 51 matches" shelf with one row of seven tiles and "See all 51", above the item results. One tile is hovered, and previewed on the pet.](https://code.openneo.net/attachments/e2e6c5a2-55c0-4a4b-b239-074c53530d9e) <details><summary>Phone width</summary> <img src="https://code.openneo.net/attachments/33d25a91-551e-4a4c-90f3-73990ad75f75" width="390" alt="The shelf at phone width, with four tiles, above the item results"> </details> ## What changes for users - **The shelf** shows how many styles match, one row of them (pet's color first), and **See all N**, which switches to the NC Pet Styles search with the same text and puts focus in the field. - **Tiles work like the grid:** click to wear or take off, and rest the mouse to preview. - **Keyboard:** Down from the search field goes to the shelf, then Down again to the items, and Up goes back the same way. Left and Right move along the shelf without wrapping. - **When it shows:** only on page 1, after a pause in typing like the item results. It's hidden if a zone, NP, PB or own/want filter rules styles out. An NC filter keeps it. - **Matching is on word starts, here and in the full grid.** "red" finds Red styles, but not names that merely contain "red". This keeps "See all N" equal to what the grid shows. ## Under the hood - `SearchResults` does the style matching itself, so it knows whether there's a shelf. With one, `firstSearchResultRef` goes on the shelf's worn (or first) tile, and the first item and the shelf point at each other for Up and Down. - `StyleShelf` renders only as many tiles as fit. It measures before the first paint and follows resizes with a `ResizeObserver`, so no tile is hidden from the keyboard. - `matchesQuery` in `StyleTiles.js` now always matches word starts. - Removed `SearchNCStylesHint` and `getSearchNCStylesMessage`. ## Testing `yarn lint` and Prettier are clean. In Chromium against a local server with public data (Faerie Aisha, 143 styles): - [x] "nostalgic" → 51 matches, 7 tiles at desktop width, 5 when narrower, 4 on a phone. "faerie" → 13; "token" → 143; "hat" and "zzz" → no shelf. - [x] The shelf's count matches the full grid's for "red" (2), "or" (1), "e" (9) and "nost" (51). - [x] Hovering previews; clicking wears; clicking again takes it off. - [x] See all (by mouse, and by Enter) switches to styles mode with "nostalgic" kept, and focuses the field. - [x] No shelf with the NP filter; shelf with the NC filter. - [x] Keyboard: field → shelf → first item and back; Left on the first tile and Right on the last stay put without wearing anything. A fresh-eyes review pass found the wrapping arrow keys, the mismatched counts, the lost focus after See all, and a one-frame flash of extra tiles. All are fixed in the last commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS
From using it:

- Hovering was too eager: sliding across tiles on the way somewhere else
  previewed them. Now the mouse has to rest on a tile (within a few
  pixels) for 250ms, however slowly it's sliding. And after clicking a
  tile, jiggling the mouse on it doesn't preview it again.
- "nc" offers NC Pet Styles too, after Neocash items.
- Choosing NC Pet Styles after typing a phrase like "nostalgic pet style"
  removes the whole "pet style", not just "style".
- The "Previewing" pill doesn't show for the style that's already worn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS
Fix two edge cases in style hover and suggestion phrase removal
All checks were successful
CI / rspec (pull_request) Successful in 1m52s
CI / deploy (pull_request) Has been skipped
3f1cf57dae
- Leaving a tile before the mouse rests on it (onto a group heading or
  the gap between tiles) cancels its pending preview, instead of
  previewing it a moment later anyway.
- Only the last word of the typed phrase can be partial, so picking NC
  Pet Styles after "back to pet" keeps "back to".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS
Now that NC Pet Styles have a home in search, the PosePicker doesn't need
its own Styles tab, which opened right over the pet you were previewing.

- With no style worn, the popover shows the expressions, then an "NC Pet
  Styles" row with the species' style count. The row closes the popover
  and opens the NC Pet Styles search, with the cursor in the field.
- With a style worn, the popover shows that style instead, with "Change
  style" (to the search) and "Remove", plus a note that styles come with
  their own expression.
- The outfit list starts with an "NC Pet Style" group when one is worn:
  the token's thumbnail, the style's full name, NC and Pet Style badges,
  and Change, Remove and More info actions.

For the full name ("Nostalgic Faerie Aisha"), the alt styles JSON now
includes `full_name`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS
Don't make the outfit list's style row look clickable
All checks were successful
CI / rspec (pull_request) Successful in 1m51s
CI / deploy (pull_request) Has been skipped
e8c360d07d
Unlike item rows, it isn't a toggle: only its action buttons do things.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS
When your item search matches some styles for your pet, like "nostalgic"
or "faerie", a shelf above the results shows one row of them, with a
"See all" button that switches to the NC Pet Styles search with the same
text. Like the full grid, clicking a style wears or removes it, and
resting the mouse on it previews it.

- Matching is on the starts of words, so "red" finds Red styles but not
  ones that merely contain "red", and waits for a pause in typing.
- It shows as many tiles as fit in one row, so none are hidden from the
  keyboard.
- No shelf when a zone, NP, PB or own/want filter rules styles out.

This replaces the blue hint that pointed to the emotion picker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS
Fix shelf keyboard, counts and focus issues found in review
All checks were successful
CI / rspec (pull_request) Successful in 1m51s
CI / deploy (pull_request) Has been skipped
2336166253
- The arrow keys go from the search field, to the shelf, to the items,
  and back up again. Within the shelf, Left and Right stop at the ends,
  instead of wrapping around and wearing every style along the way.
- Style search matches the starts of words everywhere, so the shelf's
  "See all N" shows the same N styles as the full grid.
- "See all" puts focus in the search field, rather than dropping it as
  the button goes away.
- The shelf measures how many tiles fit before it first paints, rather
  than flashing 6 tiles first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014PWWczDoFB58ZYFZ68WxeS
armin-bot force-pushed claude/style-shelf from 2336166253
All checks were successful
CI / rspec (pull_request) Successful in 1m51s
CI / deploy (pull_request) Has been skipped
to a261dd3b35
All checks were successful
CI / rspec (pull_request) Successful in 1m58s
CI / deploy (pull_request) Has been skipped
2026-11-18 09:48:18 -08:00
Compare
matchu scheduled this pull request to auto merge when all checks succeed 2026-11-18 09:52:46 -08:00
matchu merged commit 77c2c54f7b into main 2026-11-18 09:53:01 -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!43
No description provided.