[PR #2953] [MERGED] feat: enable sort by date + sort fix #5496

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/2953
Author: @richardshiue
Created: 7/8/2023
Status: Merged
Merged: 7/21/2023
Merged by: @LucasXu0

Base: mainHead: date-sort


📝 Commits (5)

  • 415db64 feat: enable date sorting
  • 4d91290 fix: checkbox sorting with empty cells
  • 224a6f7 test: fix this
  • 4d6cca9 test: fix 'em for real this time
  • fec7122 fix: multi-sort logic

📊 Changes

16 files changed (+178 additions, -101 deletions)

View changed files

📝 frontend/appflowy_flutter/integration_test/database_sort_test.dart (+53 -52)
📝 frontend/appflowy_flutter/lib/plugins/database_view/application/field/field_controller.dart (+1 -0)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_type_option.rs (+4 -0)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/checklist_type_option/checklist.rs (+4 -0)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/date_type_option/date_type_option.rs (+4 -0)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/number_type_option/number_type_option.rs (+4 -0)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/multi_select_type_option.rs (+4 -0)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/single_select_type_option.rs (+4 -0)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/text_type_option/text_type_option.rs (+4 -0)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option.rs (+2 -0)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option_cell.rs (+29 -3)
📝 frontend/rust-lib/flowy-database2/src/services/field/type_options/url_type_option/url_type_option.rs (+5 -0)
📝 frontend/rust-lib/flowy-database2/src/services/sort/controller.rs (+43 -30)
📝 frontend/rust-lib/flowy-database2/tests/database/sort_test/checkbox_and_text_test.rs (+3 -6)
📝 frontend/rust-lib/flowy-database2/tests/database/sort_test/multi_sort_test.rs (+8 -4)
📝 frontend/rust-lib/flowy-database2/tests/database/sort_test/single_sort_test.rs (+6 -6)

📄 Description

The logic for date sorting is already there. This PR primarily addreses the problem of empty cells being included in the sort. They should now be placed at the very bottom

TODO: fix regression: checkbox field not being sorted properly. The cell data is initially empty when created so it's automatically moved to the bottom, which isn't the desired behavior when the sort is Ascending (edit: done)

TODO: fix multi-sort logic (edit: done)

Feature Preview

resolves #2775


PR Checklist

  • My code adheres to the AppFlowy Style Guide
  • 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/2953 **Author:** [@richardshiue](https://github.com/richardshiue) **Created:** 7/8/2023 **Status:** ✅ Merged **Merged:** 7/21/2023 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `date-sort` --- ### 📝 Commits (5) - [`415db64`](https://github.com/AppFlowy-IO/AppFlowy/commit/415db644ed900bb3b4a9ef9eeed53efb41129a01) feat: enable date sorting - [`4d91290`](https://github.com/AppFlowy-IO/AppFlowy/commit/4d9129037d2db42754a76a249d10ee96ccf57602) fix: checkbox sorting with empty cells - [`224a6f7`](https://github.com/AppFlowy-IO/AppFlowy/commit/224a6f766a2aa284a7286f24cb70a02136345e56) test: fix this - [`4d6cca9`](https://github.com/AppFlowy-IO/AppFlowy/commit/4d6cca983fcfd28c2d8aab5554fd9f00b56edc79) test: fix 'em for real this time - [`fec7122`](https://github.com/AppFlowy-IO/AppFlowy/commit/fec712293409c098b93bbf46ef6c523990d77e3d) fix: multi-sort logic ### 📊 Changes **16 files changed** (+178 additions, -101 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/integration_test/database_sort_test.dart` (+53 -52) 📝 `frontend/appflowy_flutter/lib/plugins/database_view/application/field/field_controller.dart` (+1 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/checkbox_type_option/checkbox_type_option.rs` (+4 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/checklist_type_option/checklist.rs` (+4 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/date_type_option/date_type_option.rs` (+4 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/number_type_option/number_type_option.rs` (+4 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/multi_select_type_option.rs` (+4 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/selection_type_option/single_select_type_option.rs` (+4 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/text_type_option/text_type_option.rs` (+4 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option.rs` (+2 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/type_option_cell.rs` (+29 -3) 📝 `frontend/rust-lib/flowy-database2/src/services/field/type_options/url_type_option/url_type_option.rs` (+5 -0) 📝 `frontend/rust-lib/flowy-database2/src/services/sort/controller.rs` (+43 -30) 📝 `frontend/rust-lib/flowy-database2/tests/database/sort_test/checkbox_and_text_test.rs` (+3 -6) 📝 `frontend/rust-lib/flowy-database2/tests/database/sort_test/multi_sort_test.rs` (+8 -4) 📝 `frontend/rust-lib/flowy-database2/tests/database/sort_test/single_sort_test.rs` (+6 -6) </details> ### 📄 Description The logic for date sorting is already there. This PR primarily addreses the problem of empty cells being included in the sort. They should now be placed at the very bottom TODO: fix regression: checkbox field not being sorted properly. The cell data is initially empty when created so it's automatically moved to the bottom, which isn't the desired behavior when the sort is Ascending (edit: done) TODO: fix multi-sort logic (edit: done) ### Feature Preview resolves #2775 --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [x] My code adheres to the [AppFlowy Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides) - [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:19: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#5496
No description provided.