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

Default comment popup for Annotorious 3 #297

Open
rsimon opened this issue Sep 29, 2023 · 2 comments
Open

Default comment popup for Annotorious 3 #297

rsimon opened this issue Sep 29, 2023 · 2 comments
Labels
help wanted Extra attention is needed v3.x Work on the next major release

Comments

@rsimon
Copy link
Member

rsimon commented Sep 29, 2023

Important this issue is about Annotorious v3, which is currently a separate branch in this repository.

Annotorious is about to get a new major release. Annotorious 3 is a complete re-write, and will fix many of the issues that people had with the previous version. One breaking change, however, is that Annotorious 3 will be headless by default. Which means developers will have to build their own editor popups.

Therefore, the goal is also to offer a default popup, identical to the one from Annotorious v2.x for those who only need a basic solution for comments (and tags) that works out of the box. The popup should be a separate module, to keep the core modules slim.

@rsimon rsimon added help wanted Extra attention is needed hacktoberfest labels Sep 29, 2023
@rsimon rsimon transferred this issue from another repository Oct 1, 2023
@rsimon rsimon changed the title Default comment popup Default comment popup for Annotorious 3 Oct 1, 2023
@rsimon rsimon added the v3.x Work on the next major release label Oct 1, 2023
@Tholkappiar
Copy link

Can you please explain the popup thing , What kind of popups ? where is the identical one in the Annotorious v2 ?

@rsimon
Copy link
Member Author

rsimon commented Oct 1, 2023

Thanks for picking this up! Here's a bit of extra background/information:

  • The current (2.7.x) version of Annotorious has a built-in popup editor. When you create a new annotation, or select an existing one, you'll get that little popover component with the comment text box. You can see this e.g. on the Getting Started example page.
  • If you didn't want that popup (because your app didn't need one, or because you wanted to build your own thing), you could choose to run Annotorious in headless mode as explained here.

Annotorious 3 will be different. The next release will have only a headless mode. A popup editor is no longer part of the main package. This is because many people simply didn't need it, or had problems building custom extensions, and then ended up hacking their own solution, anyway. (Regardless, the old Annotorious bundle still included the code for the popup, which was built in React. This caused the bundle to be overlay bloated - 300kB when it really only needed to be 80kB or so. And it caused problems as soon as people wanted to integrate Annotorious in their own React applications, because their copy or React often conflicted with the one built into Annotorious.)

TL;DR: Annotorious no longer has a default popup editor.

So: what about users that did use the default popup? Obviously, I don't want to leave them behind when Annotorious 3 gets released. Therefore, I want to build a popup which looks and feels identical to the current one from v2.7. But it should be a separate JS package, so that it doesn't add bloat for those people who don't need it.

I think the old popup would be a good starting point, although I feel a Svelte-based solution might be a bit lighter than yet another React based one.

The main challenge, I believe, will be to figure out how to establish the architecture: i.e. how to attach the popup to Annotorious, while keeping this isolated as a separate module. A basic (and, yet again, undocumented...) example can be found here:

https://github.com/annotorious/annotorious/blob/3.x/packages/annotorious-react/src/openseadragon/OpenSeadragonPopup.tsx

In this case, the @annotorious/react integration package includes a wrapper component that allows users of the React package to build their own popups in React. A default popup could be built in much the same way.

Let me know if this is helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed v3.x Work on the next major release
Projects
None yet
Development

No branches or pull requests

2 participants