Hacker Newsnew | past | comments | ask | show | jobs | submit | fadymak's commentslogin

Thanks for the suggestion! I’ll look into getting that added


The URL query parameters change when you update the mock API to make sharing easier. The back and forward buttons allow you to undo/redo.

I’ll explore making the changes shareable without appending the state to the URL in that way.


I suppose OP is referring to a bug where you are stuck at the home page (i.e., the initial state) after you clicked around a few times. So just going to your page and then navigating back right away works, but once you start changing settings, it wouldn’t let you go back past the initial state.

At least it’s that way for me in Chrome.


Gotcha. The “clicking around” causes state changes like adding a field which is stored in the URL query parameters.

Initially this was a design decision to make it easy to share the URL of the Mock API you built with other developers. However, I can see this is breaking user expectations - I’ll work on getting that changed so it’s more in line with what users expect.

I appreciate the feedback because initially that felt “natural” to me but I can see how it might not be intuitive to others.


jotaen explained it well. Sorry if I sounded mean, at some point you start to get tired of the websites that break the basic behavior of the browser.

Do not use history.pushState to update the URL if whatever is happening on the page doesn't count as navigation. Try to look into history.replaceState and see if it helps.


I’d tend to agree that using the browser history doesn’t feel like the right solution for this kind of undo/redo functionality. In my mind, undo/redo actions are too fine-granular, and pollute the history, which can be very inconvenient.

Another potential approach could be to offer a custom-built widget for the undo/redo stack in the UI – in the simplest case, for example, a dropdown. It could also be persisted somewhere, e.g. in local storage, so that it isn’t lost when you navigate away.


Thanks for all the feedback! This community is incredible <3

Just pushed a fix that should resolve this while still maintaining state in the URL (using replaceState as suggested by OP).

For now it foregoes the undo/redo. I'll explore implementing it as a separate widget as you suggest in the future.


Not at all, I appreciate that you mentioned this since it seemed normal to me.

Thanks for the tip! I just pushed a fix that uses replaceState instead of push :)


Maybe only generate a new url when they ctrl + s or hit a save button? This would be more like what you want? I think CodePen does this idr. Or keep a revision list in localstorage with all urls that would have been generated.


I think local storage and keyboard shortcuts might be a good alternative - thanks for the suggestion :)


Thank you so much for the kind words! Glad you find them useful - I’m always open to feedback :)


Thanks! imgsrc.io has a paid offering for generating Open Graph and social images so it won’t need to be ad-supported.

I’m building these smaller tools (like the meta tag generator and Open Graph debugger) to make it easier for myself and hopefully others get a well-tested and up-to-date guidance on the recommended meta tags


Hey @adonese :wave: Just wanted to share that I've shipped the API based on your feedback - I hope you find it useful!


Hey tompec! Originally that was the idea for imgsrc (hence the name: the `src` attribute in an `img` tag).

I definitely plan on adding support for that in the coming weeks :) When the API is released, it will have both the POST and GET support for generating programatically, on-demand.


Thanks for the support <3


Looks like Vercel is having an incident: https://www.vercel-status.com/incidents/kpgg9p03x8x0

Pretty unfortunate timing


Right now Firefox for Android does not support Intl.Segmenter [1] but it appears that support has been added to nightly [2] and will be released soon!

Sorry about that. I was weighing the pro/con of waiting for support to be released or adding a polyfill but it seems that support is just around the corner from what I can tell from the issue.

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [2] https://github.com/mdn/content/issues/31098


I see, thanks for investigating! I guess it must be a relatively new API, seeing how recently Safari has implement it.

Looks like a very good API, glad to have learned about it!


It shipped in Safari nearly 3 years ago [1] so it’s not that new.

[1]: https://webkit.org/blog/11648/new-webkit-features-in-safari-...


eh - I wasn't aware of that site


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: