feat: add hide completed tasks button #54
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
edfloreshz/tasks!54
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
This PR adds toggle button to hide completed tasks. I added button next to the export button.
TODO:
[ ] Change icon
[ ] Use config state as fallback
@ -0,0 +27,4 @@pub enum Message {AddTask,Complete(DefaultKey, bool),Delete(DefaultKey),Only one thing, could you change this to
ToggleHideCompleted?@ -0,0 +85,4 @@.push(widget::text::title3(&list.name).width(Length::Fill)).push(hide_complete_button).push(export_button).into()You're using the same icon that's being used for the share button.
@ -0,0 +85,4 @@.push(widget::text::title3(&list.name).width(Length::Fill)).push(hide_complete_button).push(export_button).into()sorry, i forgot to mention it, I am not sure what icon should be used. I looked at cosmic-icons repository and couldn't find any that would suit. Maybe this shouldn't be a icon button at all, maybe i could move it view menu?
@ -0,0 +27,4 @@pub enum Message {AddTask,Complete(DefaultKey, bool),Delete(DefaultKey),done
@ -0,0 +85,4 @@.push(widget::text::title3(&list.name).width(Length::Fill)).push(hide_complete_button).push(export_button).into()I think having it in both places would be great, a global toggle that lives in the menu + the list toggle that overrides the global toggle.
@ -0,0 +85,4 @@.push(widget::text::title3(&list.name).width(Length::Fill)).push(hide_complete_button).push(export_button).into()sorry, i am new to rust and iced. If i understand correctly there should be flag in application state that would be updated from view and also possible persisted in some config/state, and flag on content state that would work on the list it has?
@ -0,0 +85,4 @@.push(widget::text::title3(&list.name).width(Length::Fill)).push(hide_complete_button).push(export_button).into()To clarify my previous request, I'm proposing a system with two levels of control for managing the visibility of completed tasks:
Application: I envision a menu item, specifically a checkbox, that governs a global configuration property. When this checkbox is enabled, the application would, by default, hide completed tasks in all task lists. This global preference would be persisted within the application's configuration files.
List-Specific: In addition to the global setting, each individual task list should feature its own toggle (similar to the one you previously implemented). This toggle would manage a list-specific setting for the visibility of completed tasks. This per-list setting would be saved within the configuration of that particular list.
@ -0,0 +85,4 @@.push(widget::text::title3(&list.name).width(Length::Fill)).push(hide_complete_button).push(export_button).into()Regardless of that, I think we can proceed with this PR and add the global config later on.
Please find an icon with an eye to symbolize what the button is doing and we can proceed with the merge.
I updated this so that it stores hide_completed flag in config, that part seems to be working, but i still don't know how to use config flag in content. Tomorrow I will try to solve that and to change icon to something meaningful. Also i just realized that maybe sending bool in Message is not best way because I could just do it in ApplicationAction::ToggleHideCompleted
Thanks! I just merged this in a separate PR 🎉
Pull request closed