lagrange icon indicating copy to clipboard operation
lagrange copied to clipboard

Titan deletion dialog

Open byte-diver opened this issue 10 months ago • 2 comments

More of a discussion really.

titan:// spec says: gemini://transjovian.org/titan/page/The%20Titan%20Specification

Deletion

When the client wants to delete a resource, it uses the Titan protocol to send zero bytes of content (size=0).

So while making some stuff with file-managing functionality I assumed that if we have a file at "domain.org/file" and write or generated a link to it like that:

=> titan://domain.org/file;size=0; delete

^ this would mean "press here to delete". But instead Lagrange opens file upload dialog. If I don't do anything with it and just press "upload", it works and the file is deleted. But should it make the dialog in the first place, as the intention to delete the file is clear here?

byte-diver avatar Feb 05 '25 01:02 byte-diver

The Titan specification talks there about the request that the client sends to the server. How exactly the request is initiated and composed is up to the client. Lagrange will ignore any URL parameters (except "edit") in the Titan link, as those are meant to be set according to the data provided by the user, and not dictated by the link on the page.

As I mentioned on BBS, the UI could be improved by making it easier to send a Titan request without any data attached (i.e., just "size=0").

For your use case of a delete link, why not just use a regular Gemini link since no data is needed?

skyjake avatar Feb 05 '25 14:02 skyjake

ye in my case I'll opt with doing a CGI for handle deletion, since params in the titan link is ignored by every browser I tested. that's a pity actually, but maybe since Lagrange is arguably the largest one, we could push for some change?

e.g. if we have link like titan://blabla/handle - then open the dialog for uploading but if we have link like titan://blabla/handle;size=0; on the page - then open file deletion dialog with confirmation. if user presses "OK" - then Lagrange actually sends the request and server deletes the file.

this should be safe since it's impossible to have both size=0 and file bytes in the link, since they require a newline and links in gemtext are strictly one line.

I see how this interpretation of size=0 lies in the gray zone and it would lead to different behavior in browsers, but I personally see it as a valuable improvement. This way we could have a DELETE request alternative in geminispace. If community will support this change ofc

byte-diver avatar Feb 08 '25 20:02 byte-diver