Commit Graph

23 Commits

Author SHA1 Message Date
Mia
fa99d0ee25
Add a resource page indexing all public commands (#2477)
* Add a resource page indexing all public commands

* Add preact
2025-07-22 13:51:10 -05:00
Guangcong Luo
0990e13c2d Preact minor updates batch 21
- Fix Rooms state when pressing Enter after searching
- Fix (workaround, but still) opening popups on testclient
- Fix team menu in challenge/search
- Change "Preact Alpha" to "Preact Beta"
- Support side servers

Teambuilder
- Fix Upload button and teambuilding links leaking through focus editor
- Use `inputmode="numeric"` for better number keyboard in phones
  - You can't type `+` or `-` on EVs on phones, but oh well, the Nature
    dropdown is good enough. I think it's worth it for easier EV inputs.

Trivial
- Align main menu battle search labels to the left
- Fix flicker when searching Rooms
- Hide "Open battles in right panel" option when it doesn't do anything
- Get rid of PSTeambuilder.*packTeam/export* in favor of Teams
2025-05-17 16:19:58 +00:00
Guangcong Luo
5e3e017773 Preact: Add a new "wizard" teambuilder
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
Major
- Team editor is now its own file, so that it can be used outside of PS.
- New wizard editor (more like old teambuilder)
- Text editor now supports undo
- Don't let species be cleared
- Finish pokemon/ability/item/move lists
  - Currently selected options are highlighted
  - Keyboard navigation
- Mobile support!
- Text editor now uses big icons on desktop
- With only a few remaining issues, we have reached parity with the old
  teambuilder.

Minor
- Fix links to abilities and moves
- New <ul class="tabbar"> CSS. Unfortunately not backportable, so it'll
  have to wait until Preact client is released before it can be used.
- Two-tone stats bar chart
- EV editor stub mobile support
2025-05-04 09:32:43 +00:00
Guangcong Luo
b5630d3ff2 Preact: Improve teambuilder more
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
- New export format
  - NOT FINAL, wow did Twitter freak out when they saw this
  - I have not made a decision on whether to keep this new export format

- Stub details form
- Checkbox for old export format
- 510 EV limit
- Show full search results (with windowing)
- Choosing generations rather than specific formats
- Searching/filtering/sorting results
  - Reverse sorting filter columns (move types/categories and
    pokemon types/abilities) is now possible even on oldclient

Bugfixes:
- Gen 1 (no item) species selection
- "Add pokemon" button positioning
- Dark mode results
- Width (to fit the final column of results)
- Highlighted line width
2025-04-29 00:22:50 +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
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
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
Aurastic
157dc18cbe
Preact: Add afd, showdebug and other commands (#2378) 2025-04-20 05:04:54 -07: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
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
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
FeluciaPS
36ccc1a80b
Preact: Add utilichart.css (#2349) 2025-04-12 03:21:50 -07:00
Guangcong Luo
9f18a13bbf Preact: More misc fixes
Moderate:

- Fix double messages when being DMed (and otherwise joining a room
  server-side)
- Refactor PSModel to support passing a value with updates, so
  PSStreamModel is explicitly about tracking an update backlog.
- Work on supporting AFD mode (it doesn't seem to work yet)
- Fix music still playing after closing a battle
- Show username (with capitalization and spaces) in DM titles
- Don't let people try to search for battles without choosing a username

Minor:

- Remove random BOM that made it into some files?
- Correct date Preact client started (I mistook the date testclient was
  created)
- Refactor updateLayout
2025-04-11 07:55:41 +00:00
Guangcong Luo
0eeed0d7ce Preact: Add vertical header layout for mobile
It's finally here and it's beautiful! I've had this design in my mind
for around ten years, ever since I first started working on a Preact
client.

The idea is that on small screens, you'd just scroll left to get to
the menu, instead of needing to press the menu button. This turned out
to work surprisingly well and I'm pretty happy with it.

This also exposed a number of bugs. It turns out most of our popups are
not written with horizontal scrolling in mind, so I had to fix
popup rooms as well as BattleTooltips.

There's still plenty of improvements possible, but I'm already really happy
with what I've done so far.
2025-04-11 07:55:41 +00:00
Guangcong Luo
a476ded769 Preact: Split off panel-popups.tsx from topbar 2025-04-10 05:01:49 +00:00
Guangcong Luo
7a00e5f610 Preact: Misc fixes
- Rename RoomType to PSRoomPanelSubclass (so it doesn't conflict with
  the other RoomType)
- Support message notation in popups
- Support searching for battles
- Fix Terastallizing in battles
- Fix cancelling challenges
- Support the games list
- Topbar now shows format name rather than ID
- Fix rejoining battles in progress
- Chats and battles: Focus on any click
- Retain chat/battle history when moving rooms in/out of mini-windows
- Real news (instead of just testclient placeholder)
- Add "Tournaments" and "Friends" main menu links
- Use new icon in upper left
- Use dark main menu groups
- Fix pref loading
- Support `/nick`
- Rename `room.handleMessage` to `room.handleSend` for clarity
- Rename `room.queue` to `room.backlog` for clarity
- Fix DM userlist after renames
- Darken chat logs in dark mode
2025-04-09 17:22:50 +00:00
Guangcong Luo
f272d9526b Preact: Support logging in
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
2025-04-07 20:04:49 +00:00
Guangcong Luo
5c2beea822 Update intro comment
Unfortunately it seems like the console is the new hot place to say
hi to devs, rather than the source, but we're actually using the
console. So it's gotta be here.

ASCII art circle was outlined with

https://www.asciiart.eu/ascii-draw-studio

and the exclamation mark was done by tracing the old one. The rest,
including the anti-aliasing was entirely by hand, though.
2025-04-07 17:14:22 +00:00
Guangcong Luo
5a6e935747 Preact: Open console when pressing / in Main Menu
There's no easy way to enter a command in PS if you're not logged in.
This adds one.

This also standardizes the room ID for the console as `pm-`.

I'm still mulling whether `pm-[userid1]-[userid2]` should be the roomid,
or `pm-[pmtarget]`. Arguably it's nice for PMs to have the same roomid
for both sides of the conversation, but also arguably it's nice for
PMs not to change roomid when you change your own name (it'd still
change if your PM target changed name).
2025-04-04 19:38:02 -07:00
Guangcong Luo
4dcecc9fc8 Preact: Make client usable again
A few updates seem to have made the Preact client stop working, but this
restores it to working state again.
2025-04-03 18:56:51 -07:00
Guangcong Luo
a10821ab8b
Update to ESLint 9 (#2326)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
This finally removes the tslint dependency and switches to eslint.

There are a lot of other changes here, too, to bring the codebase up to
server standards. TSLint never had much in the way of indentation
enforcement.

Not very happy about eslint splitting itself up over 6 dependencies,
or its documentation over three websites, nor how poorly documented the
new flat config is, but I mean, eslint's gonna eslint. Customizing
would be even harder if we tried to use Biome or something. They mostly
seem to go full Prettier.

Also here are some changes to our style rules. In particular:

- Curly brackets (for objects etc) now have spaces inside them. Sorry
  for the huge change. ESLint doesn't support our old style, and most
  projects use Prettier style, so we might as well match them in this way.
  See https://github.com/eslint-stylistic/eslint-stylistic/issues/415

- String + number concatenation is no longer allowed (except in ES3
  code). We otherwise now consistently use template strings for this.
2025-02-25 20:05:32 -08:00
Guangcong Luo
04fd0d8ecf Bump jQuery version 2023-12-02 20:28:01 +00:00
Guangcong Luo
5d41f3ec93
Reorganize directories (#2187)
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
2023-11-16 03:39:29 -08:00