Share button doesn't change page URL
As reported in Discord, clicking on the Share button copies the short URL to the clipboard, but doesn't change the page URL (window.location); it remains the long URL. This is confusing behavior.
On the deployed site, I don't even see the brief change in icon to a chain link anymore (but I do see it on a dev server, even though it's failing to do the PUT).
Yeah I think we pushed the work I was doing on the share button a bit prematurely. I reckon I'm being a bit inactive these days and its showing. I'll try to investigate the issue, thanks for reporting!
I misread the issue. There's no real issue. You are pointing out a behavior that seems confused (rightfully so!) Do you have a better proposal than the actual implementation? I'm all hear :)
I'd propose the following behavior:
- After content doesn't change for a bit of time, the window.location URL updates to the long explicit form (
#...) automatically. This just costs a little time but no storage, and ensures that the URL is almost always a representation of the current reality. (Currently it doesn't update until you click Share.) - After clicking Share button, the short URL (
?hash=...) is copied to clipboard (as currently) and the window.location URL changes to that as well. When the content changes again, the URL becomes the long form again (via Rule 1 above).
It seems like neither of the suggested behaviors are live on https://stage-playground.solidjs.com/scratchpad — is it OK to reopen this issue?
The share button changes the URL for me every time.
https://github.com/solidjs/solid-playground/assets/297678/d5def9dc-4c86-449a-8bb4-a9459846f34b