Commit graph

160 commits

Author SHA1 Message Date
531ca3c22f Create Cypress command to log in
I'll use this to test outfit saving!
2021-04-19 02:22:45 -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
405e35a546 Basic outfit state Cypress tests 2021-04-16 04:27:19 -07:00
6f6fc264af Add NC/NP tags to homepage & search result items 2021-04-01 20:08:35 -07:00
bfd2d78d76 Fix extra horn bug for Wraith Unis 2021-03-23 18:59:06 -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
1f103989a3 Add blanket warning for invisible pets 2021-03-18 09:02: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
db8e7848d7 Glitch info for pets w/ OFFICIAL_SVG_IS_INCORRECT 2021-03-17 05:54:34 -07:00
e4c8031c3b Show previews for bulk-add layer tool 2021-03-15 07:50:13 -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
927401fc92 The NEW UC rule is that non-body-specific is okay! 2021-03-13 07:21:40 -08:00
841c96d56a Fix crash when knownGlitches is undefined
Not sure exactly when in the flow this happens! But spooky! Don't crash!
2021-03-13 02:21:32 -08:00
da2b8813c2 Oops, fix HTML5 badge for Flying in an Airplane
Oops, the HTML5Badge was using the presence of an `svgUrl` to decide if the item is converted!

Here, we add an extra condition that if the OFFICIAL_SVG_IS_INCORRECT glitch is applied, then *that* indicates HTML5 conversion, too.
2021-03-13 02:00:32 -08:00
6ebbc4af02 Explain Static UC conflict in a new glitch UI 2021-03-13 01:48:12 -08:00
d44315de2c Oops, actually Static hides UCs! 2021-03-13 01:08:48 -08:00
56dd2bbdd7 Hide Static zone for UCs, just like restricteds 2021-03-13 00:51:13 -08:00
bdc4cdf46b Use official PNG when available, instead of ours
This was one more bit that needed fixing for "Flying in an Airplane": it wasn't just the official SVG that was incorrect, but also the official SWF. So our converted PNG was also incorrect!

Here, we now try to use the official Neopets PNG when the manifest provides it, instead of our own.
2021-03-12 04:28:57 -08:00
0aaf1adb29 Add Support tool for OFFICIAL_SVG_IS_INCORRECT
Inspired by the "Flying in an Airplane" bug (item 82287), where the official SVG (and I think SWF) were visually glitched and included both zones in the image, but the official PNG was correct.

This flag lets us use the PNG, like the official player does—but only for this item, while still keeping SVGs for everyone else!
2021-03-12 04:01:35 -08:00
0ae26a6633 [WIP] UI for isManuallyNc support tool 2021-02-22 19:11:03 -08:00
614dc0795a Switch to bottom tooltips for zone/html5 info
I've decided that covering up the species faces with other species info is too weird! It feels like it's removing some ability to cross-reference.

A cool UI affordance would be to have this and the faces interact with each other, like you can hover to highlight the relevant species faces, or even vice-versa, to show the relevant zones for this species. But that's probably way overkill for this relatively niche feature.
2021-02-12 18:35:16 -08:00
7421f41e58 Move HTML5Badge to zones area 2021-02-12 17:46:33 -08:00
d2c672667d Fix performance problem with defaulting to [] 2021-02-10 13:51:59 -08:00
bbb752fa65 Extract out layerUsesHTML5 function 2021-02-10 13:50:42 -08:00
10e47115bd List non-HTML5 items in wardrobe page 2021-02-10 13:47:02 -08:00
0c80491f99 Add HTML5Badge to outfit page 2021-02-10 13:35:34 -08:00
9e49b6ae3e Fix text color for OutfitPreview
Oops, I never actually saw the practically invisible text in light mode! Let's make it actually dark in light mode item pages, and still dark in all wardrobe pages!
2021-02-09 22:36:50 -08:00
1eb00ba6ca Fix crash when choosing invalid appearance
Oops, I messed up in my `useOutfitPreview` refactor just now! Fixing fixing!
2021-02-09 22:27:22 -08:00
193273f00f Share appearance data via useOutfitPreview
Here, we offer a second syntax for `<OutfitPreview />`: a hook that offers the same UI as `preview`, but _also_ shares the `appearance` data.

This makes it easier to have UI that depends on the outfit appearance, without having to commit to all the `useOutfitAppearance` stuff in the parent. Same easy syntax! :3

I've refactored the item page to use this for compatibility testing, instead of using the Apollo cache (which was also cute and same perf impact, but more overhead!)
2021-02-09 20:28:03 -08:00
75fccf1adf Load best available pose in SpeciesFacesPicker
Oh right, I left in a hack to just always pick HAPPY_MASC or HAPPY_FEM, back when it was just the basic colors. Now that we're all the colors, we need to be able to handle fallbacks for missing or unlabeled poses, too!!
2021-02-03 02:10:52 -08:00
6d05fb8680 Fix bug in SpeciesColorPicker loading state
Oops, I made a fix to the color picker, but not the species picker! Updated them both to match.
2021-02-02 16:46:07 -08:00
f699d867e5 Disable species picker for species-specific items 2021-02-02 16:45:28 -08:00
05282f4b7b Handle memory issues in OutfitMovieLayer
I think what's happening in Sentry error IMPRESS-2020-1F is that mobile devices are running out of memory, so `canvas.getContext("2d")` returns null.

Now, we have a UI affordance to let you know when this is probably what's happening!

Also, when researching this, I learned about a Safari bug where you need to manually garbage-collect your own canvas data. It's possible that Safari users have been having particular trouble with memory leaks over long sessions? I'm not sure, but it seems like a good idea to add this small garbage-collection code!
2021-02-01 18:55:05 -08:00
5d827bc78d Disable species/color picker while item page loads
Ok I think I've finally narrowed this bug down! We had one more loading case: the items page needs time to figure out which species/color to default the fields to, and passes null into the component while this loads. Now, we wait for that!
2021-02-01 18:05:29 -08:00
10e09e266c Add debug logging for species/color picker bug
We're occasionally getting errors on the homepage, of the new message I added: `Error loading valid poses for species=, color=108: byteOffset cannot be negative`.

So ok, now we know it's a species undefined bug, coming from `onChangeSpecies`! That suggests we're not finding by ID correctly?

So I'm adding some new logging to help me understand the sequence of actions leading up to this point, and the species data state when the error itself happens!
2021-01-26 14:08:09 -08:00
7092d86b76 Better error logging for movie clip errors
I'm getting some vague errors in Sentry about `canvas.getContext` returning null? Weird. (IMPRESS-2020-1F)

I'm not sure what that's about, so I don't want to stop sending it to Sentry. But I do want to make sure we handle this kind of error gracefully! (I'm thinking about how, while I don't think this one was, in the future this _could_ be caused by errors in Neopets movie clip JS, and I don't want our app to start messing up because of it!)

Here, we make sure to log the error to the console with more detail (the library URL), and show feedback to the user, and only log the error once per clip (so that animated ones don't like, send a bunch).
2021-01-23 12:43:17 -08:00
38969e8658 Use loading state while loading /api/validPetPoses
Oops, we were getting errors when people tried to change the species/color picker before the valid pose data was ready!

This was only happening on the homepage and item page, because on the wardrobe page we wait for the valids to load before showing the picker at all (`showPlaceholders` is false).

To fix this, we add the valid poses loading state to our existing `isLoading` state on the selects, which disables the element and adds a loading spinner cursor. This prevents interactions we're not ready for!
2021-01-22 14:27:23 -08:00
88fd4698d0 Better handling for getPairByte errors
I'm not sure why, but people are seeing errors when reading from the /api/validPetPoses binary blob. I think it's the picker not handling loading states well?

In this change, we start by just giving it graceful handling, and improving the logging. I'll also try to fix the cause in the next change!
2021-01-22 14:23:05 -08:00
81117218a3 Only wait for auth on queries that need it
I switched from my `_NoAuthRequired` opname hack, to a more robust `context` argument, and it's opt-in!

This should make queries without user data faster by default. We'll need to remember to specify this in order to get user data, but it shouldn't be something we'd like, ship without remembering—the feature just won't work until we do!
2021-01-21 14:57:21 -08:00
6e33132881 Load homepage faster for logged-in users
When building the code to await auth before sending _any_ GraphQL queries, I didn't realize that auth might be kinda slow. So, I've added a hack to let me mark queries with no user-specific data to skip auth, and applied that to the main queries on the homepage.

I think this is a hint that we might want to change our strategy - e.g. to flip it to hackily mark that auth _is_ required, or to create wrappers or option-builder helpers for logged-in queries, etc.

I also notice that SSR would have resolved this particular case...
2021-01-18 07:15:00 -08:00
154046695f Avoid alt text flash of content for item thumbnail 2021-01-18 06:51:23 -08:00
334d89c101 Add Latest Items section to homepage 2021-01-18 06:31:27 -08:00
1376e95f84 bug fixes for new ItemCard
Oops, I messed up the background color in dark mode! and left in an extra `as` prop
2021-01-14 05:34:13 -08:00
8567f9d4b8 Try a grid-based view for item lists
I took out virtualization for now too, I wanna see how this non-Chakra UI version, with fewer nodes and no tooltips etc, performs on large lists in production.
2021-01-14 04:58:40 -08:00
7a5a6b919b Fix Download button
Huh, I'm not sure why SVGs ever didn't have `crossOrigin: "anonymous"`? The old commit isn't really super helpful for understanding that. Maybe I just didn't notice the problem in that case?

Well, whatever. Let's see if this breaks something else! (I'm also wondering if we should just like, _always_ ask for things with crossOrigin set?)
2021-01-08 17:38:27 -08:00
62579dc671 Keep outfit thumbnail while individual layers load 2021-01-08 02:53:31 -08:00
2a8be58973 Show thumbnail in wardrobe page while outfit loads
To help the load time for outfits feel shorter, we now reuse the outfit thumbnail from the Your Outfits page as a placeholder!

This doesn't add any overhead when the thumbnail data _isn't_ in your session cache, e.g. if you navigate to the outfit directly. But if we have the thumbnail on hand already, we just show it, easy peasy!
2021-01-08 01:23:24 -08:00
3804457839 fix OutfitPreview fade out bug
Oops, when switching to @emotion/react, it turns out they no longer support that cute hack I was doing to append suffixes to class names!

Here, I change strategy and let `CSSTransition` apply the plain `exit` and `exit-active` classes to its children, and apply Emotion styles to the child to check for _also_ having those classes.
2021-01-07 00:33:51 -08:00
4a352e04e0 simulate login with IMPRESS_LOG_IN_AS flag 2021-01-05 23:22:03 -08:00
1f5a9d60a2 Show saved outfits in wardrobe page!
Still a pretty limited early version, no saving _back_ to the server. But you can click from the Your Outfits page and see the outfit for real! :3 We have a WIPCallout explaining the basics.
2021-01-05 06:29:39 +00:00