Introducing a new way to review your PRs.

Read the announcement

frappe / insights

Open Source Business Intelligence Tool

View on GitHub

25 documents · Updated Nov 23, 2026

docs / workbook-interface

Workbook interface

The workbook interface is the frontend workspace for finding, organizing, and using related analytical assets. It connects workbook discovery with query, chart, and dashboard work while giving users clear paths for access control, empty states, and data lineage.

Workbook library

The workbook library is the main entry point for analytical work. It lets users search and filter workbooks by scope before they open one, then shows enough ownership and activity information to help them choose the right asset. frontend/…/WorkbookList.vue and frontend/…/workbookListColumns.tsx define this library view.

The library supports two starting points:

  • New Workbook starts a workbook for new work.
  • Library opens supplied workbook templates when they are available.

The list loads more results as the user requests them. An empty scope offers a new-workbook action unless the scope contains shared items only. frontend/…/WorkbookList.vue and frontend/…/workbooks.ts support these entry states.

References: frontend/…/WorkbookList.vue• L25-72 frontend/…/WorkbookList.vue• L74-107 frontend/…/WorkbookList.vue• L109-123 frontend/…/WorkbookList.vue• L144-240 frontend/…/workbooks.ts• L10-59

Workbook workspace

The workbook workspace provides a common shell for the selected workbook. It combines a top bar, an optional sidebar, and a routed content area so navigation and editing share one workbook context. If no query exists, the workspace creates one so the user can begin at once. A direct workbook visit opens the first query when one exists. frontend/…/Workbook.vue coordinates this shell.

The top bar provides the workbook title and main actions. Users can rename the title in place. Read-only access is shown before editing, and it prevents the normal save path. frontend/…/WorkbookNavbar.vue and frontend/…/workbook.ts define this behavior.

The workspace routes each asset to its focused work area:

AssetUser-facing role
QueryBuild or run an analytical query.
ChartCreate a visual result from a query.
DashboardArrange charts and other dashboard content.

The selected asset stays in the URL. This lets sidebar, tab, and lineage actions reach the same workspace state. frontend/…/router.ts and frontend/…/Workbook.vue define the route structure.

References: frontend/…/Workbook.vue• L16-45 frontend/…/Workbook.vue• L71-105 frontend/…/WorkbookNavbar.vue• L12-47 frontend/…/workbook.ts• L27-57 frontend/…/workbook.ts• L437-446 frontend/…/router.ts• L30-67

Asset tabs

The tab bar makes queries, charts, and dashboards switchable parts of one workbook. Each tab uses the asset title and type so the user can identify it quickly. The plus menu creates an asset, while closing the selected asset asks for confirmation and then moves to another available asset. frontend/…/WorkbookTabSwitcher.vue and frontend/…/workbook.ts provide this navigation model.

Query and chart links accept a stored asset name or an older numeric position. A numeric link is resolved to the stored name and replaced in the URL. This keeps older links useful while making later navigation independent of list order. frontend/…/WorkbookQuery.vue and frontend/…/WorkbookChart.vue handle this transition.

References: frontend/…/WorkbookTabSwitcher.vue• L13-71 frontend/…/workbook.ts• L50-57 frontend/…/workbook.ts• L59-191 frontend/…/WorkbookQuery.vue• L6-24 frontend/…/WorkbookChart.vue• L7-32

Query interfaces

The query area starts with an interface choice when no query mode is set. The user can choose the visual Query Builder, SQL Editor, or Script Editor. The selected choice becomes the query's working mode and opens the matching editor. frontend/…/WorkbookQueryEmptyState.vue and frontend/…/Query.vue define this handoff.

An existing source operation also lets a query continue in the visual builder. This preserves a useful builder entry for queries that already contain a source even when their mode flags are incomplete. Query composition and execution are covered in Query editor and execution workflow.

References: frontend/…/WorkbookQueryEmptyState.vue• L4-49 frontend/…/Query.vue• L12-41

Chart tabs

The chart tab opens the chart builder with workbook queries as possible sources. A chart created beside a query can start from the active query, while a chart created from the main plus menu can start without a source. Chart setup is covered in Chart authoring and sharing. frontend/…/WorkbookChart.vue, frontend/…/WorkbookSidebar.vue, and frontend/…/workbook.ts connect the tab to that builder.

References: frontend/…/WorkbookChart.vue• L24-32 frontend/…/WorkbookSidebar.vue• L55-71 frontend/…/workbook.ts• L96-115

The sidebar groups workbook assets into query, chart, and dashboard sections. It marks the active route and places creation and removal actions beside each group. Query icons also show the selected query interface, so the sidebar gives both navigation and mode context. frontend/…/WorkbookSidebar.vue supplies this structure.

Queries and charts can belong to folders. A folder holds one asset type. Users can create, rename, open, close, and delete folders, then move items between the root and folders of that same type. The saved sort order controls the displayed order. Deleting a folder returns its items to the root instead of deleting them. frontend/…/WorkbookSidebarFolders.vue and frontend/…/workbook.ts define these relationships.

Dashboards stay in a flat sidebar list. Users can create, open, and remove them there, but dashboard folders are not part of this organization model. frontend/…/WorkbookSidebarListSection.vue and frontend/…/WorkbookSidebar.vue provide this view.

References: frontend/…/WorkbookSidebar.vue• L11-88 frontend/…/WorkbookSidebarFolders.vue• L22-71 frontend/…/WorkbookSidebarFolders.vue• L100-129 frontend/…/WorkbookSidebarFolders.vue• L132-313 frontend/…/WorkbookSidebarListSection.vue• L21-69 frontend/…/workbook.ts• L309-364

Sharing dialog

The sharing dialog lets a workbook owner set access for named users and for the whole organization. Each entry can have view or edit access. The owner remains visible as a fixed entry, and Save stays inactive until a permission change exists. frontend/…/WorkbookShareDialog.vue and frontend/…/workbook.ts define this access model.

The Share action appears only for a saved remote workbook owned by the current user. It is hidden for local or unsaved workbooks. Saving sends the current user and organization permissions, then closes the dialog and reports success. The server-side lifecycle is covered in Workbook API lifecycle. frontend/…/WorkbookNavbarActions.vue and frontend/…/WorkbookShareDialog.vue expose this flow.

References: frontend/…/WorkbookNavbarActions.vue• L16-68 frontend/…/WorkbookShareDialog.vue• L20-97 frontend/…/WorkbookShareDialog.vue• L100-216 frontend/…/workbook.ts• L193-230

Lineage view

The lineage dialog helps users trace workbook results back to their sources. It shows tables, queries, and chart-backed results as non-editable nodes connected by directed edges. A search narrows the graph to matching node labels or chart titles. frontend/…/WorkbookLineageDialog.vue provides this view.

Lineage also supports navigation. Selecting a query node closes the dialog and opens that query in the workbook, so a user can move from understanding a result to inspecting its source.

The flow from the workbook action to an opened query is:

sequenceDiagram
    participant User
    participant Workspace
    participant Lineage
    participant Query
    User->>Workspace: Select View Lineage
    Workspace->>Lineage: Open dialog
    Lineage->>Workspace: Request lineage graph
    Workspace-->>Lineage: Return tables, queries, and edges
    User->>Lineage: Select a query node
    Lineage->>Query: Close dialog and navigate to query

References: frontend/…/WorkbookNavbarActions.vue• L28-36 frontend/…/WorkbookLineageDialog.vue• L18-43 frontend/…/WorkbookLineageDialog.vue• L45-68 frontend/…/WorkbookLineageDialog.vue• L132-141 frontend/…/WorkbookLineageDialog.vue• L145-267

Template opening

The workbook library offers ready-made templates grouped by their source app. Each template gives the user context before import, including a preview, description, data state, and update state. An imported workbook can be opened again, and a newer template version can update it. If the workbook has local changes, the interface asks for confirmation before replacement. frontend/…/WorkbookTemplates.vue defines this interaction.

Both a library import and a stable template link create or prepare the workbook. If the result includes a dashboard, the interface opens it; otherwise it opens the workbook. If creation fails, the route shows an error and returns to the workbook list. The supplied template lifecycle is covered in Workbook templates.

flowchart LR
    A[Template card or template link] --> B{Entry path}
    B -->|Library import| C[Create workbook from template]
    B -->|Stable template URL| C
    C --> D{Dashboard returned?}
    D -->|Yes| E[Open dashboard]
    D -->|No| F[Open workbook]
    C -->|Failure| G[Show error and return to workbook list]

References: frontend/…/WorkbookList.vue• L84-101 frontend/…/WorkbookList.vue• L144-171 frontend/…/WorkbookTemplates.vue• L10-25 frontend/…/WorkbookTemplates.vue• L31-116 frontend/…/WorkbookTemplates.vue• L119-247 frontend/…/OpenTemplate.vue• L8-37

Change checklist

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

  • Keep workbook child route names and asset-name handling aligned across the router, sidebar, tab switcher, and lineage navigation.
  • Keep folder type, item assignment, and sort order aligned when changing folder actions or drag-and-drop behavior.
  • Keep read-only and local-workbook rules aligned between workbook state and navbar actions. These rules control editing and sharing affordances.
  • Keep template result routing aligned between library imports and stable template links so both open a returned dashboard when one exists.
  • Keep workbook list access labels aligned with the permission states used by the sharing dialog.

Important failure modes

TriggerConsequenceGuard
A workbook asset is removed while its route stays active.The workspace can point to an asset that no longer exists.The removal flow selects another asset or returns to the workbook route.
A folder is deleted.Its items can appear lost.Folder deletion moves the items to the root and reloads the workbook.
A customized imported template is updated without confirmation.Local workbook changes can be replaced.The template dialog requires confirmation before the update.
A read-only workbook shows normal save or share actions.The user can expect changes or sharing that cannot succeed.The workspace marks read-only access and disables auto-save. Sharing is owner-only.
Template creation fails.The user cannot reach the intended dashboard or workbook.The route shows an error and returns to /workbook.

Key files

FileWhy to read it
frontend/…/Workbook.vueShows the workbook shell, load behavior, default query entry, and routed content.
frontend/…/router.tsShows the library, workbook asset routes, and stable template route.
frontend/…/WorkbookList.vueShows workbook discovery, search, scopes, empty states, creation, and template entry.
frontend/…/WorkbookTabSwitcher.vueShows the shared tab model for workbook assets.
frontend/…/WorkbookSidebar.vueShows asset groups, active navigation, and creation routes.
frontend/…/WorkbookSidebarFolders.vueShows folder behavior and item movement for queries and charts.
frontend/…/WorkbookNavbarActions.vueShows sharing, lineage, and other workbook-level actions.
frontend/…/WorkbookShareDialog.vueShows user and organization access editing.
frontend/…/WorkbookLineageDialog.vueShows lineage loading, search, display, and query navigation.
frontend/…/WorkbookTemplates.vueShows template import, update, and customized-copy confirmation.
frontend/…/OpenTemplate.vueShows stable template-link preparation and redirect behavior.
frontend/…/workbook.tsShows shared workbook state and interface actions.