-
Notifications
You must be signed in to change notification settings - Fork 76
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
REF: Add tags into context #195
Comments
Yeah, good suggestion! Just adding to context is a quick & easy workaround. In general there are all kinds of metadata that could be useful, e.g:
I need to think a bit more what's the best way to handle it.. because adding stuff to db is easy. The interesting question is what t do with it in the UI -- although just displaying it could be a good start. |
Just made a PR #199 to include in Hypothesis rows a new context-line with (hash-)-tags; the same can be done with github(labels), gmail(labels). BUT when trying to search by a hash-prefixed tag e.g. These are the logs when searching
While this is when prefixed with hash(
|
Thanks, the change looks good! So I think I know why this happens. promnesia/src/promnesia/server.py Lines 271 to 280 in aded41c
, as you can see it searches in several different columns (and somewhat confusingly, paramter name is 'url' even though it really means anything you typed in the search box). But it delegates to However, this function also normalizes the url passed to it: promnesia/src/promnesia/server.py Lines 164 to 167 in aded41c
In particular, at the moment that means stripping out the 'fragment' part of the URL (there is a plan to do something smarter, but still work in progress Lines 127 to 142 in aded41c
So as a result, when you search #freedom , it ends up normalizing this to empty string, and this results in matching against the whole database.
So I guess there are several things we could do here
More reasonable solutions:
This would probably be easier if we had a richer search interface (so e.g. you could tick whether you want to search context/url/etc). Either way, I'm happy to merge your PR if you are, the issues should be worked around separately. |
I would prefer that the PR is self-contained, and it works as expected. |
Actually the same has to happen on the extension js-code [edit:] for bookmarks & history: promnesia/extension/src/api.js Line 38 in ae0ce94
Also need to trim the URL before searching; would there be any problem to that? |
- reason: canonicizing "#tag" eliminates it, fetchi everything, as discussed in karlicoss#195 - Missing a respective js-change in the extension for bookmarks/history.
- reason: canonicizing "#tag" eliminates it, fetchi everything, as discussed in #195 - Missing a respective js-change in the extension for bookmarks/history.
I see that hypothesis source does not harvest tags, correct?
Although this is fixable, it made me wonder whether tags should be a new column in promnesia db?
The text was updated successfully, but these errors were encountered: