Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:AFK surf Open agent View GroupBy Configuration

From Leeroopedia
Knowledge Sources
Domains Database, Data_View, BlockSuite
Last Updated 2026-10-25 00:00 GMT

Overview

Pattern of grouping rows by a chosen property column, scoped per view, by writing a groupBy setting derived from the column's property meta via the view's GroupTrait.

Description

Group-by organizes rows into buckets keyed by a property's value (e.g. group cards by a multi-select tag). It is view-scoped: each view (table, kanban) can group by a different column. The GroupTrait is retrieved from the current view via traitGet(groupTraitKey). Calling changeGroup(columnId) resolves the column, looks up its property meta from the data source, computes a defaultGroupBy (carrying the column id, type, and a default grouping strategy), and writes it via ops.groupBySet. Passing undefined clears the grouping. The kanban view renders groups using this configuration.

Usage

Apply this principle when you want to organize rows into groups within a view — kanban cards grouped by status, table rows grouped by a tag — while keeping other views ungrouped or grouped differently.

Theoretical Basis

Group-by is a view-scoped partition: groupBy: GroupBy = { columnId, type, ... }. The GroupTrait maps the column's TypeInstance to a GroupByConfig via the group-by matcher service, which provides defaultKeys and grouping operations (addTo, removeFromGroup). Writing the groupBy re-derives the group list reactively.

Pseudo-code:

const groupTrait = viewManager.currentView$.value?.traitGet(groupTraitKey);
groupTrait?.changeGroup(database.props.columns[1].id);

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment