Skip to content

feat: [re]Init Page Templates 🎨#624

Merged
surajshetty3416 merged 29 commits into
developfrom
builder-templates
Jun 9, 2026
Merged

feat: [re]Init Page Templates 🎨#624
surajshetty3416 merged 29 commits into
developfrom
builder-templates

Conversation

@surajshetty3416

@surajshetty3416 surajshetty3416 commented Jun 8, 2026

Copy link
Copy Markdown
Member

Page Tempates

This add an option to create a pages using a template.

Screen.Recording.2026-06-08.at.3.22.59.PM.mov

Templates are fetched from a centralised site. Once the user selects the page, all the required file are pulled from the centralised server required to create a page. All the templates are maintained and served from builder_hub (repository where all the assets related to builder like templates and plugins will reside)

Available Templates

Fronds Relay
Fronds · Earthy multi-page starter for boutique brands
Landing · About · Contact
Relay · Crisp SaaS starter with feature grids and plan cards
Landing · Pricing · About · Contact
Atelier Mono
Atelier · Bold studio site for agencies and freelancers
Home · Work · Contact
Mono · Dark, bold-type portfolio for studios and freelancers
Home · Project · About · Contact
Verso Husk
Verso · Ultra-minimal personal site with fixed left sidebar
Home · Work · Writing · About
Husk · Warm-toned personal site with centered single column
Home · Work · About
Quill Commit
Quill · Clean editorial template for blogs and publications
Home · Article · About
Commit · Vivid conference starter with animated hero
Home · Speakers · Schedule · Tickets

This was the first attempt but did not keep it active since the templates we had were not good enough

surajshetty3416 and others added 21 commits June 5, 2026 00:48
- Redesign Templates dialog with TemplatesDialog, TemplateGroupList,
  TemplatePageGrid, TemplatePageCard components + shared state
- Add template_sync.py to load templates from builder_templates/ on install
- Wire template selection into page creation flow (DashboardContent,
  DashboardToolbar, BuilderToolbar, PageBuilderDashboard, PageBuilder)
- Extend Builder Page doctype with template fields; update api.py helpers
- Update block_template.py, install.py, utils.py for template support
- Remove old TemplateSelector.vue and TemplatePagePreview.vue
- Update types and webPage data layer for template-aware pages
Move all page-template content out of builder into a new builder_hub app
fetched over HTTP, so templates get their own release cycle.

- builder ships zero templates now; the 6 groups + assets move to builder_hub
- machinery stays in builder (parameterized with app/target_app to avoid a
  circular dep): template_sync, asset/preview helpers, on_update/on_trash hooks
- get_template_groups fetches the hub catalog server-side (cached, graceful
  empty fallback) + merges local "My Templates"
- create_page_from_template fetches a per-page bundle, import_doc's the deps,
  and builds an editable page directly from the blocks (no local template rows)
- add Builder Settings > Template Hub URL; drop sync from install hooks;
  hub-guarded cleanup patch removes previously-synced template-group pages
- frontend: hub previews/Preview open absolute live_url; edit pencil hidden
  for remote templates
Strip the consumer down to the core "browse → use" flow:
- get_template_groups just fetches the hub catalog live (no redis cache, so
  config changes take effect immediately; no stale-empty-catalog bug)
- drop the local "My Templates" merge and the dual local/hub create path —
  create_page_from_template always materializes from the hub bundle
- move catalog-building into builder_hub (builder no longer builds catalogs)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two crashes hit right after create_page_from_template navigated to the new
page (cleared on refresh):

- fontManager.setFont read .find on userFont.data while the list resource was
  still loading -> null crash + Vue mount cascade. Guard with (data || []).
- importing the template's components fired BuilderComponent.on_update ->
  queue_action("clear_page_cache") -> DocumentLockedError mid-import. Skip the
  background cache-clear during in_import/in_install/in_migrate/in_patch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…late

create_page_from_template now enqueues generate_page_preview_image, so the new
page shows a real thumbnail on the dashboard instead of the fallback.

generate_page_preview_image renders via BuilderPageRenderer in preview mode
(uses draft_blocks), so it works for unpublished/draft pages too — not just
pages reachable by their published route. This lets template_sync drop its
duplicate render_template_page helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The hub URL now comes only from site config (template_hub_url in site_config /
common_site_config) — one source, no per-site doctype field to manage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@surajshetty3416 surajshetty3416 marked this pull request as ready for review June 8, 2026 10:13
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 18.36735% with 320 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.91%. Comparing base (f5a52d9) to head (b3cf9a2).

Files with missing lines Patch % Lines
builder/template_sync.py 11.67% 227 Missing ⚠️
builder/api.py 19.04% 68 Missing ⚠️
...ilder/builder/doctype/builder_page/builder_page.py 34.78% 15 Missing ⚠️
...r/builder/doctype/block_template/block_template.py 0.00% 4 Missing ⚠️
builder/domain.py 0.00% 3 Missing ⚠️
builder/ai_page_generator.py 0.00% 2 Missing ⚠️
builder/utils.py 94.11% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #624      +/-   ##
===========================================
- Coverage    58.36%   54.91%   -3.45%     
===========================================
  Files           29       30       +1     
  Lines         3295     3613     +318     
===========================================
+ Hits          1923     1984      +61     
- Misses        1372     1629     +257     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stravo1

stravo1 commented Jun 8, 2026

Copy link
Copy Markdown
Member

Added an option to "Import All" pages in a Template Group

Screen.Recording.2026-06-09.at.5.14.16.AM.mp4

and use preview directly from template instead of creating from waiting for preview generator
@surajshetty3416

Copy link
Copy Markdown
Member Author
Screenshot 2026-06-09 at 9 20 00 AM

Made some minor changes

@surajshetty3416 surajshetty3416 merged commit bb72414 into develop Jun 9, 2026
7 of 10 checks passed
@surajshetty3416 surajshetty3416 deleted the builder-templates branch June 9, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants