Navigator
The Jalpi Page Builder Navigator (implemented as the Layers Panel) provides a structured, hierarchical tree view of every section, container, column, and widget on your page. It enables seamless DOM navigation, instant element selection, drag-and-drop reordering, visibility toggling, node locking, and inline renaming without needing to click on overlapping or zero-padding canvas elements.
Navigator Overview#
Modern web pages often contain deeply nested container hierarchies, zero-margin inner columns, absolutely positioned badges, sticky elements, or overlays. Selecting or reordering these elements directly on a visual canvas can be difficult or error-prone.
The Navigator solves this by displaying a direct, two-way synchronized structural tree representation of your page's internal JSON document model (pageData.sections). Every item rendered on the visual canvas corresponds to a node in the tree.
Precision DOM Tree
Access any deeply nested element, hidden layer, or zero-height spacer with a single click, bypassing z-index overlaps or negative margins on the canvas.
Reliable Drag & Drop
Reorder sections, rearrange columns, or move widgets across containers with pinpoint insertion line indicators before and after target nodes.
Locking & Protection
Lock sections or widgets to prevent accidental dragging, accidental edits, or unwanted shifts while working on neighboring elements.
Device Visibility Toggles
Quickly inspect and toggle element visibility per breakpoint (Desktop, Tablet, Mobile) with real-time dimmed state indicators.
Opening Navigator#
The Navigator is tightly integrated into the primary editor workspace and can be opened in multiple ways:
1. Inspector Outline Tab
The primary location of the Navigator is inside the right-hand Inspector panel. In the tab navigation bar at the top of the Inspector, click the Outline tab button (represented by an outline list icon):
<div className="jalpi-inspector-nav">
<button
className={"jalpi-inspector-nav__btn" + (inspTab === 'outline' ? ' is-active' : '')}
onClick={() => setInspTab('outline')}
title="Page Outline"
>
<OutlineIcon /> Outline
</button>
<button className={"jalpi-inspector-nav__btn" + (inspTab === 'style' ? ' is-active' : '')} onClick={() => setInspTab('style')}>Style</button>
<button className={"jalpi-inspector-nav__btn" + (inspTab === 'page' ? ' is-active' : '')} onClick={() => setInspTab('page')}>Page</button>
<button className={"jalpi-inspector-nav__btn" + (inspTab === 'global' ? ' is-active' : '')} onClick={() => setInspTab('global')}>Global</button>
<button className={"jalpi-inspector-nav__btn" + (inspTab === 'classes' ? ' is-active' : '')} onClick={() => setInspTab('classes')}>Classes</button>
</div>2. Global Command Finder (Ctrl+K / βK)
You can quickly reveal or toggle the Navigator from anywhere in the editor using the Global Finder palette:
- Press Ctrl+K (Windows/Linux) or βK (macOS) to open the palette.
- Type
layersoroutline. - Select Show layers panel or Hide layers panel.
3. Panel Resizing & Docking
The Inspector containing the Navigator is docked to the right edge of the editor. A drag-resizer handle (PanelResizer) separates the Canvas and the Inspector, allowing you to fluidly resize the panel from a minimum width of 220px to a maximum of 560px. Your customized width is remembered during your editing session.
Navigator Structure#
Jalpi Page Builder structures pages using a strict, semantic node tree. The Navigator visualizes this exact hierarchy using distinctive type icons and indentation depths (6px + depth * 14px):
1. Sections (β£ section)
Sections form the top-level roots of the page document (stored in pageData.sections). A section typically spans full viewport width and acts as the outer wrapper for margins, backgrounds, border overlays, and overall vertical cadence. In the Navigator header, a dedicated + Add Section button allows you to instantly append a fresh section to the document.
2. Containers (β container)
Containers are flexible layout blocks placed inside sections or nested inside other containers. They implement CSS Flexbox or Grid layouts, control maximum content widths (e.g. 1200px boxed layout), handle padding, and provide multi-directional flow alignment.
3. Columns (β₯ column)
Columns represent structural vertical divisions within multi-column sections or container grids. They manage proportional width sizing (e.g. 50%/50%, 33%/66%), vertical alignment, and mobile stacking order.
4. Elements & Widgets
Elements are leaf nodes (or composite components) that render actual user content. Each widget type is represented with a designated icon and a dynamic, human-readable label extracted from its content:
| Type Icon | Widget Type | Default Label Preview | Description |
|---|---|---|---|
β£ | section | Section | Top-level page section layout block. |
β | container | Container | Flex / Grid wrapper with width & alignment controls. |
β₯ | column | Column | Column partition within multi-column grid layouts. |
H | heading | Text snippet (first 26 chars) | Typography heading element (H1βH6). |
ΒΆ | text | HTML stripped snippet (first 26 chars) | Rich text paragraph / content block. |
β¬ | button | Button label (first 26 chars) | Call-to-action button element. |
β¬ | image | Image | Responsive media image node. |
βΆ | video | Video | HTML5, YouTube, or Vimeo embed block. |
β | spacer | Spacer | Adjustable vertical spacing element. |
β | divider | Divider | Horizontal decorative rule or separator. |
β
| icon | Icon | Vector SVG icon from Tabler / Bootstrap icon registries. |
[] | shortcode | Shortcode snippet (first 22 chars) | WordPress shortcode handler node. |
<> | html | Html | Raw HTML embed block. |
β | maps | Maps | Interactive Google Maps embed widget. |
β | logo | Logo | Site logo / brand graphic element. |
β | form | Form | Interactive input form container. |
β | alert | Alert | Notification / dismissible banner widget. |
# | counter | Counter | Animated numerical milestone counter. |
β° | progress | Progress | Percentage progress bar indicator. |
β | testimonial | Testimonial | Quote, author attribution, and avatar block. |
β‘ | accordion | Accordion | Collapsible accordion panel group. |
Visual Hierarchy Tree
The code below illustrates how the tree structure is represented in Jalpi Page Builder:
Page (pageData.sections)
βββ β£ Section (id: "sec-1")
βββ β Container (id: "cnt-1")
βββ β₯ Column (id: "col-1", width: "50%")
β βββ H Heading ("Welcome to Jalpi")
β βββ ΒΆ Text ("The next-generation WordPress...")
β βββ β¬ Button ("Get Started Today")
βββ β₯ Column (id: "col-2", width: "50%")
βββ β¬ Image (hero-banner.webp)
βββ β Spacer (24px)Working with Elements#
The Navigator is not merely a passive read-only tree; it provides full operational control over every layer on your page.
Navigator Actions Reference
Every action listed in the table below is confirmed and active in the current Jalpi Page Builder implementation (LayersPanel.tsx):
| Action | Trigger / Control | Description | Canvas Effect |
|---|---|---|---|
| Select | Left-click on any row | Updates state.selectedId in editorStore. | Draws active selection boundary on canvas and switches Inspector to element properties. |
| Expand / Collapse | Chevron toggle button (> / v) | Toggles visibility of children for the specific branch. | None (affects tree view only). |
| Expand All | Expand All icon in panel header | Expands all collapsed nodes across the entire page. | None (affects tree view only). |
| Collapse All | Collapse All icon in panel header | Collapses all sections and containers to top-level view. | None (affects tree view only). |
| Search / Filter | Header search input (Esc to clear) | Filters nodes by custom label or element type; automatically expands ancestor paths. | Non-matching nodes are hidden from tree list. |
| Inline Rename | Double-click label OR Right-click β Rename | Opens inline text input with autofocus. Press Enter or blur to commit, Esc to cancel. | Updates label override dictionary for convenient project layer organization. |
| Toggle Visibility | Eye icon button (IcoEye / IcoEyeOff) OR Context Menu | Toggles node visibility across breakpoints (store.toggleNodeVisibility(id)). | Hides/reveals element on canvas and dims layer row in Navigator with strike-through eye. |
| Lock / Unlock | Lock icon button (IcoLockOn / IcoLockOff) OR Context Menu | Toggles node.locked flag (store.lockNode(id, locked)). | Prevents canvas edits, hides drag handle, and prevents drag reordering. |
| Drag Reorder | Drag grip handle (:::) | Drags node before or after another target node using native HTML5 drag events. | Instantly repositions element in canvas DOM and pushes an undo history step. |
| Duplicate | Right-click β Duplicate OR Ctrl+D | Deep-clones the node and children with newly generated unique IDs (store.duplicateNode(id)). | Inserts cloned duplicate immediately beneath original node. |
| Copy | Right-click β Copy OR Ctrl+C | Copies JSON serialization of node to editor clipboard state (store.copyNode(id)). | Allows pasting into another section or container with Ctrl+V. |
| Delete | Right-click β Delete OR Delete / Backspace | Removes node and all nested children from tree (store.deleteNode(id)). | Removes element from canvas DOM and registers undo history step. |
| Add Section | + button in panel header | Appends a new empty section with an initial container (store.addSection()). | Appends new section to canvas bottom and scrolls into view. |
Expanding & Collapsing Hierarchy
Each node containing children displays a triangular chevron button:
- Right arrow (
>): Indicates a collapsed node. Click to reveal children. - Down arrow (
v): Indicates an expanded node. Click to collapse children.
In addition, the panel header provides global Collapse All and Expand All buttons. This allows developers working on lengthy single-page sites to instantly collapse dozens of sections to focus on a single branch.
Renaming Elements
To keep complex wireframes organized, you can assign custom names to any layer (e.g. renaming Section to Hero Section or Button to CTA Checkout):
- Double-click any layer name in the Navigator, or right-click and choose Rename.
- An autofocus input replaces the text label.
- Press Enter or click outside to save. Press Escape to discard changes.
Visibility Indicators & Toggles
Every row features an eye icon button on hover:
- When an element is visible, clicking the eye hides the element.
- When hidden, the row receives the CSS class
.is-hidden, applying a dimmed opacity (0.5) and switching the icon toIcoEyeOff. - Hidden elements remain fully accessible and selectable in the Navigator tree, allowing you to unhide them at any time.
Locking Elements
When you have finalized the styling and layout of a header or complex grid, click the Lock icon (IcoLockOn):
- The layer row receives the
.is-lockedclass. - The drag handle is disabled (
draggable={false}). - Accidental canvas drag-and-drop or selection modifications on that node are prevented until unlocked.
Duplicating & Deleting Elements
Right-clicking any layer opens the contextual menu (CtxMenu):
- Duplicate: Calls
store.duplicateNode(node.id). All child elements and attributes are recursively cloned with fresh timestamp-based IDs, avoiding collision bugs. - Delete: Highlighted in red (
.jalpi-lctx__item--danger). Removes the element from the document tree and records a snapshot to undo history.
Searching & Filtering Nodes
The panel header includes a real-time search input:
- Type any query (e.g.
hero,button,column). - The tree dynamically filters nodes matching your query by label or node type.
- Automatic Ancestor Expansion: The helper
buildMatchSetautomatically identifies and expands all parent and ancestor branches of matched nodes, ensuring deep search results remain visible in context. - Pressing Escape or clicking the
βbutton clears the filter.
Selecting Elements#
Clicking any row in the Navigator executes store.selectNode(node.id):
- The active row is highlighted with an accent background and border (
.is-selected). - The corresponding element on the canvas receives an active selection outline with resizing handles.
- The right Inspector switches to the Style tab (or keeps the Outline active depending on workflow).
- Quick action buttons (Duplicate, Copy, Delete) appear below the active layer.
Reordering Elements#
Reordering elements in Jalpi is handled through the Navigator with high precision. While canvas dragging can suffer from ambiguous drop targets in tight spaces, the Navigator guarantees clear, deterministic order placement.
Drag & Drop#
Drag and drop in the Navigator uses standard HTML5 drag events optimized with visual insertion indicators.
Drag Handles & Drop Indicators
Each non-locked layer row displays a six-dot grip handle (IcoDots):
- Drag Start: Clicking and dragging the grip sets
dragInfo.nodeIdand marks the row with.is-dragging(reduced opacity). - Drag Over & Half-Height Calculation: As the mouse hovers over potential target rows, the client Y coordinate is evaluated against the target's midpoint:ts (Drop Position Calculation)
const r = e.currentTarget.getBoundingClientRect(); const position = e.clientY < r.top + r.height / 2 ? 'before' : 'after'; - Visual Drop Guide:
.is-drop-before: Draws a high-contrast 2px accent indicator line along the top border of the target node..is-drop-after: Draws a high-contrast 2px accent indicator line along the bottom border of the target node.
- Drop Execution: On mouse release,
store.moveNodeTo(sourceId, targetId, position)reorders the tree and clears drop indicators.
Drop Rules & Boundaries
- Sections: Can be reordered among sections at the document root.
- Containers & Columns: Can be reordered before or after sibling containers or columns.
- Widgets: Can be moved before or after any element within the same container, or moved across different containers and columns.
- Locked Elements: Cannot be dragged. Attempting to drag a locked element cancels the event immediately (
draggable={!isLocked}).
Canvas Synchronization#
The Navigator and Canvas maintain strict, bidirectional synchronization powered by the central editorStore.
Two-Way Selection Sync
- Canvas to Navigator: When a user clicks any element on the visual canvas,
setSelectedId(node.id)is dispatched. The Navigator row corresponding to that node is automatically highlighted, and its parent branches are expanded if collapsed. - Navigator to Canvas: Clicking any row in the Navigator sets
selectedId, immediately scrolling the canvas to reveal the element and painting its active boundary frame.
Immediate DOM Updates & History
When an element is dropped into a new position in the Navigator, the store invokes the tree mutation helper:
const moveNodeTo = useCallback((nodeId: string, targetId: string, position: 'before' | 'after') => {
setState((prev) => {
const newSections = moveNodeInTree(prev.pageData.sections, nodeId, targetId, position);
if (newSections === prev.pageData.sections) return prev;
const newData = { ...prev.pageData, sections: newSections };
return { ...prev, pageData: newData, isDirty: true, ...mkHistory(prev, newData, 'Move') };
});
}, []);This delivers three critical guarantees:
- Zero Desync: Both the Canvas and the Navigator derive from the single source of truth:
state.pageData.sections. - Full Undo/Redo: Reordering via Navigator logs a
'Move'history step. Pressing Ctrl+Z immediately restores the previous node positions. - Dirty Flag Tracking:
isDirty: trueactivates the Save/Publish button in the top navigation bar.
Responsive Behavior#
The Navigator adapts cleanly across various screen sizes and editor viewport states:
1. Desktop Docking (1024px and above)
On standard desktop monitors, the Navigator lives within the docked right Inspector sidebar. The canvas occupies the central viewport, while the Navigator stays pinned to the right. The resizable panel divider lets developers expand the tree width to view deeply nested branches comfortably.
2. Tablet & Mobile Drawer (below 1024px)
On compact screens and tablets, the editor automatically transforms sidebars into slide-over modal drawers. Toggling the Outline tab slides the Navigator over the canvas, allowing full structural reordering and element selection on touch devices without cluttering the canvas editing area.
3. Breakpoint Preview Synchronization
When switching between Desktop, Tablet, and Mobile preview modes using the top bar device switcher, the Navigator tree retains its state. If an element has been hidden specifically on mobile using responsive display settings (node.hideOn.mobile = true), the Navigator row reflects this state when previewing in mobile mode.
Developer Information#
This section documents the internal technical architecture of the Navigator for developers extending or contributing to Jalpi Page Builder.
Component Architecture
The Navigator is implemented across four primary React components located in admin/editor/src/components/layers/ and admin/editor/src/:
| Component | File Path | Role |
|---|---|---|
LayersPanel | admin/editor/src/components/layers/LayersPanel.tsx | Root container. Houses header search input, expand/collapse all controls, add section action, and manages drag/drop coordination. |
LayerRow | admin/editor/src/components/layers/LayersPanel.tsx | Recursive tree row component. Renders drag handle, expand chevron, type icon, inline label, and quick action buttons. Recursively renders children. |
CtxMenu | admin/editor/src/components/layers/LayersPanel.tsx | Floating context menu for right-click interactions. Bound to viewport coordinates with boundary collision detection. |
App.tsx | admin/editor/src/App.tsx | Mounts LayersPanel within .jalpi-inspector-body when inspTab === 'outline'. |
Node Data Model (CBNode)
Every node displayed in the Navigator adheres to the core CBNode TypeScript interface defined in admin/editor/src/types/index.ts:
export interface CBNode {
id: string; // Unique string identifier (e.g. "sec-1712345678")
type: string; // "section" | "container" | "column" | "heading" | ...
content?: Record<string, unknown>; // Text, shortcode, image URL, button label
settings?: Record<string, unknown>; // CSS styles, typography, spacing, backgrounds
children?: CBNode[]; // Recursive array of child nodes
locked?: boolean; // True if locked from editing / dragging
hideOn?: { // Responsive breakpoint visibility flags
desktop?: boolean;
tablet?: boolean;
mobile?: boolean;
};
}State Management & Store Actions
The Navigator consumes the useEditorStore custom hook. Key store methods utilized by the Navigator include:
| Store Method | Signature | Navigator Usage |
|---|---|---|
selectNode | (id: string) => void | Dispatches active selection to canvas and inspector. |
moveNodeTo | (nodeId: string, targetId: string, pos: 'before' | 'after') => void | Reorders node within tree structure and updates undo history. |
duplicateNode | (id: string) => void | Deep-clones target node and inserts adjacent duplicate. |
copyNode | (id: string) => void | Copies node JSON into editor internal clipboard state. |
deleteNode | (id: string) => void | Removes node and children from document. |
lockNode | (id: string, locked: boolean) => void | Toggles node locked status. |
toggleNodeVisibility | (id: string) => void | Toggles device visibility flags. |
addSection | () => void | Appends a new blank section to the bottom of the page. |
Public APIs & Extension Points
Navigator-specific public extension APIs are not currently available.
The Navigator is currently bundled as an internal core React component inside the Jalpi Page Builder editor. Third-party developers cannot currently register custom Navigator tree rows, context menu items, or custom drag-drop decorators via external JavaScript window APIs.
Upcoming Navigator Capabilities
The Jalpi Page Builder roadmap includes the following planned enhancements for the Navigator:
| Planned Feature | Status | Description |
|---|---|---|
| Multi-Node Selection | π Coming Soon | Hold Shift or Ctrl/β to select multiple layers simultaneously for bulk moving, locking, or deletion. |
| Custom Tree Badges & Labels API | π Coming Soon | JavaScript extension hooks to append custom status badges (e.g. A/B test variant flags, dynamic tag indicators) onto tree rows. |
| Detachable Floating Window | π Coming Soon | Ability to undock the Navigator into a floating, draggable window anywhere on the screen or onto a secondary display. |
Related Documentation#
Continue exploring the Jalpi Page Builder Editor
- Editor Overview β Mount lifecycle, four screen regions, and shortcuts.
- Canvas β Visual viewport rendering, node bounding boxes, and drag interactions.
- Responsive Editing β Breakpoints, mobile overlays, and responsive style cascading.
- Editor Settings β Canvas preferences, zoom controls, and theme toggles.
- Data Structure Reference β Complete JSON schema of sections, containers, and widgets.
Last updated: November 2026