Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

November 18, 2023: Merge with PS #20

Merged
merged 70 commits into from
Nov 19, 2023
Merged

November 18, 2023: Merge with PS #20

merged 70 commits into from
Nov 19, 2023

Conversation

Rezzo64
Copy link
Collaborator

@Rezzo64 Rezzo64 commented Nov 18, 2023

Quite a lot of restructuring happened. Going to test this thoroughly before merging.

Zarel and others added 30 commits October 29, 2023 04:51
The headline feature here is that we now support being logged in and
searching for private replays. We also have a new button to instantly
find your own replays.

Also here is the basics of HTML5 history support. It's the first step
to having the two-column layout up and running!
Old Replays's two column support was the Panel system most notably
shown off by PSDex. It was definitely very nice but a bit hard to
port to Preact.

This new one, written from scratch, has a few niceities:

- topbar can scroll offscreen
- only one scrollable area (scroll wheel works everywhere, and
  the PageUp/PageDown/Spacebar keys are unambiguous)
- uses very little JavaScript when resizing; most of the layout
  work is done by CSS

With the drawbacks:

- no animation
- only two columns supported (not relevant to Replays which has
  never used over two columns)
- uses a lot of modern CSS (overflow: sticky, and flexbox) but
  should degrade gracefully
New Replays now supports adding `?p2` to the end of a replay
URL, to see the replay from the opposing viewpoint.

Search results will now automatically be from the viewpoint of
the player you're searching for.

Viewpoint is now a selector rather than a "Switch sides" button,
which should hopefully be clearer about what it's doing.
New name is a lot clearer.
This also includes some refactors. Polyfills are now gone from
utils.ts (I'm not sure why they were ever there; they're redundant
with ps-polyfill.js) and there's a new Net.decodeQuery.
This makes the left sidebar less cramped on the biggest displays
(specifically, MacBook Pro 14" and up).
I nearly missed this feature from Old Replays, but I was comparing
the two side by side and noticed it.
Specifically, the bugs fixed are to searches not updating correctly.
Mostly this makes dark mode darker, but it does come with a whole suite
of other design improvements.
- Updates New Replays for the design refresh
- Updates STYLING.html for the design refresh

Fixes #2177
Fixes #1991

(Removing a move by clicking on it in search didn't actually
remove it from the set.)

Fixes #2134

(Sorting and clicking on a filter would clear the currently
selected pokemon/move textbox, but this was only supposed to
happen when searching for a filter.)
PR #2164 added duplicate copies of these functions to battle.ts
which is already quite overloaded. This temporarily relocates them
to battle-dex, in preparation for a longer-term deduplication
probably involving moving the storage.js implementation there.

The API has been revised slightly, to match the server's
sim/teams.ts.
PR #2162 removed the CSS on downloaded replays without any
explanation. I think it was intended to save space and/or make
things bigger? But it came with a number of bugs.

- downloaded replay logs are much wider than intended
- downloaded replays now have a "battle options" button that does
  nothing
- downloaded replays have some unstyled text in e.g. popups
- MOST IMPORTANTLY: downloaded replays are no longer styled when
  you don't have an internet connection

Anyway, reverting that change fixes all these issues, and doesn't
seem to cause any new ones? This is a temporary measure while
waiting for Karthik to explain why the CSS removal was done in
the first place.

Refs #2165
- Teams in folders in the team dropdown were unstyled

- `.button.disabled` wasn't taking precedence over `.button.notifying`
The idea is to eventually move all client parts to their domain name
subdirectory, for clarity and better organization. New Replays is
just first.

Anyway, yeah, minor updates to New Replays, but otherwise it's just
getting deployed as-is, straight to

https://replay.pokemonshowdown.com/

The old URLs are getting taken down; they were only used for
development anyway.
I was watching an old replay and noticed it no longer worked.

Turn 7 of https://replay.pokemonshowdown.com/randombattle-247965078

Apparently when I did this rename, I didn't bother to make it
backwards compatible with old replays?

9aba6a3
I completely missed that this was being used...
This should make Google search results and Discord link previews
for replays work correctly.

This actually involved a ton of work, but at least this work also
makes replays load faster.
Zarel and others added 27 commits November 16, 2023 00:01
Anyone who wants to test on HTTPS can use localhost-443.psim.us.

This can help with the issue where browsers prefer HTTPS over HTTP.
There was an actual Cloudflare issue that made HTTP straight-up
stop working for a while, but that one appears to be fixed now.
We originally let PS be embedded because I was happy to get more
attention, but at this point it's no longer a good idea.

(also add a logo update I missed from 9d8655c )
Files meant to be served have been moved into
`play.pokemonshowdown.com/` and `pokemonshowdown.com/`.

We now have three directories for the three subdomains handled by this
repo:

- `pokemonshowdown.com/`
- `play.pokemonshowdown.com/`
- `replay.pokemonshowdown.com/`

Naming them after the subdomains will make it much easier to tell where
the files for each go.

The diff is probably useless; it'll be easier if you just look at the
new tree:
https://github.com/smogon/pokemon-showdown-client/tree/reorganize
It was previously throwing errors about 'no client_id provided', this fixes that by the initialization code for auth2 first (suggested by several google results and confirmed to work by me.)
I'm trying to centralize config.
(Also fixes the build error.)
(Introduced in - you guessed it - the directory reorg.)
This stuff isn't really relevant to anyone trying to develop at
home, anyway.
At some point we need to update eslint but now is not that point.
Made the animations for the various types of Tera Blast various kinds of beam or blast moves (or in the case of Grass, the closest thing to that).
@Rezzo64 Rezzo64 marked this pull request as ready for review November 18, 2023 18:11
@Rezzo64
Copy link
Collaborator Author

Rezzo64 commented Nov 18, 2023

  • 'DH2/' moved to 'caches/DH2/'
  • data, fx, js, replays, sprites, src, style, swf, index.html, index.template.html, ladder.php, testclient-beta.html, testclient.html all separated into 'play.pokemonshowdown,com', 'pokemonshowdown.com' and 'replay.pokemonshowdown.com' subdirectories
  • index.html now copied directly from index.template.html on build

@Rezzo64 Rezzo64 merged commit 1ac9ed5 into scoopapa:main Nov 19, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.