After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774034 - Schedule panel to update on task's due date change
Schedule panel to update on task's due date change
Status: RESOLVED FIXED
Product: gnome-todo
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME To Do maintainer(s)
GNOME To Do maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-11-07 07:58 UTC by Victor Toso
Modified: 2017-03-22 23:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scheduled-panel: All labels show in scheduled view (3.89 KB, patch)
2017-03-13 06:02 UTC, Aeden McClain
committed Details | Review

Description Victor Toso 2016-11-07 07:58:39 UTC
I went through the tasks that were pending from last week in order to mark them for this week or next week. The pane did not update when the due-date changed, only when I closed the edit-pane.

As I have changed several tasks without closing the edit-pane, I got really confused if my changes were saved or not.

We should update the Schedule panel as soon as a due-date changed.
Comment 1 Victor Toso 2016-11-07 22:43:48 UTC
Also and probably related, the following is true:

1) In Today panel, mark a task to tomorrow
2) Go to Schedule panel, the task is still on "Today" section although it has the correct date (tomorrow!)
Comment 2 Mohammed Sadiq 2016-11-25 05:53:20 UTC
(In reply to Victor Toso from comment #1)
> 1) In Today panel, mark a task to tomorrow
> 2) Go to Schedule panel, the task is still on "Today" section although it
> has the correct date (tomorrow!)

If gnome-todo is restarted after this, I see that the event due date have not changed, and it is still "Today".
Comment 3 Akarsha 2016-12-24 09:41:47 UTC
Hey, I am a newbie and wants to contribute. has this bug been fixed ? Can I work on this. If so, kindly give me some guidance on how to approach this.
Comment 4 Christian Stadelmann 2017-01-01 17:32:34 UTC
(In reply to Victor Toso from comment #0)
> I went through the tasks that were pending from last week in order to mark
> them for this week or next week. The pane did not update when the due-date
> changed, only when I closed the edit-pane.

This behavior might be intended because if you change a task due date and the sorting updates immediately, you might end up jumping around leaving you in either of these non-perfect situations:
1. The currently edited task may end up invisible, because it is part of a section which is not on the screen. The user will have to scroll up or down to find the task.
2. The currently edited task is still being visible and focused, but the view has jumped (scrolled up or down). The user will have to scroll up or down. Changing the view without a user requesting the change is a bad idea because users might be unable to follow.


(In reply to Victor Toso from comment #1)
> Also and probably related, the following is true:
> 
> 1) In Today panel, mark a task to tomorrow
> 2) Go to Schedule panel, the task is still on "Today" section although it
> has the correct date (tomorrow!)

I think that's the real bug here.


(In reply to Mohammed Sadiq from comment #2)
> If gnome-todo is restarted after this, I see that the event due date have
> not changed, and it is still "Today".

I can't confirm that. After restarting gnome-todo, the section is correct for me. Are you sure that gnome-todo was closed? Are you running gnome-todo 3.22.1 or a different version (which one?) ?


(In reply to Akarsha from comment #3)
> Hey, I am a newbie and wants to contribute. has this bug been fixed ?

Hi, nice to read that. This bug hasn't been fixed in 3.22.1. According to the git log on https://git.gnome.org/browse/gnome-todo/log/ (master) and https://git.gnome.org/browse/gnome-todo/log/?h=gnome-3-22 (3.22 branch), the bug hasn't been fixed yet. I'm referring to the bug as reported in comment #0 and comment #1.

> Can I work on this. If so, kindly give me some guidance on how to approach this.

I'm sorry, I can't help you with that.
Comment 5 Mohammed Sadiq 2017-01-02 01:30:18 UTC
(In reply to Christian Stadelmann from comment #4)

> (In reply to Mohammed Sadiq from comment #2)
> > If gnome-todo is restarted after this, I see that the event due date have
> > not changed, and it is still "Today".
> 
> I can't confirm that. After restarting gnome-todo, the section is correct
> for me. Are you sure that gnome-todo was closed? Are you running gnome-todo
> 3.22.1 or a different version (which one?) ?
> 

I can still reproduce this. I'm from git master. This may be because, the event is saved only if the edit-pane is closed. But in today panel, when the event is rescheduled, the edit-pane goes hidden, and the changes not get persistent. I don't know why you can't reproduce.
Comment 6 Aeden McClain 2017-03-13 06:02:21 UTC
Created attachment 347796 [details] [review]
scheduled-panel: All labels show in scheduled view

The panel was being sorted, but seemed to place tasks in random groups

The problem is that both dates and times were set for each task. This
breaks the labeling, as single day gaps between tasks could be
interpreted as less than a day due to the fact that only whole days are
counted in the current mechanism. This groups certain tasks together,
which places some under the wrong header.

The fix is to seperate the working date difference system from the
mechanism which adds labels to the far right side of the task. Since
this works for labelling the task as "Tomorrow" or "Today", it is
suitable for also managing which headers should be set for each task.
Comment 7 Georges Basile Stavracas Neto 2017-03-22 14:15:41 UTC
Review of attachment 347796 [details] [review]:

Looks very good - congratulations! Just two minor nitpicks, and it's ready to be merged

::: plugins/scheduled-panel/gtd-panel-scheduled.c
@@ +76,3 @@
+    {
+      *days_diff = g_date_time_difference (dt, today) / G_TIME_SPAN_DAY;
+    }

You can remove the brackets (one-line if()s don't need them)

@@ +81,3 @@
+    {
+      *next_year_diff = g_date_time_difference (next_year, today) / G_TIME_SPAN_DAY;
+    }

Ditto

@@ +87,3 @@
+  g_clear_pointer (&now, g_date_time_unref);
+
+  return;

Don't need the return here.
Comment 8 Georges Basile Stavracas Neto 2017-03-22 23:32:20 UTC
Thanks for the patch!