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

Show popup when already selected text #2145

Closed
seanh opened this issue Apr 8, 2015 · 8 comments
Closed

Show popup when already selected text #2145

seanh opened this issue Apr 8, 2015 · 8 comments

Comments

@seanh
Copy link
Contributor

seanh commented Apr 8, 2015

Go to a web page. Select some text. Realise that Hypothesis isn't launched. Launch Hypothesis. You have to unselect and reselect the text to get the popup button.

Solution: show popup on launch if selected text.

@seanh seanh added the Usability label Apr 8, 2015
@dwhly
Copy link
Member

dwhly commented Apr 8, 2015

+1

@tilgovi
Copy link
Contributor

tilgovi commented Apr 8, 2015

This has worked at some point :-/

@tilgovi
Copy link
Contributor

tilgovi commented Apr 8, 2015

But it was never intentional.

@csillag
Copy link
Contributor

csillag commented Apr 8, 2015

But it was never intentional.

Yes it was. I supported this use-case on purpose.

The required code was removed during one of the refactorings, as superfluous.

@tilgovi
Copy link
Contributor

tilgovi commented Apr 8, 2015

Sorry, but I can't recall any such intention or removal. You may be right.

@csillag
Copy link
Contributor

csillag commented Apr 8, 2015

Here is how it worked the last time:

  • at that time, we could only have one new annotation editor open in the sidebar

  • therefore, when we started to create a new annotation, we had to disable the adder button.

  • to achieve this, I added a switch to Annotator, to temporarily remove the ability to create new annotations. (IIRC, it was called disableAnnotating() and enableAnnotationg(), or something similar.)

  • While the creation of annotations was disabled, the selection events were not registered, so the adder button was never shown.

  • On enableAnnotating(), the Annotator plugin responsible for dealing with the selection tested if we have a valid selection, and if we did, triggered the same code path which is usually triggered by creating a new selection.

  • The tricky bit was that in this case, we don't have a mouse event, so we can't position the adder button based on the coordinates found in it. To work around this, we used to have a helper method for getting the location of the selection range. It used some jQuery magic, and worked by inserting "probes" before and after the wanted range, in order to get the right coordinates.


Most of this was removed when we started to support having more than one "new annotation" editors in the sidebar. The rest of this (which has been dead code since the first refactoring) has been removed later.


As of now, we no longer need the disableAnnotationg() / enableAnnotating() feature, but we could still do the same check upon initialization.

@csillag
Copy link
Contributor

csillag commented Apr 16, 2015

The tricky bit was that in this case, we don't have a mouse event, so we can't position the adder button based on the coordinates found in it. To work around this, we used to have a helper method for getting the location of the selection range. It used some jQuery magic, and worked by inserting "probes" before and after the wanted range, in order to get the right coordinates.

If we ever want this feature back, this part was removed here: 29ff86f

@nickstenning
Copy link
Contributor

Hi there! I'm going to close this as part of a clean-up of all issues currently open on this repo that represent ideas or features rather than reports of bugs or technical chores.

I want to be clear that this isn't intended to say anything at all about the content of this issue—it certainly doesn't mean we're no longer planning to do the work discussed here—just that we don't want to use GitHub issues to track feature requests or ideas, because the threads can get long and somewhat unwieldy.

If you're interested in what we are working on at the moment, you can check out our Trello board and, for a longer-term view, our roadmap.

And, if you're interested in following up on this issue, please do continue the discussion on our developer community mailing list. You might also want to check out our contributing guide.

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

5 participants