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

Implement Tag Filters! #73

Merged
merged 3 commits into from
Jan 16, 2019
Merged

Implement Tag Filters! #73

merged 3 commits into from
Jan 16, 2019

Conversation

cal2195
Copy link
Collaborator

@cal2195 cal2195 commented Jan 4, 2019

In preparation for #53 and #13, this PR adds 3 new filters for tags! 🎉

Clicking on a tag now adds it to the tag filter, rather than the file filter! 👍

To see one of the differences between the filters, try search for a file extension in both the file and tag filters! 💯

This will become a lot more useful once manual tags, folder tags and extension tags are added! 👍

@cal2195 cal2195 added enhancement Improves existing features ✏️ ready for review PR is ready for review labels Jan 4, 2019
@cal2195 cal2195 added this to the v2.0.0 milestone Jan 4, 2019
@cal2195 cal2195 self-assigned this Jan 4, 2019
@cal2195 cal2195 requested a review from whyboris January 4, 2019 14:01
} else {
if (!this.settingsButtons['file'].toggled) {
this.settingsButtons['file'].toggled = true;
if (!this.settingsButtons['tagIntersection'].toggled) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The handleFileWordClicked method gets called when a word in the file name in the top bar is clicked - so the old behavior (opening file search) should be maintained in that scenario: https://github.com/whyboris/Video-Hub-App/blob/master/src/app/components/home/home.component.html#L402

This is because I intended for users (and suspect the current ways users use the feature is) to click on a word in the file name and see other files that have that word.

Once manual tags are added, and the tag search (tagIntersection) will be searching manual tags, the intended functionality will disappear.

Similarly the 'word cloud' currently is correlated with the file name not with the tags.

Perhaps we just make handleFileWordClicked include another parameter (say 'tags: bool' -- and depending on whether the parameter is true or false, it will search either file names or tags?

Also unlike before this change, the 'shift' key doesn't seem to affect when clicking on a word in the file name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha - I hadn't even realised that this was functionality! 😂 Are you sure 'shift' click worked before hand? I don't think the event gets passed through!

And I think we're slightly on different pages here - the idea of the tag filters are that they are customisable. As I discussed in #13, my idea is that you can have any combination of the following included in tags:

  • clean file names
  • clean folder names
  • manual tags
  • other file metadata (extensions etc.)

So since the top file name words are already cleaned, it makes sense to pop them in the tag filter if you have clean file names for tags enabled! Since they are the same, the functionality won't change.

Say you just enable manual tags for tagging, then we can have it pop top bar words into the file search instead - but I would prefer to do this once tagging is initially implemented! 👍

Let me know if you don't get what I mean - want to be on the same page going forward! 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case you've missed it - what do you think of my thinking above? 😄

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it took so long to get back to your question / idea / proposal -- busy week.

I feel like I might be misunderstanding you. I'll try to summarize what I think you're recommending and you can correct whatever misunderstanding I have.

Part of the communication problem may be that I hadn't coherently labeled what things are called. So in the text below I'll try to be more clear.

  • auto-tags - the tags that are automatically extracted from the file names (auto-capturing two-word combinations like "Batman Returns" if you have many files that include that word combination).
  • manual-tags - the feature not yet in master but that I'm working on at the moment - allowing users to add additional string descriptions to any file.
  • filter - a user-editable field in the sidebar that removes from view from the full list of videos items that don't fit some rule (e.g. don't contain the word "batman").

In #13 I think you're proposing that when the app generates the auto-tags list it also include folder names on the auto-generated list (possibly colored differently; perhaps if the folder contains more than 5 videos inside it). If that's done, then clicking on any one of the entities should pop the folder name into a filter on the sidebar; but at the moment there isn't a place which would accept both a folder name and a file name - hence the need for some hybrid filter (other than the "magic" filter we already have).

Is this roughly correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct so far! The idea is that we add this hybrid filter, which I've been referring to as the "tag filter"! This hybrid filter is customisable, allowing users to include/exclude any of the following:

  1. auto tags from file name
  2. auto tags from folder names Optionally include folder names in file tagging algorithm #13
  3. manual tags added by the user

This way, the tagging system is very flexible. In addition, we keep the folder filter (which only filters by folder) and the file filter (which only filters by *full file name). But we change it so clicking on tags (1,2,3 above), whether from the word cloud, detail view or other places tags appear inserts them into the hybrid tag filter.

*Full file name = includes file extensions and symbols ([], {}, - etc.)

Clicking on the file name as your point above could still add to the file filter, if you don't think that would be confusing!

The idea is to let users enable what kind of tags they want, and use the same hybrid filter for them all.

Let me know if you'd like me to clarify anything! 😄

PS: I like the idea of folder tags being a different colour!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some extra notes:

This PR (#73) implements such a tag filter!

And by the hybrid filter can include/exclude 1,2,3 above, I mean users could turn off auto tags if they wanted, and only use manual tags - or just have auto folder tags, and manual tags!

@whyboris
Copy link
Owner

whyboris commented Jan 4, 2019

It's looking great. We'll definitely merge this in within the week. I just have the small concern over handleFileWordClicked (see comment) - but that could be fixed rather easily.

I'll try to get a very basic version of tags as a PR and after your approval add into the master (hopefully I can finish this weekend). And then this set of filters will hook into the field it's intended to search 🎉

@cal2195
Copy link
Collaborator Author

cal2195 commented Jan 5, 2019

Looking forward to the basic version of tagging! 👍 👍

@cal2195 cal2195 added this to Needs review in Cal's Current Workflow Jan 11, 2019
@whyboris whyboris mentioned this pull request Jan 13, 2019
@cal2195 cal2195 moved this from Needs review to In progress in Cal's Current Workflow Jan 14, 2019
@cal2195
Copy link
Collaborator Author

cal2195 commented Jan 15, 2019

@whyboris If you're happy with my idea for now, this can be merged! 👍

Next steps are:

  1. Make it when you click on a manual tag, it get added to the new tag filter.
  2. Optionally show auto tags in the detail view.
  3. Implement Optionally include folder names in file tagging algorithm #13! 🎉

@whyboris
Copy link
Owner

Will try to find time to review today when I'm home from work 👌

Cal's Current Workflow automation moved this from In progress to Reviewer approved Jan 16, 2019
@whyboris
Copy link
Owner

whyboris commented Jan 16, 2019

I am thinking that there should be eventually (something I'm planning to implement) a tag search (that only searches manual tags) with autocomplete (just like in the details view). I'm guessing this will be in addition to the filters you're including.

Perhaps, since the new filters you've added will be doing more than one thing each, they could be called "hybrid" filters? 😄

@whyboris whyboris merged commit 5175fe6 into whyboris:master Jan 16, 2019
Cal's Current Workflow automation moved this from Reviewer approved to Done Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves existing features ✏️ ready for review PR is ready for review
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants