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

Added support for task pinning #695

Merged
merged 5 commits into from Oct 31, 2019
Merged

Added support for task pinning #695

merged 5 commits into from Oct 31, 2019

Conversation

timholl
Copy link
Contributor

@timholl timholl commented Oct 30, 2019

Implements #694

@codecov
Copy link

codecov bot commented Oct 30, 2019

Codecov Report

Merging #695 into master will increase coverage by 0.25%.
The diff coverage is 21.21%.

@@            Coverage Diff             @@
##           master     #695      +/-   ##
==========================================
+ Coverage   10.89%   11.14%   +0.25%     
==========================================
  Files          44       44              
  Lines        2020     2045      +25     
  Branches      360      366       +6     
==========================================
+ Hits          220      228       +8     
- Misses       1668     1683      +15     
- Partials      132      134       +2

@timholl
Copy link
Contributor Author

timholl commented Oct 30, 2019

Pinned state can be toggled by clicking on the pin icon next to the star

detail

detail2

Pinned tasks also get an additional icon in the list view
list

@raimund-schluessler
Copy link
Member

Thanks for the contribution.

Regarding the feature:
This feature has no effect in the web interface. Toggling the pinned state does not change anything and only has an effect for users of the OpenTasks app. Considering this, the implementation is quite prominent in the web interface. I wonder whether we can realise this a bit more unobtrusively. @nextcloud/designers @jancborchardt Any opinion?

Regarding the code:
It looks very good and clean 👍 You only need to signoff your commit, see https://github.com/nextcloud/tasks/pull/695/checks?check_run_id=282263610

@raimund-schluessler
Copy link
Member

We could also try to add some benefit for the web interface. E.g. show a pinned task always at the top of a list.

Signed-off-by: Tim Hollmann <github.fe8c53c0@mail.tim-hollmann.de>
Signed-off-by: Tim Hollmann <github.fe8c53c0@mail.tim-hollmann.de>
@timholl
Copy link
Contributor Author

timholl commented Oct 30, 2019

We could also try to add some benefit for the web interface. E.g. show a pinned task always at the top of a list.

Sounds like a good idea to me, implemented that prematurely.

ordering-new

timholl and others added 2 commits October 30, 2019 21:39
Signed-off-by: Tim Hollmann <github.fe8c53c0@mail.tim-hollmann.de>
Co-Authored-By: John Molakvoæ <skjnldsv@users.noreply.github.com>
Signed-off-by: Tim Hollmann <github.fe8c53c0@mail.tim-hollmann.de>
@timholl
Copy link
Contributor Author

timholl commented Oct 30, 2019

To justify myself a litte for https://github.com/nextcloud/tasks/pull/695/files#diff-88cbe2e916273c5c244516d0ec6b33ffR756-R757 :

I had a little struggle with the icons since I added two and as a side-effect the big star icon (and the new pin) did not work anymore.
I figured out that was because the sprite was resized from 5x5 to 6x5.
No problem for svg-sprite module to find the correct positions in CSS, but the 1.5-upscaling of the background for .star.icon-bw class was hardcoded in the CSS for 5x5 (to 120px 120px) and also for .star.icon-color. Had to take that numbers apart and put them humpty-dumpty back together for 6x5 (kinda "improved" it by using auto for the second parameter so there is just one hardcoded number left).

Maybe one could find a more conceptual solution for this in the future than incrementing a hardcoded number ^^

@raimund-schluessler
Copy link
Member

See my two comments, I think we are good after that.

@raimund-schluessler
Copy link
Member

To justify myself a litte for https://github.com/nextcloud/tasks/pull/695/files#diff-88cbe2e916273c5c244516d0ec6b33ffR756-R757 :

I had a little struggle with the icons since I added two and as a side-effect the big star icon (and the new pin) did not work anymore.
I figured out that was because the sprite was resized from 5x5 to 6x5.
No problem for svg-sprite module to find the correct positions in CSS, but the 1.5-upscaling of the background for .star.icon-bw class was hardcoded in the CSS for 5x5 (to 120px 120px) and also for .star.icon-color. Had to take that numbers apart and put them humpty-dumpty back together for 6x5 (kinda "improved" it by using auto for the second parameter so there is just one hardcoded number left).

Maybe one could find a more conceptual solution for this in the future than incrementing a hardcoded number ^^

Don't worry, I will have a look at this in a follow-up PR. We will move the header to flex-box then this should not be necessary anymore.

Co-Authored-By: Raimund Schlüßler <raimund.schluessler@mailbox.org>
Signed-off-by: Tim Hollmann <github.fe8c53c0@mail.tim-hollmann.de>
@raimund-schluessler
Copy link
Member

I had a little struggle with the icons since I added two and as a side-effect the big star icon (and the new pin) did not work anymore.
I figured out that was because the sprite was resized from 5x5 to 6x5.
No problem for svg-sprite module to find the correct positions in CSS, but the 1.5-upscaling of the background for .star.icon-bw class was hardcoded in the CSS for 5x5 (to 120px 120px) and also for .star.icon-color. Had to take that numbers apart and put them humpty-dumpty back together for 6x5 (kinda "improved" it by using auto for the second parameter so there is just one hardcoded number left).

I only now got what you meant. This is indeed not really nice, but I couldn't find any other solution so far. And obviously, flex-box won't do much about it.

@raimund-schluessler
Copy link
Member

I tend to reduce the pin size down to a normal icon (16px x 16px), but let's discuss this in a later PR.

@raimund-schluessler raimund-schluessler merged commit c35b04f into nextcloud:master Oct 31, 2019
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.

None yet

3 participants