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

Teambuilder: Generate user samples from boxes #2226

Merged
merged 10 commits into from
Apr 10, 2024
Merged

Conversation

im-tofa
Copy link
Contributor

@im-tofa im-tofa commented Mar 2, 2024

This is an implementation of a suggestion to display user sample sets from boxes.

The first time a user clicks "Import/Export" in a set view of the teambuilder, this addition will scan through the teambuilder for any boxes with the appropriate format, and cache all sets as user samples. These will then be displayed as buttons. User samples with duplicate names receive a number suffix.

The cache for a given format is cleared if the user exits a box in said format. Caching reduces repetitive scans each time the user wants to import a set.

I did a quick "performance" test by creating 5000 teams, does not cause hiccups for me at least. Tested on Firefox. The bottleneck, if any, has been the smogon samples fetched using HTTP.

Let me know if I can improve the code quality or functionality, thanks!

This is what it looks like in my test client, see the bottom of the screenshot:

This was the corresponding box:

@im-tofa
Copy link
Contributor Author

im-tofa commented Apr 7, 2024

Thanks for the feedback @Zarel! I've fixed the linting issues now (no more use of ?., for-of, let, const or { [name] : pokemon }), made sure to try it out locally first now which I should've done the first time, my bad :)

After some thinking, I realised this feature is not very easy to discover or "self-explanatory". In an attempt to improve this, I changed the displayed text from "User sets" to "Box sets" and added a hint if no box sets are available for the format, see bottom of below screenshot. Let me know if that's not desired or if there are better alternatives:

bild

@Zarel Zarel merged commit 4d4816c into smogon:master Apr 10, 2024
1 check passed
@Zarel
Copy link
Member

Zarel commented Apr 10, 2024

Thanks!

Regular-Pokemon-Trainers-League added a commit to Regular-Pokemon-Trainers-League/pokemon-showdown-client that referenced this pull request Apr 12, 2024
* Update HiZo Credits (smogon#2223)

* Teambuilder: Provide Smogon Dex resources when building teams

* Teambuilder: Fix target on Smogon links

* Teambuilder: Don't try to load resources when they're already cached

* Teambuilder: Cache failures for formats without resources

* Modify CSS for accessibility

* Rules: Add Korean translation (smogon#2221)

Credits to igeu  , xerneas9050 and dhwna for the translation, aegii for the formatting.

* Remove a certain someone from credits

Been spending some time processing the last decade of my life, including reading
some old logs from the period where this user was banned, and I've decided that
I have to make this commit to be able to move on.

* Add package-lock.json

* Remove unnecessary jabs at PO, which doesn't even exist anymore

* One more

* Improve dark mode checkboxes

* Let's Go: Support itemless megas (smogon#2233)

* Teambuilder: Show Restricted Legendaries for VGC/BSS Reg G (smogon#2239)

* Add client support for Random Meta of the Decade

* AFD Mode: Fix the ability to turn it off

* Add support for adding badges in battle (smogon#2235)

* Add support for adding badges in battle

* oops

Forgot these needed to be below the avatar per latest spec, not above

* Move |badge| message handling to battle.ts

* Update play.pokemonshowdown.com/src/battle.ts

Co-authored-by: Karthik <[email protected]>

* Style button on ladder page, also add custom badges for ou/rands

* change some badge filename stuff

* more css stuff, final version

---------

Co-authored-by: Karthik <[email protected]>

* Support rematching with custom rules (smogon#2234)

* Teambuilder: Add EV optimization checker (smogon#2240)

---------

Co-authored-by: pyuk-bot <[email protected]>

* Fix optimizer output when new spread has a 0 (smogon#2241)

* Teambuilder: Generate user samples from boxes (smogon#2226)

---------

Co-authored-by: Hisuian Zoroark <[email protected]>
Co-authored-by: Mia <[email protected]>
Co-authored-by: Lionyx <[email protected]>
Co-authored-by: Christopher Monsanto <[email protected]>
Co-authored-by: Guangcong Luo <[email protected]>
Co-authored-by: Karthik <[email protected]>
Co-authored-by: Kris Johnson <[email protected]>
Co-authored-by: Andrew Werner <[email protected]>
Co-authored-by: pyuk-bot <[email protected]>
Co-authored-by: tofa <[email protected]>
Regular-Pokemon-Trainers-League added a commit to Regular-Pokemon-Trainers-League/pokemon-showdown-client that referenced this pull request Jul 19, 2024
* Support new ability flags

* Update HiZo Credits (smogon#2223)

* Teambuilder: Provide Smogon Dex resources when building teams

* Teambuilder: Fix target on Smogon links

* Teambuilder: Don't try to load resources when they're already cached

* Teambuilder: Cache failures for formats without resources

* Modify CSS for accessibility

* Rules: Add Korean translation (smogon#2221)

Credits to igeu  , xerneas9050 and dhwna for the translation, aegii for the formatting.

* Remove a certain someone from credits

Been spending some time processing the last decade of my life, including reading
some old logs from the period where this user was banned, and I've decided that
I have to make this commit to be able to move on.

* Add package-lock.json

* Remove unnecessary jabs at PO, which doesn't even exist anymore

* One more

* Improve dark mode checkboxes

* Let's Go: Support itemless megas (smogon#2233)

* Teambuilder: Show Restricted Legendaries for VGC/BSS Reg G (smogon#2239)

* Add client support for Random Meta of the Decade

* AFD Mode: Fix the ability to turn it off

* Add support for adding badges in battle (smogon#2235)

* Add support for adding badges in battle

* oops

Forgot these needed to be below the avatar per latest spec, not above

* Move |badge| message handling to battle.ts

* Update play.pokemonshowdown.com/src/battle.ts

Co-authored-by: Karthik <[email protected]>

* Style button on ladder page, also add custom badges for ou/rands

* change some badge filename stuff

* more css stuff, final version

---------

Co-authored-by: Karthik <[email protected]>

* Support rematching with custom rules (smogon#2234)

* Teambuilder: Add EV optimization checker (smogon#2240)

---------

Co-authored-by: pyuk-bot <[email protected]>

* Fix optimizer output when new spread has a 0 (smogon#2241)

* Teambuilder: Generate user samples from boxes (smogon#2226)

* client: escape dots in URL regex (smogon#2243)

* Changes for all of the s13 buffs.

* Updates for S13

* lots of fixes including for replays which should be moved to the main RPTL branch.

* Clarify 2D/3D Model Options (smogon#2244)

* Main menu: Add a button to the partner selection input for partner formats

* Add SSB client support (smogon#2245)

* ssb support

* SSB

* teehee

* poop

* more tooltip things

* Fix tooltips

* ok support

* More tooltip updates

* last changes

* Fix build

* Updates fixing announcer and trusted external sites

* Fix past gen tooltips (smogon#2247)

* CAP: Add Chuggalong minisprite index

* SSB: Client-side balance patch changes (smogon#2250)

* SSB: Client-side balance patch changes

* more changes

* oops

* Mark more evolution items as bad

* Fix tooltips getting cleared when using switch moves (smogon#2251)

* Override Fling and Natural Gift data for items in past gens (smogon#2252)

* Teambuilder: Update Smogdex links

* Add Psychic Noise animation (smogon#2254)

* Add Psychic Noise animation

* Satisfy linter

* Replays: Fix More Replays button on mobile (smogon#2255)

* Add Elo filter 1000 (smogon#2249)

PR for https://www.smogon.com/forums/threads/give-an-option-for-1000-minimum-elo-in-the-battles-tab-to-filter-out-challenge-battles.3743305/

* Properly display legal egg moves in teambuilder (smogon#2256)

* Include smogtours in "server down" message

* Add teambuilder support for BW 1 (smogon#2257)

* Fix crash in Replays

* Fix teambuilder move display for formes (smogon#2258)

* Fix teambuilder move display for formes

https://www.smogon.com/forums/threads/bug-report-teambuilder.3746541/
This bug was caused by my assumption that the client gets changesFrom the same way the server does.

* Update battle-dex-search.ts

Linter got upset

* Fix Ogerpon mask BP tooltip (smogon#2259)

* Fix crash (client) (smogon#2260)

* Point bug reports redirect to the subforum

* Fix client sending the wrong team to the server in some cases (smogon#2206)

* Convert noSketch to move flag (smogon#2261)

* Chat: Support nameless /html messages (smogon#2263)

* Teambuilder: Don't recommend 0 Atk IVs with Tera Blast

* Fix ???-type icon loading on type change animations

* Fix getAllyAbility for Gen < 7 (smogon#2264)

* Fix paralysis tooltips in Gens I-II

* Updates before cleanup.

* Removing buffed pokemon

---------

Co-authored-by: Karthik99999 <[email protected]>
Co-authored-by: Leonard Craft III <[email protected]>
Co-authored-by: Hisuian Zoroark <[email protected]>
Co-authored-by: Mia <[email protected]>
Co-authored-by: Lionyx <[email protected]>
Co-authored-by: Christopher Monsanto <[email protected]>
Co-authored-by: Guangcong Luo <[email protected]>
Co-authored-by: Karthik <[email protected]>
Co-authored-by: Kris Johnson <[email protected]>
Co-authored-by: Andrew Werner <[email protected]>
Co-authored-by: pyuk-bot <[email protected]>
Co-authored-by: tofa <[email protected]>
Co-authored-by: Auguste Charpentier <[email protected]>
Co-authored-by: Distrib <[email protected]>
Co-authored-by: Marty-D <[email protected]>
Co-authored-by: shrianshChari <[email protected]>
Co-authored-by: dot-Comfey <[email protected]>
Co-authored-by: Earl Joves <[email protected]>
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.

2 participants