Python-Type-Challenges icon indicating copy to clipboard operation
Python-Type-Challenges copied to clipboard

Refactor random button

Open F-park opened this issue 1 year ago • 7 comments

Description

Use HTMX refactor random button.

Done

homepage random button sidebar random button Resolve #104

F-park avatar Jan 27 '24 04:01 F-park

It is ready for review.

F-park avatar Jan 28 '24 03:01 F-park

I definitely love the change. My only feedback is to consider whether this can be done without pre-loading the "random" challenge, i.e. preserve the old behavior to delay the pick until users have clicked on "random". If this is not achievable, it would be helpful to describe why. Thanks.

laike9m avatar Jan 28 '24 15:01 laike9m

If preserve the old behavior to delay the pick until users have clicked on "random", the address bar will display https://python-type-challenges.zeabur.app/random when the user clicks the button. However, if the user refreshes the page, they will not be able to return to the previous challenge.

F-park avatar Jan 28 '24 15:01 F-park

I already tried to dynamically modify hx-get, but it could not work.

F-park avatar Jan 28 '24 16:01 F-park

I have an new idea for avoiding the first /random request, wait for me to refactor the code.

F-park avatar Jan 28 '24 16:01 F-park

It is ready for review.

F-park avatar Jan 29 '24 02:01 F-park

Thanks. I'll need to take a closer look at this.

laike9m avatar Jan 29 '24 06:01 laike9m