Introducing a new way to review your PRs.

Read the announcement

frappe / builder

Craft beautiful websites effortlessly with an intuitive visual builder and publish them instantly

View on GitHub

20 documents · Updated Nov 23, 2026

docs / visual-builder-workspace

Visual builder workspace

The visual builder workspace is the Vue-based authoring surface for building website pages in a browser. It joins page choice, visual layout, reusable content, property editing, page settings, collaboration, draft saving, and publishing so an author can move from an idea to a live page in one flow.

Workspace shell

Editor frame

The editor frame keeps the page canvas at the center of the work area. A toolbar sits above it, while optional left and right panels provide discovery, structure, property, and history tools. On a small screen the workspace asks the user to switch to a larger screen instead of offering a reduced editor. PageBuilder.vue

The frame supports page mode and fragment mode. A fragment is a temporary copy of reusable content that an author can edit in isolation before saving it back to its owner. This boundary lets an author refine shared content without applying unfinished work to every page that uses it. PageBuilder.vue canvasStore.ts

References: frontend/…/PageBuilder.vue• L1-86 frontend/…/canvasStore.ts• L48-65 frontend/…/canvasStore.ts• L168-217

Workspace panels

The left panel gathers tools for finding and organizing page content. The right panel changes the selected block or opens version history. The toolbar provides page identity, view controls, collaboration status, settings, preview, and publish actions. BuilderLeftPanel.vue BuilderRightPanel.vue LeftPanelTabs/index.ts BuilderToolbar.vue

Settings provide a shared entry point for global site options and current-page options. The settings surface loads the needed data before it displays the panes and remembers the selected area while the user moves through the workspace. BuilderSettings.vue

The command palette gives keyboard access to workspace actions. It groups commands, supports search, and lets the user move through results or nested command groups without leaving the current editor context. CommandPalette.vue

The page title area connects page identity to site behavior. It shows the page title and route, marks the homepage and limited-access pages, and opens a published or staging page in the browser. PageTitlePopover.vue

References: frontend/…/BuilderSettings.vue• L1-121 frontend/…/CommandPalette.vue• L1-256 frontend/…/PageTitlePopover.vue• L1-98 frontend/…/ViewerAvatars.vue• L1-44

Page dashboard

The page dashboard is the entry point for choosing and managing website pages. It supports grid, list, and route-tree views. Authors can filter pages, sort them, inspect publish state, and open a page in the builder. Grid and list cards also show route, access, ownership, and recent-change signals that help an author choose the right page. PageBuilderDashboard.vue DashboardHead.vue PageCard.vue PageListItem.vue

The dashboard warms builder settings and the template catalog when it mounts. It can also route a signed-in user to the persona survey when site setup requires it. The same dashboard hosts the command palette and template dialog, so an author can start a page without first opening an existing page. PageBuilderDashboard.vue prefetch.ts

For page lists, routes, dynamic route values, and navigation rules, see Page navigation and routing.

References: frontend/…/PageBuilderDashboard.vue• L1-49 frontend/…/PageCard.vue• L1-66 frontend/…/PageListItem.vue• L1-87 frontend/…/prefetch.ts• L12-36

Authoring surface

Canvas model

The canvas renders the page block tree as the author will see it while adding selection, movement, resizing, pin and alignment guides, responsive widths, zoom, and visual editing aids. The editor can switch between desktop, tablet, and mobile views and can inspect the page in light or dark mode. BuilderCanvas.vue BlockEditor.vue BoxResizer.vue

Direct manipulation follows the block's layout role. In-flow blocks can be reordered, while movable blocks can be moved or resized against their containing block. Position controls expose edge pins and center alignment, and the canvas draws guides that make those relationships visible. BlockEditor.vue BlockPositionHandler.vue PinDiagram.vue PinLines.vue

The workspace selects the page canvas or the fragment canvas as the active editing surface. Fragment mode edits a safe copy and uses an explicit save action to apply the result. This keeps shared content changes deliberate. PageBuilder.vue PageBuilder.vue canvasStore.ts

For pointer, drop, selection, and responsive behavior, see Editor canvas interaction.

References: frontend/…/BuilderCanvas.vue• L15-87 frontend/…/BuilderCanvas.vue• L165-252 frontend/…/BlockEditor.vue• L67-147 frontend/…/BlockEditor.vue• L225-347 frontend/…/BlockPositionHandler.vue• L87-127 frontend/…/BoxResizer.vue• L107-235 frontend/…/PinDiagram.vue• L33-101 frontend/…/PinLines.vue• L32-115 frontend/…/PageBuilder.vue• L34-54 frontend/…/PageBuilder.vue• L328-336 frontend/…/canvasStore.ts• L168-217

Block tree

Blocks are the shared language for page structure. A block can render content, contain child blocks, expose values for editing, and carry visibility or reusable-component information. The canvas and Layers panel show the same tree, so selecting a block in either place selects the same authoring target. BuilderBlock.vue LayersTab.vue

Authors can add blocks from categorized templates or move existing blocks in the tree. The block picker supports search and drag-to-canvas insertion, while developer mode can open a template for editing. The Layers panel also supports names, expansion, and temporary visibility changes. The block context menu adds reuse and structure actions such as wrapping, repeating, copying styles, and saving reusable content. BuilderBlockTemplates.vue BlockLayers.vue BlockContextMenuOptions/index.ts

For the rules that govern block creation and reusable composition, see Block composition system.

References: frontend/…/BuilderBlock.vue• L1-41 frontend/…/LayersTab.vue• L1-30 frontend/…/BlockLayers.vue• L1-130 frontend/…/BuilderBlockTemplates.vue• L1-103 frontend/…/index.ts• L33-287

Property editing

The right panel turns the selected block into an editable form. It shows controls that apply to that block and groups them into named sections. Search helps an author find a known property without scanning the full set of controls. BlockProperties.vue BlockPropertySections/index.ts

The property editor covers content, typography, layout, spacing, position, accessibility, and other block concerns through one conditional surface. Position controls let an author choose normal, free, relative, fixed, or sticky placement and set the related edges or center alignment. Typography controls keep text content, font choice, weight, size, spacing, transform, and alignment in the same authoring model. BlockPropertySections/PositionSection.ts BlockPropertySections/TypographySection.ts

The property editor works in both page mode and fragment mode. When no block is selected, it gives the author a clear next action instead of showing unrelated controls. HTML-capable blocks can also expose inner HTML for direct editing. BlockProperties.vue HTMLOptionsSection.ts

Large inline SVG content can be converted into an uploaded image asset from the HTML controls or the block context menu. The conversion keeps useful dimensions and avoids storing unnecessarily large source content inside the page. HTMLOptionsSection.ts helpers.ts ImageUploader.vue

For property types, style controls, and value rules, see Property and style editing.

References: frontend/…/BlockProperties.vue• L1-68 frontend/…/index.ts• L24-66 frontend/…/PositionSection.ts• L5-20 frontend/…/TypographySection.ts• L18-197 frontend/…/BuilderRightPanel.vue• L7-15 frontend/…/HTMLOptionsSection.ts• L1-71 frontend/…/ImageUploader.vue• L1-36 frontend/…/helpers.ts• L400-429

Asset and template reuse

The workspace offers reuse at several scales. Block templates provide page structure, saved components provide reusable content, and complete page templates provide a starting page design. The template gallery also offers a blank page, category filters, grouped page designs, and a separate preview step before selection. BuilderBlockTemplates.vue BuilderAssets.vue TemplateGallery.vue BlankPageCard.vue

The gallery can show local and remote template pages inside named groups. A group may belong to more than one catalog category, while each page can expose a thumbnail, preview, and optional live URL. An author can open a group, use one page, use every page in the group, or return to the dashboard after a multi-page import. template.ts TemplateGroupCard.vue TemplatePageGrid.vue TemplateGallery.vue

Template previews render at desktop, tablet, or mobile width. Local pages use the builder preview endpoint, while remote pages use their live URL. This keeps preview useful for both built-in designs and templates supplied by an external catalog. TemplatePreview.vue

Images and other builder assets enter the page through upload or saved-asset selection. Uploads use the shared builder asset area, while the gallery warms only lightweight thumbnails in the background so the picker opens quickly without downloading full previews. ImageUploader.vue helpers.ts prefetch.ts

For asset ownership, saved components, block templates, and template save boundaries, see Assets and block templates.

References: frontend/…/BuilderBlockTemplates.vue• L47-103 frontend/…/BuilderAssets.vue• L51-129 frontend/…/TemplateGallery.vue• L41-249 frontend/…/TemplateGroupCard.vue• L1-53 frontend/…/TemplatePageCard.vue• L1-45 frontend/…/TemplatePageGrid.vue• L1-34 frontend/…/TemplatePreview.vue• L23-81 frontend/…/BlankPageCard.vue• L1-24 frontend/…/TemplatesDialog.vue• L1-35 frontend/…/template.ts• L1-25 frontend/…/prefetch.ts• L20-53

Page authoring flow

Page loading

Page loading connects the route to the document being edited. The page store fetches the active Builder Page, reads its draft content, restores route values, loads page data and client scripts, and places the resulting block tree into the active canvas. It rejects stale responses when a later page selection has already started. pageStore.ts

The route can change while the editor stays mounted. The workspace closes the old real-time document, subscribes to the new page, and loads the new page so the URL, canvas, page data, and viewer list stay aligned. A new-page route creates a starter page and moves the user to its normal editor route. PageBuilder.vue

For page lists, routes, dynamic route values, and navigation rules, see Page navigation and routing.

References: frontend/…/pageStore.ts• L26-145 frontend/…/PageBuilder.vue• L257-313 frontend/…/PageOptions.vue• L1-63

Content assembly

Authors assemble a page by choosing a starting point, adding blocks, placing saved components, and editing the resulting tree. The block panel supplies categorized structure pieces. The asset panel supplies reusable content, and the template gallery can start a page from a blank page or a complete design. BuilderBlockTemplates.vue BuilderAssets.vue TemplateGallery.vue

This creates a clear reuse path: use a block for a small piece of structure, a saved component for content that must stay reusable, or a page template for a larger starting point. The author can then refine all of them through the same canvas and property editor.

For these sources and their save boundaries, see Assets and block templates.

References: frontend/…/BuilderBlockTemplates.vue• L47-103 frontend/…/BuilderAssets.vue• L51-129 frontend/…/TemplateGallery.vue• L41-249 frontend/…/canvasStore.ts• L106-117

Draft persistence

The workspace treats the page draft as the working copy and keeps it separate from the published page. Page edits trigger a short delayed save in normal page mode. The saved value is the current block tree without editor-only links. PageBuilder.vue pageStore.ts helpers.ts

Publishing waits for pending draft saves before asking the page service to make the draft live. Preview is read-only. Version restore also waits for pending saves and then reloads the page so the restored draft becomes the active canvas. Staging is a separate publish state that keeps the page reachable by link while removing it from search and the sitemap. pageStore.ts pageStore.ts PublishButton.vue

For autosave, undo and redo, snapshots, previews, and restore behavior, see Editing state and history.

References: frontend/…/PageBuilder.vue• L338-365 frontend/…/pageStore.ts• L218-257 frontend/…/pageStore.ts• L281-298 frontend/…/pageStore.ts• L341-390 frontend/…/PublishButton.vue• L1-79

Extended authoring

The workspace supports behavior as well as static layout. The Code panel exposes page and block scripts. Blocks can resolve page data or component data while they render. These features keep dynamic behavior inside the same page and block model instead of creating a separate authoring path. CodeTab.vue BuilderBlock.vue

AI assistance uses the same authoring surface to inspect and change a page. An AI chat can carry several page-scoped sessions, accept explicit block or image context, stream a coarse canvas preview, and apply authoritative page edits while keeping autosave paused during the build. Its turn timeline groups repeated work, shows thinking and tool steps, and restores the same view when a turn is loaded again. The debug panel exposes the run outcome, model, token and latency counts, context use, round trace, tool failures, and raw run data. Signals also call out truncation, repaired arguments, and stream retries. This gives an author a readable view of an automated page-building action without changing the page model. AIChatController.ts AIChatController.ts AITurnTimeline.vue AIDebugPanel.vue

For client-side code and data-driven blocks, see Client-side code and data blocks. For AI-specific authoring flows, see AI-assisted building.

References: frontend/…/CodeTab.vue• L1-14 frontend/…/BuilderBlock.vue• L114-183 frontend/…/AIChatController.ts• L86-148 frontend/…/AIChatController.ts• L455-645 frontend/…/AITurnTimeline.vue• L1-145 frontend/…/AIDebugPanel.vue• L1-282

Editing boundaries

Editing modes

The workspace has page mode and fragment mode with different ownership rules. Page mode changes the selected page draft. Fragment mode changes a temporary copy and returns to page mode only after the author saves it or confirms that unsaved work can be discarded. canvasStore.ts canvasStore.ts PageBuilder.vue

The workspace also has a read-only state. Version preview, protected pages, and site-level restrictions use it to stop writes while still allowing inspection. The toolbar shows the state and actions that would change content stay disabled. PageBuilder.vue builderStore.ts pageStore.ts

References: frontend/…/canvasStore.ts• L48-61 frontend/…/canvasStore.ts• L187-217 frontend/…/PageBuilder.vue• L157-175 frontend/…/PageBuilder.vue• L217-224 frontend/…/builderStore.ts• L21-69 frontend/…/pageStore.ts• L341-347

Shared editing state

The builder store holds workspace concerns such as active panels, editor mode, layout widths, read-only state, viewers, theme state, and AI build state. The canvas store holds selection, drag targets, fragment mode, and version preview state. The page store holds the active page, route data, scripts, saving state, and publish actions. This split keeps page content, canvas interaction, and workspace chrome separate while allowing them to coordinate. builderStore.ts canvasStore.ts pageStore.ts

The stores meet at the active canvas and active page. Page changes replace the canvas root. Canvas changes start page saves. Builder read-only and AI-building state gate those saves. Real-time page viewers are also scoped to the active route so collaboration signals describe the page the author is viewing. AI server edits pause local history and then become one authoring step, while a failed or abandoned preview resynchronizes the canvas from the saved draft. PageBuilder.vue PageBuilder.vue AIChatController.ts AIChatController.ts

References: frontend/…/builderStore.ts• L21-124 frontend/…/canvasStore.ts• L13-117 frontend/…/pageStore.ts• L38-53 frontend/…/PageBuilder.vue• L257-319 frontend/…/PageBuilder.vue• L330-365 frontend/…/AIChatController.ts• L647-665 frontend/…/AIChatController.ts• L680-763

Workspace sequence

The following flow shows how a page moves from route selection to a saved and published result.

flowchart LR
    A[Page route] --> B[Load Builder Page]
    B --> C[Build active block tree]
    C --> D[Render canvas and layers]
    D --> E[Insert or edit content]
    E --> F[Save page draft]
    F --> G[Preview or publish]
    G --> H[Live website]
    E --> I[Edit reusable fragment]
    I --> J[Save fragment to owner]
    J --> D

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the route, active page, selected page, and real-time document aligned when page navigation changes.
  • Preserve the page-versus-fragment boundary when changing canvas selection, save actions, or root block replacement.
  • Keep read-only checks consistent across canvas edits, property controls, page settings, autosave, and publish actions.
  • Keep draft serialization compatible with page publishing, snapshot restore, and version preview.
  • Keep the Layers panel and canvas selection in sync when block identifiers or tree shape change.
  • Keep AI build ownership from racing with autosave while an AI operation controls the draft canvas.
  • Keep streamed AI previews separate from authoritative tool edits, and resync the draft when a preview ends without a committed result.
  • Keep page-scoped AI sessions and cross-page canvas events from changing the visible chat or the wrong page.
  • Keep AI turn timeline grouping and restored message metadata compatible with live realtime steps.
  • Keep published, staging, homepage, and limited-access signals consistent between the page dashboard and editor toolbar.
  • Keep template group categories, page summaries, previews, and selection actions compatible across the catalog and gallery cards.
  • Keep blank-page creation, single-template creation, and whole-group import aligned with the route and dashboard state.
  • Keep asset upload paths and image conversion behavior aligned with the shared builder asset area.
  • Keep position pins, center alignment, resize behavior, and visible canvas guides consistent with the block's stored layout styles.
  • Keep property-section conditions and search terms aligned when new content or style controls are registered.
  • Keep unit-preserving inputs compatible with percentage, pixel, and keyword style values.
  • Keep command palette selection and nested navigation compatible with the command groups supplied by the workspace.
  • Keep page subscriptions and viewer updates scoped to the current route when in-editor navigation changes the page.

Important failure modes

TriggerConsequenceGuard
A route changes but the old page is not closed and the new page is not loadedThe URL can show one page while the canvas and real-time viewers show anotherClose the old document before subscribing to and opening the new page
A stale page response finishes after a newer page selection startsAn older page can replace the current page in the canvasUse the page load token and selected-page check before applying the response
A user edits during version preview or on a protected pageA read-only view can write changes to the working draftKeep read-only state as the gate for canvas, settings, save, and publish actions
Autosave runs while an AI build is still streamingA partial AI canvas can overwrite the intended draftKeep AI canvas ownership in the save guard
A streamed AI preview is treated as the saved page before an authoritative edit arrivesA failed or cancelled turn can leave temporary blocks in the working canvasMark previews as unconfirmed and reload the saved draft when the turn ends without a committed result
A page-scoped AI event from another session is shown as the current chat turnThe author can see the wrong conversation state or attach the wrong result to itFilter chat events by session while allowing page-level canvas updates to apply to the page
A fragment exits with unsaved changesShared content can lose the author's workRequire the fragment save action or an explicit discard confirmation
Publish or restore runs before the latest draft save completesThe live or restored page can miss the author's last editsWait for the page saving state to clear before the operation
Dashboard and toolbar use different publish or access signalsAuthors can misread whether a page is public, staged, limited, or unpublishedDerive both displays from the page publish and access state
A movable block loses its pin state while its position values remainA resize or move can change the block's anchor or make it drift in its containerKeep pin changes, edge values, center alignment, and guide display under one position model
A large inline SVG has no conversion pathCostly source content remains inside the pageKeep size-aware SVG conversion available from the property editor and context menu
A template thumbnail or preview is missingA gallery card can show a broken or misleading imageUse the template fallback image and keep preview separate from selection
A template group import does not refresh the page listNewly created pages are not available from the dashboardReload the page resource before returning to the dashboard
A command group changes shape without updating the palette contractKeyboard navigation can select the wrong item or show no resultKeep grouped items, active indexes, and select events aligned

Key files

FileWhy to read it
frontend/…/PageBuilderDashboard.vueShows the dashboard shell, setup gate, and background loading before page authoring
frontend/…/PageCard.vueShows how a page enters the editor and how publish and access state appears in grid view
frontend/…/PageListItem.vueShows how route, ownership, access, and status appear in list view
frontend/…/PageBuilder.vueShows the editor frame and coordinates page, fragment, route, real-time, and save lifecycles
frontend/…/BuilderCanvas.vueDefines the visual page surface and responsive viewing controls
frontend/…/BuilderBlock.vueShows how the shared block tree becomes rendered page content
frontend/…/BlockEditor.vueShows how selection, reorder, free movement, and direct canvas editing meet at a block
frontend/…/BoxResizer.vueShows the direct resize experience and its relationship to history and layout state
frontend/…/BlockPositionHandler.vueShows the position and pin controls exposed in the property editor
frontend/…/PinDiagram.vueShows the visual controls for edge and center alignment
frontend/…/PinLines.vueShows how the canvas explains a block's pins with measurement guides
frontend/…/BuilderLeftPanel.vueExplains the discovery and structure side of the workspace
frontend/…/BuilderRightPanel.vueExplains the property and version-history side of the workspace
frontend/…/BuilderSettings.vueShows the boundary between global site settings and current-page settings
frontend/…/CommandPalette.vueShows the keyboard command interface used across the workspace
frontend/…/BuilderBlockTemplates.vueShows categorized block insertion, search, and drag-to-canvas authoring
frontend/…/TemplateGallery.vueShows blank-page creation, category filtering, group navigation, and template import
frontend/…/TemplatePreview.vueShows responsive preview and the local-versus-remote template source boundary
frontend/…/TemplateGroupCard.vueShows grouped template selection and preview behavior
frontend/…/TemplatePageCard.vueShows page-template selection, preview, and developer-only editing access
frontend/…/ImageUploader.vueShows the shared image upload and remove contract
frontend/…/index.tsShows block actions, SVG conversion, and read-only action gating
frontend/…/index.tsShows the property-section registry that builds the selected-block editor
frontend/…/PositionSection.tsShows how position editing enters the property surface
frontend/…/TypographySection.tsShows the text and font controls available to eligible blocks
frontend/…/HTMLOptionsSection.tsShows HTML editing and the size-aware inline-SVG conversion path
frontend/…/AIChatController.tsCoordinates AI sessions, streamed canvas previews, page edits, cancellation, and draft resynchronization
frontend/…/AITurnTimeline.vueShows how an automated authoring turn is presented and grouped for the author
frontend/…/AIDebugPanel.vueShows the run status, trace, token, context, and failure view for AI authoring
frontend/…/pageStore.tsOwns page loading, route data, draft persistence, publish, staging, and version operations
frontend/…/canvasStore.tsOwns canvas selection, fragment editing, drag state, and version preview state
frontend/…/builderStore.tsOwns workspace-wide mode, panel, collaboration, read-only, and AI state
frontend/…/prefetch.tsShows how settings and template previews are warmed without blocking the editor
frontend/…/helpers.tsShows shared page serialization, asset upload, route-variable, and SVG conversion boundaries