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

I want better support for tags #138

Closed
matthewwong525 opened this issue Mar 26, 2022 · 5 comments · Fixed by #609
Closed

I want better support for tags #138

matthewwong525 opened this issue Mar 26, 2022 · 5 comments · Fixed by #609

Comments

@matthewwong525
Copy link
Collaborator

matthewwong525 commented Mar 26, 2022

What is wanted now:

USE CONTEXTMENUS that was just released in flutter 3.7

  • autocomplete for tags when you type # (no spaces & just like obsidian)
    • use link_suggestions.dart probably rename it to suggestions (also probably rename it to be more generic F2 hotkey)
    • In content_field.dart:
      • showTitleLinksOverlay is the function that displays the LinkSuggestion
      • _onContentChange triggers the above function and isTitleLinksVisible is the function that determines if we should show the LinkSuggestion
  • tags are greyed out (like how links have the blue colour)
    • in note_editor.dart search StyleableTextFieldController

use the tag regex in obsidian plugin code!

DONT DO THIS

  • loop thru every single note to find all the tags using regex! DONT DO THIS! Store a local storage (use HiveDB) I want better search performance #190
    • every time u save a note, it'll update the local storage with key = note_id, value is { tags: [String...], links: [String...] }
    • Just do the above and create a function in database.dart called findAllTags. I'm thinking of changing from HiveDB to Isar Database for better query management when working locally

How would this be implemented

  • look at how the links are implemented and try to do the same thing!
  • TODO: add more instructions (for matt or maybe john is smart boi)

What is potentially wanted for the future

  • tags will have a different shade in the text field like a light grey colour (tags won't have spaces)
  • tags will also have autocomplete suggestions (see title_links.dart)
  • when someone adds "#tag1 #tag2" the query will know to search for tags. The user can add any text around or between the tag and it'll basically ignore the #tags (also when searching tags, order SHOULD NOT matter)
  • when someone clicks on a tag, it will update the search on the side

E.g.
"Hello #tag1 I am #tag2" =
"Hello I am" + filter for #tag1 and #tag2

@matthewwong525 matthewwong525 added this to the v0.0.6 milestone Mar 27, 2022
@matthewwong525 matthewwong525 modified the milestones: v0.0.6, v0.0.7 Apr 4, 2022
@matthewwong525
Copy link
Collaborator Author

How i'd implement is I would adjust the getSearchNotes function. When the string is passed into the function, I will use regex to find & remove all the #tags into a list then loop thru all notes (using regex again) to find notes that contain all the tags.

@matthewwong525 matthewwong525 modified the milestones: v0.1.0, v0.1.1 Apr 19, 2022
@matthewwong525 matthewwong525 modified the milestones: v0.1.1, v0.1.2 Apr 25, 2022
@matthewwong525 matthewwong525 changed the title I want to support tags I want better support for tags May 8, 2022
@matthewwong525 matthewwong525 removed this from the v0.1.5 milestone May 20, 2022
@matthewwong525
Copy link
Collaborator Author

User feedback:
image

@matthewwong525
Copy link
Collaborator Author

First just start with changing the text colour of tags to grey and have autocomplete tags when they type #.

ransurf added a commit that referenced this issue Oct 13, 2022
I want better support for tags #138
@matthewwong525
Copy link
Collaborator Author

where's the PR for this? also add the Closes #138 into the PR description. the closes makes it so that when you clsoe the PR it closes teh issue

@matthewwong525
Copy link
Collaborator Author

Cloded by #609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
3 participants