{"record":{"id":"eecfe0d617dbccec","repo":"toeverything/AFFiNE","slug":"databaseblockerror-eecfe0","errorCode":"DatabaseBlockError","errorMessage":"Unknown arrow keys, only support: up, down, left, and right keys.","messagePattern":"Unknown arrow keys, only support: up, down, left, and right keys\\.","errorType":"exception","errorClass":"BlockSuiteError","httpStatus":null,"severity":"warning","filePath":"blocksuite/affine/data-view/src/view-presets/kanban/pc/controller/selection.ts","lineNumber":381,"sourceCode":"\n    if (nextPosition === 'right') {\n      return getNextGroupFocusElement(\n        this.host,\n        groups,\n        selection,\n        groupIndex => (groupIndex === groups.length - 1 ? 0 : groupIndex + 1)\n      );\n    }\n\n    if (nextPosition === 'left') {\n      return getNextGroupFocusElement(\n        this.host,\n        groups,\n        selection,\n        groupIndex => (groupIndex === 0 ? groups.length - 1 : groupIndex - 1)\n      );\n    }\n    throw new BlockSuiteError(\n      ErrorCode.DatabaseBlockError,\n      'Unknown arrow keys, only support: up, down, left, and right keys.'\n    );\n  }\n\n  getNextFocusCell(\n    selection: KanbanCellSelection,\n    index: number,\n    nextPosition: 'up' | 'down' | 'left' | 'right'\n  ):\n    | {\n        cell: KanbanCell;\n        cardId?: string;\n        groupKey?: string;\n      }\n    | undefined {\n    const host = this.host;\n    if (!host) {","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/26c515e050211269e911f7d9cfe162a26c83ed98/blocksuite/affine/data-view/src/view-presets/kanban/pc/controller/selection.ts#L363-L399","documentation":"In the Kanban PC selection controller, the group-navigation method handles 'up'/'down'/'right'/'left' explicitly and throws DatabaseBlockError in the final else branch. It is a defensive guard ensuring only the four arrow directions reach the end.","triggerScenarios":"Calling the method with a nextPosition value outside the 'up'|'down'|'left'|'right' union — possible only via a typing escape or a future direction constant.","commonSituations":"TypeScript should prevent this at compile time; at runtime it indicates an unhandled direction enum or a cast bypassing the type.","solutions":["Treat this as an unreachable branch per the typed union; if hit, fix the caller passing an invalid direction.","Extend the union and add handling before this throw if a new direction is introduced."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"const isArrowDir = (d: string): d is 'up'|'down'|'left'|'right' => d === 'up' || d === 'down' || d === 'left' || d === 'right';","tryCatchPattern":null,"preventionTips":["Rely on the typed union to make this branch unreachable","If hit at runtime, fix the caller passing an invalid direction"],"tags":["kanban","selection","keyboard","internal"],"backgroundTag":null,"analyzedSha":"26c515e050211269e911f7d9cfe162a26c83ed98","analyzedAt":"2026-08-12T13:15:16.447Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}