dwyl / mvp

πŸ“² simplest version of the @dwyl app
https://mvp.fly.dev
GNU General Public License v2.0
87 stars 2 forks source link

Parse tags regex #234

Closed SimonLab closed 1 year ago

SimonLab commented 1 year ago

Test it at: https://mvp-pr-234.fly.dev/ ~(database unavailable at the moment, looking into it, similar error to https://github.com/dwyl/hits/issues/203)~ fixed with #235 image

Parse tags using regex. The regex search for tag name starting with #. The selected tags are displayed under the textarea with a default colour. When the item is created the tags are saved if new ones are created

@nelsonic @iteles Would this be a better solution than #222 (dropdown tags)? If yes, I can continue to improve this PR:

codecov[bot] commented 1 year ago

Codecov Report

Merging #234 (d411b22) into main (85b5cab) will decrease coverage by 1.27%. The diff coverage is 50.00%.

@@             Coverage Diff             @@
##              main     #234      +/-   ##
===========================================
- Coverage   100.00%   98.72%   -1.28%     
===========================================
  Files           13       13              
  Lines          309      313       +4     
===========================================
  Hits           309      309              
- Misses           0        4       +4     
Impacted Files Coverage Ξ”
lib/app_web/live/app_live.ex 96.42% <40.00%> (-3.58%) :arrow_down:
lib/app/item.ex 100.00% <100.00%> (ΓΈ)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

SimonLab commented 1 year ago

Liveiview (and sockets) seems to not work on this deployed review-app: image

SimonLab commented 1 year ago

I've deleted and deployed again the application. It is now testable at https://mvp-pr-234.fly.dev/

nelsonic commented 1 year ago

@SimonLab what exactly am I testing here? πŸ’­

image image

Should the parser have picked out my #hello #world ?

SimonLab commented 1 year ago

Should the parser have picked out my #hello #world ?

Yes, but at the moment only when you create the item, not on edit. I'm not sure if you created Another test first then edit the task and added Β #hello #world?

nelsonic commented 1 year ago

Created the #hello one on CREATE and the #world on UPDATE πŸ“

nelsonic commented 1 year ago

Tags picked up on first input (CREATE):

mvp-tags
SimonLab commented 1 year ago

Thanks for testing the tagging again @nelsonic I'll add the same feature when a task is edited.

nelsonic commented 1 year ago

Good plan. Thanks @SimonLab

nelsonic commented 1 year ago

@SimonLab do you want to try and wrap up this work? πŸ§‘β€πŸ’» ⏳ Or is there some other way of capturing it so that it's not lost? πŸ’­

nelsonic commented 1 year ago

To be clear this kind of parsing will absolutely be part of a future iteration of capturing text and automatically suggesting tags. So if you prefer to create a new repo to explore this kind of text parsing - including using some ML that could be a good place to take this. πŸ’­

SimonLab commented 1 year ago

Closing for now. We can come back to parsing tag later. The idea on this PR is to use a Regex to detect string starting with "#": Regex.scan(~r/#(\w+)/, text)