-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: persist region filter in URL in and across pages #493
base: main
Are you sure you want to change the base?
Conversation
Deploying the-trans-dimension with
|
Latest commit: |
e95fcc1
|
Status: | ✅ Deploy successful! |
Preview URL: | https://c6ee61e9.the-trans-dimension.pages.dev |
Branch Preview URL: | https://feat-persist-region-url.the-trans-dimension.pages.dev |
Connected to Huly®: TD-494 |
This works great on the preview branch, great job! My only comment is to make the filter param Otherwise way outside my ability to review, can you have a look please @katjam? |
I'll make time to look at this tomorrow. I think you can track url changes in elm-pages. We access the query values when they occur in the URL so I am assuming we can sync that to the model. It might not be documented very well and I may be missing some obvious reason it won't work. |
I am still making time to look at this! Sorry for delay. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love to get this merged @katjam - i think if you dont have time to look soon lets just get it live before it gets too far out of sync with main. we can always open more tickets later to review.
Ah yes! Apologies... totally forgot this was sitting around. I'll do some Trans Dim work this weekend. |
Closes #466.
This PR:
I’m not entirely sure this is the best way to implement this feature, but I couldn’t find any other approach. In Elm Pages, there doesn’t appear to be a straightforward way to manage or track URL changes directly (using anchor elements with preventDefault to change the URL resulted in strange scrolling behavior).
Since this is my first time using Elm Pages, I may be missing a simpler approach. I’d be happy to hear any suggestions on how to do this in a cleaner way, ideally without using JavaScript/ports and direct history manipulation.
Regarding testing, ideally we should test the behavior of storing and retrieving the URL filter, but I haven’t had much success with that either. It seems to me that this is a case where it would be much simpler to test the entire behavior using a framework like the one suggested by @kimadactyl in #492