Bug Hunting Session
Bug 98372 (Sidebar-Research) - SIDEBAR: Research/Reference sidebar deck
Summary: SIDEBAR: Research/Reference sidebar deck
Status: NEW
Alias: Sidebar-Research
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.2.0.0.alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval, needsUXEval, topicUI
: 98858 108627 (view as bug list)
Depends on:
Blocks: Sidebar-New-Decks
  Show dependency treegraph
 
Reported: 2016-03-03 04:37 UTC by Yousuf Philips (jay) (retired)
Modified: 2019-03-22 08:12 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
research side panels in MS Office and Google Docs (76.97 KB, image/png)
2016-03-03 04:37 UTC, Yousuf Philips (jay) (retired)
Details
Sidebar mockup (36.97 KB, image/png)
2016-03-06 10:20 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2016-03-03 04:37:39 UTC
Created attachment 123176 [details]
research side panels in MS Office and Google Docs

This sidebar deck will allow a user to not have to leave LibreOffice interface in order to do research, which a user would normally turn to their browser for. It will contain research and reference tools like encyclopedias (e.g. wikipedia), dictionaries (e.g. wiktionary), thesaurus, translators (e.g. google translate), etc. The deck can feature both built-in and online services, but would primarily be for online services.

The sidebar deck should ideally have support to render html content, so webview control (e.g. WebKitGtk+, MozView) would be needed, as it will allow online services to provide a suitable webpage that would only need to be displayed in order to get full search functionality (e.g. http://www.thefreedictionary.com/lookup.htm#searchbox).
Comment 2 V Stuart Foote 2016-03-03 05:26:58 UTC
@Jay, oh my goodness! Is that you?

We don't actually need to do this as a LibreOffice core feature. Especially as the Sidebar Deck is a perfect container to encourage extension developers to build content panels against.

The API needs to be cleaned up and published, but the Zotero plug-in comes immediately to mind. As well some of the Latex extensions and MathML extensions.

I could see this research content panel might be a good prototype feature/SDK example of a cmplex Sidebar Deck/Content panel extension.
Comment 3 Yousuf Philips (jay) (retired) 2016-03-03 05:44:21 UTC
(In reply to V Stuart Foote from comment #2)
> @Jay, oh my goodness! Is that you?

@Stuart: Yep its me. :D

> We don't actually need to do this as a LibreOffice core feature. Especially
> as the Sidebar Deck is a perfect container to encourage extension developers
> to build content panels against.

I guess i'd have to disagree, as extension imagine if each provider created their own extension, what would the sidebar turn into. It is better that we create the core functionality and let providers (most of which wouldnt spend the time to create their own extension) create just the minimum needed integration to enable their service to function within it. We are doing the same thing with the GSoC project to revamp the gallery sidebar tab so that it can search online providers like openclipart, which used to be its own dedicated panel until the sidebar arrived.

https://wiki.documentfoundation.org/Development/GSoC/Ideas#Revamp_the_gallery_tool
Comment 5 V Stuart Foote 2016-03-06 15:40:16 UTC
Mock-up looks like a good start, you forgot to insert a Tab bar button for switching to the Deck.

--Network connectivity--
When this Research/Reference content panel(s) be implemented as a core feature of LibreOffice--it will be important to be able to completely disable any external connection. That is, the mock-up should be clear to provide a "Not Active" mode, with no Encyclopedia "selected". And any network hooks must be silent when in that mode.

Pushing this enhancement over to the UX-advise side for design and implementation. Otherwise if these core content panels are effective for Writer, they would be equally effective in Impress, Calc and Draw (possibly even Math if you connect to the right journal services).

(In reply to Yousuf (Jay) Philips from comment #3)
> > We don't actually need to do this as a LibreOffice core feature. Especially
> > as the Sidebar Deck is a perfect container to encourage extension developers
> > to build content panels against.
> 
> I guess i'd have to disagree, as extension imagine if each provider created
> their own extension, what would the sidebar turn into. It is better that we
> create the core functionality and let providers (most of which wouldnt spend
> the time to create their own extension) create just the minimum needed
> integration to enable their service to function within it.
> ...

@Jay, still believe the flexibility is needed and will attract interesting projects to implement Sidebar based extensions. Where most extensions now provide Toolbar or Dialog based interface, they could provide richer Sidebar Deck held content panels of various function. Much like the work Jan-Marek is investigating to host the WollMuxBar in a set of Sidebar content panels with dedicated deck and tab bar launcher.

Our goal for Sidebar should be publishing an API and IDL in the SDK for control and layout of Sidebar Deck, Tabbar and Content panels--and continuing to develop the internal framework needed for holding state in profile (per module, per user) and in extending ODF to carry any needed content to make the document portable. Another discussion and subject of Design & UX preliminary survey.

Stuart
Comment 6 Yousuf Philips (jay) (retired) 2016-03-06 21:09:39 UTC
(In reply to V Stuart Foote from comment #5)
> Mock-up looks like a good start, you forgot to insert a Tab bar button for
> switching to the Deck.

Yep forgot about that part as i didnt have an icon for it. :D

> --Network connectivity--
> When this Research/Reference content panel(s) be implemented as a core
> feature of LibreOffice--it will be important to be able to completely
> disable any external connection. That is, the mock-up should be clear to
> provide a "Not Active" mode, with no Encyclopedia "selected". And any
> network hooks must be silent when in that mode.

Yes it would need to check if the internet is available once a user switches to it, and if not, then it would disable all the entries that require internet in the drop down menu.

> Pushing this enhancement over to the UX-advise side for design and
> implementation. Otherwise if these core content panels are effective for
> Writer, they would be equally effective in Impress, Calc and Draw (possibly
> even Math if you connect to the right journal services).

Yep i would expect we'd have a design session maybe after the design meeting to talk about it once heiko gets back to iron out the UX part. If it would be useful in other modules, it should definitely be. I would assume the dictionary, thesaurus, and translator would likely be useful in Calc and Impress.

> (In reply to Yousuf (Jay) Philips from comment #3)
> @Jay, still believe the flexibility is needed and will attract interesting
> projects to implement Sidebar based extensions. Where most extensions now
> provide Toolbar or Dialog based interface, they could provide richer Sidebar
> Deck held content panels of various function. Much like the work Jan-Marek
> is investigating to host the WollMuxBar in a set of Sidebar content panels
> with dedicated deck and tab bar launcher.

Would never say that we shouldnt encourage sidebar extensions, but believe this functionality shouldnt be left to out of core where

1) it would likely not seen by all users because its not part of the default install or

2) the extension wasnt design and developed in the best manner, which results in a bad user experience or

3) the extension isnt maintained and possible changes to the sidebar API would make it no longer functional (QA doesnt cater to questions regarding broken extensions).

This it being part of core, we the design team can properly plan the correct UI and UX for implementation and can work with the dev who wishes to implement it.

> Our goal for Sidebar should be publishing an API and IDL in the SDK for
> control and layout of Sidebar Deck, Tabbar and Content panels--and
> continuing to develop the internal framework needed for holding state in
> profile (per module, per user) and in extending ODF to carry any needed
> content to make the document portable. Another discussion and subject of
> Design & UX preliminary survey.

We could always have the developer who will implement this do it as a built-in sidebar extension, and use that as a means of showcasing the ability of the sidebar api and have it as a reference example those who want to build extensions.

I'm hoping that infra could provide a dedicated server that could be used as the powering backend for this implementation. Where in a user would easily be able to install additional services as the service list is found on the server and queries would would be routed through the server, so that if there is any breakage in service, the fix can be done on the dedicated server and users wouldnt have to upgrade to the latest version to get a fixed version of the service.
Comment 8 Adolfo Jayme 2016-03-24 13:09:32 UTC
*** Bug 98858 has been marked as a duplicate of this bug. ***
Comment 10 Robinson Tryon (qubit) 2016-08-25 05:49:23 UTC Comment hidden (obsolete)
Comment 11 Cor Nouws 2019-02-05 18:35:52 UTC Comment hidden (off-topic)
Comment 12 Heiko Tietze 2019-02-12 08:30:56 UTC
Adolfo, why is this not true anymore? When you reopen a ticket at least a short comment is needed.

> *** This bug has been marked as a duplicate of bug 87078 ***
Comment 13 Keith Curtis 2019-03-19 08:37:57 UTC
I wrote some sample Python code to fetch definitions from Wiktionary, and then filter it via Beautiful Soup to be shorter and more relevant:

https://gist.github.com/KeithCu/29f6a2131a7dcad7de9a270c9d11b62c

Is there an easy way to put the text into the research sidebar?
Comment 14 Heiko Tietze 2019-03-19 09:01:52 UTC
*** Bug 108627 has been marked as a duplicate of this bug. ***
Comment 15 Samuel Mehrbrodt (CIB) 2019-03-19 09:21:20 UTC
(In reply to Keith Curtis from comment #13)
> I wrote some sample Python code to fetch definitions from Wiktionary, and
> then filter it via Beautiful Soup to be shorter and more relevant:
> 
> https://gist.github.com/KeithCu/29f6a2131a7dcad7de9a270c9d11b62c
> 
> Is there an easy way to put the text into the research sidebar?

I'm not sure if this is supposed to be done as an extension, or core feature.
If extension, you can surely use the python code and create a sidebar deck using the api. See wollmux code for a full example.

If this is supposed to be a core feature, this needs to be implemented with C++ as any other sidebar deck.

Let me know if you need more code pointers (and for which approach).
Comment 16 Keith Curtis 2019-03-19 21:33:29 UTC
The wizards ship as a core feature and run in Python, why couldn't this? It is good to use a more productive language in LibreOffice whenever possible, and a research tab seems like a great example of something that would be good enough in Python.
 
It is becoming the language of choice for neural networks, data science, etc. I hope that LibreOffice one day will have PyTorch inside for the grammar checker, and other places: http://document-foundation-mail-archive.969070.n3.nabble.com/Fwd-AI-in-Microsoft-Office-td4231071.html

I wrote that code because it was an interesting little task for me. I think the Beautiful Soup filter is a good start to taking the default output of Wiktionary and making it reasonable enough to fit in a dialog box. There could be other solutions such as requesting a mobile version. I might try to figure that out next. Also, it should have an LRU cache to not hit their servers too much. I'll put that in, as it's just one line of code ;-)

I could investigate how to create a simple UI, or figure out how to create / update a research tab on the sidebar, but I've not done any LibreOffice UI stuff yet. If someone else has more knowledge or time to learn, they could take this Python and keep going. It should be possible to quickly build a very good extension, and then people can decide what to do with it.

Thanks for the Wollmux reference. I may find their source and go through it. Lightproof could also be another good starting point: https://cgit.freedesktop.org/libreoffice/lightproof/tree
Comment 17 Keith Curtis 2019-03-19 22:50:58 UTC
I figured out how get a mobile view from Wiktionary, but it had just as many sections. i.e, it will also need filtering. 

It might be possible to tell it what sections you want, but I'm not sure if it's possible to tell it sections you *don't* want. I'll look around. If LibreOffice knew that the word was a noun, it could request just that section for example, and get the minimal amount of data, but that requires looking the word up elsewhere first.

Another possibility is to get all the sections, filter out the ones LibreOffice wouldn't want, and then request just that content. That requires more API calls, and might not be faster, but it could be worth trying.
Comment 18 Keith Curtis 2019-03-20 22:43:50 UTC
I tried to have Wiktionary filter the text it sends, and was able to turn off the table of contents, and edit sections, but not the translation table, for example. I don't fully understand the Wikipedia API: https://en.wikipedia.org/w/api.php?action=help&modules=parse I've updated the code.
Comment 19 Keith Curtis 2019-03-22 03:19:32 UTC
I've tweaked the Wiktionary code to work with some more languages, but eventually it would need to handle langids. I see a useful C++ routine: https://docs.libreoffice.org/setup_native/html/sellang_8cxx_source.html Is that information available via UNO?

I discovered that Wiktionary links show up as local URLs, and wasn't able to fix this via the API, so I changed it on the client side. It's not rocket science to get data from Wiktionary. Let's add this and other online features asap.

It turns out to be 1 line of code (using a PIP package) to have Google translate a string of text and I added that to the file. I also got Azure translation working. It's not 1 line, but it's not bad. I'll go through this: https://en.wikipedia.org/wiki/Comparison_of_machine_translation_applications and find another FOSS one to talk to.

It seems like LibreOffice could hook up to a number of online services, and have a dialog box which let you configure what is enabled via the right-click menu. The Azure API needs a key, for example.
Comment 20 Heiko Tietze 2019-03-22 08:12:34 UTC
(In reply to Keith Curtis from comment #19)
> Is that information available via UNO?

Here is a automatically updated list of UNO commands https://wiki.documentfoundation.org/Development/DispatchCommands You can grep the code with http://opengrok.libreoffice.org/

If the questions go more into detail it's better to ask the developers on IRC #libreoffice-dev (see also https://wiki.documentfoundation.org/Development)