News for hackers. Stuff that matters.
Re:How to store your app's entire state in the url by hunter2_ on Monday January 09, 2023 @03:21PM (#34315441)
I don't think people care so much about a messy address bar as a messy chat/email message after pasting a URL. Shorteners and vanity URLs exist, but that's more friction than just copying from the address bar as-is.

This can be overcome with html, markdown, and other rich text formats that let you specify the visible link text (missing from many chat apps*), but that's also friction to compose compared to automatically linking from just a URL.

*Slack's implementation is awesome: type the link text, highlight it, and paste a URL.

Re:How to store your app's entire state in the url by owl57 on Monday January 09, 2023 @03:59PM (#34315973)
It's not even only about messiness. "https://news.ycombinator.com/item?id=34315441" isn't some horrible long base64, but it's not a good UX either: when you paste it in a messenger, or in your notes, by default the reader can't tell what's it about without clicking.

> *Slack's implementation is awesome: type the link text, highlight it, and paste a URL.

Yes! Matches my vision of hypertext perfectly: I usually type a message in normal human language and then paste links all over it for the reader who needs to dig deeper.

Re:How to store your app's entire state in the url by TheBrokenRail on Monday January 09, 2023 @05:44PM (#34317513)
> by default the reader can't tell what's it about without clicking.

Most chat apps like Discord will automatically include an embed generated from a URL's metadata when present in a message.

Re:How to store your app's entire state in the url by owl57 on Monday January 09, 2023 @08:48PM (#34319274)
At least in Telegram, this works for at most one link per message, and quickly fills the screen if you send multiple such messages.

And I believe that there is no standard API to get previews of non-public websites in a work chat, you need to develop site-specific bots or something like that?

Re:How to store your app's entire state in the url by hunter2_ on Monday January 09, 2023 @11:38PM (#34320574)
> previews of non-public websites

It would be interesting if browsers / OSes / apps offered a way to use the browser's cookie jar / basic auth headers / whatever sessioning scheme in whatever apps the user decides should display authenticated previews.

Re:How to store your app's entire state in the url by withinboredom on Tuesday January 10, 2023 @01:45AM (#34321354)
I just include a screenshot. It’s not that hard.
Re:How to store your app's entire state in the url by gdprrrr on Tuesday January 10, 2023 @02:03AM (#34321475)
Plesse no
Re:How to store your app's entire state in the url by efreak on Wednesday January 11, 2023 @12:52AM (#34335459)
Examples of why this is bad:

* http://example.com/settings/transferownership?to=efreak * http://example.com/settings/deleteaccount?confirm=true * http://example.com/sendmoney?to=efreak&amount=10000

Might need a redirect. Do previews follow redirects? Does your poorly-written chat app filter urls by protocol, or does it just look for a token with '://'? A good app will allow me to link to things like steam://connect/IP so I can invite you to a game.

* tel:9005555555 (call a phone number. Fortunately, this requires confirmation these days, but what if you're on desktop or the app that does texting can directly make calls without invoking the dialer?) * steam://exitsteam (steam will exit if it's running)

Re:How to store your app's entire state in the url by WorldMaker on Tuesday January 10, 2023 @03:53PM (#34331305)
There is a standard for this. It's called oEmbed: https://oembed.com/

The chat host still likely needs access to the "non-public website" to discover and call its oEmbed API, so that's something you'd have to figure out, but any website anywhere can offer oEmbed metadata if it wishes.

Re:How to store your app's entire state in the url by OJFord on Monday January 09, 2023 @06:25PM (#34318032)
> I don't think people care so much about a messy address bar as a messy chat/email message after pasting a URL.

But it's painful how few care about that!

I always clean them up before I send them (just manually - typically meaning all query parameters, e.g. with Amazon the text description after the actual ID) rarely even feel the need to check they still work, it's pretty easy, but maybe I shouldn't bother because it's only me that cares; they don't seem to notice that their links occupy half the screen and my don't!