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

Refactor random button #108

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Refactor random button #108

wants to merge 5 commits into from

Conversation

F-park
Copy link
Contributor

@F-park F-park commented Jan 27, 2024

Description

Use HTMX refactor random button.

Done

homepage random button
sidebar random button
Resolve #104

@F-park F-park marked this pull request as ready for review January 28, 2024 03:58
@F-park
Copy link
Contributor Author

F-park commented Jan 28, 2024

It is ready for review.

@laike9m
Copy link
Owner

laike9m commented Jan 28, 2024

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.

@F-park
Copy link
Contributor Author

F-park commented Jan 28, 2024

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
Copy link
Contributor Author

F-park commented Jan 28, 2024

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

@F-park
Copy link
Contributor Author

F-park commented Jan 28, 2024

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

@F-park
Copy link
Contributor Author

F-park commented Jan 29, 2024

It is ready for review.

@laike9m
Copy link
Owner

laike9m commented Jan 29, 2024

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

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.

[Web] Use HTMX to random page.
2 participants