[PR #4782] [MERGED] chore: type option cell data trait cleanup #6435

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

📋 Pull Request Information

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

Base: mainHead: chore/code-cleanup


📝 Commits (2)

  • 8a73010 chore: remove dead code
  • 63ec062 chore: remove legacy FromCellStringTrait

📊 Changes

13 files changed (+40 additions, -264 deletions)

View changed files

📝 frontend/rust-lib/flowy-database2/src/entities/filter_entities/select_option_filter.rs (+4 -2)
📝 frontend/rust-lib/flowy-database2/src/services/cell/cell_operation.rs (+4 -10)
📝 frontend/rust-lib/flowy-database2/src/services/cell/type_cell_data.rs (+2 -110)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_tests.rs (+3 -2)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_type_option_entities.rs (+2 -19)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/date_type_option/date_type_option_entities.rs (+1 -19)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/number_type_option/number_type_option_entities.rs (+1 -9)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/multi_select_type_option.rs (+0 -2)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/select_ids.rs (+11 -26)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/select_type_option.rs (+5 -11)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/text_type_option/text_type_option.rs (+1 -25)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option.rs (+5 -6)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/url_type_option/url_type_option_entities.rs (+1 -23)

📄 Description

  • TypeCellData is dead code. We use AnyMaps for serialization and deserialization when dealing with data storage and BoxAnys for generic in-memory storage instead now.
  • The DecodedCellData trait has been replaced with TypeOptionCellData whose contents are the same but is more thoroughly implemented (and actively used, in TypeOptionCellDataCompare)
  • FromCellString isn't required for the TypeOption::CellData type. We have replaced it with for<'a> From<&'a Cell>. As such, I've decided to remove this trait completely and let the individual cell data types that need this functionality implement the FromStr trait

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/4782 **Author:** [@richardshiue](https://github.com/richardshiue) **Created:** 2/29/2024 **Status:** ✅ Merged **Merged:** 2/29/2024 **Merged by:** [@richardshiue](https://github.com/richardshiue) **Base:** `main` ← **Head:** `chore/code-cleanup` --- ### 📝 Commits (2) - [`8a73010`](https://github.com/AppFlowy-IO/AppFlowy/commit/8a730104101adbd8b63a7310c654b532c6d94333) chore: remove dead code - [`63ec062`](https://github.com/AppFlowy-IO/AppFlowy/commit/63ec0623b9e4f045fe7a32cb33f1e6e7626d0ecc) chore: remove legacy FromCellStringTrait ### 📊 Changes **13 files changed** (+40 additions, -264 deletions) <details> <summary>View changed files</summary> 📝 `frontend/rust-lib/flowy-database2/src/entities/filter_entities/select_option_filter.rs` (+4 -2) 📝 `frontend/rust-lib/flowy-database2/src/services/cell/cell_operation.rs` (+4 -10) 📝 `frontend/rust-lib/flowy-database2/src/services/cell/type_cell_data.rs` (+2 -110) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_tests.rs` (+3 -2) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_type_option_entities.rs` (+2 -19) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/date_type_option/date_type_option_entities.rs` (+1 -19) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/number_type_option/number_type_option_entities.rs` (+1 -9) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/multi_select_type_option.rs` (+0 -2) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/select_ids.rs` (+11 -26) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/select_type_option.rs` (+5 -11) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/text_type_option/text_type_option.rs` (+1 -25) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option.rs` (+5 -6) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/url_type_option/url_type_option_entities.rs` (+1 -23) </details> ### 📄 Description - `TypeCellData` is dead code. We use `AnyMap`s for serialization and deserialization when dealing with data storage and `BoxAny`s for generic in-memory storage instead now. - The `DecodedCellData` trait has been replaced with `TypeOptionCellData` whose contents are the same but is more thoroughly implemented (and actively used, in `TypeOptionCellDataCompare`) - `FromCellString` isn't required for the `TypeOption::CellData` type. We have replaced it with `for<'a> From<&'a Cell>`. As such, I've decided to remove this trait completely and let the individual cell data types that need this functionality implement the `FromStr` trait ### 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:13 +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#6435
No description provided.