sugarlabs / sugar-web

Components for Sugar web activities
Apache License 2.0
13 stars 32 forks source link

Merge sugar-web work from Sugarizer. #127

Open icarito opened 7 years ago

icarito commented 7 years ago

While similar, it would be good to keep track and avoid to diverge these two. Currently env.isStandalone() is different for Sugarizer and this breaks WebKit2 webactivities.

quozl commented 7 years ago

+1.

If it helps, https://github.com/zhirzh/sugarizer-activity-moon/issues/12 describes an issue with the Stop button when the Sugarizer Moon activity is tested on Sugar desktop.

tony37 commented 7 years ago

Hi, James

Web activities would not respond to quit or to ctrl + q. it could only be terminated through the frame. I didn't keep good records because I assumed this was a Sugar issue, not an issue connected to the coding of the activity.

Tony

On 04/29/2017 08:44 AM, James Cameron wrote:

+1.

If it helps, zhirzh/sugarizer-activity-moon#12 https://github.com/zhirzh/sugarizer-activity-moon/issues/12 describes an issue with the Stop button when the Sugarizer Moon activity is tested on Sugar desktop.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sugarlabs/sugar-web/issues/127#issuecomment-298135831, or mute the thread https://github.com/notifications/unsubscribe-auth/AAULkkG57SK2BFg86L6VThQida1-khJLks5r0ofjgaJpZM4NLHjk.

quozl commented 7 years ago

But not all web activities. Gears-6.2 and FindWords-3.1 we ship on OLPC OS 16.04.2 do respond to Stop button and ctrl+q.

It isn't an issue with Sugar, it is an issue with some web activities. The web activities include within them a copy of sugar-web (this repository), and so any fix will require new releases of affected activities.

A developer will be interested in a recursive diff (e.g. meld(1)) of https://github.com/llaske/sugarizer/tree/master/activities/Moon.activity/lib/sugar-web vs https://github.com/sugarlabs/sugar-web ... I've done that, and the changes are extensive.

My guess is that Sugarizer has made changes to sugar-web or has used other JavaScript libraries that accidentally block the feature on Sugar desktop; and they aren't testing their activities on Sugar desktop so they wouldn't have found out before release.

icarito commented 7 years ago

James @quozl, I believe this should be fixed with my embedded copy of sugar-web. In any case, I believe most if not all activities should work by just swapping sugar-web directory for a working one.

quozl commented 7 years ago

@icarito, yes, I think you're right. It will be interesting to hear the result.

icarito commented 7 years ago

Ah, missed to share the link https://github.com/somosazucar/artisan/blob/master/Jappy.activity/lib/sugar-web/env.js#L63 - I think this could be merged. I'll test moon with this.

icarito commented 7 years ago

Okay, with my patch to sugarizer's sugar-web the Activity properly colors the icon and the Stop button actually works in Sugar. There appears however to be an issue, I observed the javascript console complaining about the activity trying to save a non-text object (this stops the first display, but pushing toolbar icons makes it finally work).

tony37 commented 7 years ago

I created an activity HelloWeb to provide a minimal sugar-web-activity corresponding to HelloWorld. Most of the additional code appears to come from require.js. It does not contain a reference to sugar-web. I tried it and it responds to quit as expected.

If 'sugar-web' something that was needed earlier but no longer?

Tony

On 04/29/2017 10:18 AM, Sebastian Silva wrote:

Ah, missed to share the link https://github.com/somosazucar/artisan/blob/master/Jappy.activity/lib/sugar-web/env.js#L63

  • I think this could be merged. I'll test moon with this.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sugarlabs/sugar-web/issues/127#issuecomment-298141189, or mute the thread https://github.com/notifications/unsubscribe-auth/AAULkvdbsYFD1KVB1rEAhg0BGqCCWFwpks5r0p3-gaJpZM4NLHjk.

icarito commented 7 years ago

Tony, check HelloWorld.activity/lib/sugar-web - it has to be there and is bundled with every web activity.

tony37 commented 7 years ago

Hi, Sebastian,

You are right. The activity is HelloWeb (HelloWorld is the python counterpart).

On Ubuntu 16.04 0.106.1, the activity quits as expected.

Tony

On 04/29/2017 10:27 AM, Sebastian Silva wrote:

Tony, check |HelloWorld.activity/lib/sugar-web| - it has to be there and is bundled with every web activity.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sugarlabs/sugar-web/issues/127#issuecomment-298141608, or mute the thread https://github.com/notifications/unsubscribe-auth/AAULkttUzGy9kP8GXah-dXhseRQL2HBMks5r0qAtgaJpZM4NLHjk.

b18050 commented 4 years ago

Hello @quozl , I have copied Moon.activity directory from llaske/sugarizer/activities and pasted in sugar/activities . The activity started well in sugar but stop-button did not work. So, I want to ask does sugar supports sugarizer activities?

quozl commented 4 years ago

It once worked. It doesn't now. You may have to recreate the missing support by fixing a bug or two. See also https://github.com/sugarlabs/GSoC/blob/5ac9c642ff8c307e9348c2d357d0241c51d2cab4/Ideas-2020.md#port-sugarizer-activities-to-sugar for a summary of the situation.

b18050 commented 4 years ago

So , I need to modify lib/sugar-web of Moon.activity to be able to run in sugar.

quozl commented 4 years ago

I don't know. How do you know this? The stop button problem could easily be in the gwebsockets or Sugar API.

b18050 commented 4 years ago

Sorry @quozl for making that guess. I thought we need to modify sugar-web of every activity individually.

quozl commented 4 years ago

We need to find where the problem is caused, and fix it. If a cause is in the JavaScript of sugar-web, then sure, we'll need to change sugar-web of every activity. But if a cause is in Sugar, we only need to change Sugar. I don't know where the cause is.

srevinsaju commented 4 years ago

@quozl can't we use the builtin sugarizer presence.js for sugar too. This will only create the need to serve the index.html on a port, so using a webview, we may access the web-activities. This is just a intuition, but thats the easiest possible way it would work, probably :)

quozl commented 4 years ago

@srevinsaju, not sure I understand, sorry. Do you mean switching from Telepathy to presence.js for Python activities? Or do you mean using presence.js in Sugar Web activities to add collaboration instead of interoperating with Telepathy? As far as I can recall, presence.js was added because Sugarizer didn't have collaboration, even though Sugar did at the time, and using Telepathy was impossible because there was no way to execute it in the browser.

llaske commented 4 years ago

I guess @srevinsaju mentioned presence.js because in Sugar Web Sugarizer it's included in activity.js here and launched at activity setup. BTW it's possible to ignore it or implement it in another way on Sugar by doing a test at the beginning of the file like it's done in other Sugar Web files imported in Sugarizer like here for example. Regarding the need to change lib/sugar-web directory in all Sugarizer activities. Yes of course all lib/sugar-web directories should be change but if Sugar-Web Sugarizer is back-ported to Sugar, I will be happy to do that.

quozl commented 4 years ago

https://github.com/sugarlabs/gwebsockets/pull/10 fixes the Sugar Moon activity stop button and datastore on Sugar 0.116. It was a Port to Python 3 incomplete work. However, the Sugar Moon activity uses an older or different lib/sugar-web than the Sugarizer Moon activity.