AppFlowy icon indicating copy to clipboard operation
AppFlowy copied to clipboard

feat: group by date

Open zoli opened this issue 2 years ago • 10 comments

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.

zoli avatar May 28 '23 18:05 zoli

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

appflowy avatar May 29 '23 02:05 appflowy

Hi @zoli. using the UpdateGroup event 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.

zoli avatar May 29 '23 10:05 zoli

Hi @zoli. using the UpdateGroup event 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.

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.

image

Still a work in progress.

appflowy avatar May 30 '23 00:05 appflowy

Made it draft because it has some bugs.

zoli avatar Jun 01 '23 05:06 zoli

@zoli FYI, the timezone ID of the date cell has been moved to the DateTypeOption (develop branch)

appflowy avatar Jun 02 '23 01:06 appflowy

I see two problems with grouping in general currently:

  1. On changing the page group by resets to group by status, the group by isn't preserved.
  2. On changing card group sometimes the card data (field) doesn't get updated immediately.

zoli avatar Jun 04 '23 06:06 zoli

@appflowy Is there something should I do for getting this merged?

zoli avatar Jul 02 '23 20:07 zoli

@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.

appflowy avatar Jul 03 '23 04:07 appflowy

Codecov Report

Merging #2641 (6e5450d) into main (9643315) will decrease coverage by 0.02%. The diff coverage is 0.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:

... and 1 file with indirect coverage changes

codecov[bot] avatar Jul 03 '23 06:07 codecov[bot]

Hey, @zoli . This PR conflicts with the main branch. You may need to fix it.

Done.

zoli avatar Jul 03 '23 06:07 zoli

Hey @zoli, seems the Rust-CI is failing can you take a look at this?

Xazin avatar Jul 14 '23 09:07 Xazin

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.

zoli avatar Jul 14 '23 11:07 zoli

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.

Xazin avatar Jul 14 '23 11:07 Xazin

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'"

zoli avatar Jul 14 '23 12:07 zoli

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:

  1. On changing the page group by resets to group by status, the group by isn't preserved.
  2. 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?

Xazin avatar Jul 14 '23 12:07 Xazin

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 avatar Jul 14 '23 13:07 zoli

@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.

image

appflowy avatar Jul 21 '23 01:07 appflowy

@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.

zoli avatar Jul 21 '23 10:07 zoli

Will also continue to implement changing group by condition (e.g. DateCondition) with this issue (#2734) probably after this.

zoli avatar Jul 21 '23 10:07 zoli