-
Notifications
You must be signed in to change notification settings - Fork 1
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
Custom context menus #33
Comments
I prepared some proof of concept here #34. Any feedback is welcomed. Basically every page has its own context menu. And these menus are rendered via React Portal. Menu is shared within annotations on the same page.
Simple answer: However we want to. 😃
Currently, the annotations are stored in global context. Every annotation contains - selected text, normalized coordinates of every rectangle when PDF is not scaled (as one annotation can be on multiple lines), color
New annotation triggers updating of the global context. And every affected component is re-rendered. @viktor-yakubiv What is that button in top left corner with |
The annotation would be added if any color button is clicked. However, the The button itself add a highlight and opens a commenting window. Based on this we need to extend annotation object with a comment field. Although, we were looking into storing annotations on hypothes.is. We decided that this is not a priority now and stopped all research in this area. Currently if you are developing this, I will take a closer look into it. |
React Portals sound good! I meant more how to design the component flexible enough to fit different count of buttons with different actions along with menu items and input fields. |
Good enhancement for the Reader we may already implement is context-driven help. When a user selects the text during reading, the context menu below is shown in a second above the selected text (or below the text if there is not enough free space).
The menu design includes the annotation colors and primarily was designed for annotating. Although, the first line of the menu is useful even without annotation functionality and may include:
searching in Wikipedia(see below 👇)Also, where is possible we can append the menu by contextual wikification. For example, when there exists a corresponding Wikipedia page for the selected text (when a couple of words selected only) we show a term description above the menu.
It would be nice to add 'Search in CORE option too. However, this should be investigated more deeply because people would not like to change the context when they are reading the paper.
Inspiration
The context menu feature is borrowed from Google Play Books app for Android. You may find how it works if install the app and in the reading mode select the text.
The wiki-notification may be explored on any Wikipedia page when you hover on any link. You will see the brief description of the term you are pointing at.
Open questions
More sketches
Let me know if you need more sketches. I will append these below.
The text was updated successfully, but these errors were encountered: