Skip to content

feat: migrate template dialog from static data to hub API (phased) #10678

@dante01yoon

Description

@dante01yoon

Context

The template dialog currently uses a static index.json file as its data source. We want to migrate to the hub API (GET /api/hub/workflows) so that the database becomes the source of truth.

However, the current hub list API only supports search and tag (single) query parameters. The frontend template dialog relies on several filters that are not yet available server-side:

Filter Server support
Text search search param
Tag (single) tag param
Model filter (multi-select) ❌ Not supported
Runs on (open source vs external) ❌ Not supported
Sort (recommended, popular, newest, alphabetical, VRAM, model size) ❌ Not supported

Using server-side pagination with incomplete filter support would degrade the UX — client-side filters would only apply to the currently loaded page, producing incomplete results.

Proposed Plan

Phase 1 — Database as source of truth (frontend-driven filtering)

  • Fetch all hub workflows via the list API (paginate through all pages on init)
  • Keep all existing client-side filtering, sorting, and search (Fuse.js) unchanged
  • This preserves the current UX while switching the data source from static files to the database
  • Frontend work is ready; no backend changes needed
  • PR: feat(templates): migrate cloud template dialog to hub API #10675

Phase 2 — Server-side filtering and pagination (scalable)

  • Backend adds missing filter/sort params: model, open_source, sort, multi-tag support
  • Frontend switches to cursor-based pagination with server-side search and filtering
  • Fuse.js and client-side filter logic removed for cloud
  • This enables the dialog to scale to a large number of templates without loading everything upfront
  • Blocked on backend API changes

┆Issue is synchronized with this Notion page by Unito

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions