Making data collection services plugins
Currently Health only has a rather limited amount of data collection: Activities/Calories/Steps/Weight. Not all users necessarily want to collect all of these types of data. In general, the kinds of data users want to collect vary a lot from user to user. As such, it makes sense to make these data collection services plugins, so users can enable/disable the services they want/dont want.
We could have a Trait
for plugins like so:
pub trait Plugin {
/// returns a card view with a short summary, e.g 2000/10000 steps done for the home page
fn summary(&self) -> IsA<gtk::Box>;
/// returns a card view containing details,e.g. steps over some weeks
fn detailed(&self) -> IsA<gtk::Box>;
fn name(&self) -> String;
fn icon_name(&self) -> &str;
}
We could visualize this like Apple Health:
The summary would be displayed in a list where users can choose what plugins to enable. Details would be displayed upon clicking on the summary.
This way we could support new features without bloating the application for everyone. Prerequisite for: