Uh oh!
There was an error while loading. Please reload this page.
Let apps toggle an unread counter on app icons - #26939
Conversation
| export const setUp = () => { | ||
| Object.assign(OC, { | ||
| setNavigationCounter(id, counter) { |
There was a problem hiding this comment.
I'm a bit undecided on the approach to take here, maybe we should rather listen to an event that might be emitted then by the apps through the event bus?
There was a problem hiding this comment.
I'd advocate against the global variable approach, at least form an app API perspective. We can hide this in yet another @nextcloud/xyz package or add it to an existing one. Then we can also later on change the way this action propagates from an app to the server component.
There was a problem hiding this comment.
OK, then lets keep the OC.setNavigationCounter for use in the additional package then which we then can use for offering a stable API. Unfortunately I don't think we have any fitting package for that already so it would need an additional one.
jancborchardt
commented
May 11, 2021
For reference what I also said in the chat:
In the notifications app we provide 2 icons, 1 regular and 1 with dot. We could do the same with the app icons as well, and standardize the position and size via recommendation. That way we can also achieve the cut-out border for the dot which is difficult to do via CSS because we have a fade in the header. |
blizzz
commented
Jun 2, 2021
what's the state here? moving to 23? |
7db0abe to
8818011Compare8818011 to
d563317Comparejuliusknorr
commented
Jun 10, 2021
Ready review, we'd still need this for 22. |
blizzz
commented
Jun 10, 2021
CI is unhappy |
Uh oh!
There was an error while loading. Please reload this page.
489f341 to
a73b6aaComparea73b6aa to
a0f081dComparejuliusknorr
commented
Jun 16, 2021
Pushed another fix for the tests, waiting for CI to pass |
blizzz
commented
Jun 16, 2021
CI is unhappy |
Co-authored-by: Louis Chemineau <louis@chmn.me> Signed-off-by: Julius Härtl <jus@bitgrid.net>
a0f081d to
a942364Compare
The count value is currently hidden as we don't want to clutter the UI too much, but might be useful at some point.
It can either be updated during page load through the navigation manager
$navigationManager->setUnreadCounter('activity', 10);or through JavaScript by callingOC.setNavigationCounter('deck', 123)