Commit graph

922 commits

Author SHA1 Message Date
f3e9df2d91 Fix PosePicker support modal
It wouldn't open, because I'd set `isLazy` on the popover, so opening the modal would close and UNMOUNT the popover, which unmounted the modal!

Now, we use the new `lazyBehavior` prop to keep it mounted _after_ the first time it opens. This is why I needed to upgrade Chakra!
2021-04-30 12:48:49 -07:00
e735b9b0f6 Disambiguate some UC conflict glitch message cases 2021-04-29 12:59:33 -07:00
cb104954af More aggressive zone filtering for UCs 2021-04-29 12:38:31 -07:00
d373a7a54f Add restricted zones to pet appearance support UI 2021-04-29 11:52:25 -07:00
cb2a5bc912 Don't add ?state until opening Support pose picker
Oops, I made a recent change to automatically add `appearanceId` to the outfit state when you open the Support pose picker, to avoid navigation issues.

But I didn't realize this happened _silently_ when you open the page as a Support user, because the Popover preloads!

Now, the Popover doesn't preload its content. This is probably better for normal users too, the PosePicker UI is a bit heavier with 6 previews than I really want!
2021-04-28 15:00:34 -07:00
f3173db7b3 Fix bug unwearing/removing search results
Oops, our "items to reconsider" feature was preventing unwearing/removing items you're already wearing!

This feature helps you try stuff in Search, without disrupting your outfit. e.g. if you try on a new Background, then change your mind and unwear it, then we reapply whatever old Background you had on the outfit before.

But this made it impossible to remove your _current_ background from the search page if you went back and searched for it again, because we would remove it and then reconsider and reapply it 😅

Now we, um, stop that!
2021-04-26 07:21:47 -07:00
6517087568 Improve search result click performance
Huh, dunno when I regressed this! Or maybe I never did it for search results, just the main items page? But we're needlessly re-rendering the entire search results list when you wear/unwear something, because `onRemove` always changes, and that breaks the `React.useMemo` on `Item`.

Now, we cache the `onRemove` callback with `React.useCallback`, so perf is much happier!
2021-04-26 07:14:29 -07:00
571b064fb5 Oops, fix crash for empty manifests!
Lol whoops I goofed up what happens when there's no manifest! Ooops
2021-04-26 06:48:33 -07:00
d98a533dce Update asset manifests after 3 days of staleness 2021-04-26 06:40:05 -07:00
6918b3cefa Fix bulk-add layers tool
Oops, we extracted Support fields out from the default `appearanceLayerFragment`!

This was causing the page to silently fail to show any changes, because `layer.remoteId` was evaluating to `undefined` rather than one of the ID numbers in the range.

Here, I've added both `remoteId` explictly because we use it directly, and also the support fields because that's what the layer support UI needs!
2021-04-26 06:07:52 -07:00
3a4e5d7e13 Whoops, fix lint 2021-04-26 05:52:43 -07:00
de27c4297d Stop reverting PosePickerSupport with cache data
Oops, making changes in PosePickerSupport would sometimes trigger a re-fetch in PosePicker.

Specifically, PosePicker needs some fields that PosePickerSupport doesn't, so changing the canonical poses causes PosePicker to ask for stuff again—which will probably serve a SWR'd cached version that doesn't reflect the Support changes!

Here, we update the PosePickerSupport query to prefetch all the fields the PosePicker _would_ want for any of these poses. That way, if we swap in a new one as the canonical appearance for a pose, there's no refetch needed, and therefore no risk of hitting a stale cache.
2021-04-23 16:05:52 -07:00
e955817acf Don't navigate away after updating a pose 2021-04-23 15:58:47 -07:00
f223424cfa Add total count to /support/petAppearances 2021-04-23 15:37:52 -07:00
61636a0067 Better focus/hover UI on /support/petAppearances 2021-04-23 15:34:16 -07:00
72e4fa0ad0 More precise data for /support/petAppearances
We move to an actual GQL query, instead of approximating with /api/validPetPoses.

Notable changes are omitting glitched states from UNKNOWN, so we don't prompt Support users to fill in missing states with bad states; and omitting glitched states from standard, so that we _do_ prompt Support users to check UNKNOWN states for new _non-glitched_ versions we can start to use.
2021-04-23 15:31:10 -07:00
a0107aaf7b Add createdAt and updatedAt to Outfit GQL
Not used in-app yet, but Dice wanted it for the Discord Neobot!
2021-04-23 13:02:18 -07:00
14ec4585d7 Oops, fix stale-while-revalidate for modeling data
Huh, I used max-age=1, which suggests to me that I _meant_ to put SWR in here too but just forgot! Oh well lol, fixed now!
2021-04-23 12:12:15 -07:00
a14bddb39e Separate modeling queries into public vs user data
This will enable better caching! Though it looks like the stale-while-revalidate isn't coming through on modeling public data, I wonder why?
2021-04-23 12:10:16 -07:00
2f7b6571f2 Fix loop in useFetch
Oops, my recent change made it so `useFetch` started re-requesting stuff in an infinite loop 😅 right, this is how effects work, lol!
2021-04-23 11:48:38 -07:00
0fe83419f7 Navigate Support directly to unknown pose 2021-04-23 11:44:55 -07:00
a16765b27e Fix lint errors 2021-04-23 11:40:49 -07:00
cc0833f7ac Add explainer info to /support/petAppearances 2021-04-23 11:38:52 -07:00
aa28ee8b39 Add /support/petAppearances page 2021-04-23 11:31:25 -07:00
8b5ba60ea8 Check for new outfit saved indicator in Cypress 2021-04-22 02:44:45 -07:00
99e0fdbf59 Add indicator for whether changes are saved
Now, when viewing a saved outfit that you own, you'll see a "Saved" indicator if it matches the version on the server, or a temporary UI of "Not saved" and a tooltip if not.

Auto-save coming next!
2021-04-22 02:35:59 -07:00
dc6d5b5851 Minor variable name change 2021-04-22 01:59:49 -07:00
34b69a5e2b Oops, show the 600x600 image in pet layer support
Previously, the PNG link for a pet layer would show the 150x150 version. This was both an inconvenient size, but also not reflective of how the layer actually behaved, because we only use Neopets's official PNG for the 600x600 version!
2021-04-21 22:08:15 -07:00
b9b6667414 Add support tools for pet layers 2021-04-21 22:06:07 -07:00
e8a2b8ba28 Rename {Item -> Appearance}LayerSupportModal
In preparation for extending it to non-item layers? 👀
2021-04-21 21:29:10 -07:00
2617052da0 Oops, fix lint errors 2021-04-21 21:27:10 -07:00
c64f542829 Reload Your Outfits after saving an outfit 2021-04-20 02:26:46 -07:00
6640a2d8ca Can save outfits with items 2021-04-20 02:12:07 -07:00
f504808e12 Oops, fix crash saving untitled outfits 2021-04-20 01:53:30 -07:00
5ac758cc72 Oops, don't allow saving existing outfits
Ah, oops, the `id` field from `useOutfitState` went missing and I didn't notice, so `useOutfitSaving` didn't correctly detect that this was an existing outfit!

This made saves on existing outfits create new copies, which isn't a bad behavior exactly, but I don't want to go there; saving a copy is just gonna pollute people's outfit lists rn, worse than no option imo.
2021-04-20 01:50:42 -07:00
f9b07dad24 Can save new outfits w/o items
Just a basic e2e starting point! Simple logic, with simple gates to prevent saving outfits we're not ready for. Safe to ship, despite being very incomplete!
2021-04-19 03:56:51 -07:00
531ca3c22f Create Cypress command to log in
I'll use this to test outfit saving!
2021-04-19 02:22:45 -07:00
9f2629ae61 Fix crash when editing saved outfit
Oops, something I didn't test in the recent refactor! Right, these need to be Sets.
2021-04-16 23:49:10 -07:00
71215fe599 LRU caches to speed up outfit layer preload
The layer preloader already takes advantage of, and primes, the HTTP cache.

But we still do duplicate work, on every OutfitPreview render, to re-execute movie clip libraries, and create a movie clip to test for animations. The former is nontrivial cost, and the latter is often large cost. This can make even basic outfit changes slow, when there's no change to the movie clip layers and the player is paused!

Here, we add an LRU cache for movie clip libraries, and for the question of "is it animated?". This should speed up a number of places where we would reload the movie (including between toggling the item), and various changes that were triggering full movie clip rebuilds unnecessarily.

We _aren't_ solving here for the fact that toggling an animated item requires rebuilding the movie clip, which could conceivably be cached—but with some state management trickiness, because ideally it should be a separate clip for each context where it's being shown. Imo not yet worth the effort! (esp because I think users understand that toggling an animated item can be slow, whereas this was affecting _other_ actions way too much)
2021-04-16 20:16:56 -07:00
6f03a13516 Serve null outfit names for anon outfits
Oopsie!
2021-04-16 19:26:07 -07:00
e3ac9d06e5 Handle non-existant outfits better
Gotta remember to check the validity of IDs earlier than that lol!
2021-04-16 19:18:28 -07:00
9e2f9eab16 Better support for colorId=0
This is a glitchy state that pets can get into! `spankaroonie` is an example, at time of writing.

Before, we would crash on loading downstream fields for the pet's color. Now, we don't! We also fix an oversight in the pet's `petAppearance` field, to trigger the "not yet modeled" error when the pet type doesn't exist.
2021-04-16 18:47:21 -07:00
ddd224c8d1 Handle null outfit creator, oops! 2021-04-16 18:41:26 -07:00
fd931c064e Merge branch 'outfit-saving' into main 2021-04-16 04:32:45 -07:00
405e35a546 Basic outfit state Cypress tests 2021-04-16 04:27:19 -07:00
e1f9f87695 Add ?loadPet param to support custom search engine 2021-04-16 03:15:24 -07:00
8d18bc06b7 Refactor outfit state selection
Here, we consolidate useOutfitState to get its base `outfitState` from a few different places: parsing the URL, and processing the saved outfit data, return an object of the same shape as the state stored in the reducer.

This enables us to just pick one of the three, instead of our kinda awkward individual-field fallbacks.

This will also help us with some upcoming work to make Back/Forward navigation work better.
2021-04-15 17:17:53 -07:00
4bc4e98a0a DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN pet layers
Now we show a message for pet layers with the DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN glitch applied! Previously, there would just be no message, because we only had UI logic for when it was applied to an _item_ layer.
2021-04-13 17:17:42 -07:00
3e3188786c Add glitch OFFICIAL_MOVIE_IS_INCORRECT
Some of the "MiniMME11-S1: Approaching Eventide Skirt" visuals are pretty clearly glitched on TNT's end, like the Jubjub, which just has a single flat version of the dress floating in the corner of the screen.

This is a message to make that case even clearer!
2021-04-12 19:51:19 -07:00
1e4063f0d9 Add glitch DISPLAYS_INCORRECTLY_BUT_CAUSE_UNKNOWN
I'm applying this to the "MiniMME11-S1: Approaching Eventide Skirt" on the Acara, which seems to load all 1000 images from the manifest, but then show no animation and no errors. Not sure what's up, and not inclined to deep-debug until we have a check on whether it works on-site!
2021-04-12 19:36:08 -07:00
5212375c34 Handle very large asset manifests
Huh, so apparently the "MiniMME11-S1: Approaching Eventide Skirt" on the Acara has 1000 layer images lol.

This caused the manifest string to overflow the MySQL `TEXT` field, and fail to parse as valid JSON when loading it back for the client.

I've updated the database to use `MEDIUMTEXT` instead, and added a warning message & skip behavior when the manifest size would exceed the database limit, and added graceful error handling for the invalid JSON scenario. Now, we don't crash, and the data self-repairs, and keeps in a better state in the first place!

But I'm also worried about this asset, it doesn't play correctly anyway, and I'm not sure if that's an overload on our end, or just a flat problem in the JS. (There's no error message on the client, it just… loads all the layers, then shows no play button, seemingly self-satisfied.)
2021-04-12 18:58:28 -07:00
020ac572e4 Use asset IDs when looking up pet's PetAppearance
This was causing a bug where unlabeled poses would cause pet lookups to fail!

Now, we return the actual pet appearance for the pet, if we have it, by matching against asset IDs first.
2021-04-12 18:30:41 -07:00
4cb47f3c7c Don't crash if auth0 credentials are missing
I'm setting up the app in a fresh box, and I noticed that the Auth0 credentials are an immediate crasher if not present. That doesn't seem ideal to me for something only used in support actions! I'd rather just have that support mutation crash, if we happen to call it.
2021-04-12 18:05:00 -07:00
b80149440d Merge branch 'waka-ui' into main 2021-04-08 18:32:46 -07:00
b92b5696b4 Remove unused import 2021-04-07 22:12:03 -07:00
089654e092 Use VERCEL_URL for waka loader if given
Oh right, our preview deploy was loading the prod allWakaValues data! Now it uses the VERCEL_URL env variable to request from the current deployment instead.
2021-04-07 22:02:10 -07:00
a32bc34171 Tweak Waka tooltip copy 2021-04-07 21:46:03 -07:00
ce57f9a67a Fix crash on pressing Escape in item search 2021-04-07 20:24:45 -07:00
2b93e5cca7 Waka tooltip copy edits 2021-04-07 17:37:38 -07:00
be816d89c9 Waka item page UI! 2021-04-07 16:48:41 -07:00
d918162a2f Minor bugfix in wakaValueText
This is the same user-facing behavior, but stops logging errors for items that are _expected_ to not have Waka data
2021-04-03 14:32:12 -07:00
a73427af1e Add 1-hour caching to wakaValueText
One day is too long! I'd prefer 1min for just the value itself, but I don't want to bog down all the other metadata with it, it's not _essential_ for it to be faster.
2021-04-03 14:29:37 -07:00
df71a16354 Add wakaValueText GQL field to items
Again, I think I'm getting a bit ahead of myself :p Mostly I wanted to see if this architecture would work out!
2021-04-03 14:26:41 -07:00
5cd6fac052 Apr 1 "New Updates" 2021-04-01 20:10:06 -07:00
6f6fc264af Add NC/NP tags to homepage & search result items 2021-04-01 20:08:35 -07:00
e0c7a4d82c Add OFFICIAL_BODY_ID_IS_INCORRECT glitch
Applied to
- Colourful Female Kiko Dancer Tambourine
- Magma Usul Bow
- Stealthy Elephante Mask
- Wocky Gadgeteer Air Balloon
2021-03-30 22:27:34 -07:00
8487d9674a Only show Save if logged in 2021-03-29 19:50:34 -07:00
06ec0b0b52 Add disabled save UI 2021-03-29 19:46:21 -07:00
7a7c166148 Move Rename into outfit menu
More stuff will be there later, mostly I'm just creating the new home, and making room for the new save UI
2021-03-29 19:25:00 -07:00
9f5b8a7e6e Remove stray import 2021-03-28 16:24:12 -07:00
bfd2d78d76 Fix extra horn bug for Wraith Unis 2021-03-23 18:59:06 -07:00
7c9f4828f9 Add toggle to show/hide older trades 2021-03-23 18:52:01 -07:00
3984f9c9ba Filter trade counts to the last 6 months 2021-03-23 18:32:22 -07:00
62952b80dd Can edit closet list text, incl as Support
I wanted the ability to clear out closet list text for Support users, and figured I should just build the UI for end users too, and grant Support users the same access!
2021-03-23 17:48:11 -07:00
790c231b5d Add "Send email" button for Support users 2021-03-23 16:50:09 -07:00
0e8e50b054 Simpler, faster modeling query
I narrowed down the problem to the fact that we were joining in pet types against assets, and *then* running GROUP and DISTINCT and everything. Assets x compatible species/color pairs is a LOT of rows!

Here, we instead get all the relevant body IDs first, and *then* match them against pet types—which we fetch in one batch to match body to canonical species/color.

I'm also trashing the weird caching mechanism we did here, because in practice it doesn't seem reliable anyway. If anything, I'd want to look at stronger CDN caching. (I made a small improvement to the caching annotation, but ultimately it still doesn't matter, because this query uses logged-in stuff and always comes out max-age=0 anyway.)
2021-03-18 13:02:06 -07:00
1f103989a3 Add blanket warning for invisible pets 2021-03-18 09:02:40 -07:00
85c17a177c add comment about pet appearance glitch message 2021-03-18 08:58:40 -07:00
0b16278703 Add message for glitched pet appearance
Seeing this right now with a lot of Invisibles, who have faces but we don't have the correct faceless ones in the db yet
2021-03-18 08:31:12 -07:00
a848533c7c Add OFFICIAL_SWF_IS_BROKEN glitch
Snug Hissi and Old School Draik outfits are gonna be labeled with this!
2021-03-18 06:59:21 -07:00
6638ff409e Extract OutfitKnownGlitchesBadge to new file 2021-03-18 06:40:52 -07:00
db8e7848d7 Glitch info for pets w/ OFFICIAL_SVG_IS_INCORRECT 2021-03-17 05:54:34 -07:00
a66fa02f15 HomePage updates Mar 16 2021-03-16 09:10:02 -07:00
17d75ee97f Add color and step-value support for bulk add
This is enough to start fixing items like Baby in a Pumpkin! Hooray! 😁
2021-03-15 13:28:16 -07:00
92db11b995 Add REQUIRES_OTHER_BODY_SPECIFIC_ASSETS glitch
This helps with items like "Living in Watermelon Foreground and Background", which has a species-specific foreground and bodyId=0 background.

With this flag set on the background, it won't appear for pets that don't _also_ have something else that fits. In this case, it hides it from Standard Vandas, and all non-standard colors.

There's some hacky limitations here: the item page still highlights the Vanda, even though clicking gives nothing; and the zone info for it is messy too, with the Background claiming to fit all species, and the LFI claiming to fit 54 specific species. But those don't seem important enough to code for!
2021-03-15 12:44:40 -07:00
4e9805af60 Bulk-add tool actually saves stuff!
I fixed Dug Up Dirt foreground, hooray! Hope it sticks
2021-03-15 09:13:25 -07:00
5f32d80022 Oops, fix backend syntax error
Right, I keep forgetting that my local env isn't picky about this, but prod is
2021-03-15 08:29:26 -07:00
1dce12e792 Oops, fix item previews with bodyId=0!
The other day, I deleted what was apparently a load-bearing glitch row, lol 😂

We had a row in pet_types that somehow had `body_id = 0`. And I guess that was causing this query to return some species, even though that body has no species.

Here, I'm adding support for the special `representsAllBodies` body's species to be null. The client seems chill with it, we weren't using that property in that situation anyway!
2021-03-15 08:22:17 -07:00
c0e70b4c62 Preview + save UI for bulk-add tool
still not wired up tho!
2021-03-15 08:11:10 -07:00
67245d6f70 Add support for no-Vanda items to bulk-add tool 2021-03-15 07:58:44 -07:00
e4c8031c3b Show previews for bulk-add layer tool 2021-03-15 07:50:13 -07:00
9eb0906a69 Copy tweak for item support drawer 2021-03-14 08:13:17 -07:00
b1ca7c6bab Tweak zone labels in support UI
I like making these more concise and consistent across the dropdown and the cards, I'm still not 100% sold on the design but it seems ok for now!

At first I had it in the dropdown as "Background (3)", but realized that conflicts with the usual pattern of like, saying how many items match a certain filter…
2021-03-14 08:07:41 -07:00
f3f8f6748f [WIP] A better TODO message for the bulk add tool 2021-03-14 07:57:56 -07:00
d2eb941c24 [WIP] Add bulk-add form to "Layers on all pets"
It doesn't work yet though! Just form UI!
2021-03-14 07:50:21 -07:00
2dcfc7524a Add Neopets ID to support layer UI
Using this to get an at-a-glance check on how Neopets IDs are typically assigned for body-specific items… looks like it's increasing, and alphabetical by species? (not by species ID?)
2021-03-14 07:18:36 -07:00
7c5e7ab21a Add Support view for all appearances of an item
I think this will be generally useful to minimize switching around for common operations, but also I'm thinking of building a bulk assign tool for things with broken body IDs, and this will be the place for it to live, I think
2021-03-14 07:16:01 -07:00
535abec228 Oops, fix manually NC condition!
Oops, we weren't doing a good job encapsulating the different conditions in item search. The `OR` in the NC condition was causing a precedence problem!

Now, we wrap all the conditions in parens at the interpolation site, to make it really clear that they all need to be made safe like that!

Now, there's not a bunch of "??????" entries in NC search, oops 😅
2021-03-14 05:28:57 -07:00
927401fc92 The NEW UC rule is that non-body-specific is okay! 2021-03-13 07:21:40 -08:00
36b0cb75e5 Add Twitter link to homepage updates 2021-03-13 03:18:32 -08:00