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

Expandable Tags entry in navigation #18607

Closed
Andreas-Kainz opened this issue Dec 30, 2019 · 8 comments
Closed

Expandable Tags entry in navigation #18607

Andreas-Kainz opened this issue Dec 30, 2019 · 8 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: tags needs info stale Ticket or PR with no recent activity

Comments

@Andreas-Kainz
Copy link

In Favorites you can pin folders and files. This work fine when you have an file hierarchy structure. together with automatic labeling and other stuff that will be possible with 18, it would be useful to favorite labels like an todo label. So you have all your stuff labels with todo with one click available.

Favorites

@jancborchardt
Copy link
Member

The "Tags" category should be expandable just like Favorites as well, showing the tags below it. Someone just has to implement it – it’s not planned yet so any help is welcome. :)

@jancborchardt jancborchardt changed the title favorites to labels Expandable Tags entry in navigation Dec 30, 2019
@jancborchardt jancborchardt added 1. to develop Accepted and waiting to be taken care of feature: tags help wanted and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Dec 30, 2019
@Andreas-Kainz
Copy link
Author

As favorite and shares are expandable, yes it would be good to have the sidebar consistent and make labels also consistent expandable.

@jancborchardt
Copy link
Member

@newhinton let me know if you need any input here! :) For the first iteration, it should definitely be single-select of tags only, that is clicking another tag should switch to that. Nothing more for the first version to keep it simple. :)

@skjnldsv skjnldsv added this to Legacy bugs in Files to vue via automation Jun 22, 2023
@skjnldsv skjnldsv moved this from Legacy bugs to Enhancements in Files to vue Jun 22, 2023
@skjnldsv
Copy link
Member

@jancborchardt considering this is directly the list of tags and that with 28 we now display them like folders, do we still want this?
I'm afraid this can easily get messy with too many tags :)
And the backend doesn't allow us to actually favorite tags 🤔

@skjnldsv skjnldsv added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed help wanted 1. to develop Accepted and waiting to be taken care of labels Sep 20, 2023
@jancborchardt
Copy link
Member

Does the backend directly know how many times a tag is used? Cause then we could show the top X tags in there for quick access.

@skjnldsv
Copy link
Member

I think there is a way, but it should be done async, as this could be expensive 🤔
@blizzz, do you know about this, how performant can this be?

public function getChildren(): array {
$user = $this->userSession->getUser();
$userFolder = null;
try {
if ($user) {
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
}
} catch (NoUserException) {
// will throw a Sabre exception in the next step.
}
if ($user === null || $userFolder === null) {
throw new Forbidden('Permission denied to read this collection');
}
$result = $this->systemTagsInFilesDetector->detectAssignedSystemTagsIn($userFolder, $this->mediaType);
$children = [];
foreach ($result as $tagData) {
$tag = new SystemTag((string)$tagData['id'], $tagData['name'], (bool)$tagData['visibility'], (bool)$tagData['editable']);
// read only, so we can submit the isAdmin parameter as false generally
$node = new SystemTagNode($tag, $user, false, $this->systemTagManager);
$node->setNumberOfFiles((int) $tagData['number_files']);
$node->setReferenceFileId((int) $tagData['ref_file_id']);
$children[] = $node;
}
return $children;
}

public function selectTagUsage(): self {
$this
->select('systemtag.name', 'systemtag.id', 'systemtag.visibility', 'systemtag.editable')
->selectAlias($this->createFunction('COUNT(filecache.fileid)'), 'number_files')
->selectAlias($this->createFunction('MAX(filecache.fileid)'), 'ref_file_id')
->from('filecache', 'filecache')
->leftJoin('filecache', 'systemtag_object_mapping', 'systemtagmap', $this->expr()->andX(
$this->expr()->eq('filecache.fileid', $this->expr()->castColumn('systemtagmap.objectid', IQueryBuilder::PARAM_INT)),
$this->expr()->eq('systemtagmap.objecttype', $this->createNamedParameter('files'))
))
->leftJoin('systemtagmap', 'systemtag', 'systemtag', $this->expr()->andX(
$this->expr()->eq('systemtag.id', 'systemtagmap.systemtagid'),
$this->expr()->eq('systemtag.visibility', $this->createNamedParameter(true))
))
->groupBy('systemtag.name', 'systemtag.id', 'systemtag.visibility', 'systemtag.editable');
return $this;
}

@blizzz
Copy link
Member

blizzz commented Sep 22, 2023

I think there is a way, but it should be done async, as this could be expensive 🤔 @blizzz, do you know about this, how performant can this be?

https://github.com/nextcloud/server/blob/master/apps/dav/lib/SystemTag/SystemTagsInUseCollection.php#L82-L107

https://github.com/nextcloud/server/blob/master/lib/private/Files/Cache/CacheQueryBuilder.php#L44-L61

This should be fine to be called (in a non-blocking way). It's also what the Photos app is doing, albeit limited to image mime types. If apps like recognize are used you may end up with a huge number of tags, I doubt if there is a benefit to show more than xty tags.

@nextcloud-command
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@nextcloud-command nextcloud-command added the stale Ticket or PR with no recent activity label Dec 10, 2023
@nextcloud-command nextcloud-command closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2023
Files to vue automation moved this from Enhancements to Done Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: tags needs info stale Ticket or PR with no recent activity
Projects
Status: Done
Files to vue
  
Done
Development

No branches or pull requests

5 participants