[tech] trailing '?' for input (was: entry field in gemtext)
mbays mbays at sdf.org
Fri Sep 10 16:44:40 BST 2021
* Thursday, 2021-09-09 at 09:59 -0400 - Michael Lazar <lazar.michael22@gmail.com>:
> [spartan]
> =: /link Enter your input
>
> I honestly think this is a flat-out improvement over gemini's "10
> INPUT" status (and I rarely say that). It avoids an extra round trip,
> allows for better client UX, and is probably more intuitive.
We could actually get something similar in gemini by adopting the following convention: a link with a gemini uri ending in a bare '?' should have the query component filled in by the user. So following a link
```
=> /link? Enter your input
```
in an interactive client would prompt the user for input *before* making a request to the server.
Pros:
* Avoids a round-trip.
* Clients could render such links differently, e.g. with an inline text box.
* Doesn't break clients who ignore the convention, as long as the server returns 10 to a request with empty query.
Cons:
* It's surprising; doesn't contradict the gemini spec, but impossible to guess from it.
* It's arguably an abuse of uris, since it's adding new semantics to an uri beyond its meaning as a resource identifier.
* Because of the need to return 10 on an empty query for compatibility, there's no way to represent actually empty input.
* It's not impossible that such an uri could have some specific meaning on some server. However, I think this is unlikely; certainly every CGI implementation I've seen won't differentiate between "/link" and "/link?". But technically they are different URIs which could point to different resources.
Any thoughts? I'm not sure myself whether this is a good idea, but cutting down on that unnecessary round trip seems very appealing.
Anyone know of anything this would break? Is adding such additional semantics to uris a route to extensibility hell?
Regarding the "empty input" problem: the neatest solution would be to always terminate a user input query component with a newline. But it's probably too late to introduce that as a convention.
Archive home | About this archive