mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-24 05:07:06 +08:00
fix(data-view): preserve filtering on hidden properties (#14500)
Fixes issue #14036 where hiding a column used in filters caused empty table/kanban results. Root cause: filter evaluation built the row map from visible properties only. Change: evaluate filters using full property set (propertiesRaw$) so hidden filtered columns still participate. Added unit regressions for both table and kanban hidden-column filtering behavior. Verified this does fix the filtering issue for hidden columns: <img width="3440" height="1440" alt="Screenshot of before and after views of a database with hidden columns and filtering on said column" src="https://github.com/user-attachments/assets/c1e2674f-06be-44e9-97bd-63593172f05b" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed filtering in Kanban and Table views so filters evaluate against all properties (including hidden/raw columns), ensuring consistent results regardless of column visibility. * **Tests** * Added tests covering filtering behavior with hidden and filtered columns to prevent regressions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -349,7 +349,7 @@ export class KanbanSingleView extends SingleViewBase<KanbanViewData> {
|
||||
isShow(rowId: string): boolean {
|
||||
if (this.filter$.value?.conditions.length) {
|
||||
const rowMap = Object.fromEntries(
|
||||
this.properties$.value.map(column => [
|
||||
this.propertiesRaw$.value.map(column => [
|
||||
column.id,
|
||||
column.cellGetOrCreate(rowId).jsonValue$.value,
|
||||
])
|
||||
|
||||
@@ -269,7 +269,7 @@ export class TableSingleView extends SingleViewBase<TableViewData> {
|
||||
isShow(rowId: string): boolean {
|
||||
if (this.filter$.value?.conditions.length) {
|
||||
const rowMap = Object.fromEntries(
|
||||
this.properties$.value.map(column => [
|
||||
this.propertiesRaw$.value.map(column => [
|
||||
column.id,
|
||||
column.cellGetOrCreate(rowId).jsonValue$.value,
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user