[PR #4828] [MERGED] fix: number and select filter logic #6474

Closed
opened 2026-03-23 22:23:22 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/4828
Author: @richardshiue
Created: 3/6/2024
Status: Merged
Merged: 3/14/2024
Merged by: @richardshiue

Base: mainHead: feat/fill-row-cells-with-filter-data2


📝 Commits (2)

  • 897b947 fix: number and select option filter bugs
  • 5f2bc01 chore: rename filter condition enum and variants

📊 Changes

57 files changed (+1320 additions, -1248 deletions)

View changed files

📝 frontend/.vscode/tasks.json (+1 -1)
📝 frontend/appflowy_flutter/integration_test/desktop/database/database_filter_test.dart (+2 -2)
📝 frontend/appflowy_flutter/lib/plugins/database/domain/filter_service.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/plugins/database/grid/application/filter/filter_create_bloc.dart (+4 -4)
📝 frontend/appflowy_flutter/lib/plugins/database/grid/application/filter/select_option_filter_bloc.dart (+2 -2)
📝 frontend/appflowy_flutter/lib/plugins/database/grid/application/filter/select_option_filter_list_bloc.dart (+8 -4)
📝 frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/filter/choicechip/select_option/condition_list.dart (+50 -61)
📝 frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/filter/choicechip/select_option/option_list.dart (+11 -3)
📝 frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/filter/choicechip/select_option/select_option.dart (+3 -2)
📝 frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/filter/choicechip/select_option/select_option_loader.dart (+31 -1)
📝 frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/filter/choicechip/text.dart (+10 -10)
📝 frontend/appflowy_flutter/test/bloc_test/grid_test/filter/filter_menu_test.dart (+2 -2)
📝 frontend/appflowy_flutter/test/bloc_test/grid_test/filter/filter_rows_by_text_test.dart (+4 -4)
📝 frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_data.ts (+10 -1)
📝 frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_types.ts (+2 -2)
📝 frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterConditionSelect.tsx (+41 -16)
📝 frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/select_filter/SelectFilter.tsx (+3 -3)
📝 frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/select_filter/SelectFilterValue.tsx (+5 -5)
📝 frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/text_filter/TextFilterValue.tsx (+6 -6)
📝 frontend/resources/translations/am-ET.json (+1 -5)

...and 37 more files

📄 Description

requires https://github.com/AppFlowy-IO/AppFlowy/pull/4807

resolves https://github.com/AppFlowy-IO/AppFlowy/issues/3346

  • Fix a bug where, in the event that a number filter is supplied but no content is given, no rows are shown when they should be.
  • Fix a bug where, when choosing "is not empty" as the condition for select option filter, empty rows are not shown when they should be. (see linked issue)
  • Add two new filter conditions for multi-select option "contains" and "does not contain" to allow more flexibility.
  • Add a bunch of tests to cover these edge cases in select option filters
  • Clean up translations for select option filter
  • Fix a bug where the Is select option condition allows selecting multiple options when the field type is single select

Is vs Contains

The cell "C", "A", "B" satisfy the filter CONTAINS "A", "B", "C" and IS "A", "B", "C"
The cell "B", "A" satisfies the filter CONTAINS "A", "B", "C" but not IS "A", "B", "C"

Before

SelectOptionConditionPB::Is + FieldType::SingleSelect = Is
SelectOptionConditionPB::IsNot + FieldType::SingleSelect = Is not

SelectOptionConditionPB::Is + FieldType::MultiSelect = Contains
SelectOptionConditionPB::IsNot + FieldType::MultiSelect = Does not contain

After

SelectOptionConditionPB::Is + FieldType::SingleSelect = Is
SelectOptionConditionPB::IsNot + FieldType::SingleSelect = Is not
SelectOptionConditionPB::Contains + FieldType::SingleSelect = Is (not available)
SelectOptionConditionPB::DoesNotContain + FieldType::SingleSelect = Is not (not available)

SelectOptionConditionPB::Is + FieldType::MultiSelect = Is
SelectOptionConditionPB::IsNot + FieldType::MultiSelect = Is Not
SelectOptionConditionPB::Contains + FieldType::MultiSelect = Contains
SelectOptionConditionPB::DoesNotContain + FieldType::MultiSelect = Does not contain

Feature Preview


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/4828 **Author:** [@richardshiue](https://github.com/richardshiue) **Created:** 3/6/2024 **Status:** ✅ Merged **Merged:** 3/14/2024 **Merged by:** [@richardshiue](https://github.com/richardshiue) **Base:** `main` ← **Head:** `feat/fill-row-cells-with-filter-data2` --- ### 📝 Commits (2) - [`897b947`](https://github.com/AppFlowy-IO/AppFlowy/commit/897b94724c72c5f791802f68cd447c98150d8820) fix: number and select option filter bugs - [`5f2bc01`](https://github.com/AppFlowy-IO/AppFlowy/commit/5f2bc01ac033ac24d0b1e79fc0407d4adfacaa63) chore: rename filter condition enum and variants ### 📊 Changes **57 files changed** (+1320 additions, -1248 deletions) <details> <summary>View changed files</summary> 📝 `frontend/.vscode/tasks.json` (+1 -1) 📝 `frontend/appflowy_flutter/integration_test/desktop/database/database_filter_test.dart` (+2 -2) 📝 `frontend/appflowy_flutter/lib/plugins/database/domain/filter_service.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/application/filter/filter_create_bloc.dart` (+4 -4) 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/application/filter/select_option_filter_bloc.dart` (+2 -2) 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/application/filter/select_option_filter_list_bloc.dart` (+8 -4) 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/filter/choicechip/select_option/condition_list.dart` (+50 -61) 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/filter/choicechip/select_option/option_list.dart` (+11 -3) 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/filter/choicechip/select_option/select_option.dart` (+3 -2) 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/filter/choicechip/select_option/select_option_loader.dart` (+31 -1) 📝 `frontend/appflowy_flutter/lib/plugins/database/grid/presentation/widgets/filter/choicechip/text.dart` (+10 -10) 📝 `frontend/appflowy_flutter/test/bloc_test/grid_test/filter/filter_menu_test.dart` (+2 -2) 📝 `frontend/appflowy_flutter/test/bloc_test/grid_test/filter/filter_rows_by_text_test.dart` (+4 -4) 📝 `frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_data.ts` (+10 -1) 📝 `frontend/appflowy_tauri/src/appflowy_app/application/database/filter/filter_types.ts` (+2 -2) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/FilterConditionSelect.tsx` (+41 -16) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/select_filter/SelectFilter.tsx` (+3 -3) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/select_filter/SelectFilterValue.tsx` (+5 -5) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/database/components/filter/text_filter/TextFilterValue.tsx` (+6 -6) 📝 `frontend/resources/translations/am-ET.json` (+1 -5) _...and 37 more files_ </details> ### 📄 Description requires https://github.com/AppFlowy-IO/AppFlowy/pull/4807 resolves https://github.com/AppFlowy-IO/AppFlowy/issues/3346 - Fix a bug where, in the event that a number filter is supplied but no content is given, no rows are shown when they should be. - Fix a bug where, when choosing "is not empty" as the condition for select option filter, empty rows are not shown when they should be. (see linked issue) - Add two new filter conditions for multi-select option "contains" and "does not contain" to allow more flexibility. - Add a bunch of tests to cover these edge cases in select option filters - Clean up translations for select option filter - Fix a bug where the Is select option condition allows selecting multiple options when the field type is single select ### Is vs Contains The cell "C", "A", "B" satisfy the filter CONTAINS "A", "B", "C" and IS "A", "B", "C" The cell "B", "A" satisfies the filter CONTAINS "A", "B", "C" **but not** IS "A", "B", "C" ### Before SelectOptionConditionPB::Is + FieldType::SingleSelect = Is SelectOptionConditionPB::IsNot + FieldType::SingleSelect = Is not SelectOptionConditionPB::Is + FieldType::MultiSelect = Contains SelectOptionConditionPB::IsNot + FieldType::MultiSelect = Does not contain ### After SelectOptionConditionPB::Is + FieldType::SingleSelect = Is SelectOptionConditionPB::IsNot + FieldType::SingleSelect = Is not SelectOptionConditionPB::Contains + FieldType::SingleSelect = Is (not available) SelectOptionConditionPB::DoesNotContain + FieldType::SingleSelect = Is not (not available) SelectOptionConditionPB::Is + FieldType::MultiSelect = Is SelectOptionConditionPB::IsNot + FieldType::MultiSelect = Is Not SelectOptionConditionPB::Contains + FieldType::MultiSelect = Contains SelectOptionConditionPB::DoesNotContain + FieldType::MultiSelect = Does not contain ### Feature Preview <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [x] I've listed at least one issue that this PR fixes in the description above. - [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [x] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:23:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#6474
No description provided.