Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the pane's filter when updating the start date of a task #1059

Merged

Conversation

SqAtx
Copy link
Contributor

@SqAtx SqAtx commented Mar 10, 2024

Fixes #1039

Updating the start date of a task may influence whether or not it needs to be visible. For example, if you're on the Actionable pane and you set the start date of a task to some time in the future, then the task is no longer actionable and needs to disappear from that view.

Testing by having some tasks in the Actionable pane, then verifying that the following make the task disappear from the pane:

  • click on a task and then on Start Tomorrow
  • right-click on a task > Set Start Date > "anything in the future"
  • double-click on a task > modify "Starts on" to a date in the future > close task editor
  • create a new task > without closing the editor, add a child to it > click on child > click on Open Parent

@@ -1041,6 +1046,11 @@ def update_start_to_next_day(self, day_number):
for task in self.get_pane().get_selection():
task.date_start = next_day

# Changing the start date of a task may take it out of the current pane
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we're again running into the fact that the same functionality (updating the start date of a task) is implemented in two different methods (update_start_date() and update_start_to_next_day()).

I'd like to have one call the other instead, but that's not really related to the current change so I didn't include it here.

.gitignore Outdated Show resolved Hide resolved
@diegogangl
Copy link
Contributor

Looks good, except for a couple nitpicks and it works. Thanks! There's one part missing though, if the start date is changed in the task editor using the calendar widget. Maybe we should call refresh() when the window is destoryed?

@SqAtx
Copy link
Contributor Author

SqAtx commented Mar 17, 2024

There's one part missing though, if the start date is changed in the task editor using the calendar widget. Maybe we should call refresh() when the window is destoryed?

Good point! I actually noticed that earlier this week too, but didn't have time to look into it further. Will do.

@SqAtx SqAtx marked this pull request as draft March 17, 2024 01:46
@SqAtx SqAtx force-pushed the fix_actionable_view_refresh branch from 1dfb459 to c2ed5b0 Compare March 17, 2024 02:00
@SqAtx
Copy link
Contributor Author

SqAtx commented Mar 17, 2024

I also added a .refresh() to TaskEditor.destruction(). I was originally wondering if I shouldn't add it to Application.close_task(), whose docstring is "Close a task editor window."

But destruction() is linked to the "close-request" callback of the editor, so I think it makes most sense there.

@SqAtx SqAtx marked this pull request as ready for review March 17, 2024 02:10
@diegogangl
Copy link
Contributor

Looks good now 👍
Merging

@diegogangl diegogangl merged commit 6ceec80 into getting-things-gnome:master Mar 18, 2024
1 check failed
@SqAtx SqAtx deleted the fix_actionable_view_refresh branch May 25, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing Start Date doesn't remove task from Actionable view
2 participants