After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728293 - Port to WebKit2 or GtkTextView
Port to WebKit2 or GtkTextView
Status: RESOLVED FIXED
Product: bijiben
Classification: Applications
Component: Edition
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: Bijiben maintainer(s)
Bijiben maintainer(s)
available
Depends on:
Blocks: 686373 728876
 
 
Reported: 2014-04-15 20:35 UTC by Pierre-Yves Luyten
Modified: 2017-08-23 12:47 UTC
See Also:
GNOME target: 3.22
GNOME version: ---


Attachments
editor: Remove unused code in preparation for WebKit2 port (44.24 KB, patch)
2016-03-09 13:54 UTC, Carlos Garcia Campos
accepted-commit_now Details | Review
WIP: Port to WebKit2 (54.55 KB, patch)
2016-03-09 14:01 UTC, Carlos Garcia Campos
committed Details | Review
WK2 Editor Issues (15.92 KB, image/png)
2017-03-14 00:22 UTC, Isaque Galdino
  Details

Comment 1 Pierre-Yves Luyten 2014-04-15 20:36:23 UTC
Adding features to the editor should wait for this.
Comment 2 Marcos Chavarria Teijeiro 2014-11-21 08:54:00 UTC
Hi! Is there anybody working on this port???
Comment 3 Pierre-Yves Luyten 2014-11-21 11:21:38 UTC
(In reply to comment #2)
> Hi! Is there anybody working on this port???

Hi,

"Assigned" might not be the right status as of today.

Some work has been done inside GSoC context. However, somme comment recently happened : see https://bugzilla.gnome.org/show_bug.cgi?id=728859#c7
Comment 4 Michael Catanzaro 2016-01-18 22:31:34 UTC
I just discovered the GSoC work. It is here: https://github.com/xuchunyang/bijiben/commits/WebKit2

I didn't try it out, but it looks abandoned to me.
Comment 5 Pierre-Yves Luyten 2016-01-19 21:33:38 UTC
(In reply to Michael Catanzaro from comment #4)
> I just discovered the GSoC work. It is here:
> https://github.com/xuchunyang/bijiben/commits/WebKit2
> 
> I didn't try it out, but it looks abandoned to me.

Yes the projects still had a lot to finalize. Also it did not implement an "extension". I'm remaning bug title from "Port to WebKit2" to "Port to WebKit2 or GtkTextView".
Comment 6 Matthias Clasen 2016-03-01 23:03:53 UTC
not going to happen for 3.20, I guess
Comment 7 Carlos Garcia Campos 2016-03-09 13:54:09 UTC
Created attachment 323510 [details] [review]
editor: Remove unused code in preparation for WebKit2 port

I don't know why there's so much unused code, we can bring it back from git history if needed eventually, but at the moment it doesn't make sense to port unused code to WebKit2, since we can't even test it.
Comment 8 Carlos Garcia Campos 2016-03-09 14:01:37 UTC
Created attachment 323511 [details] [review]
WIP: Port to WebKit2

This is WIP because it only works for new notes for now, and I don't know what to do with existing notes, but other than that the port is complete. There shouldn't be regressions (at least compared to the version i have in debian testing), but it's the first time I use bijiben, so I might have forgotten something. 
I've converted all the GObject DOM code into JavaScript, using user script messages API to notify the UI process. The problem with new notes is that now both the css and the js file are loaded from the HTML, but those changes are not present in existing notes. So there are several solutions that come to mi mind:

 a) Inject the CSS and js as user stylesheet/javascript. It's more code, but possible.

 b) Do not store the whole HTML for notes, but the body contents, and always add the html, header and body from the application, for new and existing notes.

 c) Add a migrator that reads the notes at startup and migrates them.
Comment 9 Pierre-Yves Luyten 2016-03-09 16:08:21 UTC
thanks

Unused code is historical : editor code comes from evolution work (whenever evolution composer has been ported to Webkit). Unused part have not moved since, so it is obviously right to remove it.


debian testing is 3.18 ; 3.20 does not implement new editor feature, only a light css update : https://git.gnome.org/browse/bijiben/commit/?id=bed6de550b54abbc53be9294c7a853b670aa2b5c


Appart from formating, the biggest no-to-forget-part would be simple text notes, which is used for storage as "memo" or onto ownCloud.

So about the several solutions, b) seems easier. It might be more adapted to alternative notes storage as above : the txt notes would have their own method without adding the js which is only for rich text notes.
if my comment is obscure or wrong please tell me!

i'll try to test patches in decent timeline. also i could branch 3.20 so master is available right now.
Comment 10 Carlos Garcia Campos 2016-03-10 07:11:20 UTC
(In reply to Pierre-Yves Luyten from comment #9)
> thanks
> 
> Unused code is historical : editor code comes from evolution work (whenever
> evolution composer has been ported to Webkit). Unused part have not moved
> since, so it is obviously right to remove it.
> 
> 
> debian testing is 3.18 ; 3.20 does not implement new editor feature, only a
> light css update :
> https://git.gnome.org/browse/bijiben/commit/
> ?id=bed6de550b54abbc53be9294c7a853b670aa2b5c
> 
> 
> Appart from formating, the biggest no-to-forget-part would be simple text
> notes, which is used for storage as "memo" or onto ownCloud.

Ah, I had no idea that existed, how can I try that?

> So about the several solutions, b) seems easier. It might be more adapted to
> alternative notes storage as above : the txt notes would have their own
> method without adding the js which is only for rich text notes.
> if my comment is obscure or wrong please tell me!

I also prefer b) that way we can always add more things to the HTML in the future without having to adapt the existing notes.

> i'll try to test patches in decent timeline. also i could branch 3.20 so
> master is available right now.

We are not in a hurry in any case, since it's too late for 3.20, we have the whole 3.22 cycle.
Comment 11 Michael Catanzaro 2016-03-10 14:24:22 UTC
(In reply to Carlos Garcia Campos from comment #10)
> Ah, I had no idea that existed, how can I try that?

Add an OwnCloud account in gnome-online-accounts (consider Igalia has an internal you can use OwnCloud), open Bijiben, go to Preferences -> Primary Book and select it from the super-squished webview with the massive checkboxes that are only visible via horizontal scrolling. I tested this in 3.18, not your port, so it looks super broken already in 3.18. If anyone wants to fix this, be sure to make the dialog transient for the main window while you're at it.
Comment 12 Pierre-Yves Luyten 2016-05-20 20:07:23 UTC
- Unused code can be removed
- The port is fine for new notes. This includes ownCloud notes, which only show cut / copy / paste / link. "link" is going away (https://bugzilla.gnome.org/show_bug.cgi?id=711594).
  So old notes have to be handled
Comment 13 Pierre-Yves Luyten 2016-05-20 20:19:24 UTC
Carlos, on bug https://bugzilla.gnome.org/show_bug.cgi?id=728859 it is stated : "either WebKitGtk needs to grow the necessary support, or WebKit needs to be replaced with GtkTextView".

I did see this myself, but am not sure about WebKit2. Is this port offering a solution? or the port to WK2 has no impact on bug 728859?
Comment 14 Carlos Garcia Campos 2016-05-23 10:43:35 UTC
(In reply to Pierre-Yves Luyten from comment #13)
> Carlos, on bug https://bugzilla.gnome.org/show_bug.cgi?id=728859 it is
> stated : "either WebKitGtk needs to grow the necessary support, or WebKit
> needs to be replaced with GtkTextView".
> 
> I did see this myself, but am not sure about WebKit2. Is this port offering
> a solution? or the port to WK2 has no impact on bug 728859?

I don't remember, I would need to check all this again, but at a first glance we might need some new api to expose the caret cursor position in Webkit or something like that.
Comment 15 Milan Crha 2016-08-11 08:00:14 UTC
Just a heads-up, evolution-data-server 3.21.90 will link against WebKit2. As I noted for example here [1], anything what links against libedataserverui should also link to WebKit2 (or no WebKit at all, of course), but bijiben still uses WebKit1. You may want to either finish the port for 3.22.0 (or any version before it) or do not link against libedataserverui for now, which may drop some functionality in bijiben, I'm afraid.

I'm sorry for a late notice (and generally bad cooperation from my side).

See also bug #769643 comment #0, its last paragraph about the upcoming Ubuntu 16.10.

[1] https://mail.gnome.org/archives/desktop-devel-list/2016-August/msg00001.html
Comment 16 Michael Catanzaro 2016-08-15 10:21:38 UTC
This is probably 3.21.90 release blocker unless we drop bijiben from gnome-apps. We can't link bijiben to multiple versions of WebKit, so we can't release in its current state. Alternatively, we could release it broken and say it's OK for a development release....
Comment 17 Jeremy Bicha 2016-08-19 15:53:08 UTC
bijiben in general does seem to work with evolution-data-server 3.21.90. Maybe it's just the online accounts part of bijiben that doesn't work (I didn't test that).
Comment 18 Michael Catanzaro 2016-08-19 16:07:57 UTC
If we're lucky then WebKit1 functions will be used whenever there is a name clash, and the only thing broken will be the WebKit2 component of e-d-s that Bijiben doesn't use. But I have no clue how the linker really works, if it's deterministic or not.
Comment 19 Jeremy Bicha 2016-08-19 16:20:25 UTC
I rebuilt bijiben against e-d-s 3.21.90 and like I said, local notes seemed to work.
Comment 20 Pierre-Yves Luyten 2016-08-21 22:35:35 UTC
sorry to come in late, about the Webkit1 note editor : it is used for both local notes, evolution, ownCloud notes. Serializing is different according to note type, but editor is shared.

At worst i guess a little patch would make bijiben read only untill WebKit2.
Comment 21 Jeremy Bicha 2016-08-21 22:55:48 UTC
(In reply to Pierre-Yves Luyten from comment #20)
> sorry to come in late, about the Webkit1 note editor : it is used for both
> local notes, evolution, ownCloud notes. Serializing is different according
> to note type, but editor is shared.
> 
> At worst i guess a little patch would make bijiben read only untill WebKit2.

By default, Bijiben uses local notes. 

I created a memo in Evolution. Bijiben doesn't display it.

In Bijiben, Preferences>Primary Book, I switched the default backend to the Evolution Personal category. I then created a note in Bijiben and Evolution displayed the note ok.

I don't have an owncloud account.
Comment 22 Milan Crha 2016-08-22 08:46:05 UTC
(In reply to Jeremy Bicha from comment #19)
> I rebuilt bijiben against e-d-s 3.21.90 and like I said, local notes seemed
> to work.

It looks like the check for libedataserverui in the configure.ac is not needed. I removed it from there an the bijiben built without issues. I cannot speak about the runtime, because it doesn't start here at all, see bug #744661 and
bug #770223 which prevent the run here.

In any case, the side-effect of the non-usage of the libedataserverui would be that the bijiben would not be able to ask for user's credentials when the evolution-data-server source might need it. That's no problem for local sources and those configured in GNOME Online Accounts (GOA).
Comment 23 Michael Catanzaro 2016-08-22 12:04:54 UTC
(In reply to Milan Crha from comment #22)
> It looks like the check for libedataserverui in the configure.ac is not
> needed. I removed it from there an the bijiben built without issues.

OK, then let's get rid of it, that will avoid the emergency problem of linking to multiple versions of WebKit. I think the editor only works due to luck in the meantime.
Comment 24 Bjørn Lie 2016-09-05 10:33:43 UTC
Hi upstream.

Are we not pretty late in 3.22 cycle?

I feel this has become rather urgent.
Comment 25 Michael Catanzaro 2016-10-04 15:35:03 UTC
See https://blogs.gnome.org/mcatanzaro/2016/09/21/gnome-3-22-core-apps/#comment-282 for an example of breakage. So, as I advised last week on desktop-devel-list, if a release with the double-linking issue fixed does not exist by next Monday, I will remove Bijiben from our JHBuild modulesets and advise distros to drop the package. It looks like it might be trivial to fix, as per comment #22.
Comment 26 Michael Catanzaro 2017-02-01 00:39:49 UTC
Note: Bijiben is the last GNOME app that has not yet been ported to WebKit2. It's going to be removed from Fedora soon as we're going to get rid of our old WebKit package in early March.
Comment 27 Isaque Galdino 2017-03-01 18:15:01 UTC
(In reply to Michael Catanzaro from comment #25)
> It looks like it might be trivial to fix, as per comment #22.

Change commit in master: https://git.gnome.org/browse/bijiben/commit/?id=bff3cc849ca05d6017620ee9849888e84a963a71
Comment 28 Isaque Galdino 2017-03-09 02:27:33 UTC
(In reply to Pierre-Yves Luyten from comment #9)
> Appart from formating, the biggest no-to-forget-part would be simple text
> notes, which is used for storage as "memo" or onto ownCloud.

I've tested current version in Fedora 25 (3.21.2) and ownCloud is not working right. Notes created in Bijiben is not shown correctly in ownCloud and even notes created in ownCloud can't be edit correctly in Bijiben.

So, I suggest to forget about ownCloud now and focus in making the transition to WebKit2 ASAP, then we can concentrate in fixing all these other issues later.

If anyone disagree to this approach, please let me know, but I'm thinking about committing this patch by the end of week, when I finish testing it, because I had to do a small change to apply it.
Comment 29 Pierre-Yves Luyten 2017-03-09 21:26:20 UTC
(In reply to Isaque Galdino from comment #28)
> So, I suggest to forget about ownCloud now and focus in making the
> transition to WebKit2 ASAP, then we can concentrate in fixing all these
> other issues later.
> 
> If anyone disagree to this approach, please let me know, but I'm thinking
> about committing this patch by the end of week, when I finish testing it,
> because I had to do a small change to apply it.

It would be nice to deactivate OwnCloud, so people do not hurt existing notes. Until things work again.
Comment 30 Isaque Galdino 2017-03-14 00:22:11 UTC
Created attachment 347895 [details]
WK2 Editor Issues

Instead of committing this to master, I decided to commit it to a working in progress branch, because I noticed the editor is misbehaving.

I've attached the screenshot so you can see what I'm talking about.

The work in progress branch is wip/igaldino/webkit2-port, so feel free to take a look and help me out to fix that issue.

Thanks.
Comment 31 Isaque Galdino 2017-03-17 13:43:55 UTC
It seems that when fixing the issue in bug: https://bugzilla.gnome.org/show_bug.cgi?id=761765, it also fixed the editor issue.

So, now in wip/igaldino/webkit2-port we should have a kinda working Bijiben in webkit2. Please take a look there and let me know how bad that is ;)
Comment 32 Isaque Galdino 2017-04-18 00:28:36 UTC
I've pushed this change to master (https://git.gnome.org/browse/bijiben/commit/?id=fb7b8bbac5ef3591d2f940f3034a4390468ad01d), so I'll go ahead and close this ticket.
If you find issues related to the webkit2 port, please open tickets accordingly.
I would like to thank Carlos Garcia Campos for this great work.
Comment 33 Isaque Galdino 2017-04-18 00:29:32 UTC
Review of attachment 323511 [details] [review]:

Nice work, thanks for your patch.
Comment 34 Daniel Mustieles 2017-08-23 11:45:11 UTC
Hi all,

Can this issue be marked as Resolved in the wiki page? this is the only remaining module to mark this goal as completed.

Thanks!
Comment 35 Jeremy Bicha 2017-08-23 12:43:53 UTC
(In reply to Daniel Mustieles from comment #34)
> Can this issue be marked as Resolved in the wiki page? this is the only
> remaining module to mark this goal as completed.

Done.
Comment 36 Daniel Mustieles 2017-08-23 12:47:01 UTC
(In reply to Jeremy Bicha from comment #35)
> (In reply to Daniel Mustieles from comment #34)
> > Can this issue be marked as Resolved in the wiki page? this is the only
> > remaining module to mark this goal as completed.
> 
> Done.

Great, thanks! :)