Skip to content

Workspaces

Auto-generated from knowledge base TOML files by docs_gen.py. Do not edit manually; run dazzle docs generate to regenerate.

Workspaces compose multiple data views into cohesive dashboards or information hubs. They aggregate related surfaces, metrics, and data for specific user needs. This page covers workspace definitions, regions, aggregates, display modes, and layout stages.


Workspace

A composition of multiple data views into a cohesive dashboard or information hub. Workspaces aggregate related surfaces and data for specific user needs.

Region types: - Data region: has source + optional filter/sort/limit → renders entity rows - Aggregate-only region: has only aggregate: block → renders KPI metric cards

Key features: - filter: applies a ConditionExpr so regions only show matching rows (e.g. status = open) - sort: orders results (e.g. due_date desc for most urgent first) - limit: caps result count (useful for "top 5" style regions) - action: links rows to a surface or workspace for click-through navigation (e.g. action: task_edit); on a metrics/summary region the WHOLE tile is the link — point it at a workspace or a list/create surface (a tile counts many rows, so it has no row id) - aggregate: computes metrics like count(Entity where condition) displayed as KPI cards - stage: controls CSS grid layout (focus_metric, dual_pane_flow, scanner_table, monitor_wall, command_center) - primary_actions: the heading's CTA buttons, each action "<label>" -> surface|workspace <name>. Without the block the heading infers one "New " per region source with a create surface; declaring it REPLACES that inference (author action "New X" -> surface <create> to keep a create button)

Syntax

workspace <workspace_name> "<Display Name>":
  purpose: "<semantic intent>"
  [stage: "<stage_name>"]
  [primary_actions:]                     # replaces the inferred "New <Entity>" CTAs
    [action "<label>" -> surface|workspace <name>]

  <region_name>:
    source: <Entity|surface_name>
    [filter: <condition>]
    [sort: <field> [asc|desc], ...]
    [limit: <number>]
    [display: <list|grid|summary|metrics>]
    [action: <surface_name|workspace_name>]
    [empty: "<message>"]
    [group_by: <field>]
    [aggregate:]
      <metric_name>: <expression>

  [ux:]
    [as <persona>: ...]

# Aggregate expressions:
#   count(Entity)                        → total entity count
#   count(Entity where status = open)    → filtered count
#   sum(Entity.amount)                   → field sum (planned)
#   avg(Entity.duration_days)            → field average (planned)

Example

workspace customer_dashboard "Customer Dashboard":
  purpose: "Customer health overview for account managers"
  stage: "command_center"

  active_contracts:
    source: Contract
    filter: status = active
    sort: renewal_date asc
    limit: 10
    action: contract_detail
    display: list
    empty: "No active contracts"

  overdue_invoices:
    source: Invoice
    filter: status = overdue
    sort: due_date asc
    limit: 5
    action: invoice_edit
    display: list
    empty: "All invoices paid!"

  kpi_metrics:
    aggregate:
      active_customers: count(Customer where status = active)
      open_invoices: count(Invoice where status != paid and status != cancelled)
      total_revenue: sum(Invoice.amount)
    display: metrics

  recent_activity:
    source: AuditLog
    sort: created_at desc
    limit: 20
    display: list

Related: Persona, Regions, Aggregates, Display Modes, Stage


Regions

Named sections within a workspace that pull data from entities or surfaces. Each region defines a data view with optional filtering, sorting, display mode, and aggregation. Three types of regions: - Data region: has source + optional filter/sort/limit (renders entity rows) - Aggregate-only region: has only aggregate: block (renders KPI metric cards) - Multi-source region: has sources: [Entity1, Entity2] (renders tabbed list)

Regions support date-range filtering (v0.34.0) with date_field + date_range flag.

Presentation options (#1809, #1814): filters: none hides a list region's filter and find-by-title bar (explicit only, never implied by a small page_size). exclude: <region> omits the rows the named region on the SAME workspace and source entity renders on its first page — one scope-safe id NOT IN (<that region's first-page id query>); a "Resume" row is not repeated as the first "Recent" row. eager: true|false overrides the default fold (the first three regions load on page load, the rest on intersect once) for one region, so the persona's key region is promoted without reordering; there is no workspace-wide fold_count:. On display: comparison, limit: N keeps the N best-ranked rows — cut after ranking, in the one grouped aggregate query (ORDER BY the ranking measure, LIMIT N).

Syntax

<region_name>:
  source: <EntityName>                       # Single source
  source: [<Entity1>, <Entity2>]             # Multi-source (tabbed list)
  [filter: <condition_expr>]                 # Row filter
  [filter_map:]                              # Per-source filters (multi-source)
    [<EntityName>: <condition>]
  [sort: <field> [asc|desc], ...]            # Sort order
  [limit: <1-1000>]                          # Row cap, no pager
  [page_size: <1-100>]                       # Rows per page + pager (not with limit:)
  [columns: <field>[(<modifiers>)], ...]     # Authored columns (see list_columns)
  [filters: none]                            # Hide a list region's filter/search bar
  [exclude: <region>]                        # Omit rows <region> (same workspace + entity) shows on its first page
  [eager: <true|false>]                      # Override the default fold (first three regions load eagerly)
  [display: <list|grid|timeline|summary|metrics|kanban|bar_chart|queue|tabbed_list>]
  [action: <surface_name|workspace_name>]    # Click-through (metrics: whole tile)
  [empty: "<message>"]                       # Empty state message
  [group_by: <field>]                        # Group data by field
  [date_field: <field>]                      # Date-range filter field
  [date_range]                               # Enable date picker
  [aggregate:]                               # KPI metrics
    [<metric_name>: <expression>]

Example

workspace ops_dashboard "Operations Dashboard":
  purpose: "Monitor daily operations"

  # Data region with filter and sort
  open_tickets:
    source: Ticket
    filter: status = open
    sort: priority desc, created_at asc
    limit: 20
    display: list
    action: ticket_detail
    empty: "No open tickets"

  # Aggregate-only region (no source needed)
  kpi_metrics:
    aggregate:
      total_tickets: count(Ticket)
      open_count: count(Ticket where status = open)
    display: metrics

  # Multi-source tabbed region
  activity:
    source: [Ticket, Order, Invoice]
    sort: created_at desc
    limit: 10
    display: tabbed_list

  # Date-range filtered region
  sales:
    source: Order
    date_field: created_at
    date_range
    sort: created_at desc
    display: list

Related: Workspace, Display Modes, Aggregates, List Columns, Pagination


Aggregate

Computed metrics on workspace regions. Aggregates calculate summary values from entity data using count(), sum(), avg(), min(), max() functions with optional WHERE conditions.

Syntax

aggregate:
  <metric_name>: count(<Entity>)
  <metric_name>: count(<Entity> where <condition>)
  <metric_name>: sum(<field>)
  <metric_name>: avg(<field>)

Example

workspace dashboard "Dashboard":
  purpose: "Team overview"

  metrics:
    source: Task
    aggregate:
      total_tasks: count(Task)
      open_tasks: count(Task where status = open)
      critical: count(Task where priority = critical and status != closed)

Related: Workspace


Workspace Region Filters

How workspace region filter: expressions become SQL at runtime.

Supported well: - Simple equality: status = open - Same-field equality OR: status = held or status = confirmed → status__in - AND trees of equalities - current_user / current_user.<attr> / current_context on equality

Fail-closed / avoid: - Mixed-field OR (status = held or priority = high) → empty region + validate warn - Assuming full SQL boolean algebra in region filters

Prefer one criterion per region when unsure (split held vs confirmed).

Syntax

# Supported same-field OR (#1630)
held_or_confirmed:
  source: HoldRequest
  filter: status = held or status = confirmed
  display: list

# Preferred clarity — split regions
held:
  source: HoldRequest
  filter: status = held
confirmed:
  source: HoldRequest
  filter: status = confirmed

Best Practices

  • Same-field or is OK; mixed-field or is not
  • Split regions instead of inventing compound OR
  • Counter-prior: workspace_filter_or_silent_empty

Related: Regions, Empty Desk False Green, Demo Identity


Aggregates

Computed metrics and aggregate functions for workspace regions.

Entry point for chart authoring: read docs/reference/reports.md before writing any chart region. It explains the single/multi-dim decision, the fast/slow-path distinction, FK auto-join behaviour, scope-safety contract, and the dazzle db explain-aggregate debugger.

Fast path (recommended — one SQL query, scope evaluated once): - count(<source_entity>) with group_by: <field> — bar_chart - count / sum / avg / min / max over the source (plus derived metrics) with group_by: [<a>, <b>] — pivot_table; every measure shares one where (#1800) - count(<source_entity>) with group_by: bucket(<ts>, day|week|month|quarter|year) — time-series (line_chart) — v0.60.0 - sum:<col>, avg:<col>, min:<col>, max:<col> — numeric measures

Slow path (N+1 — avoid when the fast path applies): - count(<other_entity> where field = current_bucket) — cross-entity, per-bucket queries. Used only when the bucketing dimension lives on a different entity than what you're counting.

Syntax

aggregate:
  total: count(Task)
  completed: count(Task where status = done)
  completion_rate: count(Task where status = done) * 100 / count(Task)
  avg_duration: avg:duration_days

Related: Regions, Workspace, Display Modes


Display Modes

Visualization modes for workspace regions. Each display consumes a specific IR shape:

  • list / grid / timeline — row-per-item views
  • metrics / summary — KPI tiles from an aggregate: block
  • bar_chart — single-dim count/measure distribution (uses group_by: <field>)
  • kanban — single-dim grouping with column-per-value layout
  • pivot_table — N-dim cross-tab (group_by: [field, field]) — v0.59.3
  • line_chart — single-dim time series (group_by: bucket(ts, day)) — v0.60.0
  • activity_feed / queue — specialised

New in v0.59: Strategy C aggregate primitive. Chart regions now run one scope-aware GROUP BY SQL query via Repository.aggregate — no more N+1 enumeration. See the reports doc for the canonical entry point when writing any chart region.

Syntax

display: <list|grid|timeline|metrics|bar_chart|pivot_table|kanban|queue|tabbed_list|activity_feed>

Related: Regions, Workspace, Aggregates


A collapsible navigation group within a workspace. Groups workspace navigation items under a labeled, optionally collapsible header with an optional Lucide icon. Each item links to an entity or workspace by name and can have its own icon.

Syntax

workspace <name> "<Title>":
  ...
  nav_group "<Label>" [icon=<lucide-icon-name>] [collapsed]:
    <EntityOrWorkspaceName> [icon=<lucide-icon-name>]
    <EntityOrWorkspaceName> [icon=<lucide-icon-name>]
    ...

# icon: Lucide icon name (e.g., settings, file-text, check-circle)
# collapsed: if present, group starts collapsed (default: expanded)

Example

workspace dashboard "Dashboard":
  nav_group "Management" icon=settings:
    Task icon=check-circle
    User icon=users
    Project icon=folder

  nav_group "Reports" icon=bar-chart-2 collapsed:
    Invoice icon=file-text
    Payment icon=credit-card

  tasks:
    source: Task
    display: list

Best Practices

  • Use nav_group to organize workspaces with many entities
  • Use collapsed for secondary navigation that is rarely needed
  • Use Lucide icon names for visual clarity (hyphenated, e.g., file-text)

Related: Workspace, Regions


List Columns

One column vocabulary for workspace regions and list surfaces (#1792). A column names a field and may carry two hints:

  • width: <n>%|<n>rem|<n>ch — lands as style="width: …" on the column's <col>; columns without a width share the remaining width equally.
  • truncate / truncate: true|false — false lets a text or ref cell wrap whole; truncate forces the one-line ellipsis. Unset keeps the list default (text and ref cells truncate on a list surface).

A region names its columns with columns:. The order is authoritative and only the named fields render — this is the opt-out for the framework's column heuristic (fitness.repr_fields / the entity's list surface / the entity's fields) and the opt-in for an image or file field on a non-card display. Ref fields show the related record's display name; dotted paths are not supported. columns: drives list, queue, grid, kanban and timeline regions; width/truncate hints only apply to display: list (a warning says so elsewhere). A multi-source region ignores columns:.

A list surface has no columns: keyword — its columns are its field lines, which take the same width: / truncate modifiers.

Validation: every name must be a field on the region's source entity (E_COLUMNS_UNKNOWN_FIELD), no name twice (E_COLUMNS_DUPLICATE), and a width must use %, rem or ch (parse error).

Syntax

# Region
<region_name>:
  source: <Entity>
  columns: <field>[(<modifier>, ...)], <field>, ...

# List surface field line
field <field> ["Label"] [width: <n>%|<n>rem|<n>ch] [truncate | truncate: false]

# Modifiers
width: 34%  |  width: 12rem  |  width: 20ch
truncate    |  truncate: true  |  truncate: false

Example

workspace hod_cohort "Cohort":
  pupils_below_target:
    source: StudentProfile
    display: list
    columns: name(width: 30%), photo_url, tutor_group, latest_grade, target_grade
    page_size: 25

surface stack_list "My Stacks":
  uses entity Stack
  mode: list
  section main:
    field title "Title" width: 34%
    field mark_scheme "Mark scheme" truncate
    field status "Status"

Related: Regions, Section, Pagination, Display Modes