Skip to main content

catalog_with_status

Function catalog_with_status 

Source
pub fn catalog_with_status(
    store: &Store,
    templates_dir: &Path,
) -> Result<Vec<TemplateHubEntryWithStatus>, TemplateError>
Expand description

Annotate the catalog with per-entry install status. A template counts as installed when either:

  • a template_membership row exists whose hub_source_slug matches the catalog slug, OR
  • the canonical file <templates_dir>/<slug>.flow.json is on disk.

The on-disk check covers orphan files (DB reset, schema migration, row hand-deleted) so the Hub row’s button flips to Update / Installed without the user having to click Add first and rely on the heal path in add_to_collection.