connectapi
connectapi copied to clipboard
feat:`content_render()` and `content_restart()` implementations
Intent
Add content_render(content) and content_restart(content) functions.
Approach
-
content_render()takes a piece of rendered content and triggers a render via thevariantsAPI. It returns aContentTaskobject. If called on non-rendered content, raises an error. -
content_restart()takes a piece of interactive content and sets then unsets an environment variable. If called on non-interactive content, raises an error. - Added a
default_variantproperty to theContentclass, an active binding that returns its default variant. - Added two active bindings (a.k.a. dynamic properties) to
Content:is_interactiveandis_rendered, both booleans that are computed fromapp_mode.
Added tests for all behaviors. I'm still feeling out testing this library; I feel like I'm used to more fully-specified unit tests rather than the more e2e style tests here.
It appears the CI failures are due to missing documentation. Once those are added, I think this is ready for final review.
@tdstein I'm gonna address a few more comments before I merge; thanks for the approval!