Commit graph

2063 commits

Author SHA1 Message Date
64b1d11faa Remove old record_tag_helper gem
This is a transitional gem to help with upgrading from old versions of
Rails: it provides a deprecated feature that Rails removed.

I audited and I *think* we only used it in one place, and that this one
place doesn't even use any of its functionality for styling or
scripting? So, begone!
2024-09-26 12:50:47 -07:00
e63f4df25b Run bundle update 2024-09-26 12:42:18 -07:00
535a0029f9 Replace some JS with the @starting-style CSS directive
Oh sweet, I learned about a new CSS feature with good-enough support!
This lets you use CSS transitions for an element as it enters the page,
or becomes visible.

Firefox only has partial support for this feature rn, but its partial
support covers our case, I tested to make sure! (Specifically, it
doesn't handle transitioning from `display: none` yet, which isn't what
we're doing.)
2024-09-24 19:33:06 -07:00
c0e4291745 Remove FragmentLocalization and localized_cache helper
We replace the `localized_cache` helper with just simple keys provided
to the `cache` helper, with `locale=#{I18n.locale}` inlined. End of an
era!
2024-09-20 20:10:04 -07:00
d27c03606f Delete unused images
Whew, quite a history here! I didn't _extensively_ audit for these, but
I scanned with pretty good searches and hit major pages and they didn't
crash, so. Good enough for me!
2024-09-20 19:38:52 -07:00
40a3f5bf68 Don't show the list filter for petpage exports if you have no lists 2024-09-20 19:30:23 -07:00
4bc38db5aa Replace closet_hangers/petpage.js with modern CSS
We use jQuery to basically simulate the `:has()` pseudoselector. Let's
just, use `:has()` now!
2024-09-20 19:27:39 -07:00
2ab1951e68 Move closet_hangers/petpage stylesheet into its own CSS file 2024-09-20 19:26:06 -07:00
cae2f3ca74 Serve jquery and jquery.tmpl from our own codebase, instead of a CDN
Right, yeah, we've been depending on an external CDN for a long time
for jQuery and the jQuery Template library, and I don't like that kind
of external dependency! Let's put it in with the rest of our libs.
2024-09-20 19:23:53 -07:00
31619071af Remove ajax_auth.js lib, by merging it in where needed
It's only actually used in two JS files, so rather than doing a weird
global `$.ajaxSetup` call, let's just inline it into the small handful
of AJAX calls that actually care.
2024-09-20 19:10:26 -07:00
f20a1b5398 Oops, fix locale form with Turbo pageloads
Before this change, this would only work on the first pageload, and
fail after doing a Turbo page navigation. Now, it works all the time!
2024-09-20 18:55:08 -07:00
3bd6f09a54 Remove "About NeoPass" page, now that it's on the blog 2024-09-20 18:43:38 -07:00
38474d19d7 Oops, fix broken strings on Neopets page import wizard
Uhh I guess when I half-removed a feature from the translations list (I
don't remember when?), it left two different dictionaries labeled
`neopets_page_import_tasks.new`, and the second one overwrote the
first. Oops! Yikes!

By removing these, the translations *above* them actually get to apply
to the page correctly. Before this change, the page just showed the
translation keys as placeholders, womp womp.
2024-09-20 18:16:06 -07:00
73e0b3bb3c Remove some silly view template caching calls
When I was trying to debug slow view code one time long long ago, I was
like "let's cache any part of the template that's static!"

And like. no that's silly, I don't trust that this speeds anything up,
but it _definitely_ adds complexity. Let's just not.
2024-09-20 18:08:11 -07:00
1f53615654 Add "State of DTI: 2024" blog post announcement 2024-09-20 18:02:58 -07:00
7f55456454 Explicitly disable the unused ActionCable Rails feature
Just for consistency with the other features we're not using, we turn
off ActionCable when loading the app. I just removed
`config/cable.yml`, so I figure, let's not load a feature without the
config file it expects! (even though that didn't seem to bother it)
2024-09-20 13:14:00 -07:00
f23bebb607 Remove unused config/cable.yml and config/store.yml files
We're not using the ActionCable or ActiveStorage Rails features in this
app, so we can clear out these default config files. If we need them
later, it's not hard to re-find / re-generate them!
2024-09-20 13:12:47 -07:00
cf2cd41531 Remove unused config/basic_type_hashes.yml file
Our production data now contains basic hashes for all species/color
combinations, and it's easy enough for a dev copy of the site to get
them too by running `rails public_data:pull`. So, I think it's time to
retire this hardcoded set, and get one more file out of our codebase!
2024-09-20 13:10:15 -07:00
d45162897d Upgrade to Rails 7.2.1
No pressing reason, I'm just doing upgrades today, and noticed a new
version is out, and scrolled the patch notes and there's no obvious
breaking changes for my purposes, so. Up we go!
2024-09-20 12:57:59 -07:00
02b510bb3f Upgrade to Yarn 4.5.0 2024-09-20 12:47:54 -07:00
9ebc498888 Upgrade to Ruby 3.3.5, and improve the mechanisms for it a bit
I move `ruby_version` into an Ansible variable, to make it easier to
update in the future!
2024-09-20 12:47:35 -07:00
5bf2ef42a0 Move JS libraries to vendor/javascript
The silly motivation is that I wanted to remove `.prettierignore`,
which just exists to omit that one folder from `npm run format`. But it
also seems like this is the standard place to put them—a standard
created long after we first set this up lol
2024-09-13 21:16:46 -07:00
0a5d369735 Remove i18n locale config complexity we don't use anymore
I forget what this was for, I think part of it was for managing item
names in different languages, and the "private" locale thing was
probably for WIP locales? But yeah, not used, delete!
2024-09-13 20:55:09 -07:00
ebd400369a Remove misc unused files 2024-09-13 20:43:32 -07:00
81e4d16816 Remove unused Delicious-Heavy.otf font
I don't think we've uhh ever used this? Idk?
2024-09-13 20:39:22 -07:00
95ae669549 Remove Noto fonts and just use system-ui
Yeah, I don't remember why So Many Years Ago I felt it was important to
use the Droid fonts; I adapted this choice into the Noto fonts when
modernizing the other day, but, tbh, the default system fonts are
probably just a better fit for like. everything we do, and then *not*
downloading MB of font files.

I also feel like a lot of the contexts where we used serif fonts were
like, frankly incidental, based on where we chose `<p>` for semantic
reasons? I don't think any of them actually are made much better by
serifs, I'm okay with just simplifying and dropping that, instead of
looking for a better serif font stack to replace it.
2024-09-13 20:07:12 -07:00
989c96fd2b Oops, fix pb_item for "Royal Girl Elephante Gold Bracelets" and similar
There's some funny bugs we had here, like "Relic Elephante Jewellery"
and "Royal Girl Skeith Bodice" getting assigned "Ice", and
"Tyrannian Meerca Spear" being "Pea" lmao

I went and checked all the assignments now and they look good to me!

```ruby
Item.is_pb.order(:name).
  map { |i| [i.pb_color&.human_name, i.name] }
```
2024-09-13 19:56:41 -07:00
fdf1f31867 Add pets:find task to look up pets of a given color/species 2024-09-13 18:59:17 -07:00
c7b0ec71ef Add pet_types:guess task to guess poses for Invisible etc pets 2024-09-13 18:12:28 -07:00
287d7af1b9 Fix minor whitespace issue on item page "Occupies" zone list
Ahh right, when you indent stuff underneath a tag in HAML, it does the
same indented form in the output HTML, which adds whitespace that
creates a problem for how we're doing this list.

Before this change, the "Engulfed in Flames Effect" item showed below
the preview: `Occupies: Background Item , Lower Foreground Item`, with
an extra space before the comma.

After this change, it now shows
`Occupies: Background Item, Lower Foreground Item`, as intended.
2024-09-12 16:03:10 -07:00
58d7c38523 Simplify CSP header for SWF asset embeds, to fix 502 for some assets
Fun little bug: viewing the "Engulfed in Flames Effect" item was
showing our "502 Bad Gateway" custom error page in the embed. This is
because the Rails app was providing a `Content-Security-Policy` header
value that was longer than nginx is configured by default to allow, so
it was refusing the response, and showing the same 502 error as if the
app hadn't responded at all. (We discovered this by opening
`/var/log/nginx/error.log`, which explained this very clearly, ty~!)

In this change, we no longer list every `images.neopets.com` asset,
instead marking the entire domain as a valid image source for the
SWF asset embed iframe. I don't _love_ this solution, I liked the
property of specifying literally exactly the assets we allow! But I
don't think there's any practical danger here, and it helps a *lot* for
making this more reliable.

(If we could have solved this reliably by increasing nginx's allowed
response header size, I probably would've done that? But I researched a
bit, and ultimately concluded that I don't trust other intermediary
software like firewalls not to have the same issue. Let's not be
pushing the limits of HTTP headers of all things!)
2024-09-12 15:59:18 -07:00
68b6f46939 Oops, fix typo blocking non-bold-or-italic Delicious font from loading 2024-09-09 21:45:52 -07:00
cf6a19a7fc Use Noto Sans as a fallback if Delicious fails to load
This shouldn't ever be an issue in practice? I just noticed it because
something funny is going on with the `#userbar` element specifically
not using the Delicious font, and so I figured, hey, this simulates a
very real possible scenario, I'd rather use our consistent sans font
in this case!
2024-09-09 21:44:39 -07:00
9e052789db fix hash in Thanks for showing us banner 2024-09-09 21:37:56 -07:00
30f211caf3 Remove some now-unused homepage styles
These must be from long ago! Shrug!
2024-09-09 21:35:06 -07:00
dab865689f Refactor module sections on homepage, to handle font change
Huh okay, moving to my other machine, the change to Noto Sans subtly
broke the homepage layout a bit, wrapping the form buttons to the next
line in the three module sections.

Here, I refactor to more modern grid/flexbox sensibilities. Btw, there
was a Flexbox thing that didn't work quite how I expected? I commented
on my confusion, but checked in Chrome and Firefox and it seems to work
in both, so, ok!
2024-09-09 21:33:05 -07:00
874483eacb Fix SassC::SyntaxError when compiling perfectly valid CSS files
Okay cool, so this was an error that was happening *only* when building
assets for production: Sass's CSS minifier isn't familiar with all
modern CSS syntax (I think is the issue?), and so errors on things that
are actually totally okay.

I had previously worked around this in `swf_assets/show.css` with an
equivalent syntax that Sass recognized. But in this latest case with
the new `fonts.css.erb`, it was upset about the `src` list for the
fonts, and I don't know a workaround for that.

So, let's just disable Sass's CSS minification for now. I imagine the
difference isn't huge when CSS compresses just fine with gzip anyway?
(Most of what you can "minify" in CSS is whitespace, and that largely
seems silly to me when gzip is running.)
2024-09-09 19:59:43 -07:00
2466e5971e Move font definitions into a separate CSS file, using ERB and not Sass
Just checking out what doing asset references in a non-Sass way is!
2024-09-09 19:49:51 -07:00
ce50a19d31 Remove second reference to Delicious fonts that I missed 2024-09-09 19:45:58 -07:00
d55512ad99 Remove unused _blue.sass file
I think these were for the old site layout, which we replaced with the
"clean" theme?
2024-09-09 19:34:10 -07:00
852dc74001 Migrate from Droid fonts to Noto fonts, and host them locally
I was just scrolling our CSS and surprised to find we use Google Fonts
embeds! I don't like depending on external hosts like that.

Google Fonts doesn't offer the Droid fonts for download anymore,
though—looks like the Noto fonts are their spiritual successor. The
Droid Serif and Noto Serif fonts look visually identical to me, but the
Sans ones are a bit different… I kinda like the charm of the Droid Sans
better, but ah well! I'd rather be moving forward with a more modern
font with more reliable glyph support etc for now.
2024-09-09 19:31:41 -07:00
1d36e60df9 Remove now-unnecessary extra header on Modeling Hub page 2024-09-09 19:06:19 -07:00
0f7b01bec3 Remove unused DEBUG variable from pets/bulk.js
Huh, I wonder what that used to do! Oh well!
2024-09-09 19:05:07 -07:00
a14c4fca48 Remove needed items form on Modeling Hub
I think this has just been broken for a long time? And I don't think
it's very useful in a world 15 years later, where our problem *used* to
be giant gaps in our library, which isn't really our data problem
anymore.
2024-09-09 18:56:39 -07:00
a315282b70 Extract all the item pages' stylesheets into their own CSS files
No more of this loading everything into `application.css`! I'm
arbitrarily starting here because that's where I've been playing
lately, but this is part of a larger effort to move toward a more
straightforward CSS architecture (and away from Sass even?)
2024-09-09 18:48:08 -07:00
38b2bad044 Include application stylesheet first, so other styles override it
Ran into a funny thing on an upcoming change, where a style on the
page-specific stylesheet was getting undone by the *CSS Reset* of all
things in the application stylesheet. Resets come first!

I haven't audited that I didn't break a ton of stuff with this change,
but. I hope not! :)
2024-09-09 18:33:28 -07:00
8a8dd468be Improve handling of image hash pet names on the homepage
Closes #3, by adapting the suggested changes! Thank you!!

We both change how we create pet name preview jobs, by catching the `@`
case early; and we better handle symbols in pet names when showing the
thank you message, by parsing the query string more correctly.

Co-Authored-By: Steve C <diceroll123@gmail.com>
2024-09-09 18:25:56 -07:00
d84ab44771 Fix response when modeling pet from Modeling Hub homepage form
This was always modeling correctly, but not showing the message,
because Turbo doesn't handle anchors in redirect URLs the same way the
browser's full page loads do.

I forget why we had this as a `#` URL anyway to begin with. Use `?`
instead!
2024-09-09 18:17:09 -07:00
903fb19d5c Remove some unused code from outfits/new.js
This whole file could probably be made a LOT smaller and simpler but
hey, I'm not in the mood lol!
2024-09-09 18:11:03 -07:00
7f356cdede Slight improvement to Customize More noscript behavior
My wife suggested this, thanks Aria!! Identical behavior, but not using
the hack of reading the `style` attribute.
2024-09-09 16:27:39 -07:00