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
[Feature]: Comments and Annotations. #411
[Feature]: Comments and Annotations. #411
Conversation
|
Great work :) Some things I noticed and leaving here for documentation:
|
|
Thanks. :) |
I think @subrat-sahu ran into the same issue, right? |
|
@oliversauter @digi0ps
And the scrolling behaviour I think is not specific to |
Yup sorry, it didn't strike then! |
5d5f79a
to
61bba02
Compare
61bba02
to
445c7d3
Compare
cde58a9
to
27c74aa
Compare
90b7078
to
a9bb711
Compare
|
Great stuff, so happy to see this working :) Well well well done @digi0ps A couple of things that need some repolishing: |
|
Fixed 1 and 3. |
3d0177a
to
a7877bf
Compare
|
Another few improvements:
|
|
good morning @digi0ps :) I checked on your PR. We are getting there but there is still a lot of work to do to round it up. In general, there is just still a lot of work to do to fit it to the designs of the annotations, try to be as closely as possible to the current designs, and if you have questions, I am always there :) We are almost there :) Congrats! |
| const Annotation = props => ( | ||
| <div | ||
| className={cx(styles.container, { | ||
| [styles.pointer]: props.isIFrame && props.isJustComment, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as only, or as single?
|
Great and lots of work! Cool that you've got this feature almost ready! Reading through the code, I've come up with the follow things:
|
The main thing we've tried to encourage here is making the actual underlying state (what's in the store) as simple as possible, then putting the majority of the logic needed to produce the derived states (what's used in containers/views) in memoized selectors. For maintainability, and especially flexibility with accessing states/triggering actions from different parts of the codebase, it would be really nice to put everything in redux and ignore React component state. But redux does come with an large amount of boilerplate which can be especially annoying if the state is super simple and probably only ever going to be used in the context of that component 😕
Interaction with data sources should definitely be separated from the rendering code. At the very least there should be a clear distinction between container and view/presentational components (sometimes called "dumb" and "smart" components, and prob a bunch of other names), with data interaction being done at the container level, and/or in redux thunks - esp. if an explicit React container class is not needed. Probably already acknowledged by everyone, but also note interaction with the main data (stuff that is stored in StorageManager) should only ever be accessible from the background script. There will need to be some interscript communication method being employed to get it from the BG script to the options UI script (so the |
Exactly :) If any state at all is stored in React components or interactions with the back-end, I'd do it in container components, not mixed inside presentation components. |
|
@digi0ps Great work, almost almost there! What still needs some doing: Before Launch
CAN be after launch, but should not:
|
b678f0a
to
e29896c
Compare
|
@digi0ps Ah looks already really good. A couple of things caught my eye that still need doing: Priority 1:
Priority 2:
|
|
A few things i recognised:
|
|
Another few things:
|
Can you tell me more? |
|
|
Another few bugs: EDIT:
|
|
Sorry for the late response, I was working on fixing the bugs. But I was worked on some of the things you said side by side. Moved most of the interactions functions which are related to higlights to the sidebar module, unified the highlight classes into one, got rid of most of the render-* functions sending data around instead. Working on making
This seems perfect, I will move all the annotation storage related backend to a separate module. (
I'm in the process of moving the
Regarding Right now the data flow is different for in-page sidebar/overview sidebar. In the overview sidebar it's simple, it's fetched through remote calls. While in the in-page sidebar, the annotations are fetched in the Ribbon, highlighted sorted and then passed to the |
The code setup to prevent the page from scrolling when the sidebar is open was interfering with the highlight scrolling code. Fixed the problem in this commit.
When a new annotation is created, it updates the highlights, sorts the annotations and scrolls to the place.
offsetTop only gives the position from the wrapping parent.
Adds a new state annotationCount for that.
Moved most of the react operations as Redux code.
Also, attemp at improving scrolling to annotation.
Previously, was just removing classnames. Now unwraps the whole element.
Now annotations gets stored in the annotation table.
Also, fixed lastEdit not being visible.
f09975d
to
0128f0b
Compare













Modules
src/sidebar-overlay:
Contains:
src/overview/sidebar: Contains redux code related to overview sidebar.
src/direct-linking/background/storage.ts - Storage ops related to CAH.
External dependencies
react-burger-menumomentdexieTODO
Sidebar
Sidebar in websites
sidebar.htmlsidebar.htmlsrc/overview/sidebarandsrc/sidebar-overlay/container)Storage
feature/direct-linking-uifor StorageManagerBugs
pageTitleproperly for comments. (Right now it's being set as the overview page's title. A better way would be to add pageUrl, pageTitle to state to easily access it.)createdWhenis unreadable in the client, need to fix this to sort annotations.