bluerobotics / bluerobotics/cockpit
Allow importing/providing custom widgets for dynamic loading
- Dominant language
- TypeScript
- Stars
- 198
- Forks
- 63
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 57
Description
### Current behaviour
The only available widgets (standard and mini) are currently those that are built into Cockpit, which limits the functionality users can access, and means that widgets that don't belong in the mainstream Cockpit binary need to be maintained in custom Cockpit forks, which is inefficient and problematic to the unity of the project.
This has been part of the idea of Cockpit from the start - I just realised we don't actually have an Issue for it that people can keep track of.
### Expected or desired behaviour
The most practical mechanism I can think of for this would be via file-based [add-ons](https://github.com/bluerobotics/BlueOS/issues/1939), that a user can either manually add to (and modify within) a folder, or "install" via a system like the proposed BlueOS Bazaar, which Cockpit can then look for and load as relevant (e.g. on startup, or on frontend refresh depending on the View).
This could start simple with just "put a Vue file [here] and Cockpit will load it", but fleshed out support should
1. include detailed documentation of the Cockpit APIs that widgets have access to (e.g. for data sources/inputs, output/display formats, filtering pipelines, etc)
2. allow defining relevant widget configuration parameters
3. allow defining/declaring custom input sources and outputs that can be re-used in other widgets
4. allow defining Actions that can be used elsewhere in Cockpit (e.g. via a joystick button)
- this may be better suited as independent add-ons that can be installed as some form of bundle with the widget
5. include some kind of tracking that could be used to replicate a given View/Profile by someone who does not currently have the relevant custom widgets (assuming they are installable from a known/common location)
- this may require version management/tracking in some form of database, and hashes/checksums for validation
- it could also be supported by the View/Profile save and download options including the custom widget files as relevant, although that could be inefficient, and potentially problematic if there are version or naming conflicts
### Prerequisites
- [X] I have checked to make sure that a similar request has not already been filed or fixed.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing Cockpit’s existing widget loading and the View/Profile save and download behavior; the issue does not name specific files or tests. Then map the proposed file-based add-on flow, widget API documentation, configuration, reusable inputs and outputs, and action support before defining a smaller first milestone and its completion criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100