[PR #4682] [MERGED] refactor: checkbox field type #6385

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/4682
Author: @richardshiue
Created: 2/19/2024
Status: Merged
Merged: 2/20/2024
Merged by: @richardshiue

Base: mainHead: refactor/checkbox-type-option


📝 Commits (3)

  • 1955dc1 refactor: checkbox field type
  • f399d9f chore: rename is_check to is_checked
  • e4f836d chore: rename checkbox type option field

📊 Changes

16 files changed (+121 additions, -140 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/plugins/database/application/cell/bloc/checkbox_cell_bloc.dart (+3 -3)
📝 frontend/appflowy_flutter/lib/plugins/database/application/cell/cell_controller_builder.dart (+3 -3)
📝 frontend/appflowy_flutter/lib/plugins/database/application/cell/cell_data_loader.dart (+10 -0)
📝 frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_types.ts (+8 -2)
📝 frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/type_option_types.ts (+1 -1)
📝 frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/CheckboxCell.tsx (+1 -1)
📝 frontend/rust-lib/event-integration/tests/database/local_test/test.rs (+3 -3)
📝 frontend/rust-lib/flowy-database2/src/entities/type_option_entities/checkbox_entities.rs (+18 -9)
📝 frontend/rust-lib/flowy-database2/src/services/cell/cell_operation.rs (+7 -7)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_filter.rs (+9 -10)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_tests.rs (+5 -4)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_type_option.rs (+17 -23)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_type_option_entities.rs (+25 -63)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/multi_select_type_option.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/select_type_option.rs (+5 -5)
📝 frontend/rust-lib/flowy-database2/src/services/group/controller_impls/checkbox_controller.rs (+5 -5)

📄 Description

Currently, the checkbox cell data is parsed to a single-String tuple struct. It works, there are no bugs, but can be more intuitive.

image

There are three states. When grouping, calculating, filtering, sorting or what have you, we need to check whether a cell is checked or not.

image

Evidently, is_uncheck() may cause bugs in the future. We don't run into this issue now because we negate is_check() instead of using is_uncheck(), but it would be so much simpler if we just use a bool instead. We also get to remove the dependency on these consts "Yes" and "No" on the frontend-frontend.

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/4682 **Author:** [@richardshiue](https://github.com/richardshiue) **Created:** 2/19/2024 **Status:** ✅ Merged **Merged:** 2/20/2024 **Merged by:** [@richardshiue](https://github.com/richardshiue) **Base:** `main` ← **Head:** `refactor/checkbox-type-option` --- ### 📝 Commits (3) - [`1955dc1`](https://github.com/AppFlowy-IO/AppFlowy/commit/1955dc1347b05731d05ab8a16a5fd0d038ecc275) refactor: checkbox field type - [`f399d9f`](https://github.com/AppFlowy-IO/AppFlowy/commit/f399d9f2ba3206db990f5929cb86c105359c77b6) chore: rename is_check to is_checked - [`e4f836d`](https://github.com/AppFlowy-IO/AppFlowy/commit/e4f836df6b0d794b28b435b07a8fb4b26dbbe213) chore: rename checkbox type option field ### 📊 Changes **16 files changed** (+121 additions, -140 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/plugins/database/application/cell/bloc/checkbox_cell_bloc.dart` (+3 -3) 📝 `frontend/appflowy_flutter/lib/plugins/database/application/cell/cell_controller_builder.dart` (+3 -3) 📝 `frontend/appflowy_flutter/lib/plugins/database/application/cell/cell_data_loader.dart` (+10 -0) 📝 `frontend/appflowy_tauri/src/appflowy_app/application/database/cell/cell_types.ts` (+8 -2) 📝 `frontend/appflowy_tauri/src/appflowy_app/application/database/field/type_option/type_option_types.ts` (+1 -1) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/database/components/cell/CheckboxCell.tsx` (+1 -1) 📝 `frontend/rust-lib/event-integration/tests/database/local_test/test.rs` (+3 -3) 📝 `frontend/rust-lib/flowy-database2/src/entities/type_option_entities/checkbox_entities.rs` (+18 -9) 📝 `frontend/rust-lib/flowy-database2/src/services/cell/cell_operation.rs` (+7 -7) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_filter.rs` (+9 -10) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_tests.rs` (+5 -4) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_type_option.rs` (+17 -23) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_type_option_entities.rs` (+25 -63) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/multi_select_type_option.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/select_type_option.rs` (+5 -5) 📝 `frontend/rust-lib/flowy-database2/src/services/group/controller_impls/checkbox_controller.rs` (+5 -5) </details> ### 📄 Description Currently, the checkbox cell data is parsed to a single-String tuple struct. It works, there are no bugs, but can be more intuitive. ![image](https://github.com/AppFlowy-IO/AppFlowy/assets/71320345/10c17bd9-263a-4b1e-99e1-d741ea2eb8a1) There are three states. When grouping, calculating, filtering, sorting or what have you, we need to check whether a cell is checked or not. ![image](https://github.com/AppFlowy-IO/AppFlowy/assets/71320345/97c0d740-46f2-46da-950d-7469f7f90635) Evidently, `is_uncheck()` may cause bugs in the future. We don't run into this issue now because we negate `is_check()` instead of using `is_uncheck()`, but it would be so much simpler if we just use a bool instead. We also get to remove the dependency on these consts "Yes" and "No" on the frontend-frontend. ### 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 - [ ] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/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. --- <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:00 +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#6385
No description provided.