Hi! First I guess a short introduction: I work with Mike Hanson and Ben Adida at Mozilla, and over the past week we've been talking a lot about Web Intents. I've only started looking closely at the project this week, so my apologies if I'm misinterpreting something.
In the process of discussing we created a kind of brainstorm of use cases; it's terse and sometimes more verb-oriented than user-intent-oriented:
https://gist.github.com/1222633
Brainstorming how to satisfy some of the use cases using Web Intents (or based on my understanding of Web Intents) I had some concerns...
Issue: mimetypes can't be easily pluralized.
One can imagine two use cases for PICK on a profile (say, application/json+jcard): pick one person (someone to send a message to, for instance), and pick many people (some friends you want to add to a service, or CC on a message). At the Javascript level it's pretty obvious, but when actually starting the intent you have to choose a mimetype, most of which are singular.
Suggestion: another standard action:
http://webintents.org/pickmanyJust like pick, but returns multiples.
Issue: picking a profile and picking information about yourself are hard to distinguish.
That is, Intent("
http://webintents.org/pick", "application/json+jcard") is applicable to "pick a contact" and "pick profile information" (since either way you are picking stuff, and the content type doesn't say anything about the user's relation to the content.
Suggestion: yet another action,
http://webintents.org/pickself ? Feel wonky.
Another is to more clearly figure out what the data means in the case of a pick, so you could perhaps do:
Intent("
http://webintents.org/pick", "application/json+jcard", {personal_profile: true})
This pattern is not well explored, and of course the content type applies to the response, not the intent data, unlike with other actions. The meaning of {personal_profile: true} is only meaningful with the combination of both the action and the data type, which makes it difficult to document (
http://webintents.org/pick isn't necessarily a great place to document data-type-specific details; or maybe it is?)
I am tempted to suggest that there are two broad categories of actions: query and do. And that those two should be treated somewhat differently. But maybe there's another approach...
Issue: Content types/mimetypes are not very applicable to the data I imagine passing around.
For instance, a URL without any extra information is sometimes sufficient, but adding extra information (e.g., title) is helpful. But if you pass {url: "http://...", title: "..."} then the real content type is application/json (or json+something). In many cases it feels like extra information should be added. For example, you can pass text/html, but you probably need to also pass the base URL that the HTML came from. But even a very small amount of extra data changes the type (unless you get sloppy and ignore that you aren't attaching an accurate type).
Suggestion: Formalize data and metadata.
HTTP for example has two channels: bodies and headers (and both request and response bodies get distinct content types).
Maybe this could work by specifying that the data (and response) contain a body, and all other keys are metadata. For instance:
new Intent("
http://webintents.org/share", "text/uri-list", {body: "
http://example.com", title: "Example Site"})
Issue: it is ambiguous (in the general case) whether the type refers to the intent data type, or the response data type.
Suggestion: Adding a sense of metadata helps; in the absence of a "body" key, type becomes irrelevant.
Most pick cases might use only ad hoc intent data, e.g.:
new Intent("
http://webintents.org/pick", "application/json+jcard", {fields: ["name", "email"]})
Edit conveniently has symmetric types. Save for instance would be convenient if it returned the URL to which the data was saved, but could also be ad hoc ({url: "
http://storageservice.com/files/23958494"}).