Skip to content

Template System Improvements

Spec for improving template discovery, usability, and format handling in Application-Frontend.

Branch: improve-templates PR: #1897

Problem

Templates are hard to find and use:

  • Workspace-scoped: Users can't see or use templates from other workspaces in the same enterprise. A colleague in Spain creates a great template, but someone in Norway can't find it without switching workspace.
  • Flat, unorganized picker: The template selector in the creative wizard is a plain paginated list with name-only search. No grouping, no visual hierarchy.
  • Confusing format logic: The "Inherit Format" toggle is unclear. Users don't understand the relationship between the template's format and the format they're selecting for their new creative.
  • Block order scrambling: Templates stored with integer orders got scrambled when compareOrder() did string comparison ("13" < "7"). Fixed in initial commit.

Design

1. Cross-workspace template listing

Show templates from all workspaces in the user's enterprise, not just the active one.

Approach (frontend-only, no backend changes):

  • On wizard mount, fetch the workspace list for the current enterprise (endpoint exists: GET /enterprises/:id/workspaces)
  • Call GET /workspaces/:id/creative_templates for each workspace in parallel
  • Merge results, grouped by workspace
  • Current workspace loads first and displays immediately; other workspaces load in the background

Constraints accepted:

  • N+1 requests (1 for workspace list + 1 per workspace). Acceptable because enterprises typically have 3-10 workspaces and templates are intentionally created (not hundreds per workspace).
  • Pagination is per-workspace, not unified. Each workspace fetches up to ~20 templates.
  • Search is client-side across workspaces, server-side within each workspace.

Future backend improvement (documented, not in this branch):

A single GET /enterprises/:id/creative_templates endpoint with unified pagination and search would replace the N+1 approach. Follows the existing pattern of /enterprises/:id/workspaces.

2. Template picker UI

Replace the flat list with a grouped, searchable interface.

  • Grouped by workspace: Each workspace is a collapsible section with the workspace name as header
  • Current workspace first: Expanded by default, others collapsed
  • Template count in headers: e.g. "Spain workspace (4)"
  • Format chips: Template formats shown as visual chips/badges instead of plain text
  • Cross-workspace search: Client-side filtering across all loaded templates by name
  • Loading states: Current workspace content shows immediately, other workspaces show loading indicators until their requests complete

3. Format simplification

Remove the "Inherit Format" toggle and simplify the mental model.

New model: template = content and structure. Format = your choice.

  • Remove the "Inherit Format" toggle entirely
  • Show the template's original formats as informational context (e.g. "This template was created in 300x250, 728x90") but not as a binding choice
  • The user's selected format(s) in the wizard are always used
  • If the user hasn't selected formats yet when choosing a template, pre-select the template's formats as suggestions (user can change them)

This eliminates the confusion about what happens when template format differs from selected format.

What's already done

  • compareOrder() handles numeric orders correctly (string "13" no longer sorts before "7")
  • Removed redundant double-serialization in completeStandaloneEditWizard (createMassFormatCreative already calls serializeOrdersForSave)

Key files to modify

FileChange
src/components/CreativeWizard/CreativeWizard.vueFetch templates from all enterprise workspaces, not just active
src/components/CreativeWizard/TemplateSelector/TemplateSelector.vueGrouped UI, cross-workspace search, format chips
src/components/CreativeWizard/TemplateSelector/TemplateRow.vueFormat chip display
src/store/modules/creativeWizard.tsSupport multi-workspace template fetching
src/components/CreativeWizard/wizardSavingLogic.tsRemove inherit format logic, simplify format handling

Out of scope (documented for future work)

Backend: enterprise-level template endpoint

A single endpoint for listing templates across an enterprise:

GET /enterprises/:id/creative_templates?page=1&per_page=20&name=search

Would replace the N+1 frontend approach with a single paginated, searchable query. Small backend change following existing patterns in start/routes/enterprises.ts.

Tags and categories

A tagging system for templates (e.g. "holiday", "product launch", "social"). Requires:

  • New creative_template_tags table (or JSON column on creative)
  • Backend CRUD endpoints for tags
  • Frontend tag picker in Templatizer + tag filter in TemplateSelector

Mass-format splitting behavior

When removing formats from a mass-format creative, the removed child creatives become standalone creatives instead of being deleted. Some users exploit this as a workflow (create master with many formats, then split). This is confusing UX -- removing a format should remove it, not create orphaned creatives.

Cross-workspace creative copying

Copying creatives between creative groups or workspaces without going through the template system. Currently the only way is to templatize, switch workspace, create from template. A direct "copy to..." action would be more intuitive.

Internal documentation