Commit graph

2183 commits

Author SHA1 Message Date
39e6872f59 Add some better comments and organization to swf_assets/show.js
Mostly headers, a comment that was out of date, and a function I moved
to be in a slightly more sensible spot!
2025-01-04 13:47:23 -08:00
3940513244 Oops, fix silly mistake when combining zones by label on the item page
Oh, right, silly: my previous version of this change still grouped by
zone, then mapped the zones to their labels. This didn't *merge* the
lists of appearances for zones that share the same label; just one of
the zones would win, and the others would disappear.

In this change, I just go upstream and actually group them by label in
the first place, instead of grouping by zone then trying to merge and
transform them.
2025-01-02 19:39:53 -08:00
28cdef29d0 Combine zones with the same label on the item page
For example, the "Red Knitted Beanie with Wig" occupies two different
"Hat" zones: one for behind the head, and one for in front. It's not
useful to split them up!
2025-01-02 19:26:11 -08:00
5be35591c2 Use CSS instead of server requests for image format in pet styles form
Instead of offering a form to request a different format, we just
render both in the HTML, and use CSS to swap between the two. Love to
see the `:has` filter come through for us!
2025-01-02 19:04:48 -08:00
7f62417294 Fix bug sorting pet styles by creation date
Before this change, the sort order when searching for
"Prismatic Pine: Nostalgic" showed:

- [Added Dec 18, 2024] Prismatic Pine: Nostalgic Christmas Flotsam
- [Added Dec 19, 2024] Prismatic Pine: Nostalgic Christmas Gelert
- [Added Dec 18, 2024] Prismatic Pine: Nostalgic Christmas Bruce
- [Added Dec 17, 2024] Prismatic Pine: Nostalgic Christmas Scorchio
- <more>

This is because the Gelert was created at 11:37 NST on Dec 19, whereas
the Flotsam was created at 18:11 NST on Dec 18—but in UTC, which is how
timestamps are stored in the database, these are both Dec 19, so the
Flotsam was sorting first alphabetically.

In this change, we do a hacky transform from UTC to NST-ish. I didn't
want to set up the deploy process to pull named time zones into MySQL,
and then have this as a potential gotcha for the dev environment
later—so instead, I pretend `-08:00` is a good-enough specification of
NST.

This will sometimes create slightly incorrect sort ordering when it
*is* Daylight Savings, and a record was created around midnight. I'm
okay with that!
2024-12-29 16:11:00 -08:00
fe6d42ef67 Remove "<New?>" from pet style search filters
When there's an unlabeled style, previously we'd include the placeholder
value "<New?>" in the search dropdown, even though we don't actually
support searching by it.

Now, we don't! I did this in part by just refactoring how we look this
stuff up, with queries that don't load *all* alt styles into memory,
which will help perf a bit as more of them are released.
2024-12-29 15:52:50 -08:00
b8772c3aad Add no results message for alt style searches 2024-12-29 15:47:12 -08:00
8502b780c2 Add FORCE=1 flag to override series names in Styling Studio auto-import
I ran a bad version of this job yesterday, and set a lot of the new
styles to an incorrect "Prismatic" series name. This will help me fix
them!

There's still styles to manually fix, where TNT decided not to put the
full series name in the item name. (Presumably some of the names were
too long? Or maybe they just forgot?) But this is a better starting
point!
2024-12-29 15:39:52 -08:00
2f090f3924 Oops, improve series name parsing in Styling Studio auto-importer
Ahh right, that's part of why I skipped Prismatics: it's no longer true
that the first word of the style is its series name.

In this change, I try to parse out everything before the pet name part
of the style name, and default to skipping it if we can't quite get it
right.
2024-12-29 15:26:26 -08:00
ab572b6576 Fix magic magnifier positioning in Firefox
Oh oops, Firefox is a bit stricter about interpreting custom elements
as inline elements by default instead of block elements. This messes up
the positioning relative to the container. Fixed!
2024-12-28 16:11:38 -08:00
019484b6dd Oops, fix showing the magic magnifier in Firefox
Oh, guess Firefox doesn't support this CSS container query feature yet!
Use a more compatible technique instead.
2024-12-28 16:08:28 -08:00
34bf27069b Oops, fix silly routing mistake where I set path twice for same route
Ruby 3.3.6 has a warning for this, neat! I apparently didn't notice the
`path` option already there at first, and just added a new one.

This change shouldn't affect behavior, it just is clearer and removes a
warning!
2024-12-28 15:58:41 -08:00
84dec2d82e Tweak output for Styling Studio auto-importer
A style not being modeled yet is not a big deal, whereas some of those
other warnings actually require manual intervention. I want to make the
list easier to scan for the warn icons!
2024-12-28 15:53:24 -08:00
d75492bd1d Add Prismatic styles to Styling Studio auto-importer
I missed this the first time, and had just kinda been putting it off.
But now there's a lot of new Prismatics, so let's finally do it!
2024-12-28 15:52:48 -08:00
b61526f6ad Upgrade to Ruby 3.3.6
Fedora upgraded its system Ruby, and I'm on that laptop today, and I
prefer to have prod keep pace rather than use rbenv to keep myself and
prod knowingly on an older version!
2024-12-28 15:34:42 -08:00
2b8fe68387 Refactor rails neopets:import:rainbow_pool to run in parallel
We're using our new helpers to make it easier, yay!
2024-12-16 14:12:38 -08:00
86205c5e44 Create new DTIRequests.{get,post} helpers for HTTP requests
Instead of using `Async::HTTP::Internet` directly, and always applying
our `User-Agent` header manually, let's build a helper for it!
2024-12-16 14:12:19 -08:00
5546d6df5d Use new DTIRequests.load_many helper in SwfAsset.preload_manifests 2024-12-16 13:19:58 -08:00
2be21a9238 Use new DTIRequests.load_many helper in Item.preload_nc_trade_values 2024-12-16 13:19:16 -08:00
1d4771ecc5 Create new DTIRequests.load_many helper, to make parallel requests
Just a wrapper for the barrier/semaphore thing we're doing constantly!

I only applied it in the importer rake tasks for now. There's other
call sites to move over to it, too!
2024-12-16 13:16:03 -08:00
7eb209e206 Update pet state bulk-labeling to skip to next unlabeled if desired
Previously, "Then: Go to unlabeled appearance" would always take you to
the *first* unlabeled appearance in our database.

Now, we go to the *next* unlabeled appearance in the list, relative to
this one.
2024-12-08 10:08:39 -08:00
30d42d29c1 Oops, fix magnifier position bug when page is scrolled 2024-12-07 12:41:03 -08:00
347419aee8 Add SVG/PNG picker when editing pet appearances
I've known there are bugs in the SVGs pretty often, because they're not
very well attended-to—I noticed pretty quick that the Marble Eyrie, for
example, has its Body asset saved correctly in PNG, but its SVG is just
another copy of the head, oops!

I think SVG is still a nice default for this UI, but I added a little
form to switch to PNG, to give us a debugging method and escape hatch
if it starts to get weird.
2024-12-07 12:16:52 -08:00
98965ccc6f Increase contrast for non-highlighted layers when editing pet appearance
This washes out the colors a bit more than necessary on lighter pets,
but helps a lot on darker pets. It really kinda pushes everything other
than the lineart all the way to white, which tbh is a pretty neat
sketch-like effect.
2024-12-07 12:00:10 -08:00
763f6d66be Fix minor bug to hide magnifier if its position isn't ready yet 2024-12-07 11:53:18 -08:00
addf2d6cc5 Use SVG for the magnified outfit viewer when editing pet appearance 2024-12-07 11:45:01 -08:00
b2a23b3e7b Add magnification when editing pet appearance
I couldn't find a library for this functionality that didn't require
jQuery, and I don't want to be adding *more* jQuery requirements. So, I
decided to throw together my own!

The `<magic-magnifier>` component copies its contents into a "lens"
element, then uses basic JS to track mouse position, then uses CSS to
move the lens and its contents into a helpful position.

One thing I noticed here is that the zoom is a bit crunchy because
we're using PNG images, and it's hard to zoom in even further than we
already are. I might try switching this UI to use the SVG images by
default instead?
2024-12-07 11:39:37 -08:00
b3f3b39aa0 Add helpful layer interactions on pet appearance edit page
When you hover the row for a layer in the table, it highlights the
corresponding layer in the outfit viewer. And when you click anywhere
in the row, it opens the first link (usually the PNG image).
2024-12-07 10:41:52 -08:00
d92e3288ab Add layers table to pet appearance edit page
Gonna add some more functionality here too, but right now we at least
have this!
2024-12-07 09:58:24 -08:00
c32a495780 Announce the temporary server upgrade (and refactor announcement helper) 2024-12-01 19:26:42 -08:00
ea5c315c2a Oops, fix typo in "Glitched?" label in pet appearance edit form 2024-12-01 11:27:18 -08:00
ab238ab2a6 Add "Support summary" section to Rainbow Pool
This both gives us a sense of progress on labeling, and adds a link to
get started in bulk labeling mode!
2024-12-01 11:13:21 -08:00
0d2648d030 Move support_staff? method into ApplicationController
I want to use it in a controller in our next change!
2024-12-01 11:12:24 -08:00
d9bf4f745b Skip glitched appearances in bulk-labeling mode
It's not as important to label glitched states, and sometimes the glitch
prevents it from being visually identifiable. Don't sweat 'em!
2024-12-01 10:39:19 -08:00
407c4b38a5 Add link to reference pet type when labeling pet appearances
Sometimes I forget like, what the masc/fem variants of a given pet
actually look like? Some are super obvious about things like eyelashes,
and others use more subtle eye differences.

This is a cheap lil hack to make it easier to open a reference! Ideally
I think it would be neat to like, when you hover over an option, have
it show you the reference variant of that pose? But this is good enough
I think!
2024-12-01 10:28:58 -08:00
6dc5aa28a4 When labeling pet appearances on mobile, give pose options equal height
If the screen is narrow, many of the bubbles will wrap their text onto
two lines, but "Unconverted" won't. Give it equal height to the rest
anyway, for visual consistency!
2024-12-01 10:27:38 -08:00
b656ccd982 Add bulk labeling mode for pet appearances
We copy the same feature from alt styles, now that the UI is shared via
support form helpers! Easy peasy!

This adds a "Then: Go to unlabeled appearance" checkbox next to the
submit button on the pet appearance edit form. If checked, it takes you
to the first unlabeled appearance in the database, and keeps the box
checked for next time. Slam through 'em!
2024-12-01 10:10:33 -08:00
02836494ae Add debug gem in development
This helped me debug a thing in the upcoming change! It lets you drop a
`debugger` line into the app, then run `rdbg --attach` in another
terminal to get into a debug session. Neat!
2024-12-01 10:05:54 -08:00
b6e6f27fdf Minor refactor to support_form_with implementation
Realizing that, with the keyword argument spread syntax, I don't need
to do merging, I can just. spread at the right place!

My rationale for the ordering here is: if the caller theoretically tried
to override the builder (even though I don't see why), I think we would
want to respect that. Whereas the `class` argument should be overridden
because we're safely *merging* our `.support-form` class into it.
2024-12-01 09:45:26 -08:00
aeb00f73cf Extract alt style's "go to next" field into a support form helper
I want to reuse this for unlabeled pet styles is why! (That's been the
immediate motivation for this refactor, but also I do just like that
it'll make support forms easier to build.)
2024-12-01 09:42:19 -08:00
06a301e6d7 Add actions helper to support form builder 2024-12-01 09:30:17 -08:00
1119bbb292 Extract the more complex support form helpers into templates
I think helpers are fine for the simpler ones that are basically *just*
wrapper tags, but once it starts getting into `concat`, I think that's
too unfamiliar of a syntax for developers; let's bail into our usual
templating system!

I'm not sure about putting them in `application/support_form` like this.
That's cute for one-offs like `application/hanger_spinner`, because
`render partial: "hanger_spinner"` assumes the `application` view folder
by default, but that doesn't work once it's nested: it looks for a
`views/support_form` folder.

I think maybe it could soon be time to bail from the strict "view
folders belong to controllers" thing, similar to how we did for
`SupportFormHelper`, and add a `components` folder or similar? Idk, not
sure yet!
2024-12-01 09:26:40 -08:00
fdbfa3c03f Fix styles in support form when field is errored
Ah right, `> label` doesn't work with how Rails will wrap broken labels
and inputs each in a `.field_with_errors` element. Fixed, and added
some basic coloring!
2024-11-30 11:50:31 -08:00
252f4f1df1 Add errors helper to support form builder
It still has no good CSS to it, but that's okay, this is just to DRY it
up.
2024-11-30 11:46:19 -08:00
2d3d4051fe Oops, return HTTP Bad Request when item editing fails
Just a subtle thing, but Turbo can be picky about return types, and
won't reload the page with the errors in it if the status is 200.
2024-11-30 11:45:35 -08:00
3cd02baa09 Add thumbnail_input method to support form builder
Just to clean up this relatively common input type!
2024-11-30 11:34:02 -08:00
8347633a84 Add SupportFormBuilder to make the support form templates nicer
Instead of hand-rolling HTML, this offers helpers like `f.field`, to
help ensure the HTML is consistent, and to keep the templates more
focused on the unique form elements.
2024-11-30 11:26:23 -08:00
661a5385f4 Migrate pet state edit form to .support-form class
Most notable change here is extracting the pose option bubbles into a
`data-type="radio-grid"`, and pulling that into the `.support-form`
CSS. My rationale is that, unlike most fields, this field benefits from
being 100%-width, and I don't want to specify that as an override if I
can avoid it, because that's fragile-y.

Instead, I extract this into a generic type of field that
`.support-form` can use (it feels pretty reusable anyway!), and require
the caller to specify how many columns they want as `--num-columns`.
2024-11-30 10:49:47 -08:00
c27477fabe Refactor support-form CSS to be more reusable layout
Specifically, I'm going for a more-vertical layout, cuz I want to bring
PetState over to it, and the weird grid situation wasn't gonna fit the
big pose label radios.
2024-11-30 10:33:58 -08:00
c7bea666c9 Add the "body fit" field to the item editing page 2024-11-20 12:23:30 -08:00