Commit Graph

6215 Commits

Author SHA1 Message Date
Aurastic
b26709a0a0
Preact: Add battle options and timer (#2395)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2025-04-26 17:51:36 -07:00
André Bastos Dias
68d04c131a
Make team box height flexible (#2391)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-26 06:48:07 -07:00
Guangcong Luo
8ba60e45b2 Refactor avatar popup 2025-04-26 06:04:33 -07:00
Guangcong Luo
94a1876f61 Support non-full builds in testclient
Non-Preact testclients don't deal well with non-full builds anymore,
now that battledata includes data/text.js. This fixes it so that
they're usable (although no longer being able to edit battle-dex etc
without an initial full build still sucks, it's unavoidable).
2025-04-26 06:02:06 -07:00
Guangcong Luo
e68993813d Preact: Improve screenreader support
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
The page should be a lot more accessible now.

All the aria-hiddens may be distracting; the most important change is
role="tab" and role="tabpanel" for panels, and role="dialog" for
popups.
2025-04-25 11:38:45 +00:00
Guangcong Luo
2ec10bc172 Preact: Improve teambuilder
- Add format chooser
- Show team name in title
- Support selecting species/item/ability/move from menu
- Clicking species/item/ability/move selects the text for easy replace
- Add Stats menu
- Add placeholder Details menu
- Add types and item icon
- "Add Pokemon" button

It's still a very long way to go, but it's starting to look properly
like the vision I have in my mind.

Minor
- Refactor
- Fix cachebuster for teambuilder CSS
- Improve teambuilder resources HTML
2025-04-25 11:38:45 +00:00
Guangcong Luo
bee9e8e629 Preact minor updates batch 15
Minor
- Fix `/help` for server commands
- Fix multiline DMs
- Redesign collapsed userlists
- Refactor topbar to use display:table and inline-blocks, instead of
  floats and manual margin calculations
  - I nearly used flexbox, but fake tables work just as well so I
    figure why not. The old client actually manually calculates margin
    to do the thing where the right tabbar expands to the right and
    then to the left and it's nice to not to need that anymore.
- Document `.gray` in STYLING
- Convert all buttons that make sense as links to <a class="button">
  - That would be all the main menu links, plus the
    usercount/battlecount in Rooms.
- Fix dismissing popups in iOS Safari
- Add an icon for being disconnected

Trivial
- Fix stars in the old client format dropdown
- Use "Cmd" instead of "Ctrl" on Macs in the chat formatting panel
- Fix some code style in panel-popups
- Update supported browser list in README
- Add Preact keys where they make sense
  - For the most part I think requiring keys is too strict. I still
    think they're unnecessary or actively detrimental for any list
    that isn't long/complex and also rearranged ever.
- ESLint: Set no-shadow to warn
2025-04-25 11:38:45 +00:00
Aurastic
90917c4d4f
Add groupchat-* to routes (#2396) 2025-04-25 03:27:44 -07:00
Kris Johnson
0abc1ef7ad
Preact: Support hovering over roomtabs with notifications (#2394)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2025-04-23 13:09:28 -07:00
Guangcong Luo
b39b27747f Fix replay testclient to load local play.* files
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-22 08:42:34 -07:00
Mia
bb601a6d04
Preact: Support forms that send commands (#2388)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
2025-04-21 06:25:41 -07:00
Guangcong Luo
04bfc03d6b Add .details CSS and improve old CSS
1:

We now have some new CSS for details elements. Simply use
`<details class="details">` to make them look nicer.

It also has a lot of neat features (since it was designed for
expandable dexsearch). It's fully documented in STYLING.

https://play.pokemonshowdown.com/style/STYLING.html

2:

Links are now styled, with hover effects. It's just a slightly nicer
blue (and a slightly nicer purple for visited links). I haven't done
this before because it interferes with other CSS too much, but the
new(ish) `:where` selector makes it easy to cheat specificity problems.

3:

Subtle buttons are no longer different from subtle links. I've
introduced ilink buttons which behave like the old subtle buttons,
and new subtle buttons simply work exactly like subtle links.

4:

Infoboxes in dark mode are now slightly easier to see.
2025-04-21 13:16:39 +00:00
Guangcong Luo
9019a0769e Preact minor updates batch 14
Minor
- Don't allow reconnects (force refresh) after a day of uptime
- Don't toggle <details> when selecting text
- Preserve bottom-scroll position when expanding <details>
- Prevent certain kinds of overscroll on mobile
  - Scrolling on mobile should now be "less wobbly". Also, swiping
    down to refresh no longer happens inside rooms like a chat room
    or the main menu (although you can still do it intentionally by
    swiping down in the left menu).
- Fix selection in the old newish dexsearch responses

Trivial
- Add Date.now polyfill
- Linter: `no-constant-condition` is now a warning
- Support `PS.confirm` and `PS.prompt`
- Make close buttons in the left sidebar bigger
- Add a `Net.formData` function to get form data
2025-04-21 13:16:26 +00:00
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