neighbour-hoods / nh-launcher

Creating a group coherence with holochain apps
Other
4 stars 3 forks source link

As a Dev, let me build list views #192

Open adaburrows opened 2 months ago

adaburrows commented 2 months ago

List Views will slot into a page template. They will accept a render component that will render the objects in the list. However, outside of that, they just determine the layout and style of what is displayed. A few instances might be:

adaburrows commented 2 months ago

I'm wondering how much of this needs to be programmed by the user/dev since there's not that much to this aside from the gymnastics needed for iterating over the list returned from the filtering process and wiring up the resource IDs to the resource renderer and passing in the correct resource view.

That sounds like framework code.

The only kind of additional views I can think of that might need this level of customization would be a specific view of resources that form a graph, but then the view itself would need to know more about the format of the data itself and wouldn't be generic to a space, it would be tied to a set of resource schemas. That would actually make it more like an application.

Therefore, I think we can simplify this model for most people.

For people who aren't developing complicated interactive application that aren't really lists, we can have one list view that shows the resources using resource views and perhaps some custom CSS for styling the list.

OTOH, there is one simple case that we haven't really thought through. Let's go back to the example case of a music player. We would likely have the following setup:

This means we need to have a list view that can be aware of the data schema for Audio (which is honestly likely complex, since it is metadata and then a series of links to the chunks of data that make up the audio stream). Also, depending on the need to have music stream constantly, we may need to have a service worker fetching the audio blocks in the background and a foreground audio player that is located outside of the page (which could honestly just be another browser window or an iframe).

So to mimic the behaviour of a generic audio app, we would need a list view aware of the metadata a user would want to display and it would actually not use any resource views. This is actually an opportunity to make the list views a part of the possible resource views. In addition to create and edit views, there can be multiple list views. This way people can choose which view they want or be free to create a custom view based on the examples we may provide.