[PR #3051] [CLOSED] fix: sorting rows with cells that are empty #5538

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/3051
Author: @richardshiue
Created: 7/24/2023
Status: Closed

Base: mainHead: empty-cell-sort-fix-and-test


📝 Commits (4)

  • b9e8e59 fix: multiple sorts involving empty checkbox cells
  • e2aa3d4 test: add test to cover sorting with empty cells
  • c968b5c chore: remove deleted module
  • 4709cfc test: fix tests

📊 Changes

11 files changed (+138 additions, -107 deletions)

View changed files

📝 frontend/rust-lib/flowy-database2/src/services/sort/controller.rs (+60 -10)
📝 frontend/rust-lib/flowy-database2/tests/database/filter_test/checkbox_filter_test.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/tests/database/filter_test/checklist_filter_test.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/tests/database/filter_test/number_filter_test.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/tests/database/filter_test/select_option_filter_test.rs (+2 -2)
📝 frontend/rust-lib/flowy-database2/tests/database/filter_test/text_filter_test.rs (+1 -1)
📝 frontend/rust-lib/flowy-database2/tests/database/mock_data/grid_mock_data.rs (+4 -1)
frontend/rust-lib/flowy-database2/tests/database/sort_test/checkbox_and_text_test.rs (+0 -49)
📝 frontend/rust-lib/flowy-database2/tests/database/sort_test/mod.rs (+0 -1)
📝 frontend/rust-lib/flowy-database2/tests/database/sort_test/multi_sort_test.rs (+21 -23)
📝 frontend/rust-lib/flowy-database2/tests/database/sort_test/single_sort_test.rs (+47 -17)

📄 Description

When there are unchecked, initialized checkbox cells with empty cells, the empty cells are automatically sent to the end of the grid. Even when I add a second sort, say, by text, the empty cell will still be at the end even if it should've shifted up a bit.

There is quite a bit of extra code here, but unless we initialize every single checkbox cell, some extra logic is necessary.

Before:

https://github.com/AppFlowy-IO/AppFlowy/assets/71320345/a44f91cc-33f6-49d7-b4d5-d988118860ee

at 0:25, AB and AD are true, AE is false, and the others are empty. When I sort by checkbox, the natural order should be preserved instead of AE at the bottom. Worse still when I sort by Name, the order doesn't change

Feature Preview


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/3051 **Author:** [@richardshiue](https://github.com/richardshiue) **Created:** 7/24/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `empty-cell-sort-fix-and-test` --- ### 📝 Commits (4) - [`b9e8e59`](https://github.com/AppFlowy-IO/AppFlowy/commit/b9e8e5947c1350d7276f0d34051a1995eb77edc3) fix: multiple sorts involving empty checkbox cells - [`e2aa3d4`](https://github.com/AppFlowy-IO/AppFlowy/commit/e2aa3d4fb89dd570a746de0ed86d7f517e4ba5cd) test: add test to cover sorting with empty cells - [`c968b5c`](https://github.com/AppFlowy-IO/AppFlowy/commit/c968b5cda560aed3d34794154c7395722b542fb5) chore: remove deleted module - [`4709cfc`](https://github.com/AppFlowy-IO/AppFlowy/commit/4709cfc07d76f2fc29d4c541d19a2e84b07f841d) test: fix tests ### 📊 Changes **11 files changed** (+138 additions, -107 deletions) <details> <summary>View changed files</summary> 📝 `frontend/rust-lib/flowy-database2/src/services/sort/controller.rs` (+60 -10) 📝 `frontend/rust-lib/flowy-database2/tests/database/filter_test/checkbox_filter_test.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/tests/database/filter_test/checklist_filter_test.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/tests/database/filter_test/number_filter_test.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/tests/database/filter_test/select_option_filter_test.rs` (+2 -2) 📝 `frontend/rust-lib/flowy-database2/tests/database/filter_test/text_filter_test.rs` (+1 -1) 📝 `frontend/rust-lib/flowy-database2/tests/database/mock_data/grid_mock_data.rs` (+4 -1) ➖ `frontend/rust-lib/flowy-database2/tests/database/sort_test/checkbox_and_text_test.rs` (+0 -49) 📝 `frontend/rust-lib/flowy-database2/tests/database/sort_test/mod.rs` (+0 -1) 📝 `frontend/rust-lib/flowy-database2/tests/database/sort_test/multi_sort_test.rs` (+21 -23) 📝 `frontend/rust-lib/flowy-database2/tests/database/sort_test/single_sort_test.rs` (+47 -17) </details> ### 📄 Description When there are unchecked, initialized checkbox cells with empty cells, the empty cells are automatically sent to the end of the grid. Even when I add a second sort, say, by text, the empty cell will still be at the end even if it should've shifted up a bit. There is quite a bit of extra code here, but unless we initialize every single checkbox cell, some extra logic is necessary. Before: https://github.com/AppFlowy-IO/AppFlowy/assets/71320345/a44f91cc-33f6-49d7-b4d5-d988118860ee at 0:25, AB and AD are true, AE is false, and the others are empty. When I sort by checkbox, the natural order should be preserved instead of AE at the bottom. Worse still when I sort by Name, the order doesn't change ### 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 the [AppFlowy Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides) - [ ] 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. - [ ] 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:11 +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#5538
No description provided.