Commit Graph

6202 Commits

Author SHA1 Message Date
dot-Comfey
2c6f962d8f
Preact: Fix auto-show spoilers (#2389)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-20 23:35:23 -07:00
Mia
48cb201300
Preact: Support custom colors (#2385)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-20 15:48:55 -07:00
Aurastic
dbff485823
Preact: Support tabcomplete (#2382)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2025-04-20 08:00:08 -07:00
Guangcong Luo
9df60bcb57 Preact minor updates batch 13
Minor
- Load UI before BattleLog (and thus Caja)
  - Remove BattleLog dependencies from panels and panel-mainmenu
  - We now have Preact as our only dependency for the first load
    - Load times should be really fast now.
    - I remember thinking about what the load screen would look like
      but how many people would even see it?
- Don't navigate chat history when cursor isn't on the first/last
  character
- Make the main menu sticky
  - This involved refactoring most of main menu's HTML. It's very
    different now.
- Support notification coloring in mini windows
- Fix a variety of button propagation bugs
  - Most noticeably, canceling a challenge would immediately send a new
    challenge
- Fix a volume slider regression on regular client (Fixes #2383)
- Fix a Firefox issue where sending messages didn't reset the cursor
  position
- Add a `/closeand` command, mostly for buttons (Fixes #2386)

Trivial
- Refactor ChatTextEntry for readability
  - `setValue` should be impossible to use incorrectly now
- Make mini-window minimize/maximize/close buttons slightly bigger
- Remove resize handle from teambuilder text editor
2025-04-20 12:37:55 +00:00
Guangcong Luo
9f94c7ef5f Preact: Support reconnects
This adds support for reconnecting to the server after being
disconnected, without needing to refresh.

This is a little dangerous at the moment - one reason we've never done
this in the past is to enforce that everyone's using the newest client
version. This is fine in Preact Alpha but at some point we'll need to
find some way to enforce refreshing at a certain point.
2025-04-20 12:10:38 +00:00
Guangcong Luo
ab44f2de45 Fix dragging teams from teambuilder to computer
Apparently this was broken in the loginserver refactor because we all
forgot it existed...
2025-04-20 12:10:38 +00:00
Aurastic
157dc18cbe
Preact: Add afd, showdebug and other commands (#2378) 2025-04-20 05:04:54 -07:00
Mia
df017fba87
Preact: Add format resource loading to teambuilder (#2384)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
For parity with current builder.
2025-04-19 22:20:35 -07:00
Marty-D
12913f445a Add new avatars
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-19 12:09:38 +00:00
Guangcong Luo
64cf8dd361 Preact client minor update batch 12
Minor
- Fix "[Gen 6]" appearing in wrong places for the last time
- Fix a bunch of bugs in back/forward history
- Support short links (`news` can't be supported because it conflicts
  with the mini-window)
- Support `no-panel-intercept`
- Fix Z-move alignment
- Speed up loading by not using SockJS in newer browsers
- Fix backgrounds
  - Uploads required pressing Done, but it's supposed to be a close
    button
  - Random backgrounds weren't working
- Support ctrl+clicking and shift+clicking links
- Adjust main menu padding
  - Mini windows are now 20px wider
- Fix mini-window minimize buttons in Safari
- Add a maximize button to mini windows
- Stop special-casing News mini-window CSS
- Support mini-windows in vertical tab mode
  - PMs still default to being full tab, but News is now a mini-window
    on screens of any size, because the full tab is actually pretty
    unergonomic
- Fix highlight notification room in chat rooms
  - This is also refactored to be better code now
- Fix tab overflow
  - Give 180px space for userbar instead of 165px
  - Fix calculation of when to overflow
  - Improve tab list design
  - Add checkbox to switch to vertical tabs
- Fix race condition leading to connection failure

Trivial
- Options is now a semimodal
- Fix crash in load tracker
- Remove unused `update = forceUpdate` code in Popups
- Use the redesigned dark mode popups from the design refresh #2175
2025-04-19 11:58:16 +00:00
Aurastic
10f4bb5da8
Preact: Fix moderation UI bug (#2379)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-18 21:30:30 -07:00
Aurastic
a2e962622a
Preact: Fix tournaments join/leave bug (#2377) 2025-04-18 21:29:58 -07:00
shrianshChari
18665151e8
Properly type Item.naturalGift (#2370)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-18 15:58:35 -06:00
Mia
1f34776fc4 Teams: Don't allow selecting non-team text
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-18 10:34:03 -05:00
urkerab
44c4938733
Preact: Mute by double-clicking the sound button (#2375) 2025-04-18 07:27:00 -07:00
Aurastic
991eff5e5c
Preact: Support change background and other options (#2373) 2025-04-18 04:11:25 -07:00
Guangcong Luo
5971e5151a Preact minor update batch 11
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
Minor
- Unhide right panel when choosing "Two panels" layout option
- Refactor focusing
  - Correctly focus next room when closing currently active room
  - Correctly focus room when joining new room
- Use strict mode on all compiled files
- Fix router when started on `/` (it previously required starting on a
  non-empty room ID, which wasn't noticeable back when the URL needed
  to be `/preactalpha`)
- Update teambuilder sidebar CSS, to make it easier to add regular text
  - This is mainly for the "Tournaments" button in the main menu,
    which shares the CSS
- Fix new tournament elim tree text in Safari
- Update new tournament elim tree highlighted links to reliably
  link every still-playing game
- Remove latest gen from format name displays everywhere
  - Previously, they would only be removed from the format dropdown,
    but now they're also gone from the Ladder tab, battle tabs, and
    `/rank`
- Support async d3 loading
  - This allows chatrooms to be loaded way before all our dependencies
    are fully downloaded
- Remove "[Gen 9]" from format names everywhere (previously it was only
  removed from the format dropdown)
  - Also add "[Gen 6]" to unlabeled formats in `/rank` (Gen 6 was the
    last time we didn't have format generation as part of format names)

Trivial
- Stricter JSX linting
  - (unfortunately, most of the JSX style enforcement I actually want
    isn't possible in @stylistic)
- Make room.subscribeTo's second parameter optional
- Rearrange and comment loading order
- Rename hiddenInit -> focusNextUpdate (clarity)
- Rename PSMain -> PSView (clarity)
- Fix button spacing in Change Password
- Add `touch-action: manipulation` to <a> tags
- Refactor `nodeSize` in elim tour trees
2025-04-18 05:47:58 +00:00
HoeenHero
7ee7c6604a
Preact: Add roomlist overflow popup (#2374) 2025-04-17 21:19:07 -07:00
Guangcong Luo
b0d565a30b Preact minor update batch 10
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
Minor
- Fix crashes/bugs in backported elim tournament redesign
- Support opting into Preact client via cookie
- Fix popup positioning when parent element is unmounted (i.e. when you
  switch layouts in the Options menu)

Trivial
- Focus Main Menu and not Rooms when loading home page in single panel
  mode
- Correctly set user.registered
  ( Fixes https://github.com/smogon/pokemon-showdown/pull/11031 )
- Fix some text in the Options menu
2025-04-17 10:19:22 +00:00
Aurastic
ac13bb2861
Preact: Allow moderation through user options (#2371) 2025-04-17 03:19:10 -07:00
Aurastic
5636da024c
Preact: Fix PSBackground not updating (#2372) 2025-04-17 03:04:58 -07:00
Aurastic
0cc47f1f36
Preact: Add more user preferences in options menu (#2369)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-16 22:07:35 -07:00
Kris Johnson
7c1ffc9e39
Tournaments: Backport elim bracket redesign (#2368) 2025-04-16 21:28:45 -07:00
Guangcong Luo
228ee955eb Upgrade Babel dependency
Nothing major, but we no longer need `plugin-proposal-class-properties`.
2025-04-16 19:50:49 -07:00
Mia
04e9cc3f5b Teams: Ensure manage tab properly displays for all users
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-16 20:05:13 -05:00
Mia
90fc73b2e6 Teams: Add 'manage team' tab 2025-04-16 14:33:07 -05:00
Mia
d8371e5eb0 Teams: Add link to teams upload page 2025-04-16 13:14:47 -05:00
Waleed Hassan
e032688406
Preact: Support timestamps (#2361)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-15 23:25:52 -07:00
Aurastic
5775aa96e8
Preact: Support forfeiting battles (#2365) 2025-04-15 23:19:34 -07:00
Aurastic
a06909af4a
Preact: Support room aliases in autojoin (#2367) 2025-04-15 23:08:19 -07:00
Guangcong Luo
5957cef667 Preact minor updates batch 9
Minor
- Refactor placeholder room handling to fix a heisenbug crash while
  starting up
- Add `room.getParent()` (accidentally partly folded into previous
  commit)
- Support using the console without logging in
- Fix mobile support for https://pokemonshowdown.com/intro

Trivial
- Improve doc comments
2025-04-16 05:45:20 +00:00
Guangcong Luo
0fad695b44 Preact: Redesign tournament tree bracket
This is a pretty major redesign that makes our brackets look way more
like other modern tour bracket visualizations out there.

In particular, nodes now have two boxes instead of one, making it
much more straightforward to tell who won. This also makes the trees
much more compact, so they take up much less vertical and horizontal
space.

Font size has been bumped up for much better readability, and colors
are now used more meaningfully.

Tournaments also now show a summary bracket when they end, so there's
no huge full bracket filling up the screen.
2025-04-16 05:39:45 +00:00
Aurastic
c78675d1ac
Preact: Add autojoin functionality (#2359)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-15 01:43:46 -07:00
Guangcong Luo
079c7d2dd7 Preact: Support tournaments
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
Missing features:
- Popping out brackets
- Showing the bracket after the tournament ends
- Disable validate button for random teams

New and improved:
- Hover effect on tournament bar (also backported to 2013 client)
- Slightly better animations for expanding/collapsing tours
- Better scrolling around a bracket
  - "Grab" cursor
  - Selecting text is no longer completely banned (although it's still
    hard to do on desktop because of the whole drag scrolling thing)
  - Completely native scrolling on mobile
  - Scroll bars appear as normal, and regular methods of scrolling like
    arrow keys and scroll wheel also work as normal
2025-04-15 08:13:09 +00:00
Aurastic
2e50c0aad7
Preact: Add avatar and status options (#2360) 2025-04-15 01:13:03 -07:00
shrianshChari
0773f81d54
Add animation for Malignant Chain (#2358) 2025-04-14 19:52:17 -06:00
Mia
813f51d81b Teams: Adjust spacing of tera types
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-14 20:21:21 +00:00
Mia
18da66739a Teams: Properly load tera types when importing 2025-04-14 15:15:59 -05:00
Guangcong Luo
0740eb5148 Preact: Refactor client commands
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
At this point we've probably outgrown the "huge switch" pattern. So
instead, here's a client command syntax a lot like server's.

I've also added an `add` command that works more like server's and
2013 client's, as the default way to respond to client commands.
2025-04-14 03:12:22 +00:00
Aurastic
8f41ceb4da
Preact: Add /showjoins and other client side commands (#2352)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-13 12:33:55 -07:00
Aurastic
cf09cc7a91
Preact: Fix popup bug in testclient (#2357) 2025-04-13 12:13:12 -07:00
dot-Comfey
f8c09c1068
Preact: Add /ignore and /unignore (#2354)
Implements basic functionality of the ignore commands. I also added the ^ (prize winner) rank to the ignorable ranks since the inability for this rank to be ignored has been reported as a bug.
2025-04-13 12:01:30 -07:00
Guangcong Luo
21a2617289 Preact minor updates batch 8
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
Minor
- Redesign battle room tabs in vertical tab mode (they're now
  two-liners), kind of like in the original 2011 client
- Redesign roomtab tags (they're now smaller and bold)
- Fix scrolling to left when focusing textbox in Chrome Android
  - This was a huge mess. If scroll snap weren't such a horrible mess
    without CSS, I'd probably just give up and do it in JS. But given
    that that's much worse, here we are working around tons of Chrome
    and Safari bugs.
- Update replay watching UI to match modern PS
  - "Play/Pause" button has constant width
  - "Switch viewpoint" instead of "Switch sides"
  - "Last turn" -> "Prev turn"
  - Disable "First turn" and "Prev turn" when already at first turn
  - modern button arrangement
- Battle controls: align to bottom in mobile UI

Trivial
- rename `PS.closePopupsUntil` to `PS.closePopupsAbove`
- fix `<a href=".">` links to Home
- Fix ranks in DM userlist
2025-04-13 08:12:44 +00:00
Guangcong Luo
8a01113f3e Update replay download link
In practice this link should never go through, but I figure it should
have some sort of message for it to make sense at all...
2025-04-13 08:12:44 +00:00
Guangcong Luo
9040d41fb3 Improve testclient-key retrieval
Chrome makes it much harder to grab keys now. I've set up a way to
make it easy (since we're going to be doing it once a week).

Chrome did make it hard on purpose, so I'm a little paranoid, but
I think probably these warnings will be enough. If we develop a
phishing problem I'll revisit this.
2025-04-13 08:12:44 +00:00
Guangcong Luo
bfae3543e4 Add W/L/COIL to web API 2025-04-13 08:12:43 +00:00
Guangcong Luo
d84727f101
Update GitHub Actions config
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
This makes it better match the server config.
2025-04-12 18:14:30 -07:00
Guangcong Luo
e7041cc5bd Testclient: Fix clicking room links in Firefox
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-12 12:14:13 -07:00
Guangcong Luo
c3301aabea Fix testclient to work without a full build 2025-04-12 10:53:31 -07:00
Guangcong Luo
39ddd15510 Preact update batch 7
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
I've been batching all my non-huge Preact updates approximately once a
day and I intend to keep that up, but I should probably number them so
it's not just "misc updates" every time. Anyway: I went back and
counted. This is batch 7.

Major
- Update Options popup
  - Layout options
- Topbar in vertical tabs mode now contains a username/options button
- If you click on a button for a popup (like Options or a trainercard)
  while the popup is already open, it will be closed.
	- Also if you click on a popup already open somewhere else, it will
	  open correctly.
- Fix clicking on readmores, spoilers, and buttons inside links
- Make the vertical tabbar scrollable
- Reliably title <<rooms>> "Chat Rooms"
- Add a button to get to the vertical tabbar on mobile

Minor
- `users` in the URL now directs to Preact client
- refactor popup closing to never use while loops
- Fix capitalization for usercards for users with no user objects
- Migrate all `name="cmd"` buttons to `data-cmd`
- Migrate all `name="joinRoom"` buttons to `data-href`
- Fix left border thickness on home screen in vertical tabs mode
- Use `/play` for replaying battles
2025-04-12 10:38:31 +00:00