[GH-ISSUE #1574] [FR] Clear value for date fields in grid/kanban #605

Closed
opened 2026-03-23 20:38:32 +00:00 by mirror · 21 comments
Owner

Originally created by @richardshiue on GitHub (Dec 15, 2022).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1574

Originally assigned to: @dejvizelo on GitHub.

Description

Most fields in the database allow you to clear the value, such as clearing out the text in a text field, or by deselecting all of the options. In date fields, however, the user is only permitted to change the date after setting it, or delete the entire row and recreate it.

Impact

Users wishing to clear the date field in their grid/kanban will be able to do so.

Additional Context

No response

Originally created by @richardshiue on GitHub (Dec 15, 2022). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1574 Originally assigned to: @dejvizelo on GitHub. ### Description Most fields in the database allow you to clear the value, such as clearing out the text in a text field, or by deselecting all of the options. In date fields, however, the user is only permitted to change the date after setting it, or delete the entire row and recreate it. ### Impact Users wishing to clear the date field in their grid/kanban will be able to do so. ### Additional Context _No response_
Author
Owner

@annieappflowy commented on GitHub (Dec 16, 2022):

TODO: Add a 'Clear' function for Date to allow users to clear the value entered into a Date cell

<!-- gh-comment-id:1354139200 --> @annieappflowy commented on GitHub (Dec 16, 2022): TODO: Add a 'Clear' function for Date to allow users to clear the value entered into a Date cell
Author
Owner

@hdjdoxDev commented on GitHub (Jan 11, 2023):

I would like to work on this issue!

<!-- gh-comment-id:1378095788 --> @hdjdoxDev commented on GitHub (Jan 11, 2023): I would like to work on this issue!
Author
Owner

@richardshiue commented on GitHub (Jan 11, 2023):

Hey @hdjdoxDev, thanks for offering to help on this. I've assigned the issue to you, hope to see your PR soon! If you have questions about the implementation, feel free to reach out to nathan on Discord.

<!-- gh-comment-id:1378393192 --> @richardshiue commented on GitHub (Jan 11, 2023): Hey @hdjdoxDev, thanks for offering to help on this. I've assigned the issue to you, hope to see your PR soon! If you have questions about the implementation, feel free to reach out to nathan on Discord.
Author
Owner

@hdjdoxDev commented on GitHub (Jan 11, 2023):

Hello @richardshiue Given that this would be my first contribution I will need some guidance, are you sure I can ask Nathan?

<!-- gh-comment-id:1379443491 --> @hdjdoxDev commented on GitHub (Jan 11, 2023): Hello @richardshiue Given that this would be my first contribution I will need some guidance, are you sure I can ask Nathan?
Author
Owner

@annieappflowy commented on GitHub (Jan 12, 2023):

Of course you can seek them for help!
Good luck and have fun

<!-- gh-comment-id:1379725305 --> @annieappflowy commented on GitHub (Jan 12, 2023): Of course you can seek them for help! Good luck and have fun
Author
Owner

@hdjdoxDev commented on GitHub (Jan 13, 2023):

I've started getting my hands dirty with the code. Unfortunately I couldn't completely solve the issue because I'm not so familiar with the architecture and bloc in particular.

  • added method clearValue to DateCellBloc (?)
  • added DateCellAccessory following PrimaryCellAccessory (need tooltips)
  • overridden accessoryBuilder of GridDateCell to return DateCellAccessory
  • some code style changes (not sure if they are welcome)
  • retrieve bloc instance in GridDateCell
  • solve a bug I found on show/hide behaviour of GridCellAccessory
<!-- gh-comment-id:1381296836 --> @hdjdoxDev commented on GitHub (Jan 13, 2023): I've started getting my hands dirty with the code. Unfortunately I couldn't completely solve the issue because I'm not so familiar with the architecture and bloc in particular. - [x] added method clearValue to DateCellBloc (?) - [x] added DateCellAccessory following PrimaryCellAccessory (need tooltips) - [x] overridden accessoryBuilder of GridDateCell to return DateCellAccessory - [x] some code style changes (not sure if they are welcome) - [ ] retrieve bloc instance in GridDateCell - [ ] solve a bug I found on show/hide behaviour of GridCellAccessory
Author
Owner

@richardshiue commented on GitHub (Jan 13, 2023):

Hey there @hdjdoxDev, glad to see progress. Do you think the accessory or an item in the menu would be better? I personally think that accessory would be too easy mis-click.

image

<!-- gh-comment-id:1381323509 --> @richardshiue commented on GitHub (Jan 13, 2023): Hey there @hdjdoxDev, glad to see progress. Do you think the accessory or an item in the menu would be better? I personally think that accessory would be too easy mis-click. ![image](https://user-images.githubusercontent.com/71320345/212242219-c598eeb4-e3b1-4668-a67b-555ccd7f1549.png)
Author
Owner

@annieappflowy commented on GitHub (Jan 13, 2023):

Hi @hdjdoxDev , you can seek help from @appflowy and @richardshiue on Discord. Happy coding and good luck!

<!-- gh-comment-id:1381395374 --> @annieappflowy commented on GitHub (Jan 13, 2023): Hi @hdjdoxDev , you can seek help from @appflowy and @richardshiue on Discord. Happy coding and good luck!
Author
Owner

@hdjdoxDev commented on GitHub (Jan 17, 2023):

Hi @richardshiue, I changed as you suggested but I still have some trouble following the bloc logic.
Now the button actually deselects the date in the Cal bloc but it does'n clear the value once the editor is deselected in the Cell bloc. My guess is that there is some null-safe logic that prevents changes but I still couldn't track it.

<!-- gh-comment-id:1386105174 --> @hdjdoxDev commented on GitHub (Jan 17, 2023): Hi @richardshiue, I changed as you suggested but I still have some trouble following the bloc logic. Now the button actually deselects the date in the Cal bloc but it does'n clear the value once the editor is deselected in the Cell bloc. My guess is that there is some null-safe logic that prevents changes but I still couldn't track it.
Author
Owner

@richardshiue commented on GitHub (Jan 19, 2023):

Hello @hdjdoxDev, from what I can see in your code, you are following the right bloc, but the event that you're firing is what is used by the backend to send information to the Flutter side and since the date isn't cleared in the backend, the date gets restored to the UI. It'd be better if you added a new DateCalEvent similar to setTime and handle that instead. As for clearing the date value in the backend, you can simply set it to none and use the existing selectDay/setTime functions.

<!-- gh-comment-id:1396320782 --> @richardshiue commented on GitHub (Jan 19, 2023): Hello @hdjdoxDev, from what I can see in your code, you are following the right bloc, but the event that you're firing is what is used by the backend to send information to the Flutter side and since the date isn't cleared in the backend, the date gets restored to the UI. It'd be better if you added a new `DateCalEvent` similar to `setTime` and handle that instead. As for clearing the date value in the backend, you can simply set it to none and use the existing selectDay/setTime functions.
Author
Owner

@richardshiue commented on GitHub (Mar 9, 2023):

Hey there @hdjdoxDev, have you been able to make some progress on this?

<!-- gh-comment-id:1461698588 --> @richardshiue commented on GitHub (Mar 9, 2023): Hey there @hdjdoxDev, have you been able to make some progress on this?
Author
Owner

@hdjdoxDev commented on GitHub (Mar 14, 2023):

Hi @richardshiue, I'm sorry I left you hanging, I was hoping to be assigned a mentor to help me catch up with some technical gaps.

I saw your edits to the last comment, it's is not so clear to me how to proceed after adding the const factory DateCalEvent.resetTime() = _ResetTime; line. Right now I'm looking into the freezed package and the app_flowy docs.

I don't know how much of a rush you have to get this issue solved, but with me it will take some time given my inexperience and small availability at the moment. Please consider reassigning this issue given the situation, either way I would be happy to keep exploring it till I get to the solution.

<!-- gh-comment-id:1468026218 --> @hdjdoxDev commented on GitHub (Mar 14, 2023): Hi @richardshiue, I'm sorry I left you hanging, I was hoping to be assigned a mentor to help me catch up with some technical gaps. I saw your edits to the last comment, it's is not so clear to me how to proceed after adding the `const factory DateCalEvent.resetTime() = _ResetTime;` line. Right now I'm looking into the freezed package and the app_flowy docs. I don't know how much of a rush you have to get this issue solved, but with me it will take some time given my inexperience and small availability at the moment. Please consider reassigning this issue given the situation, either way I would be happy to keep exploring it till I get to the solution.
Author
Owner

@richardshiue commented on GitHub (Mar 14, 2023):

Hey there @hdjdoxDev, I encourage you to keep trying. That's a good start, the next step is to handle it. Please feel free to reach me on Discord at Stormcheetah#4271

<!-- gh-comment-id:1468241739 --> @richardshiue commented on GitHub (Mar 14, 2023): Hey there @hdjdoxDev, I encourage you to keep trying. That's a good start, the next step is to handle it. Please feel free to reach me on Discord at Stormcheetah#4271
Author
Owner

@hdjdoxDev commented on GitHub (May 9, 2023):

Hello @richardshiue, I am sorry to say that I will be unable to keep following this issue at the moment. I hope to come back and really help in the future. Thank you for your time and the encouragement!

<!-- gh-comment-id:1540804807 --> @hdjdoxDev commented on GitHub (May 9, 2023): Hello @richardshiue, I am sorry to say that I will be unable to keep following this issue at the moment. I hope to come back and really help in the future. Thank you for your time and the encouragement!
Author
Owner

@richardshiue commented on GitHub (May 10, 2023):

Hey there @hdjdoxDev, thanks for the update, and for trying to tackle this feature! Of course, I look forward to you coming back some time, I'm sure there will be other issues that you can work on.

<!-- gh-comment-id:1541382419 --> @richardshiue commented on GitHub (May 10, 2023): Hey there @hdjdoxDev, thanks for the update, and for trying to tackle this feature! Of course, I look forward to you coming back some time, I'm sure there will be other issues that you can work on.
Author
Owner

@dejvizelo commented on GitHub (May 14, 2023):

I would like to work on this

<!-- gh-comment-id:1546784326 --> @dejvizelo commented on GitHub (May 14, 2023): I would like to work on this
Author
Owner

@dejvizelo commented on GitHub (Jun 4, 2023):

As for clearing the date value in the backend, you can simply set it to none and use the existing selectDay/setTime functions.

@richardshiue I'm new to the project and would appreciate a bit of help on this. Can you elaborate a bit more on what you said above? Right now I can't seem to figure out how to set the date value to none, and I don't understand why or how we need to use the existing selectDay/setTime functions.

<!-- gh-comment-id:1575309181 --> @dejvizelo commented on GitHub (Jun 4, 2023): > As for clearing the date value in the backend, you can simply set it to none and use the existing selectDay/setTime functions. @richardshiue I'm new to the project and would appreciate a bit of help on this. Can you elaborate a bit more on what you said above? Right now I can't seem to figure out how to set the date value to none, and I don't understand why or how we need to use the existing selectDay/setTime functions.
Author
Owner

@annieappflowy commented on GitHub (Jun 19, 2023):

Hi @dejvizelo , would you like to continue to work on this issue?

<!-- gh-comment-id:1596613598 --> @annieappflowy commented on GitHub (Jun 19, 2023): Hi @dejvizelo , would you like to continue to work on this issue?
Author
Owner

@dejvizelo commented on GitHub (Jun 21, 2023):

Hi @annieappflowy, I'm still working on this but work has stalled a bit at the moment because I am not very familiar with Rust. I'm still keeping contact with @richardshiue to try to find a good implementation for it. Sorry that it's taking so long

<!-- gh-comment-id:1600881501 --> @dejvizelo commented on GitHub (Jun 21, 2023): Hi @annieappflowy, I'm still working on this but work has stalled a bit at the moment because I am not very familiar with Rust. I'm still keeping contact with @richardshiue to try to find a good implementation for it. Sorry that it's taking so long
Author
Owner

@annieappflowy commented on GitHub (Jun 21, 2023):

Thanks @dejvizelo for the update. Keep going!

<!-- gh-comment-id:1600955492 --> @annieappflowy commented on GitHub (Jun 21, 2023): Thanks @dejvizelo for the update. Keep going!
Author
Owner

@dejvizelo commented on GitHub (Jul 5, 2023):

@annieappflowy PR is now ready

<!-- gh-comment-id:1622151012 --> @dejvizelo commented on GitHub (Jul 5, 2023): @annieappflowy PR is now ready
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#605
No description provided.