New page: all tasks
ClosedPublic

Authored by dfaure on Mar 21 2019, 10:57 PM.

Details

Summary

This page shows all tasks. It's especially useful to search for a task
that one forgot in which project it was classified.

Test Plan

Tests pass; zanshin shows new All Tasks page.
Adding and removing works.
One problem left: shall we disable Promote? The page shows no projects
so I think it's the wrong place for that, the task would just disappear.

Diff Detail

Repository
R4 Zanshin
Branch
2019_03_all_tasks
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10094
Build 10112: arc lint + arc unit
dfaure requested review of this revision.Mar 21 2019, 10:57 PM
dfaure created this revision.

I'm not sure the promotion a problem in practice in this view. Yes, the promoted task would disappear, but you'd have a project appearing instead and its children would still be there I guess. It's what I'd expect.

src/presentation/alltaskspagemodel.cpp
53

Not sure "Inbox" makes sense for the user here. It might not even end up in the inbox if we added under a parent who has a project.

src/presentation/availablepagesmodel.cpp
177

Kinda nitpicking, but I'd put this one last, although I see a need it's a bit of a corner case (or "last chance to find me") situation, I don't want it too prominently displayed.

Bonus point for reordering the member variable order, the initialization order and the conditions order (now that's my OCD speaking).

src/presentation/pagemodel.h
60

Since we really should get there I'm not sure the struct name is appropriate, I'd go for "TaskExtraData" or such.

tests/units/presentation/alltaskspagemodeltest.cpp
365

Aligning with my comment, maybe it'd benefit from having a test verifying it does the right thing on promote? Obvious potential mistake would be the promoted task disappearing and its children as well (while the children should still appear with a new project as extra info).

dfaure marked an inline comment as done.Mar 22 2019, 7:20 PM

OK, added promote. BTW the implementation of promoteItem() is exactly the same in all 5 page models, why not move it to the base class?

src/presentation/pagemodel.h
60

It's not that simple.

In inbox, workday and all tasks, we need a projects query and a contexts query.
In projects, we need a contexts query.
In contexts, we need a projects query.
(+ childTask in all projects)

Either this means we have 3 structs, to use the right one in the right place, or we have one struct with everything and sometimes an unused member.

Now I'm thinking about all this and writing it down, I guess a single struct is simpler and the waste (one pointer per item) is acceptable?

tests/units/presentation/alltaskspagemodeltest.cpp
365

I re-added the same test as in workday page.

But a test like the one you mention sounds more like a feature test, no?

IMHO there's too much mocking at this level for such a test to make sense here. It'll pass for sure even if something was broken, because the mocks would return the right thing anyway.

dfaure marked an inline comment as done.Mar 22 2019, 7:57 PM
dfaure added inline comments.
src/presentation/availablepagesmodel.cpp
177

Done. A bit reluctantly because I found it convenient at the top, but I agree with the reasoning -- for more orderly people at least :-)

dfaure updated this revision to Diff 54575.Mar 22 2019, 7:59 PM
dfaure marked an inline comment as done.

Add promote with unittest, remove Inbox in text, move All Tasks last

ervin added a comment.Mar 25 2019, 8:12 AM

I agree moving the promote implementation in the base class could make sense now. Rather in a separate commit though.

src/presentation/pagemodel.h
60

Yes, this is what I had in mind. One unused pointer is OK.

tests/units/presentation/alltaskspagemodeltest.cpp
365

Right, it's time to "demock" some of the tests. But that's for later.

dfaure updated this revision to Diff 54755.Mar 25 2019, 8:34 AM
dfaure marked 3 inline comments as done.

Rename TaskProjectData to TaskExtraData

ervin accepted this revision.Mar 25 2019, 9:55 AM
This revision is now accepted and ready to land.Mar 25 2019, 9:55 AM
dfaure closed this revision.Mar 25 2019, 11:31 AM