Opened 6 years ago

Last modified 6 years ago

#7685 new defect

Alternate home layouts; fixed ring scaling; better modularization of layouts

Reported by: cscott Owned by: marco
Priority: normal Milestone: 8.2.0 (was Update.2)
Component: sugar Version: not specified
Keywords: r+ Cc: Eben, erikos, tomeu, mstone
Blocked By: Blocking:
Deployments affected: Action Needed: test in release
Verified: no

Description

The attached sugar and sugar-artwork patches add three new home layout views: square, triangle, and spiral. It also fixes the ring view scaling code, so that the ring view better handles large numbers of activities. Some refactoring of the layout code was done to make it easier to add new layouts in the future (requiring patches to fewer separate locations in the code).

With the fixes, the home view layouts can handle up to 120 or so activities. The spiral layout doesn't have any overlapping icons with this number of activities; the mesh layout has a small number (since grid layout gives up if it can't resolve conflicts); and the ring, square, and triangle layouts start overlapping icons, but remain usable.

Attachments (9)

0001-Add-three-new-favorite-views-Square-Triangular-an.patch (9.7 KB) - added by cscott 6 years ago.
Add three new favorite views: Square, Triangular, and "Sunflower".
0002-Fix-icon-radius-sizing-for-ring-based-views.patch (3.9 KB) - added by cscott 6 years ago.
Fix icon & radius sizing for ring-based views.
0003-Tweak-the-reserved-size-for-the-active-activity-ic.patch (2.1 KB) - added by cscott 6 years ago.
Tweak the reserved size for the "active activity" icon.
0004-Save-restore-additional-home-view-layouts-to-from-pr.patch (3.9 KB) - added by cscott 6 years ago.
Save/restore additional home view layouts to/from profile.
0001-Add-icons-for-box-triangle-and-spiral-home-v.patch (5.2 KB) - added by cscott 6 years ago.
sugar-artwork patch: Add icons for 'box', 'triangle', and 'spiral' home view layouts.
0005-Add-documentation-strings-for-favoriteslayout.patch (7.9 KB) - added by cscott 6 years ago.
sugar: Add documentation strings for favoriteslayout.
mazes.tgz (9.5 MB) - added by cscott 6 years ago.
100 instances of the Maze activity, for testing favorites layouts.
Screenshot.png (59.1 KB) - added by cscott 6 years ago.
"Wordless" version, so as not to break string freeze for sucrose-0.82.
Screenshot_1.png (62.3 KB) - added by cscott 6 years ago.
Version using RadioToolButton instead of Menu.

Change History (33)

Changed 6 years ago by cscott

Add three new favorite views: Square, Triangular, and "Sunflower".

Changed 6 years ago by cscott

Fix icon & radius sizing for ring-based views.

Changed 6 years ago by cscott

Tweak the reserved size for the "active activity" icon.

Changed 6 years ago by cscott

Save/restore additional home view layouts to/from profile.

Changed 6 years ago by cscott

sugar-artwork patch: Add icons for 'box', 'triangle', and 'spiral' home view layouts.

comment:1 Changed 6 years ago by cscott

  • Cc Eben added

The attached patches are against 'sugar' git HEAD. The last patch is against 'sugar-artwork' git HEAD.

I showed these to Eben, and he signed off on these changes (especially attachment 0003, which shifts the ring down slightly.)

comment:3 Changed 6 years ago by marco

  • Milestone changed from 8.2.0 (was Update.2) to 9.1.0

My opinion is that we should land this in 9.1 timeframe.

Changed 6 years ago by cscott

sugar: Add documentation strings for favoriteslayout.

comment:4 Changed 6 years ago by cscott

Whether we like it or not, the home view changes are going to be the most controversial part of 8.2. Providing more options may mute the criticism; the fixes in 0002 also make the 'ring' view significantly more useful.

I'm not strongly pushing for a 8.2 release, but I'd suggest it might be a good 'Opportunity' target.

I *would* like review, though: are the basic ideas here sound?

comment:5 Changed 6 years ago by cscott

|TestCase|

Extract the attached mazes.tgz file into ~olpc/Activities. This will give you 100 instances of the Maze activity, numbered Maze00 through Maze99. Go into the list view and select 1, 10, 25, 50, 100 activities as favorites. Verify that all of the favorites layouts look reasonable.

Changed 6 years ago by cscott

100 instances of the Maze activity, for testing favorites layouts.

comment:6 Changed 6 years ago by cscott

Since we've shifted back to ring view as default, I'm going to propose this patch set for 8.2 again: it fixes ring view scaling as you increase the number of activities installed (see test case) in addition to adding the other view alternatives.

comment:7 Changed 6 years ago by mtd

I like the (sugar) patch (it's moved to http://dev.laptop.org/git?p=users/cscott/sugar;a=summary ), especially the modularization parts. Comments on the patch are 1) there are a few times we do "y = m*x+b" instead of "y = m * x + b" that'd be nice to tidy up; and 2) I wish the "RingLayout" class's name could better express that it is suitable as a superclass to {Box,Triangle,Sunflower}Layout - perhaps RingLayout should be renamed BaseLayout and its _calculate_position() function should raise UnimplementedException, and then a new RingLayout defined, which implements that function as the current RingLayout does.

If it were up to me it'd be r+ with those comments. I don't know when it should land, though.

comment:8 Changed 6 years ago by cscott

Rebased on origin; latest patches are at:

http://dev.laptop.org/git/users/cscott/sugar

and

http://dev.laptop.org/git/users/cscott/artwork

I made the whitespace changes mtd requested. The 'BaseLayout' stuff is not so straightforward: we actually do subclass RingLayout (not some generic BaseLayout) and reuse many functions of *RingLayout* in SquareLayout, TriangleLayout, etc. Even if I were to split out a BaseLayout class, SquareLayout and TriangleLayout would still inherit from RingLayout. Look at the superclass method invocations in _compute_position, for example.

In mail to sugar and devel (http://lists.laptop.org/pipermail/devel/2008-September/019077.html) Eben has proposed a deeper rewriting of this layout code. I would like that to be a separate bug/feature for 9.1; this patch should be applied so that hopefully we can get some experience with the ideas of the Sunflower and properly-scaled ring-like layouts, even if that functionality is substantially reimplemented for 9.1 (and of course, if the rewrite doesn't make it for 9.1, then this patch is better than what we've got now).

Commit to master seems appropriate at this time.

comment:9 Changed 6 years ago by cscott

  • Cc erikos tomeu mstone added

Michael's suggested that I might pull the alternate layouts into joyride as a local patch, for broader testing.

It would be nice if I could get at least the innocuous sugar-artwork part of this patch (a few new icons) reviewed & applied to master/sucrose-0.82, so that only sugar would need to be updated to try this out.

comment:10 Changed 6 years ago by marco

Eben, please review the artwork patch... You know more then me about our icon naming policies.

comment:11 Changed 6 years ago by cscott

Attached is a screenshot of a 'wordless' version of the patch, so that string freeze isn't violated.

Changed 6 years ago by cscott

"Wordless" version, so as not to break string freeze for sucrose-0.82.

comment:12 Changed 6 years ago by cscott

Here's the extra patch for the 'wordless' version: http://dev.laptop.org/git?p=users/cscott/sugar;a=commitdiff;h=6d30c50b5d55705a801e519b08d1772acfbe2b7a

Eben says (a) he likes the icons, but he'd tweak the 'spiral' one, and (b) he'd prefer a grey selection box around the selected view. I'll see what I can do.

Changed 6 years ago by cscott

Version using RadioToolButton instead of Menu.

comment:13 Changed 6 years ago by cscott

Revised version of the patch to use RadioToolButton and the custom area of the palette, based on Eben's feedback.

http://dev.laptop.org/git?p=users/cscott/sugar;a=commitdiff;h=e15cfa7249e9e4a8322f60503b10b059df5e159e

comment:14 Changed 6 years ago by mtd

  • Action Needed changed from never set to package
  • Keywords r+ added; r? removed

r+

pushed to sugar 0.82 and master branches

|TestCase|
Go to the Favorites view. Click on the favorites view icon and confirm there are five icons and no words next to those icons.

|TestCase|
Select the Box, Triangle, and "Sunflower" views' icons. Confirm the layout changes appropriately.

comment:15 Changed 6 years ago by cscott

Box, Triangle, and "Sunflower" commented out in master and sucrose-0.82 branches.

From irc:

(12:19:08 PM) eben: we agree we need [list] and [non-list]
(12:19:22 PM) eben: we agree the non-list requires at least [ring, free]
(12:19:25 PM) eben: we agree ring is the default
(12:19:58 PM) okada: eben, yes.
(12:20:15 PM) eben: here's where we disagree:
(12:20:26 PM) eben: I think the spiral is interesting and could be added.
(12:20:29 PM) eben: cms doesn't
(12:20:40 PM) eben: [okada] think[s] if we add one more thing, we should add everything
(12:21:17 PM) eben: I'd propose an alernative, which is [list] and [ring, grid, free] (so we have 3 items in that menu, but each is unique in design...
(12:21:18 PM) okada: eben, thats the right summation
(12:20:43 PM) cms: c_scott: not to spoil the fun, but i don't think this should be in the default list, because i can't see the broad benefit. i think you or i might like it, and should be able to install it as a plug-in, but for most people it's just adding to the number of options to choose from (= more complexity), and the confusion of why someone would pick it over the ring view
(12:21:14 PM) cms: we need to be careful about adding too many options
(12:21:41 PM) cms: c_scott: but that's the point of the list view--to allow kids to choose their favorite activites to show in ring/freeform
(12:21:25 PM) eben: but we can't make a grid happen soon enough.
(12:21:31 PM) okada: grid!
(12:21:39 PM) eben: I'd like a grid, personally
(12:22:21 PM) eben: it's the perfect balance between ring and free.....one is organized but can't hold a ton, the other maximizes space but requires manual organization...

Description of how to re-enable is at http://wiki.laptop.org/go/Hacking_Sugar

comment:16 Changed 6 years ago by marco

Scott, the sunflower is *not* commented out on the sucrose-0.82 branch yet.

comment:17 Changed 6 years ago by cscott

Ah, probably because eben did the commit. =)

Fixed. (sigh)

comment:18 Changed 6 years ago by marco

  • Action Needed changed from package to test in build

comment:19 Changed 6 years ago by marco

  • Milestone changed from 9.1.0 to 8.2.0 (was Update.2)

comment:20 Changed 6 years ago by marco

  • Action Needed changed from test in build to approve for release

comment:21 Changed 6 years ago by marco

This is several git commits... Package is sugar-0.82.8-1.olpc3

comment:22 Changed 6 years ago by mstone

Approved. I _believe_ that sugar-0.82.8-1.olpc3 and sugar-artwork-0.82.2-2 are the correct package NVRs.

|TestCase|

Go to the Favorites view. Click on the favorites view icon and confirm there are two icons and no words next to those icons.

|TestCase|

Follow the instructions at Hacking Sugar to enable the Box, Triangle, and "Sunflower" layouts. Confirm that the layouts become available and function according to their names.

Suggested ChangeLog:

dlo#7685: Add several alternate home-view layouts; disabled by default. Remove layout labels so as not to add strings.

comment:23 Changed 6 years ago by mstone

  • Action Needed changed from approve for release to add to release

comment:24 Changed 6 years ago by cscott

  • Action Needed changed from add to release to test in release

Please test build 761 resulting from build-repo commit b7c11be9.

Note: See TracTickets for help on using tickets.