Commit graph

710 commits

Author SHA1 Message Date
b39914976b Add an /items/search page, and search box on Home
Woo, it's looking pretty good, I think!

I didn't bother with pagination yet, since I feel like that'll be a bit of a design and eng lift unto itself... but I figured people would appreciate the ability to look up individual items, even if the rest isn't ready yet 😅
2021-01-18 15:56:24 -08:00
9e5dfd1c84 Move "Log out" button into the nav menu
When actually using mobile, I was like "oh, it's maybe not great that the menu button is tiny and the Log out button is huge". Awkward click targets!
2021-01-18 13:51:52 -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
b78cede939 Add brief delay before Latest Items loading state
This UI generally loads very fast, thanks to the CDN cache, so the flash of skeleton content is more distracting than anything else! We still show it quickly after 300ms, but good network connections should reliably get it loaded before then.
2021-01-18 06:46:18 -08:00
f3633f5ab6 Privacy policy copy tweak 2021-01-18 06:44:07 -08:00
334d89c101 Add Latest Items section to homepage 2021-01-18 06:31:27 -08:00
934dd829c6 Fix ChunkLoadError crashes after deploys
Our host, Vercel, doesn't keep old build files on its CDN after a deploy for very long. This means that, after a deploy that changes a page's bundle, existing sessions that attempt to navigate to it for the first time will fail on the dynamic `import`, because the filename hash has changed.

The best fix I'm aware of for this is to just, reload the page when this happens!

To test this, I did the following:
1. Use `yarn build` to build a prod copy of the site.
2. Use `serve -s build` to start serving it on its own port. (API endpoints won't work, and that's okay!)
3. Don't touch the open copy of the site yet.
4. Make a change to `PrivacyPolicyPage.js`, and `yarn build` again. This simulates a deploy under similar circumstances.
5. Open the Console, tick the "Persist Logs" option, and try to navigate to Privacy Policy. Observe that it logs a ChunkLoadError in the console, and smoothly reloads the page to show you the updated Privacy Policy page.
6. Undo your change 😅
2021-01-18 05:17:14 -08:00
0f61d59917 Add "From" to feedback email body
This is just a convenience to make it easier to see at a glance in my inbox whether I should reply to the email, or whether it just goes nowhere 😅
2021-01-18 05:11:17 -08:00
ca088f3310 Group Sentry stats by route 2021-01-17 08:48:22 -08:00
753305dd11 Fix "Untitled outfit" on open outfit in new window
Previously, when you navigated directly to an outfit by typing the URL into the browser or following an external link, the name would stay as "Untitled outfit", even after the outfit loaded.

This was because, when you render an `Editable` Chakra component with `value={undefined}`, it permanently enters "uncontrolled" mode, and providing a value later doesn't change that.

But tbh passing `undefined` down from outfit state wasn't my intention! But yeah, turns out the `?.` operator returns `undefined` rather than `null`, which I guess makes sense!

So, I've fixed this on both ends. I'm now passing more `null`s down via outfit state, because I think that's a more expected value in general.

But also, for the `Editable`, I'm making a point of passing in an empty string as `value`, so that this component will be resilient to upstream changes in the future. (It's pretty brittle to _depend_ on the difference between `null` and `undefined`, as we saw here 😅)
2021-01-17 08:19:47 -08:00
9b0a99e2ae Mention starred outfits in "Your outfits" WIP 2021-01-17 08:05:05 -08:00
e149d53595 Back links to Your Outfits, *if* it's yours
Previously, when you clicked on a saved outfit from Your Outfits, the back button would take you back to the homepage, which was confusing for scanning through stuff! Now, it goes back to Your Outfits if it's yours.

I'm not suuure this is the behavior we want? But it seems intuitive enough!
2021-01-17 08:04:21 -08:00
2dbed8b8c4 Use default values for plain /outfits/new URLs
Previously, if you navigated to /outfits/new without a species or color in the query string, we'd show a blank outfit page, with the species/color picker hidden. Now, we default to a Blue Acara instead!

We don't do anything to handle _invalid_ species/color IDs, but I don't super mind that, because in practice that would require some call site to malform the URL, and I don't super expect that.

This resolves more of the _cause_ of Sentry issue IMPRESS-2020-8, but I'm still wondering how a user got to the URL `/outfits/new?[object+Object]=&objects[]=35185&objects[]=67084`. I'm wondering if the pet loader on the homepage has a bug in Safari? I feel like I heard something like that from the feedback form, too...
2021-01-17 07:43:08 -08:00
f1dd3bffa6 Hide species/color on wardrobe page when not ready
If the species/color of the current outfit aren't available yet (e.g. a saved outfit is still loading in), hide the picker altogether. This is because the picker can't handle change events during that time, and it's easier to just hide all this than to add special case handlers like disabled states! (And, while placeholders are often helpful, I'm not sure the placeholder dropdowns are any better than empty space in this case.)

This can also happen when the user loads a page without a species/color ready, like just going straight to `/outfits/new`. I think I might want to add a handler for that, though.

Resolves the direct cause of Sentry issue IMPRESS-2020-8, though I'm not sure how the user got to the URL `/outfits/new?[object+Object]=&objects[]=35185&objects[]=67084` in the first place...
2021-01-17 07:24:54 -08:00
33ee4455a7 Gracefully handle unexpected SWF URLs
Fixing our support for our "Totally Legit DTI Graffiti" item 😅

In addition to this change, I also uploaded the images to the correct URLs: the old site was doing the folder algorithm in a surprising way, yielding https://impress-asset-images.s3.amazonaws.com/object/000/000/0-1/-1/600x600.png, whereas the new site was doing the (imo clearer) https://impress-asset-images.s3.amazonaws.com/object/000/000/000/-1/600x600.png. I copied the files to the new location.

I also noticed that the thumbnail URL for that item has been broken for a while, so I created a new copy at https://impress-asset-images.s3.amazonaws.com/object/000/000/000/-1/80x80.png, and updated the database record to point to it.

This should resolve Sentry error IMPRESS-2020-6.
2021-01-17 05:16:53 -08:00
7393991046 log search result errors
We showed an error to the user, but nothing in the console! Now we have it :)
2021-01-17 04:47:11 -08:00
f6ce8611b2 Clearer errors when image download fails
Two fixes in here, for when image downloads fail!

1) Actually catch the error, and show UI feedback
2) Throw it as an actual exception, so the console message will have a stack trace

Additionally, debugging this was a bit trickier than normal, because I didn't fully understand that the image `onerror` argument is an error _event_, not an Error object. So, Sentry captured the uncaught promise rejection, but it didn't have trace information, because it wasn't an Error. Whereas now, if I forget to catch `loadImage` calls in the future, we'll get a real trace! both in the console for debugging, and in Sentry if it makes it to prod :)
2021-01-17 04:42:35 -08:00
cfb5504341 Add hidden command to send test error to Sentry
I haven't seen anything come in from prod yet, and it's hard to trigger one, maybe because the integration is React-specific? Or maybe it's... not working :p

I can send errors from dev! But just haven't _seeeen_ a prod error come in yet.

Maybe we're just squeaky clean tho :3
2021-01-16 12:01:28 -08:00
675c6310fc Fix GitHub Action for Sentry, attempt 6
Ohh, this isn't a list, got it

Yeesh, I didn't understand what I was writing at ALL
2021-01-16 11:27:26 -08:00
e0ff89420b Fix GitHub Action for Sentry, attempt 5
Hmmmmmm are they upset about the comma? Idk anymore
2021-01-16 11:26:28 -08:00
b8baf7f88e Fix GitHub Action for Sentry, attempt 4
Ahh ok, can't have conflicting names I guess? Got a new "syntax error" on line 9, so...
2021-01-16 11:24:51 -08:00
942f1e44ae Fix GitHub Action for Sentry, attempt 3
lmao
2021-01-16 11:23:07 -08:00
1c7d027465 Fix GitHub Action for Sentry, attempt 2
Lol I missed a lot of the steps, huh?
2021-01-16 11:22:35 -08:00
d7a4ddb907 Fix syntax error in new GitHub Action for Sentry
oops, I missed a node!
2021-01-16 11:18:56 -08:00
f4810aa2f4 Add Sentry GitHub Action
this shouuuld create a record in Sentry every time we push, to help it correlate new errors to releases 🤞
2021-01-16 11:15:22 -08:00
24f29173bb only sync recent users to auth0 2021-01-16 11:08:12 -08:00
ffe411c0b1 Add Sentry error logging + privacy statement
My main reason for adding this now is that I'm getting some scattered reports of things not displaying correctly, and I want to start gathering some browser data on that...

I recently confirmed that animations work on iOS (at least one did!), which was going to be my guess of what was breaking...
2021-01-16 10:59:54 -08:00
888825b1b7 add explainer text to outfits page WIP callout 2021-01-14 06:45:07 -08:00
9ce5a230e1 add cute "Impress 2021" flavor explainer text 2021-01-14 06:43:55 -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
11767828cf Disable PosePicker while saved outfit is loading
Oops, if you try to show PosePicker before we have a species/color ready, it sends a bad GraphQL request. No visible user impact, just an unnecessary network call and an error in the console! This happens when you're loading an outfit by ID.

Here, we hide PosePicker if there's no species/color ready yet. This stops the extra request from firing!
2021-01-08 03:37:56 -08:00
c7929b29a5 Fix awkward blinky loading state for outfit
When loading an outfit in the wardrobe page, there was an awkward state where the outfit preview loading spinner would vanish and then reappear.

This was because `useOutfitState` briefly reported `loading: false`, then fixed itself after almost immediately—but our OutfitPreview component has a delay before re-showing the spinner.

In this change, we smooth out the loading state, by enabling the second GQL request to start immediately once the first request is done, instead of waiting on a callback to finish.
2021-01-08 03:19:57 -08:00
62579dc671 Keep outfit thumbnail while individual layers load 2021-01-08 02:53:31 -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
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
cdf2c66686 Oops, remove extra console.log statement! 2021-01-05 23:36:54 -08:00
5865157a1b Fix crash when there are too many trade matches
Oops, the GROUP_CONCAT string was getting cut off! This caused an error trying to look up the name of an item ID that didn't exist, because the ID got truncated partway through.
2021-01-05 23:35:02 -08:00
4a352e04e0 simulate login with IMPRESS_LOG_IN_AS flag 2021-01-05 23:22:03 -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
12b357fad9 oops, tweak outfit data query slightly 2021-01-05 06:43:33 +00:00
95d94a4844 Show loading spinner when outfit data is loading
A pretty easy tweak, phew!
2021-01-05 06:42:09 +00:00
102a29fefd show outfit name faster, instead of "Untitled Outfit"
That'll still show up when the outfit is still loading, but this lets us use the Apollo cache to show the name instantly if you're clicking through a link from Your Outfits
2021-01-05 06:39:12 +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
6749d19f9e fix dev emotion crasher in wardrobe page
This seemed to only show up in dev? But right, I guess it's not happy about passing stuff from ClassNames into a Popover Portal. Move it inside, fixed!
2021-01-05 05:51:54 +00:00