Commit Graph

6579 Commits

Author SHA1 Message Date
iforgetwhyimhere
0696269f77 Assume neutral Natures in Random Battles (#2718)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2026-07-10 16:09:01 -05:00
Guangcong Luo
08f276ac44 Preact minor updates batch 39
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
- Fix Firefox height
- Fix moves being incorrectly disabled in doubles
- Fix accepting challenges with custom rules
- Correctly calculate chat box width
- Fix a bunch of bugs around battle reconnecting
  - This involved a refactor of how `room.connected` is treated
- Fix layout width calculation
  - This fixes popups being in the wrong place
- Change thresholds for which layouts are used
  - We no longer use always-visible vertical tabs at any width, width
    is just too precious. It's still used for very low heights, though.
- Change Options to say what the automatic layout would be
- Fix horizontal tab layout to show the overflow in the right place
  - Now tabs stretch all the way to the left side of your username
- Make horizontal tab layout stretch over the username in the userbar
  - Maximum space for all your tabs!
- Don't wrap the nav preview in text boxes
2026-07-10 10:09:38 +00:00
Guangcong Luo
24b86547c0 Preact: Support low-height screens
We now have like six possible battle layouts depending on the exact
height and width of your screen. You can also manually choose them.

The original low-height screen UI ("overlay controls") have been
completely redesigned, and the controls are now centralized in the
bottom right, much like the modern games. It should be much nicer
to play in horizontal phone mode now.

A variety of other resolutions are also supported now, including some
very weird ones.
2026-07-10 09:43:04 +00:00
Guangcong Luo
2f397246a7 Preact: Stop using new export format
It was a really nice dream. But the new export format was unable to
justify itself, so we're going back to the old one.
2026-07-09 09:06:39 +00:00
Guangcong Luo
68b7a81d6a Preact: Drop CSS scroll snap and contentEditable
CSS scroll snap is no longer used at all. I'm keeping the code around
for now, but the scroll snap is now being implemented 100% in
JavaScript, which basically every mobile browser likes at least a
little better.

We are no longer fighting tons of browser bugs every time we focus a
text box, and I actually haven't found even a minor usability issue
with lots of testing on Android and iOS.

contentEditable is no longer used on mobile. Even in 2026
contentEditable is too buggy on mobile for me to keep around.
2026-07-09 09:06:39 +00:00
Guangcong Luo
f202d9bfed Preact minor updates batch 38
- Remove code for wizard editor
- Refactor more code into dex-search and searchresults
- Fix a focus bug in testclient
- Rename client.css -> oldclient.css
- Fix insecure.psim.us #2652
- Fix Firefox sending mouseover events for taps on other things
- Fix immunity tooltips for Gen 1
- Fix forms sent from the server
- Fix modal popup positioning
- Teambuilder: Fix result list windowing at boundary conditions
- Teambuilder: Improve keyboard accessibility for windowing
  - In theory this should improve screenreader support
2026-07-09 09:06:39 +00:00
ShivaD173
c91d191803 Champions: Add Natures from OTS to tooltips (#2705)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2026-07-08 15:10:50 -05:00
ry
2b45bf167b Fix weather ball display (#2709)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2026-07-03 06:57:40 -07:00
Alex Párraga Ferrer
f789748b2f Battles: Disable autocomplete on username-prefix search (#2716) 2026-07-03 06:53:34 -07:00
Guangcong Luo
7f412980e0 Preact minor updates batch 37
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
- Teambuilder: Support folders on mobile
- Teambuilder: Fix needing two clicks to select item/ability/move
- Teambuilder: Importing set before selecting species
- Teambuilder: Fix set list -> set editor animation
- Teambuilder: Refactor more stuff into dex-search and searchresults
- Support joining replays from server message
- Fix battle width on mobile being wrong when switching rooms
- Fix forfeit dialog when leaving expired room
- Improve phrasing in battles
- Support dismissing locked tooltips with Esc or clicking outside them
- Move Battle Options and Timer buttons, so that the Timer button
  doesn't cover up anything important on mobile
2026-07-03 03:40:47 +00:00
Guangcong Luo
969654a714 Preact: Improve scroll location for team copy/move
This makes it so when you click the copy/move button, the team you
copied/moved will stay in the same place, so it's easier to orient
yourself for where you want to move things to.
2026-07-01 12:20:58 +00:00
Guangcong Luo
1d6489fce6 Preact minor updates batch 36
- Fix oldclient textbox size
- Highlight changed lines in "Compare" popup
- Update README to prioritize Preact client
- Fix importing uploaded teams
- Fix room width calculation
  - Resizing incorrectly calculated width sometimes
  - Now hardcodes specific breakpoints for re-rendering everything
- Fix scrolling on older WebKit
- Fix radio button keyboard accessibility
  - Left/Right now change radio buttons
- Fix support for bad server code around bad room IDs
  - At this point, `view-[not a room ID]` needs to be treated as a
    valid room ID for anything to work correctly :(
- Support `|cantleave|` and `|allowleave|` in custom roomgames
- Work around Showdex using the deprecated `semimodal-popup`
  room-location type
- Teambuilder: Improve form readonly mode
- Teambuilder: Fix styling on Firefox
- Teambuilder: EV slider on mobile
- Teambuilder: Add +/- nature buttons on mobile
2026-07-01 12:19:52 +00:00
Guangcong Luo
1780e87291 Preact: Use raw HTML windowing for search results
When I wrote search results in Preact, I always thought it might have
perf issues. But it was surprisingly good enough on most computers!

Some older phone users still reported issues, though, so I had to
go back to the oldclient approach and raw HTML. You _can_ do full
windowing in Preact but if we're gonna go for speed we might as well
go for maximum speed.

This does full windowing so it's closer to the PSDex approach than the
oldclient approach (which only windowed downwards).
2026-07-01 01:32:53 +00:00
Guangcong Luo
e6599c4af8 Preact: Replace teambuilder Wizard with Form
This replaces the old Preact Teambuilder Wizard with a new Preact
Teambuilder Form (which looks/works much more like the oldclient
teambuilder).

I admit defeat here. I made the Wizard with buttons rather than text
boxes because I thought it was the only way to fit everything into a
tiny vertical space.

But I got so many complaints about how the buttons were worse that I
gave text boxes another try, and I managed to fit them in with only
around two more pixels of height per set than the Wizard. And the
text boxes are so much nicer in every other way that it completely
eliminates any reason to use the Wizard.

I've retained all of the standard Preact client niceties:
- scales down to mobile
- fits 6 pokemon vertically on a 1440x900-equivalent screen
  - i.e. a 13" MacBook Air at default resolution
- a move multiselect mode (accessible by clicking the "Moves" label)
  - supports >4 moves
  - you might think this isn't useful for normal teambuilding, but it
    does let you add moves before removing them, if you want to be
    indecisive and come back later
- sample sets and box sets importer, right after selecting species

And added some new ones:
- type-color tints! these look surprisingly way nicer than you'd expect
- new type icons
- new gender icons
- a modern dropdown for Tera types
- animation when going from list view to editing mode
  - scroll position matching when leaving editing mode
- pressing Esc will now reliably leave editing mode
- in general, keyboard behavior should be more predictable
2026-06-29 10:40:30 +00:00
Guangcong Luo
cd3ff66690 Preact minor updates batch 35
- Improve Stellar typeicon
- Suppress crash from external code message passing
  (I think this is caused by an ad? Extensions might do this too.)
- Use caches system for crossprotocol.html
- Fix switching to Rooms room in single-panel mode
- Use new typeicons in Tera checkbox in battles
- Run commands if you type something starting with `/` into room
  search
- Fix dex.species.get on modded dexes for cosmetic formes (it was
  interfering with Preact teambuilder's forme selector)
- Make EV guesser support Unown formes
- Move a bunch of dark mode CSS to be next to the corresponding
  light mode CSS
  - Dark mode was originally implemented as a bunch of CSS at the
    bottom, but the new convention is to put it right after the light
    mode CSS. This is generally more readable/maintainable and means
    you don't accidentally leave the dark mode CSS behind when removing
    the light mode CSS.
- Use modern CSS autoresize as default for textareas
- Fix nickname loading for forms
- Refactor `onParentEvent`, splitting it into
  `onParentKeyDown` and `onParentFocus`
2026-06-29 10:40:14 +00:00
Guangcong Luo
245b8c72e5 Preact: Support command hover previews 2026-06-28 15:11:47 +00:00
Guangcong Luo
a93cc164c4 Add new typeicon class
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
This can be used for modern type tiles with icons, instead of the old
pixelly ones. It doesn't fit anywhere near as small of spaces as the
old ones, but it's still small enough to fit in one line and looks
quite good.
2026-06-24 06:42:03 +00:00
Mia
3ff8ccc8b0 Add sets to build-tools
(Zarel refactored it to modern build-tool syntax.)

---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2026-06-24 06:42:03 +00:00
Guangcong Luo
57e9c46f9d Preact minor updates batch 34
- Fix teams count in teambuilder
- Fix news publishing
- Modernize build-tools
  - Not all of them could be converted to ESM but I did what I could
- In vertical tabs, show notification on tabbar when receiving DMs
  - This is closer to Discord's behavior
- Add more info to the sprites pages
- Support custom avatars on unregistered servers
- Support reaching DMs with Alt+Shift+Arrows
- Improve pasting
  - Still quite buggy on Android, but should be much less so on desktop
2026-06-24 06:42:03 +00:00
Guangcong Luo
e3b2954f43 Add zip-sprites script
This will make it easier to package our not-in-repo directories for
redistribution. And, uh, backups.
2026-06-24 06:42:03 +00:00
Guangcong Luo
d815c89a51 Preact: Support custom rules in challenge box 2026-06-24 06:42:03 +00:00
Guangcong Luo
0ab4b61dab Preact: Refactor connecting
Adds a keepalive heartbeat, since WebSocket-raw doesn't have a
heartbeat. Also improves the reconnect timer.
2026-06-24 06:42:03 +00:00
ry
14bf2ee40e Fix build (#2708)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2026-06-22 17:13:54 -06:00
Kris Johnson
6cf6066033 Teambuilder: Add Champions NatDex Draft support (#2706)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2026-06-21 14:53:18 -06:00
Kris Johnson
39a5ca792d Champions: Reset times attacked on switch out
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2026-06-17 18:13:17 -06:00
iforgetwhyimhere
23b34b43e2 Fix Champions Random Battle speed values (#2704) 2026-06-17 17:15:25 -06:00
iforgetwhyimhere
6bc992661c Clean up getSpeedRange variables (#2703)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
When I changed the speed tooltips, some variables in `getSpeedRange` became redundant as their different values are already handled differently. This commit finishes that by replacing them with their effective values in the location where they are referenced.
2026-06-15 22:01:04 -07:00
Guangcong Luo
de9c7a2553 Preact minor updates batch 33
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
- Default to "use Rewrite always"
- Improve arrow key nav
  - Focusing News no longer breaks arrow key nav
  - Focusing Rooms reliably focuses its search bar
  - Shift+arrow doesn't lose focus when moving into/out-of mini-window
  - Shift+arrows works without logging in
- Sharpen pixel art in teambuilder
- Support side servers
  - Custom groups
  - Local ladder
- Save autojoins no matter where they are
- Bump typescript-eslint version
  - We can't bump it higher than 8.58.2 because of
    https://github.com/typescript-eslint/typescript-eslint/issues/12277
- Match oldclient unlink behavior
- Don't allow clicking on the "Searching..."" button while searching
- Fix localhost.psim.us handling
- Improve /packhidden and /unpackhidden feedback
2026-06-13 22:44:15 +00:00
Guangcong Luo
15cd682f97 Welcome back, pokeaim
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2026-06-09 22:10:59 +00:00
Guangcong Luo
35ec764446 Add ads to Preact client
Sorry, everyone, but this was coming sooner or later.
2026-06-09 21:35:47 +00:00
Guangcong Luo
8336ed5673 Preact minor updates batch 32
- Refactor notifications
  - Don't notify for things you've seen before the refresh
  - Make tournament notifications work like oldclient
  - Clear notifications on window focus
- Refactor interruptClose
  - It now warns when closing PS, too
- Remove mocha dependency (migrate to node:test)
- Update TypeScript
- Update Preact
- Fix `/afd`
- Fix move targeting under Imprison
  - I'm still not sure what's causing it, but I think Preact is getting
    confused by the nested arrays. I've switched to using a fragment
    and that seems to have fixed it.
- Add error boundaries
- Fix join/leave message location in battles
2026-06-09 17:57:29 +00:00
Guangcong Luo
f8e15af020 Get well soon, pokeaim 2026-06-06 06:39:18 +00:00
Leonard Craft III
1c7bd87280 Add support for ZA Mega cries (#2697)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2026-06-03 21:53:37 -04:00
Guangcong Luo
1c0115ec2e Preact minor updates batch 31
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
- Improve team loaded check
- Fix reconnect cutoff being wrong sometimes
- Fix .htaccess permissions
- Fix deleted teams still being editable
2026-06-03 02:02:44 +00:00
Guangcong Luo
2af6be3166 Preact: Fix pasting newlines in mobile 2026-06-03 02:02:44 +00:00
Kris Johnson
60d6eed899 Update teambuilder for champions and remove Legends Z-A
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2026-06-01 15:55:31 -06:00
ry
2b1e79abba Preact: Update footer (#2651)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2026-06-01 10:15:29 -07:00
Guangcong Luo
9867c498ea Fix new cache folder
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2026-05-31 09:18:50 -07:00
Guangcong Luo
e7b6cbaff1 Rename oldclient and newclient files for clarity
Part of this is that the Preact client is even more impending than
before, so the oldclient should no longer get the "normal" URLs.
2026-05-31 09:15:42 -07:00
Guangcong Luo
84e076befe Move oldclient to src/oldclient 2026-05-31 09:15:42 -07:00
Guangcong Luo
5f5346d88c Stop suggesting Lax/Gentle natures
Fixes #2600
2026-05-31 09:15:42 -07:00
André Bastos Dias
92b5b269de Prioritize HP when assigning the remaining EVs in Stat Guesser (#2693) 2026-05-31 09:11:17 -07:00
iforgetwhyimhere
b10395c67c Force Struggle's type effectiveness to 1x (#2691)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2026-05-26 08:00:41 -07:00
Guangcong Luo
fe3d7cd4e0 Preact minor updates batch 30
- Fix starting tournaments with custom name
- Fix error when joining private rooms
- Improve colors for command syntax highlighting
- Improve performance by not updating background rooms
- Rename a bunch of room visibility functions for clarity
- Default language to English
- Add timestamps to disconnect/reconnect messages
- Fix server teams not getting fully downloaded
2026-05-26 09:22:39 +00:00
Slayer95
75fddbbe29 Hide formats with no games or Elo=1000 in untargeted /rank (#2625)
- QoL improvement for the lowest ladder players.
- Declutters and hides away formats that were only tried long ago.
- Also updates the cutoff from 1000.5 to 1001, to
to account for rounding changes
- Redesign "show more" button

---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2026-05-26 00:52:25 -07:00
Aurastic
d82bb12a39 Preact: Fix bug with command tabcomplete (#2689)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2026-05-25 03:19:26 -07:00
Guangcong Luo
f517f8d3a7 Preact minor updates batch 29
- Fix "Reset W/L" link in `/rank`
- Improve message for canceled team dropdown
- Fix Nature issue in Teams
- Fix Users and Battle Options covering battle logs
- Fix "don't know what to do with that file" when rearranging teams
- Switch to <select value={...}>, maybe fixing a flicker issue?
- Improve error messages for nonexistent rooms/battles
- Remove nonexistent rooms from autojoins when leaving room
- Don't Opt+Shift+arrows nav if text box non-empty
- Rename "PMs" to "DMs" in Options
- Hide command output with "show DMs in chat" setting
- Fix Copy button display
- Fix groupchat autojoin
2026-05-25 09:46:00 +00:00
Guangcong Luo
87cdcf90c8 Preact: Fix avatar and server setting persistence
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
Fixes #2638
2026-05-24 06:09:47 -07:00
Guangcong Luo
2df55b0d75 Stabilize Options panel width
Fixes #2669
2026-05-24 09:12:52 +00:00
Guangcong Luo
6f42ca2153 Preact: Support |popup||wide|
Fixes #2567
2026-05-24 02:12:30 -07:00