{"record":{"id":"7487e1b90dbf90aa","repo":"toeverything/AFFiNE","slug":"databaseblockerror-7487e1","errorCode":"DatabaseBlockError","errorMessage":"no groupable column found","messagePattern":"no groupable column found","errorType":"exception","errorClass":"BlockSuiteError","httpStatus":null,"severity":"error","filePath":"blocksuite/affine/data-view/src/view-presets/kanban/define.ts","lineNumber":39,"sourceCode":"  sort?: Sort;\n  header: {\n    titleColumn?: string;\n    iconColumn?: string;\n    coverColumn?: string;\n  };\n  groupProperties: GroupProperty[];\n};\nexport type KanbanViewData = BasicViewDataType<\n  typeof kanbanViewType.type,\n  DataType\n>;\nexport const kanbanViewModel = kanbanViewType.createModel<KanbanViewData>({\n  defaultName: 'Kanban View',\n  dataViewManager: KanbanSingleView,\n  defaultData: viewManager => {\n    const groupBy = resolveKanbanGroupBy(viewManager.dataSource);\n    if (!groupBy) {\n      throw new BlockSuiteError(\n        ErrorCode.DatabaseBlockError,\n        'no groupable column found'\n      );\n    }\n\n    const columns = viewManager.dataSource.properties$.value;\n\n    return {\n      columns: columns.map(id => ({\n        id: id,\n      })),\n      filter: {\n        type: 'group',\n        op: 'and',\n        conditions: [],\n      },\n      groupBy,\n      header: {","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/26c515e050211269e911f7d9cfe162a26c83ed98/blocksuite/affine/data-view/src/view-presets/kanban/define.ts#L21-L57","documentation":"When creating a default Kanban view, kanbanViewModel.defaultData resolves a column to group by via resolveKanbanGroupBy(). If no column qualifies as groupable it throws DatabaseBlockError — a kanban view cannot be constructed without a grouping column.","triggerScenarios":"Instantiating a Kanban view on a data source that has no groupable columns (e.g. all columns are number/formula/checkbox types unsupported for grouping).","commonSituations":"User tries to switch to Kanban view on a database lacking a select/multi-select or other groupable property; a freshly created database with only a title column.","solutions":["Ensure at least one groupable column type exists before offering the Kanban view.","Disable/hide the Kanban view option when resolveKanbanGroupBy() returns null.","Auto-add a select-type column when the user chooses Kanban with no groupable column."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const groupBy = resolveKanbanGroupBy(dataSource);\nif (!groupBy) { /* do not offer Kanban view, or add a groupable column first */ }","typeGuard":"const kanbanSupported = (ds: any): boolean => Boolean(resolveKanbanGroupBy(ds));","tryCatchPattern":null,"preventionTips":["Disable the Kanban option when no groupable column exists","Auto-create a select column before switching to Kanban"],"tags":["kanban","data-view","grouping","database"],"backgroundTag":null,"analyzedSha":"26c515e050211269e911f7d9cfe162a26c83ed98","analyzedAt":"2026-08-12T13:15:16.447Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}