aardvarkxr / aardvark

A platform for AR in VR
BSD 3-Clause "New" or "Revised" License
182 stars 20 forks source link

No easy way to install or delete gadgets from the web #128

Closed cementhead closed 4 years ago

cementhead commented 4 years ago

There used to be a aardvark://install/ uri to install apps but this no longer works. There is a workaround to mimic some of the behavior in the default landing page and open a socket connection to aardvark though this essentially requires duplicating some deeper business logic into our app, which doesn't seem great.

There also doesn't seem to be a way to delete gadget favorites, so it makes it hard to test if you're successfully updating to the latest version of a gadget.

Having exposed apis for adding and removing gadgets from urls would be nice.

JoeLudwig commented 4 years ago

(Tweaked the title since "install" has been replaced by "favorite" in Aardvark itself.)

Are there pieces of DefaultLanding that you'd like to see broken out? My expectation is that viewing a gadget on the web is the place to do this sort of thing, and DefaultLanding accomplishes that. (It also occurred to me after writing that bit of code that a "manage this gadget" page could be written that takes the URL of the gadget itself as a get param.)

Why is the URL changing from version to version? Can you just redirect from the old version to the new version if the URL needs to change?

cementhead commented 4 years ago

I guess since our gadget is sort of an add on to our main VR app it would be nice to just automatically have our gadget appear in favorites for ease of use, again similar to the functionality that used to be there with aardvark://install/.

The url changing is mostly useful to facilitate different versions of the gadget, either for users themselves or for internal workflows where you might be testing out local changes, pushing to a staging environment, etc. We can put visual/ log traces to contain versioning information but a simple api to remove it would be nice, it's also how I would test automatically adding a favorite.

Maybe I'm also just not really understanding how this is supposed to work. Going to our gadget page - http://aardvark.pluto-api.com/ - I don't see an add or remove button rendering. Should I?

JoeLudwig commented 4 years ago

I was just talking to @fuag15 on Slack. Sounds like you need to update the main TSX file of your gadget to add the landing page with something like:

let main = Av() ? <TestPanel/> : <DefaultLanding/>;
ReactDOM.render( main, document.getElementById( "root" ) );

Seems like a user wouldn't want to have to favorite/delete constantly to switch versions. Or even "run" the gadget at all.

Would it make more sense to have a way for Pluto to connect to a running Aardvark instance and tell it to start a particular gadget at that moment?

cementhead commented 4 years ago

That would be very helpful, the best use case for us is to auto launch the Pluto gadget, that would be even better than adding a favorite. Since we have implemented the room api it means you could quickly have apps like the whiteboard shared just by running Pluto and aardvark

JoeLudwig commented 4 years ago

This API was added in https://github.com/aardvarkxr/aardvark/releases/tag/v0.12.0

Take a look at the 0.12+ DefaultLanding component for an example. If you run into issues with the start gadget API, please open a new issue with what you've found.