[PR #4691] [MERGED] fix: disappearing sorts #6390

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

📋 Pull Request Information

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

Base: mainHead: fix/disappearing-sorts


📝 Commits (3)

  • cc401e8 chore: just copy the FieldType
  • 4ab3a68 chore: don't store field type in Sort
  • ab087be fix: sorts disappearing

📊 Changes

20 files changed (+43 additions, -61 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/plugins/database/application/field/field_controller.dart (+7 -5)
📝 frontend/appflowy_flutter/lib/plugins/database/application/sort/sort_service.dart (+0 -2)
📝 frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_service.ts (+0 -2)
📝 frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_types.ts (+1 -3)
📝 frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortFieldsMenu.tsx (+0 -1)
📝 frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortItem.tsx (+0 -1)
📝 frontend/rust-lib/flowy-database2/src/entities/field_entities.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/src/entities/sort_entities.rs (+2 -11)
📝 frontend/rust-lib/flowy-database2/src/event_handler.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/src/services/database/database_editor.rs (+2 -2)
📝 frontend/rust-lib/flowy-database2/src/services/database_view/view_editor.rs (+8 -3)
📝 frontend/rust-lib/flowy-database2/src/services/field/field_builder.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option.rs (+2 -2)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option_cell.rs (+2 -2)
📝 frontend/rust-lib/flowy-database2/src/services/group/controller.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/src/services/share/csv/import.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/src/services/sort/controller.rs (+9 -1)
📝 frontend/rust-lib/flowy-database2/src/services/sort/entities.rs (+4 -19)
📝 frontend/rust-lib/flowy-database2/tests/database/field_test/script.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/tests/database/sort_test/script.rs (+0 -1)

📄 Description

The sort struct contains a field type that is used to determine which type option handler should be created. When switching the field type, we need to update it as well. If it doesn't get updated, the sort simply "disappears" on the frontend, as shown below.

We can keep it simple by getting the field type from the field and sort using it.

Also change some instances of &FieldType to just simply FieldType. It has Copy derived and has a u8 repr

https://github.com/AppFlowy-IO/AppFlowy/assets/71320345/abf771b7-a51c-415f-b39c-0405fbac3428

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/4691 **Author:** [@richardshiue](https://github.com/richardshiue) **Created:** 2/21/2024 **Status:** ✅ Merged **Merged:** 2/21/2024 **Merged by:** [@richardshiue](https://github.com/richardshiue) **Base:** `main` ← **Head:** `fix/disappearing-sorts` --- ### 📝 Commits (3) - [`cc401e8`](https://github.com/AppFlowy-IO/AppFlowy/commit/cc401e8e9747fc581d420eef004fe263d33c81b9) chore: just copy the FieldType - [`4ab3a68`](https://github.com/AppFlowy-IO/AppFlowy/commit/4ab3a68db5344fef9450602ae76a710b0b3487f5) chore: don't store field type in Sort - [`ab087be`](https://github.com/AppFlowy-IO/AppFlowy/commit/ab087be5546bad960a4508b88af43ad973f9d6f7) fix: sorts disappearing ### 📊 Changes **20 files changed** (+43 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/plugins/database/application/field/field_controller.dart` (+7 -5) 📝 `frontend/appflowy_flutter/lib/plugins/database/application/sort/sort_service.dart` (+0 -2) 📝 `frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_service.ts` (+0 -2) 📝 `frontend/appflowy_tauri/src/appflowy_app/application/database/sort/sort_types.ts` (+1 -3) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortFieldsMenu.tsx` (+0 -1) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/database/components/sort/SortItem.tsx` (+0 -1) 📝 `frontend/rust-lib/flowy-database2/src/entities/field_entities.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/src/entities/sort_entities.rs` (+2 -11) 📝 `frontend/rust-lib/flowy-database2/src/event_handler.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/src/services/database/database_editor.rs` (+2 -2) 📝 `frontend/rust-lib/flowy-database2/src/services/database_view/view_editor.rs` (+8 -3) 📝 `frontend/rust-lib/flowy-database2/src/services/field/field_builder.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option.rs` (+2 -2) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option_cell.rs` (+2 -2) 📝 `frontend/rust-lib/flowy-database2/src/services/group/controller.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/src/services/share/csv/import.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/src/services/sort/controller.rs` (+9 -1) 📝 `frontend/rust-lib/flowy-database2/src/services/sort/entities.rs` (+4 -19) 📝 `frontend/rust-lib/flowy-database2/tests/database/field_test/script.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/tests/database/sort_test/script.rs` (+0 -1) </details> ### 📄 Description The sort struct contains a field type that is used to determine which type option handler should be created. When switching the field type, we need to update it as well. If it doesn't get updated, the sort simply "disappears" on the frontend, as shown below. We can keep it simple by getting the field type from the field and sort using it. Also change some instances of `&FieldType` to just simply `FieldType`. It has `Copy` derived and has a `u8` repr https://github.com/AppFlowy-IO/AppFlowy/assets/71320345/abf771b7-a51c-415f-b39c-0405fbac3428 ### 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) - [ ] 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:01 +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#6390
No description provided.