From d982dfa334ebdcb581f49c1c0974d6659a56c936 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Tue, 16 Feb 2021 13:17:17 +0200 Subject: [PATCH 1/3] feat(hyp,#195) store also tags --- src/promnesia/sources/hypothesis.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/promnesia/sources/hypothesis.py b/src/promnesia/sources/hypothesis.py index 97ae057d..08eda054 100644 --- a/src/promnesia/sources/hypothesis.py +++ b/src/promnesia/sources/hypothesis.py @@ -13,11 +13,14 @@ def index() -> Results: continue hl = h.highlight ann = h.annotation + tags = h.tags cparts = [] if hl is not None: cparts.append(hl) if ann is not None: cparts.extend(['comment: ' + ann]) + if tags: + cparts.append(" ".join(f"#{t}" for t in tags)) yield Visit( url=h.url, dt=h.created, From e0f8875e8338cd2248d28fd47fe4e2f7aefdb234 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Wed, 17 Feb 2021 12:57:44 +0200 Subject: [PATCH 2/3] srv: avoid empty canonicized query-strings - reason: canonicizing "#tag" eliminates it, fetchi everything, as discussed in #195 - Missing a respective js-change in the extension for bookmarks/history. --- src/promnesia/server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/promnesia/server.py b/src/promnesia/server.py index d7ca22c6..04978584 100644 --- a/src/promnesia/server.py +++ b/src/promnesia/server.py @@ -162,8 +162,10 @@ def search_common(url: str, where): config = EnvConfig.get() logger.info('url: %s', url) - original_url = url - url = canonify(url) + original_url = url and url.strip() + url = canonify(original_url) + if not url: # Don't eliminate a "#tag" query. + url = original_url logger.info('normalised url: %s', url) visits0: List[Any] = [] From e38791ac0f622af3f048b10f9449905dc37fc980 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Wed, 17 Feb 2021 13:50:01 +0200 Subject: [PATCH 3/3] doc: mention #tag-search in features --- doc/GUIDE.org | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/GUIDE.org b/doc/GUIDE.org index 491fcac1..c672308a 100644 --- a/doc/GUIDE.org +++ b/doc/GUIDE.org @@ -67,6 +67,7 @@ Searches in visits and their contexts. You can toggle search via: - hotkey: =Ctrl+Shift+H/Ctrl+Alt+H= (Chrome/Firefox correspondingly) - Promnesia context menu - sidebar button +- search just for a =#tag= ** 'search around' Shows you browsing history 'around' another visit, useful to remember how/why did you get on the page.