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

Add shortcut to "Show only unread articles" in the toolbar #1262

Merged
merged 2 commits into from
Sep 13, 2023

Conversation

mkanilsson
Copy link
Contributor

@mkanilsson mkanilsson commented Sep 11, 2023

This PR adds a shortcut to "Show only unread articles" in the toolbar.

The shortcut isn't visible when "All unread items" and "Starred items" is open, because they ignore that option.

This was discussed in #1026.

Screenshot:

@David-Development
Copy link
Member

That was fast! Looks great! Thank you so much!

Quick review: Every time you start the app the setting is currently toggled 😅 (since you call the update updateToggleUnreadItem when the menu item is initialized which toggles it).

I'm also wondering if we should hide it in case the user selects the "All unread articles"? The app launches in that screen by default and it is kind of confusing to be in a view "all unread articles" but it gives you the option to toggle "show only unread articles"..

@mkanilsson
Copy link
Contributor Author

Every time you start the app the setting is currently toggled 😅

Whoops! This has been fixed!

I'm also wondering if we should hide it in case the user selects the "All unread articles"?

My lack of android development and inexperience with the code base is halting me, how do I get the name/id of the current folder?

I've also noticed that if "Show only unread articles" is enabled, folders which doesn't have any unread articles are hidden, meaning that if all your folders are all read, switching the to a folder would require going from All unread items -> Starred items then to the toolbar and changing the setting then it's possible to go to said folder.

Another note, I'm afraid that dropping the option from the settings page will confuse users, especially if all folder are read(see previous paragraph), is there a way to notify them?

@David-Development
Copy link
Member

@mkanilsson Terrific!

how do I get the name/id of the current folder?

Inside the NewsReaderListActivity there is already an example of how to access it (probably makes sense to put the update logic for the menu item in there as well). (It should be hidden in the All Unread Items and Starred Items - because the Starred Items will show all starred items regardless of there read status).


I've also noticed that if "Show only unread articles" is enabled, folders which doesn't have any unread articles are hidden, meaning that if all your folders are all read, switching the to a folder would require going from All unread items -> Starred items then to the toolbar and changing the setting then it's possible to go to said folder.

Good point. Maybe we should keep the setting in the Settings page as a fallback? So it would just be a shortcut which would improve the accessibility for this feature..?

folders which doesn't have any unread articles are hidden

Good catch - so the sidebar needs to be updated once the toggle is used

Bumps com.diffplug.spotless from 6.19.0 to 6.21.0.

---
updated-dependencies:
- dependency-name: com.diffplug.spotless
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@mkanilsson
Copy link
Contributor Author

@David-Development Everything's done now!

Good point. Maybe we should keep the setting in the Settings page as a fallback? So it would just be a shortcut which would improve the accessibility for this feature..?

That commit has been reverted. The option is back in the settings page (as well as in the toolbar).

Inside the NewsReaderListActivity there is already an example of how to access it

Funny that I missed it in the file I was working in 😄

I couldn't get it to update the MenuItem in updateDetailFragmentTitle (the method you linked me to), it seems that updateDetailFragmentTitle is only called once (when the toolbar is first loaded), however, updateDetailFragment is called every time a users switches folder / feed, so I put the update code there instead.

@mkanilsson mkanilsson changed the title Move "Show only unread articles" to toolbar Add shortcut to "Show only unread articles" in the toolbar Sep 12, 2023
@David-Development
Copy link
Member

@mkanilsson Awesome! Just tested it on my phone and it looks fabulous! I really like the feature!

One bug that noticed during testing - when you open a folder or a feed and you click on an article and navigate back, the menu item is missing.

@mkanilsson
Copy link
Contributor Author

@David-Development Fixed!

This patch moves "Show only unread articles" to the toolbar, inside the
three dots as discussed in nextcloud#1026

Signed-off-by: Marcus Nilsson <marcus.nilsson@genarp.com>
@David-Development
Copy link
Member

@mkanilsson Looks fantastic to me! Thank you so much!

@David-Development David-Development merged commit 813e447 into nextcloud:master Sep 13, 2023
9 checks passed
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.

2 participants