Commit graph

25 commits

Author SHA1 Message Date
1dbc142f4f [WIP] Migrate /your-outfits to Next.js routing
This one was pretty boring! I was relieved to see the pagination changes seem to just work though 😅
2022-09-14 21:55:03 -07:00
f7f6f7b82b Remove useRequireLogin, show logged-out message
There was a bug in the new db auth method where `useRequireLogin` was expecting Auth0 logins to work, so it would get caught in an infinite redirect loop.

Rather than trying to figure out how to make `useRequireLogin` work with the new modal UI, I figured we can just delete it (since we only ended up using it once anyway), and add a little message if you happen to end up on the page while logged out. Easy peasy!
2022-08-17 16:11:40 -07:00
12d525e3ab Preload next/prev user outfits page
Even in production, scrolling is a bit slow! This will preload the pagination one click ahead.

There is a bit of a perf downside, in that if you click through the pages too fast, you'll trigger _extra_ requests. I think that's a net win though, and I'm not gonna try to get cleverer than this right now.
2021-11-01 19:50:21 -07:00
299561d1e3 Paginate the user outfits page
My main inspiration for doing this is actually our potentially-huge upcoming Vercel bill lol

From inspecting my Honeycomb dashboard, it looks like the main offender for backend CPU time usage is outfit images. And it looks like they come in big spikes, of lots of low usage and then suddenly 1,000 requests in one minute.

My suspicion is that this is from users with many saved outfits loading their outfit page, which previously would show all of them at once.

We do have `loading="lazy"` set, but not all browsers support that yet, and I've had trouble pinning down the exact behavior anyway!

Anyway, paginating makes for a better experience for those huge-list users anyway. We've been meaning to do it, so here we go!

My hope is that this drastically decreases backend CPU hours immediately 🤞 If not, we'll need to investigate in more detail where these outfit image requests are actually coming from!

Note that I added the pagination to the existing `outfits` GraphQL endpoint, rather than creating a new one. I felt comfortable doing this because it requires login anyway, so I'm confident that other clients aren't using it; and because, while this kind of thing often creates a risk of problems with frontend and backend code getting out of sync, I think someone running old frontend code will just see only their first 30 outfits (but no pagination toolbar), and get confused and refresh the page, at which point they'll see all of them. (And I actually _prefer_ that slightly confusing UX, to avoid getting more giant spikes of outfit image requests, lol :p)
2021-11-01 19:33:40 -07:00
9a68bd1355 Use standard image URLs on Your Outfits page
The old URLs were glitchy because we weren't escaping the `layerUrls` param… and this will let us take better advantage of the same shared caching as other stuff!
2021-09-03 15:37:38 -07: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
9b0a99e2ae Mention starred outfits in "Your outfits" WIP 2021-01-17 08:05:05 -08:00
888825b1b7 add explainer text to outfits page WIP callout 2021-01-14 06:45:07 -08:00
9ae1704908 fix visual regressions on Your Outfits page
Oops, when refactoring and adding alt text, I didn't realize the padding for the text would affect the images too! And I forgot to add `overflow: hidden` to round the image's corners. Fixed!
2021-01-08 01:26:28 -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
fe799a9bbc Add alt text to OutfitCard images 2021-01-08 00:35:56 -08:00
b478f35103 Refactor OutfitCard a bit
Preparing to make a skeleton version for loading!
2021-01-08 00:35:09 -08:00
20f3ca75b0 fix caching on Your Outfits page
Oh right, we can't cache objects  well when they're missing their ID!

Before this change, selecting an outfit then navigating back would require the outfits to reload. Now, they stay!
2021-01-05 06:45:27 +00: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
f36d6831d0 make outfits page links, to classic DTI
Mostly just getting the link style figured out! But getting them actually working is coming soon :)
2021-01-05 05:20:07 +00:00
71bb593974 center outfits, helps a lot on mobile
I pulled it up on my phone, and there was only one column, and being left-aligned for that was bleck!

This is a good spacing compromise, I think :)
2021-01-04 09:36:01 +00:00
c9603a40ea tweak site bg color, to let card elements "pop"
This has been bothering me for a long time, but I couldn't really figure out what to do about it. But tweaking the site bg color a smidge has helped us really add texture to the cards I want to have pop out, like the outfit polaroids!

I kinda went all-in in a burst, but tbh I think it looks great :3

I haven't really touched the wardrobe page with it yet though, that'll probably need some tweaking... for now I'm overriding it to keep the old background!
2021-01-04 09:17:54 +00:00
98604b39da add message for when you have no outfits 2021-01-04 08:47:39 +00:00
72a99fd5bf fix dark mode styles for outfits page 2021-01-04 08:45:52 +00:00
be7de27c5c refine outfit thumbnail card styles 2021-01-04 08:39:15 +00:00
b01feba038 add items to outfit thumbnails
Now that wasn't so hard! :3
2021-01-04 08:26:05 +00:00
259ae9bd87 add WIP callout to outfits page 2021-01-04 08:12:25 +00:00
30e0a149be basic outfits page with pet-only thumbnails 2021-01-04 08:10:35 +00:00
b8d919b247 basic outfit data from GQL 2021-01-04 07:36:00 +00:00
778eefbdd5 placeholder Your Outfits page
it requires login, and runs a GQL query that will fail 😅
2021-01-04 07:31:02 +00:00