feat: group by date
https://github.com/AppFlowy-IO/AppFlowy/assets/3286303/47a98501-aebf-4856-a8ac-856ebc6e65ac
Feature Preview
resolves #1174
Currently, it defaults to group by date relative, Supporting group by date month, week, etc needs some changes in frontend which I think will be better to do in a separate PR alongside the hide_empty group config.
PR Checklist
- [x] My code adheres to the AppFlowy Style Guide
- [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.
Hi @zoli. using the UpdateGroup event can hide the group. I implement the event in this PR https://github.com/AppFlowy-IO/AppFlowy/pull/2640
Hi @zoli. using the
UpdateGroupevent can hide the group. I implement the event in this PR #2640
Hi @appflowy. Correct me if I'm wrong, but from what I understand there is still a need for the frontend to send more data than just field id and field type (_groupBackendSvc.groupByField(fieldId: fieldId, fieldType: fieldType);). It also should send the hide_empty flag. Then on generating groups, Will set the visible property based on the hide_empty flag.
Now with the UpdateGroup it's possible to support each group visibility and also the hide_empty flag.
Hi @zoli. using the
UpdateGroupevent can hide the group. I implement the event in this PR #2640Hi @appflowy. Correct me if I'm wrong, but from what I understand there is still a need for the frontend to send more data than just field id and field type (
_groupBackendSvc.groupByField(fieldId: fieldId, fieldType: fieldType);). It also should send thehide_emptyflag. Then on generating groups, Will set the visible property based on thehide_emptyflag.Now with the
UpdateGroupit's possible to support each group visibility and also thehide_emptyflag.
Yep. If we don't modify the codebase. We can create a new event that update the group setting. Then the frontend just need to call that event.
Still a work in progress.
Made it draft because it has some bugs.
@zoli FYI, the timezone ID of the date cell has been moved to the DateTypeOption (develop branch)
I see two problems with grouping in general currently:
- On changing the page group by resets to group by status, the group by isn't preserved.
- On changing card group sometimes the card data (field) doesn't get updated immediately.
@appflowy Is there something should I do for getting this merged?
@appflowy Is there something should I do for getting this merged?
Hey, @zoli . This PR conflicts with the main branch. You may need to fix it.
Codecov Report
Merging #2641 (6e5450d) into main (9643315) will decrease coverage by
0.02%. The diff coverage is0.00%.
@@ Coverage Diff @@
## main #2641 +/- ##
==========================================
- Coverage 69.86% 69.85% -0.02%
==========================================
Files 445 445
Lines 21111 21112 +1
==========================================
- Hits 14750 14747 -3
- Misses 6361 6365 +4
| Flag | Coverage Δ | |
|---|---|---|
| appflowy_flutter_integrateion_test | 67.41% <0.00%> (-0.02%) |
:arrow_down: |
| appflowy_flutter_unit_test | 12.87% <0.00%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files Changed | Coverage Δ | |
|---|---|---|
| ...ns/database_view/application/field/field_info.dart | 75.86% <0.00%> (-2.71%) |
:arrow_down: |
Hey, @zoli . This PR conflicts with the main branch. You may need to fix it.
Done.
Hey @zoli, seems the Rust-CI is failing can you take a look at this?
Hey @zoli, seems the Rust-CI is failing can you take a look at this?
Hey, I don't think it's because of this PR. It panicked on compiling one of the dependencies (collab-sync). Probably a retry would fix it.
Hey @zoli, seems the Rust-CI is failing can you take a look at this?
Hey, I don't think it's because of this PR. It panicked on compiling one of the dependencies (collab-sync). Probably a retry would fix it.
Before commenting I retried the failing job, I can try again.
Hey @zoli, seems the Rust-CI is failing can you take a look at this?
Hey, I don't think it's because of this PR. It panicked on compiling one of the dependencies (collab-sync). Probably a retry would fix it.
Before commenting I retried the failing job, I can try again.
I ran the tests in my system and they all passed.
Also this time it's another error. And still seems not related to the PR.
"##[error]No space left on device : '/home/runner/runners/2.306.0/_diag/pages/985238b1-0d55-4b90-b8d4-ab203e756459_cf879ef8-fc4e-5b5b-730d-0d1de1d4b2df_1.log'"
Yeah, it's looking a bit weird. I'm going to take a look at it.
I see two problems with grouping in general currently:
- On changing the page group by resets to group by status, the group by isn't preserved.
- On changing card group sometimes the card data (field) doesn't get updated immediately.
Is the above two points something you'll be working on? Or will you create a separate issue for these?
Is the above two points something you'll be working on? Or will you create a separate issue for these?
About the first one I was wondering is it intended or not. I think its better to resolve them in another PR. If they are both confirmed bugs (the second one definitely is) I will create separate issue for each of them.
@zoli, I think I made a mistake in the issue description. I've been wondering if we can transform the date group to match the style used by Notion.
@zoli, I think I made a mistake in the issue description. I've been wondering if we can transform the date group to match the style used by Notion.
@appflowy, If by Notion style you mean the group names e.g. "Last 30 days", "Next 7 days", etc. It is like Notion style already. Check group_name_from_id function. If the DateCondition is equal to DateCondition::Relative which is by default, it will result in groups with relative date names. However, the group id will be the beginning of the range so when we move a row from other groups to another the date will change to the group id which is moved to.
Will also continue to implement changing group by condition (e.g. DateCondition) with this issue (#2734) probably after this.