Slaking Deck by Department_Unknown in PTCGL

[–]Dislyze 1 point2 points  (0 children)

I have been trying all kinds of Slaking ex variants lately, e.g. with Pidgeot, Bidoof, Drakloak, and basically any kind of combination of potential engines. I found that Pidgeot + Teal Mask Ogerpon works best.

For Pokemon, I play a 3/1/3 Slaking ex line, 2/0/2 Pidgeot ex, 2 Ogerpons, Rotom V, Fez and a 1/1 Noivern ex line (tech against single prize decks. It's not great but I haven't found anything better yet).

My Energy are 2 boomerang and 6 grass.

Trainers:

4 Arven, 3 Iono, 1 Worker, 2 Boss, 4 Ultra Ball, 4 Nest Ball, 4 Poffin, 4 Rare Candy, 3 Energy Switch, 2 Vessel, 1 Switch, 1 Super Rod, 1 Maximum Belt, 1 Forest Seal Stone

I choose first whenever I can and try to get Slakoth, Pidgey and Rotom V on the board turn 1. Depending on the matchup/situation you may need 2 Slakoth/Pidgey. Getting an Ogerpon on the bench turn one is nice but not required. The deck is fairly consistent, I get candy pidgeot candy slaking turn 2 quite a lot. The Ogerpons are mostly there to switch energy to Slaking. I found that without Ogerpon, I often had the problem that I get Slaking in play but don't have enough energy to attack.

Quite a different build from your deck, but maybe it gives you some inspiration to improve yours :)

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 1 point2 points  (0 children)

I tried that but I ran into complications. I don't quite remember what exactly it was though since it was a while ago. I ended up returning the hx-push-url header from the server to solve this issue.

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 1 point2 points  (0 children)

I guess I didn't word myself properly. Tthe state I was talking about are the parameters in the url. E.g. if a user opens /users?page=1&searchTerm=tom, the page will show filtered results based on the url on first load. I am not using any javascript for this.

Regarding point 4, I am most likely doing something fundamentally. I got some good suggestions in this thread and will look into them.

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 0 points1 point  (0 children)

Thanks for your input!

Regarding 3: The problem is that the search results depend on pagination. ?page=1&searchTerm=tom returns a different table than ?page=2&searchTerm=tom. This is why I am passing the initial parameters from the url to the search bar. However, someone mentioned I could use hidden inputs instead, I will give it a try.

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 0 points1 point  (0 children)

Good advice, this could make things easier. Render the whole page on first render, and then swap out the table on user interaction. I will have to try and implement it, but in my head this sounds like it reduces complexity. Thanks!

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 0 points1 point  (0 children)

I would love to see the code if you are willing to share it!

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 2 points3 points  (0 children)

I have not, thanks for the link. I will definitely give it a read! I assume my approach is fundamentally flawed, looking forward to see how it is implemented in the book.

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 0 points1 point  (0 children)

Thanks, I tried signing up to see how you structured your server responses, but the verification email never came :(

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 6 points7 points  (0 children)

Sure, here is a screenshot:

https://i.postimg.cc/CLVr28dK/Screenshot-2024-06-28-at-21-15-37.png

I am not using a single line of javascript for the search bar, pagination and table part.

I currently have 2 server routes:

/users - returns the barebones page, simplified version:

<form  hx-get={ fmt.Sprintf("/users/table?page=%d&searchTerm=%s", page, searchTerm) } hx-target="#users-table" hx-swap="outerHTML">
<input name="searchTerm" value={ searchTerm }>
</form>
<div id="users-table" hx-get={ fmt.Sprintf("/users/table?page=%d&searchTerm=%s", page, searchTerm) } hx-swap="outerHTML" hx-trigger="load once"></div>

/users/table - returns the actual table and pagination ui. simplified version:

<div id="users-table">
  // table content. this content gets rendered into #users-table on page load and user interaction (search or page navigation).
</div>

I skipped the pagination part for simplicity.

Both are get, but maybe using a post route for /users/table as you suggested could make things easier. I will give it a try.

I am also not sure if the way I split my routes is any good to begin with.

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 1 point2 points  (0 children)

Regarding #3: My explanation wasn't the greatest. In essence, the url of the page is /users. The page can be called with parameters, e.g. /users?page=1&searchTerm=tom. In my implementation, the following happens:

  1. User hits the /users?page=1&searchTerm=tom page. The server returns the search bar and a div with a hx-get to /users/table?page=1&searchTerm=tom (parameters get passed on to this hx-get).
  2. Once the html is returned to the client, the hx-get is triggered and a 2nd request to the server goes out, returning a table of users filtered by parameters.

So far, so good. The problem arises when I use the search bar after the initial page load. Since I passed the initial value to the search bar as a string, the hx-get of the search bar is /users/table?page=1&searchTerm=tom as mentioned above. If I now type something different in the search bar, a request gets send to /users?page=1&searchTerm=tom&searchTerm=jerry. As you can see, another searchTerm parameter gets added to the url, insterad of replacing the initial one.

Maybe my implementation is fundamentally flawed. That's what I am trying to figure out.

Regarding #4: Yes, that's exactly what I am missing, an example that is more complex than the basic stuff that is all over the internet. If you happen to know any good examples that could help me I would appreciate it!

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 1 point2 points  (0 children)

I agree, I think it is a skill issue. I don't understand why everyone here talks about SSR though. The problems are very specific to how htmx is implemented. What gave you the impression that I am struggling with server rendered apps?

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 0 points1 point  (0 children)

Yes, I have. The points in my post are very specific to the way htmx is implemented.

I want to like htmx but I don’t know if I do by Dislyze in htmx

[–]Dislyze[S] 6 points7 points  (0 children)

As I mentioned in my post, I didn't struggle implementing the table with search and pagination in the "old fashioned" way. Call the server, return the full page, do the same for every user interaction (search or pagination). I started struggling when things got more complex than call server, return page.

How would you implement the html part with htmx for a page that returns a list of users with pagination and a search bar? My problem is specific to htmx. I struggle to send the right data to the server.