Commit graph

1109 commits

Author SHA1 Message Date
03acbb9757 Add Cypress env to eslint 2021-05-04 12:33:13 -07:00
b6274193d5 Hide outfit thumbnail in wardrobe after loading
Oops, it was possible after saving an outfit to get into a state where we would show the `<OutfitThumbnailIfCached />` behind the outfit even after it was saved, and then removing items would look weird until auto-saving caught up.

We had used the `backdrop` property because we wanted smoother partial load-ins, but for now I'm just fixing this by switching it to `placeholder`, which already has the right loading-only behavior.

This was also the only call site for `backdrop`, so I've removed it!
2021-05-04 12:33:13 -07:00
995a2b8a3a Fix infinite loop bug on initial outfit save
Oops, the sequence here was:
1) Save a new outfit
2) The debounced outfit state still contains id=null, which doesn't match the saved outfit, which triggers an auto-save
3) And now again, the debounced outfit state contains the _previous_ saved outfit ID, but the saved outfit has a _new_ ID, so we save the _previous_ outfit again

and back and forth forever.

Right, ok, simple change: if the saved outfit ID changes, reset the debounced state immediately, so it can't even be out of sync in the first place! (I also considered checking it in the condition, but I didn't really understand what the timing properties of being out of sync due to debouncing would be, and it seemed to not represent the reality I want.)
2021-05-04 12:33:13 -07:00
1d97988383 Finish outfit auto-saving!
Hope it actually work-works lol

Did some refactors in useOutfitState to support the new reset action we do after auto-saving, in case the server tweaked things like the name.
2021-05-04 12:33:13 -07:00
217aa8dcc1 [WIP] Outfit-saving UI
The auto-saving frontend! It seems to trigger saves at the right times, but they fail, because the backend doesn't support updates yet!
2021-05-04 12:33:13 -07:00
18a3ddfbad Fix Cypress outfit snapshot positioning (a hack!) 2021-05-04 12:31:54 -07:00
56e1ce595c Fix misc lint errors
I ran `yarn eslint src`, and fixed everything I saw!
2021-05-03 15:06:07 -07:00
ec3aa1747d Lint against console.log
and replace `console.log` instances in the codebase with better alternatives!
2021-05-03 15:01:49 -07:00
71a6dbdad7 Oh right, stop leaving console.log lying around 2021-05-03 14:57:10 -07:00
c508d49272 Add glitch message for Faerie Uni
Note that we implemented the actual horn behavior described in the message, simply by marking the yellow horn appearance glitched for Fem, but not for Masc! Also, we don't have a yellow-horn Sick Masc model, so it's blue too.
2021-05-03 14:52:50 -07:00
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
ee0185a846 Upgrade Chakra to 1.6.0
Need this for an upcoming bug fix!
2021-04-30 12:48:03 -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
fc6cb2dfdd Fix Honeycomb trace labels for API endpoints
I'm learning that top-level traces should use operation_name as well as name, because name is the low-level thing that every trace gets (including child traces like db queries and net requests)!

Also there was an incorrect label in one of these, and validPetPoses was missing it altogether
2021-04-23 12:31:50 -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
3bb0c5e5a0 Add Cypress test for outfit with items 2021-04-20 02:32:42 -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
3f66dd7244 Add image snapshot to outfit saving Cypress test
Just as a simple check that the basic outfit data is looping back around as expected!
2021-04-19 04:00:44 -07:00
437a327b73 Fix incorrect Cypress test name
Oops, I used this as a stub test for just logging in at first, and then forgot to rename it!
2021-04-19 03:57:46 -07:00