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

Can't use hash character (#) in description field in "add activity" window #757

Open
rhertzog opened this issue Jan 25, 2024 · 4 comments
Open

Comments

@rhertzog
Copy link
Contributor

When you insert any text containing a hash (#) character in the "description" field of the "Add an activity" window, then the "Save" button is greyed out and you can't add the activity.

Note that the hash character doesn't have to be at the start of the word, so it's not only tag-words that are problematic, it's also any URL with an anchor (e.g. https://example.org/#hello).

However if you input the description with the hash character within the "cmdline" field then it is accepted... for example cmdline = 09:06 Activity@Category, https://example.org/#hello.

/cc @Flupp @GeraldJansen

@rhertzog
Copy link
Contributor Author

Note that #755 would change the behaviour here. With this patch applied, the description can contain https://example.org/#hello (it is accepted and the save button is not greyed out) but a tag word is still not allowed in the description while it is a syntax that we decided to support.

My first implementation stripped the hash from tag words from the description while adding them into proper tags. But the general feedback was that we should not strip the hash character at all, thus we should allow tag words inside the description.

We should thus fix the behavior of this edit window to actually assign tags when we edit the description field with a tag word inside it.

@GeraldJansen
Copy link
Contributor

Harvesting tags from the description field as one types is complicated by the need to keep three fields in sync (cmdline, description and tags). I played with this a bit, including an effort to just sync the fields on focus_out from the description field, but I didn't manage to find a satisfactory solution.

@rhertzog
Copy link
Contributor Author

Yeah, it seems unreasonable to do it while typing because you would add multiple partial tags while your inputting the tag (i.e. typing #tag would add t, ta and tag). But doing it on focus_out (+ maybe once before save in case focus_out is not executed when you validate the save button with a keyboard shortcut) should be doable no?

What difficulties did you hit?

@GeraldJansen
Copy link
Contributor

Not fully understanding when tags from the description should be added to fact.tags. The round trip check of serialization followed by parsing fails if fact.tags is not populated with harvested tags prior to making the check. Then there is the issue of re-editing tags in the description field. In this case entries in fact.tags present in the description at focus_in need to be removed from fact.tags to avoid retaining both the old and newly edited tag. I believe I also had issues of tag order before and after saving. Things just got more complicated than I had time or desire to deal with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants