hypothesis / hypothesis/product-backlog
Support for applications which use URL fragment to identify document
- Dominant language
- No language data
- Stars
- 122
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
### Problem you are trying to address with this feature
Support annotating pages in applications which use the URL fragment to identify the document, instead of the URL path. eg. Google Groups - https://groups.google.com/a/list.hypothes.is/forum/#!forum/dev
This mostly affects "legacy" single page applications which use client-side routing and store the URL path in the URL fragment.
Original context: https://groups.google.com/a/list.hypothes.is/forum/#!topic/dev/fQyUobAl-0A
Currently Hypothesis:
1) Captures only the part of the URL before the fragment identifier in the annotation's target field.
2) Does not include the fragment identifier when searching for annotations
3) Because of (1) does not include the fragment identifier when direct-linking back to an annotation
This means that:
1) Searching for annotations on a given "page" in an SPA returns all annotations for that application, rather than just the annotations for the current "page"
2) When direct linking to an annotation, the user is sent to the home page / root page of the SPA rather than the "page" on which the document was made.
### Your solution
Bikeshed design:
- When creating an annotation, include the full URL (with fragment identifier) in the `target_uri` field
- When fetching annotations, include the full URL in the query to the server
- When searching for annotations, treat URLs with differing fragment identifiers as equivalent except for hash-bang fragment identifiers (`#!path`) which is a common convention for indicating fragment identifiers which indicate the document within an SPA rather than a part of the page.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.