Commit graph

285 commits

Author SHA1 Message Date
bf2660cbd4 show a basic item preview on the new item page 2020-09-12 17:56:31 -07:00
ef7ba58c90 refactor ItemPage a bit
to prepare the way for the other content
2020-09-12 17:27:00 -07:00
4f6f3640bb start building item page 2020-09-11 23:56:47 -07:00
ebb8c63ac6 page title upgrades 2020-09-11 23:54:37 -07:00
a52bd3e3bb fix some old lint errors! 2020-09-11 23:27:23 -07:00
76ad917843 rename ItemsPage to UserItemsPage
this is because I'm making ItemPage now lol
2020-09-11 23:20:06 -07:00
9143bacbe5 fix typo in comments 2020-09-11 22:36:38 -07:00
0d7efb2357 use 3 columns for grid on wider screens
This isn't as great for modeling cards, but it's fine imo, and it's much better for item list cards (where there's practically no badges)
2020-09-11 22:13:38 -07:00
d1262f77d7 sort trade list matches to the top of item lists
Items with the "You want this!" or "You own this!" badge will now sort to the top of their respective lists!
2020-09-11 22:04:37 -07:00
5546b21c27 use the same ItemCardList in items + modeling
and make the grid items take the full two-column width
2020-09-11 21:53:57 -07:00
8e091b14c6 add own/want compare badges
now you can compare your item lists with other users!
2020-09-11 21:45:38 -07:00
45ffa92f1d add itemsTheyWant to user GQL 2020-09-11 21:34:28 -07:00
0df57818e3 create ItemCard, use it in ItemsPage too
extracted from modeling page!
2020-09-11 20:41:39 -07:00
9cb6cc2120 use better colors for light mode hanger spinner
Initially the spinner was only used in OutfitPreview, where the background was always pretty dark. Now that we use it in more general contexts, we need a light/dark distinction!

Also went and standardized out the `size` props
2020-09-10 03:06:44 -07:00
93564ee6bd more realistic loading state into WardrobePage
Here, we extract a lean WardrobePageLayout component, so that we can bundle it into the main app as a loading state for WardrobePage.

This means that clicking Start from the homepage will, instead of flashing the screen to white while WardrobePage loads, show the correctly-sized black/white page layout instead.
2020-09-10 02:54:22 -07:00
c7e2daa07b fix visual regression on homepage
I think the Chakra upgrades made these overrides stop working? added !important so that they happen again!

The regression meant the homepage looked worse, always having the selects fade in :/
2020-09-10 02:37:06 -07:00
0975a94511 code-split nav bar out 2020-09-10 02:32:14 -07:00
0fa378ec6c lol I triggered that weird comments bug again XDD 2020-09-07 21:17:07 -07:00
75ffd813e9 oops, fix bug in Chakra globals
ahh, right, I was overriding their html/body styles! stop doing that 😅
2020-09-07 21:11:10 -07:00
901a6b14f0 add gentle border to modeling cards 2020-09-07 21:06:25 -07:00
75df0cc445 create nav menu, move dark/light toggle to left 2020-09-07 21:02:28 -07:00
0c3d9443c2 upgrade to next Chakra RC
some regressions in here with global styles and color mode! I think we got it fixed though!
2020-09-07 20:59:38 -07:00
bebb8e2d11 add Modeling link, permanent home link, subtleness 2020-09-07 19:48:03 -07:00
d4c2a681ab add some extra loading flair
just some text to keep you busy in the longer loading cases!
2020-09-07 00:34:01 -07:00
0c614deb41 add focus/hover responses to modeling page cards 2020-09-07 00:14:44 -07:00
dba8eed7e5 add dark mode styles for modeling page 2020-09-07 00:03:46 -07:00
626b36319a add a badge to items the user owns 2020-09-07 00:00:56 -07:00
6a923a55a0 add links to modeing hub cards 2020-09-06 23:51:51 -07:00
1cc4d718a5 basic modeling page cute cards! 2020-09-06 23:49:04 -07:00
715f466df4 create very basic modeling page, not useful yet! 2020-09-06 23:32:04 -07:00
1d244fd1ea wider page layout 2020-09-06 22:58:06 -07:00
578d0c45f6 use small-sized image for home link icon 2020-09-06 19:01:12 -07:00
9d6ec247cf avoid re-layout from header bar when login loads in 2020-09-06 18:54:27 -07:00
0a6a9121f0 fix wrapping when username is too long for the header bar 2020-09-06 18:52:56 -07:00
c9ef20edf7 max width to the entire page layout 2020-09-06 18:45:20 -07:00
b086a4a8d7 add cute back to home link 2020-09-06 18:42:39 -07:00
e33e5fb88f shared page layout component 2020-09-06 18:12:34 -07:00
88862f9ce7 simplify petAppearance cache lookup, remove hacks
I think I got all up in my head about direct queries for this one, because of a previous implementation I had in mind, and I forgot that I could just query species and color from the cache by reference without breaking out of the API provided to the cache function!

I also learned in here that I _can_ look up things from the root by doing `readField("allSpecies", {__ref: "ROOT_QUERY"})`, which I struggled to figure out my previous time. I couldn't figure out how to read an uncached field with arguments (I couldn't quite figure out how to build a proper FieldNode, and passing the string form seemed to provide `null` to the `species` cache field reader), but it's probably doable!
2020-09-05 16:37:17 -07:00
Matchu
70d3b06742 basic items page, with user permissioning :)
(the permissioning happens on the backend in the prev change! but yeah we send the auth token in the headers, so the backend knows who you are and whether to show you private data)

(also it is just owned items not in any list!)
2020-09-04 05:59:35 -07:00
12b87ee7d1 set up auth on the server + test utils 2020-09-02 23:00:16 -07:00
f351c7013c hide user info until it's done loading 2020-09-02 15:41:51 -07:00
8f4bbcdafa update user ID format in HomePage 2020-09-02 15:32:26 -07:00
3c3d18d371 add auth0 for login
Gonna need to import our folx into it, but gosh it would be nice to not be responsible for this anymore 😬
2020-09-02 03:06:09 -07:00
f0c50eecb7 align item elements to the ~top of the row
Essentially I want the center-y visual balance around the image, and the name and _one_ line of tags. If there are extra tags, I want that to go down on its own, rather than bringing down the image+buttons to center against them.

The single-line-of-tags case is the most common, and I think it makes things feel more consistent for all the items to stick to that basic layout, while trying to keep that layout feeling center-y
2020-09-02 01:03:51 -07:00
62629865d8 stop removing items after you try something on
I was getting annoyed by how, when you're using search, trying on an item will remove conflicting stuff, and then if you decide you don't like what you tried the old stuff _doesn't come back_

As of this change, it does! When you start a new search, we save the outfit state, and then whenever you change the items we ask "hey can these old ones safely be re-worn again?" and re-wear them if so.
2020-09-02 00:53:35 -07:00
46b8245b9a rearrange item buttons for consistency
On the search panel, not all items have the remove button, and it's confusing to have the other buttons be in inconsistent positions!

Move the Remove button to the left side of the list, so that everything else is positioned the same regardless
2020-09-01 20:45:30 -07:00
99feddb859 fix pagination ish
Okay, we handle the new pages correctly! Still some weird bugs when you send requests near each other? Probably wise to migrate to Apollo's new way of doing this
2020-09-01 20:30:18 -07:00
a11ff1326b actual zone search support? owo 2020-09-01 20:06:54 -07:00
821d05c141 refactor to use new query object in SearchPanel
not actually including zone in the GraphQL query yet, but it's available in the right location now!
2020-09-01 19:53:38 -07:00
479f43ed22 pretty UI for zone search suggestions 2020-09-01 19:43:25 -07:00
10563629ef misc zone search fixes & improvements 2020-09-01 19:11:33 -07:00
0088c3f193 first draft of search zones
It doesn't affect the actual query yet, and it looks bad! But it exists!
2020-09-01 18:59:05 -07:00
d013dd6d89 WIP: search suggestions 2020-09-01 18:05:31 -07:00
eab1b99052 use cache restore instead of field defs for Zone
This is just an implementation thing, but I realized we can just insert the Zone data into the initial Apollo cache, instead of doing weird field definitions

I _do_ still want the @client tags in the queries though, to tell them not to make server requests at all
2020-09-01 18:02:59 -07:00
612e549ddc extract SearchToolbar into a separate file
This is in preparation for extending it with more UI stuff to auto-suggest zones!
2020-09-01 17:49:12 -07:00
900f055b1b fix stray console warnings
Some unused vars, and some missing React keys!
2020-09-01 17:20:08 -07:00
6d968cc385 show incompatible items in the outfit list
This was a subtle little thing for a while! If you switch species/color, such that an item doesn't fit the pet anymore, we used to just hide it. Now, we show it in a list, so that you can understand what went wrong, and have the option to remove it.
2020-09-01 17:17:45 -07:00
574199575b oops, move restricted zone icon back to the right
I had it there before, but I switched it back in the recent tooltip refactor, oops!
2020-09-01 04:18:53 -07:00
f64b882de1 hide unnecessary zone groups
This was bothering me, I'm surprised and pleased by how easy it seems it was to fix? :)

The strategy is just, look for groups that are provably redundant, and filter them out.

I hope it's correct! It's definitely cozier. Kyrii Mage items are good tests, they have a lot of interesting zones!
2020-09-01 03:53:24 -07:00
d630c7355a more & better item badge tooltips 2020-09-01 03:50:43 -07:00
e95cc36995 undo badge streamlining
I figured that we'd want simpler UI in the ItemsPanel when possible… but now that we've got it pretty simple and comfy, I think the consistency is better
2020-09-01 03:15:19 -07:00
fd0edeca3d use simpler nc/np tags in the list 2020-09-01 03:01:02 -07:00
4a4f4f9c63 move NC tag onto the thumbnail
oh yeah I'm starting to dig this :3
2020-09-01 02:27:16 -07:00
dec9d76601 zone badges on items
These are nice! :)

The `hideSimpleZones` option I'm not sure about yet, but I figure that:
1. For a new user just doing simple outfits, I feel like the double data on the items page just looks silly, so I want to streamline for that
2. But I _do_ want to let the user think about zone complexity when things _are_ multi-zone.

I did also consider just hiding the zone badge for the header you're under, but I figured the consistency of having the item and its badges look the same in all the places in the list was more important.
2020-09-01 01:18:24 -07:00
3a6e3fac8e add isCommonlyUsedByItems to Zone
This is in preparation for hiding bio zone restrictions but showing item zone restrictions!

I also refactor the build-cached-data script substantially, to run GraphQL against the server instead of a custom query.
2020-09-01 01:16:30 -07:00
8f9f1a14de better NC badge, with name text wrapping
a bit unfortunate to be wrapping long item names on mobile now, but heck there's an info button, should be fine
2020-08-31 23:54:54 -07:00
f79379e3d3 perf improvement for PosePickerSupport
oops, forgot to tag this as @client so the server wouldn't bother with a zone lookup!
2020-08-31 23:31:56 -07:00
d2aab1da9e add NC badge to items
it's cute!
2020-08-31 23:28:35 -07:00
c3d8ead8f8 add NC badge to items 2020-08-31 23:27:21 -07:00
6dc53814c2 move restrictedZones from layer to PetAppearance
okay so the PetAppearance restrictions are stored on the asset, because that's how they're defined on Neopets.com too

but I think that's a confusing API, so here I define `PetAppearance.restrictedZones`, which just maps over the layers and aggregates the zones server-side, same as we would have done on the client

I think that's much easier to understand than having layer contain a field, but having to know that item restrictions _don't_ work that way, you know?
2020-08-31 23:18:30 -07:00
e40ec9bb05 fix typo in PosePicker 2020-08-31 23:08:03 -07:00
47f55b1c3e add UC support!
I'm really into how the PosePicker button came out :3
2020-08-31 20:26:15 -07:00
17b00e295d stray lint fix 2020-08-31 19:31:37 -07:00
d91cd80603 add support for UC zone restrictions 2020-08-31 19:23:56 -07:00
f6b9f7f440 fix fade-in for outfit loading hanger
Huh, maybe this is a Firefox bug or something? but the container wasn't applying partial opacity correctly to its children, it was only doing 0 or 1, I think maybe because the children weren't static? I refactor here to make the DOM structure a bit more natural, and fade ins work again 🤷‍♀️
2020-08-31 18:57:29 -07:00
41388ecb9d fix loading state when outfit changes
I'm not sure when this regressed, but changing the outfit was clearing out the whole preview and showing an empty loading state, instead of the intended behavior of showing a loading spinner over the old preview. This affected both the home page and the wardrobe page.

Yeah, so, huh. Fixed! I hope I didn't goof anything else with these effect trigger changes though 😅

The reason I'm doing this now is not just that it's annoying, but as a pair with the color change fix from just now, I want those color changes feeling buttery smooth!
2020-08-31 18:41:57 -07:00
856d8586e4 cache item data when switching standard colors
Previously, when changing a pet's color, we would refresh the items panel and send a new network request for the item appearances, even though they're all the same. This is because item appearance data is queried by species/color, for ease of specification.

But! Item appearances are //cached// by body ID. So, if this is a standard color, it's not hard to look in the cache for the standard color's body ID!

Now, most color changes are faster and don't flicker the item panel anymore. We do still refresh the panel and send the requests for color changes that _do_ matter though, like standard <-> mutant!
2020-08-31 18:25:42 -07:00
bfb0979801 remove hover effect from item loading placeholders
this has been annoying me for a while 😅 it's confusing and surprising that they act interactable when they very much aren't yet!
2020-08-31 17:41:28 -07:00
64ad77ec49 focus dropdown when opening support pose picker
Oops, opening the dropdown would auto-focus the left arrow button, because it's now the first focusable element! Make explicit that we want the dropdown instead.
2020-08-31 01:32:25 -07:00
59f6fe12ff remeasure pose picker after changing appearance 2020-08-31 01:04:27 -07:00
1c8eba4698 Support tools can set appearance glitched state!
this is also very good! :3
2020-08-31 00:48:54 -07:00
1ef05adce4 Support can label pet poses!
it's good shit, y'all
2020-08-31 00:32:17 -07:00
45ab35216f Add arrow buttons to PosePickerSupport
Easier to move between appearances quickly! I'm adding this in anticipation of a use case of rapidly labeling Unknown appearances—I want it to be easy to label one and go to the next!
2020-08-30 23:27:43 -07:00
5ce5356825 migrate to new useSupport hook
Just smoothing out the API for cases where you want to know `isSupportUser`, but not the secret!
2020-08-29 14:54:02 -07:00
4e923746ce Show empty PosePicker for Support users
For most users, I want to hide the pose picker if there's not actually anything to pick from.

But I want Support users to be able to open it and use Support mode, to inspect and label Unknown poses!

In this change, I add new UI to show a question mark pose picker button, and a note explaining the empty picker; but only show them for Support users.

I also made a new `useSupport` hook, to replace `useSupportSecret`, now that I have a use case for "is support user?" that doesn't require the secret. Will migrate the rest!
2020-08-29 14:49:37 -07:00
d41f80518a fix bug to resize PosePicker when it changes
Previously, toggling between the two PosePicker modes could dramatically disrupt the layout, because Popover didn't know to re-measure itself.

In this change, we add a hacky workaround to simulate a window resize event in moments when we know the content is changing. (The realistic ideal solution would still have these manual triggers, but would use an official API in Chakra to notify the Popper instance directly.)
2020-08-29 14:19:43 -07:00
05e5c5ad3e add petAppearanceById client caching
If we already got this PetAppearance, now `petAppearanceById` knows how to serve it from the client cache instead making a network request!
2020-08-29 13:23:41 -07:00
1e30e7c8b0 add Support mode to PosePicker
Still just read-only stuff, but now you can look at all the different poses we have for a species/color!

Soon I'll make the pose/glitched stuff editable :3

Some sizable refactors here to add the ability to specify appearance ID as well as pose… most of the app still doesn't use it, it's mostly just lil extra logic to make it win if it's available!

(The rationale for making it an override, rather than always tracking appearance ID, is that it gets really inconvenient in practice to //wait// on looking up the appearance ID in order to start loading various queries. Species/color/pose is a more intuitive key, and works better and faster when the canonical appearance is what you want!)
2020-08-28 22:58:59 -07:00
7954c11c74 update support to use petStateId -> id 2020-08-28 21:06:33 -07:00
10a6eff299 WIP pose picker support 2020-08-28 21:06:33 -07:00
5334801aba add zone restrict hack tools
similar to the layer zoning tools I just rolled out!

not thrilled about the outfit state hacks here bc of how we cache restrict on the appearance rather than the item, but oh well! this escape hatch is pretty easy and solid, and it's a cleanup for another day

Also did a code split here, now that this file is getting larger, to only load this for support users. I don't actually care about restricting console stuff to support users (I'd honestly rather not), but saving the bytes is worth it I think, since support mode is pretty easy to enter when we need to
2020-08-28 00:12:41 -07:00
17fa9d06b9 add id to ItemAppearance (+ refactor)
This is in support of a caching issue in a hack tool coming next! Without this, the change to ItemAppearance restricted zones would make other ItemAppearance fields go missing (bc our hack tool didn't also specify them), so the query would re-execute over the network to find the missing fields we overwrote with nothingness—which would undo the local hack change.
2020-08-28 00:10:00 -07:00
a58db2dcd1 add restricted zones to item support UI
Honestly kinda embarrased I forgot this!
2020-08-27 23:09:53 -07:00
4a6a48ccd1 fix typos in item/layer support tools
Oops, I goofed up a fix to "Item ID" and "DTI ID" one time, and was labeling layer IDs as item IDs! Fixed!
2020-08-27 22:33:32 -07:00
136df9d2a2 add DTIHackLayerZone fn to console
A dev tool to preview what an item would look like in a different zone!

To use, open the browser console, and type `DTIHackLayerZone(layerId, zoneIdOrName)`, but replace `layerId` with the layer's DTI ID, and `zoneIdOrName` with either the zone ID or its name in quotes.
2020-08-27 22:32:28 -07:00
b3aa82cc66 enable Apollo dev tools in production
I'm doing this to see if I can give Chips a cute way to hack into local data :p
2020-08-27 21:44:54 -07:00
59ffc86481 update PetAppearance id to match petStateId
Previously, we were using a custom-y `id` field to help Apollo cross-reference `petAppearance` queries with the results from bulk `petAppearances` queries. Now, instead, we deprecate `petStateId`, and start using `id` to have the same stable value!

This is in anticipation of pet appearance support tools: a stable ID will make it easier to edit them, esp changing their pose (which would otherwise have changed the ID!)
2020-08-27 21:32:22 -07:00
bf21716db0 simplify PetAppearance client-side caching
Previously, we would load all `petAppearances` in `PosePicker`, and use cache keys to instantly find it again as a single `petAppearance` in `OutfitPreview` after switching poses.

In this change, we instead have `PosePicker` explicitly load all 6 poses as separate `petAppearance` queries. This simplifies cache sharing between the two components' queries: Apollo can do it automatically, because they were queried the same way in the first place.

I'm doing this in preparation for changing the `id` field of `PetAppearance`, to become `petStateId`. This will help me build pet appearance support tools, by giving the appearances stable identifiers that won't be affected by editing which pose an appearance is!
2020-08-27 21:26:24 -07:00
3f2b4df8f3 remove stray unused outfitState prop
right, we get this value from context now; that's why this STOPSHIP was here but not actually breaking anything!
2020-08-20 21:46:32 -07:00
6821c2b734 Support tool: Remove layer from item
Heck yeah, let's clean these fuckers up!
2020-08-20 21:40:05 -07:00