Merge lp:~sinzui/launchpad/milestone-design-oops into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/milestone-design-oops
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~sinzui/launchpad/milestone-design-oops
Reviewer Review Type Date Requested Status
Michael Nelson (community) code ui* Approve
Review via email: mp+11946@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

This is my branch to fix timeout issues and IProject issues with the
milestone page and improve the layout.

    lp:~sinzui/launchpad/milestone-design-oops
    Diff size: 155
    Launchpad bug: https://bugs.launchpad.net/bugs/430726
    Test command: ./bin/test -vv -t "milestone-views|object-milestones"
    Pre-implementation: wgrant
    Target release: 3.1.0

= Fix timeout issues and IProject issues with the milestone page =

There is a content and a design problem with the milestone page.

1. There are many more timeouts because of the cost of showing the bug tags.
    Remove them, they do not work well are they are in the design.

2. For most users, the side bar has one link, and if the context is an
   IProject, there is no side bar. The content does not fill the page well.
   Remove the side bar from the IProject case, consider moving the three
   action links inline or float a fake side bar so that the content can fill
   the page.

== Rules ==

1. Removed the tags from the page.

2. This is hard to do. I had several failures before settling on the CSS
   approach.
   a) I could not conditional set the page macro
   b) I could not reliably make a mock side bar in a main_only template --
      If someone changed the yui-* definition in the CSS, the template would
      be out of sync.
   c) I tried using CSS to collapse the yui-* widths to reclaim the space,
      but Firefox ignored them
   d) I decided to give up a just add a conditional CSS block that hides the
      empty background of the side bar.

3. I then saw that the Project milestone table is still very compressed
   because it has a "Product" column. Well that is not right. It should
   read "Project"

4. The I experimented with a new class that was on a different z-index and
   very wide. The bug and spec work items filled the space very well.

5. I decided to a .wide to the release files portlets so that its description
   was not compressed.

== QA ==

The side bar and wide tables show look like these images.
    http://people.canonical.com/~curtis/milestones/

== Lint ==

Linting changed files:
  lib/canonical/launchpad/icing/style-3-0.css
  lib/lp/registry/browser/tests/milestone-views.txt
  lib/lp/registry/stories/milestone/object-milestones.txt
  lib/lp/registry/templates/milestone-index.pt

== Test ==

    * lib/lp/registry/browser/tests/milestone-views.txt
      * Added a test to verify that CSS is added to hide the project group
        milestone side bar.
    * lib/lp/registry/stories/milestone/object-milestones.txt
      * Updated the test to verify that the UI uses "Project", not "Product".

== Implementation ==

    * lib/canonical/launchpad/icing/style-3-0.css
      * Added a wide rule for content to reclaim the space lost to the
        side bar.
    * lib/lp/registry/templates/milestone-index.pt
      * Added CSS for the is_project_milestone condition
      * Added .wide to the product release files portlet and the bug/blueprint
        work items portlet
      * Removed the bug tags that were cause a zillion queries.

Revision history for this message
Michael Nelson (michael.nelson) wrote :
Download full text (10.9 KiB)

> This is my branch to fix timeout issues and IProject issues with the
> milestone page and improve the layout.
>

Hi Curtis, thanks for all the details here - and for finding a solution
to a common problem!

r=me (code/ui*)

I've got some questions below, but I'll leave it up to you whether they
are worth considering.

> lp:~sinzui/launchpad/milestone-design-oops
> Diff size: 155
> Launchpad bug: https://bugs.launchpad.net/bugs/430726
> Test command: ./bin/test -vv -t "milestone-views|object-milestones"
> Pre-implementation: wgrant
> Target release: 3.1.0

Did I miss 3.0?

>
>
> = Fix timeout issues and IProject issues with the milestone page =
>
> There is a content and a design problem with the milestone page.
>
> 1. There are many more timeouts because of the cost of showing the bug tags.
> Remove them, they do not work well are they are in the design.
>
> 2. For most users, the side bar has one link, and if the context is an
> IProject, there is no side bar. The content does not fill the page well.
> Remove the side bar from the IProject case, consider moving the three
> action links inline or float a fake side bar so that the content can fill
> the page.
>
>
> == Rules ==
>
> 1. Removed the tags from the page.

Great.

>
> 2. This is hard to do. I had several failures before settling on the CSS
> approach.
> a) I could not conditional set the page macro

I haven't need to do this but, if it's helpful, I found an example at:

http://docs.zope.org/zope2/zope2book/source/ZPT.html#macro-details

I assume this should work the same for us?

> b) I could not reliably make a mock side bar in a main_only template --
> If someone changed the yui-* definition in the CSS, the template would
> be out of sync.

Yep, good catch.

> c) I tried using CSS to collapse the yui-* widths to reclaim the space,
> but Firefox ignored them
> d) I decided to give up a just add a conditional CSS block that hides the
> empty background of the side bar.

This seems to work well.

>
> 3. I then saw that the Project milestone table is still very compressed
> because it has a "Product" column. Well that is not right. It should
> read "Project"
>
> 4. The I experimented with a new class that was on a different z-index and
> very wide. The bug and spec work items filled the space very well.

Great.

>
> 5. I decided to a .wide to the release files portlets so that its description
> was not compressed.

Yes, I agree it looks better.

>
>
> == QA ==
>
> The side bar and wide tables show look like these images.
> http://people.canonical.com/~curtis/milestones/
>
>
> == Lint ==
>
> Linting changed files:
> lib/canonical/launchpad/icing/style-3-0.css
> lib/lp/registry/browser/tests/milestone-views.txt
> lib/lp/registry/stories/milestone/object-milestones.txt
> lib/lp/registry/templates/milestone-index.pt
>
>
> == Test ==
>
> * lib/lp/registry/browser/tests/milestone-views.txt
> * Added a test to verify that CSS is added to hide the project group
> milestone side bar.
> * lib/lp/registry/stories/milestone/object-milestones.txt
> ...

review: Approve (code ui*)
Revision history for this message
Curtis Hovey (sinzui) wrote :
Download full text (8.4 KiB)

On Thu, 2009-09-17 at 08:30 +0000, Michael Nelson wrote:
> Review: Approve code ui*
> > This is my branch to fix timeout issues and IProject issues with the
> > milestone page and improve the layout.
> >
>
> Hi Curtis, thanks for all the details here - and for finding a solution
> to a common problem!
>
> r=me (code/ui*)
>
> I've got some questions below, but I'll leave it up to you whether they
> are worth considering.
>
> > lp:~sinzui/launchpad/milestone-design-oops
> > Diff size: 155
> > Launchpad bug: https://bugs.launchpad.net/bugs/430726
> > Test command: ./bin/test -vv -t "milestone-views|object-milestones"
> > Pre-implementation: wgrant
> > Target release: 3.1.0
>
> Did I miss 3.0?

3.0 is mis named. The series is 3.1.

> >
> >
> > = Fix timeout issues and IProject issues with the milestone page =
> >
> > There is a content and a design problem with the milestone page.
> >
> > 1. There are many more timeouts because of the cost of showing the bug tags.
> > Remove them, they do not work well are they are in the design.
> >
> > 2. For most users, the side bar has one link, and if the context is an
> > IProject, there is no side bar. The content does not fill the page well.
> > Remove the side bar from the IProject case, consider moving the three
> > action links inline or float a fake side bar so that the content can fill
> > the page.
> >
> >
> > == Rules ==
> >
> > 1. Removed the tags from the page.
>
> Great.
>
> >
> > 2. This is hard to do. I had several failures before settling on the CSS
> > approach.
> > a) I could not conditional set the page macro
>
> I haven't need to do this but, if it's helpful, I found an example at:
>
> http://docs.zope.org/zope2/zope2book/source/ZPT.html#macro-details
>
> I assume this should work the same for us?

I am very familiar with metal and tal. The problem is the we are *way*
to clever for our own good. There is some crazy abstraction going on
when we call macro: that ensures we call the whole macro...getting part
of the object is a no-no. I thought I could create two <html> nodes for
each condition:

        <html
          xmlns="http://www.w3.org/1999/xhtml"
          xmlns:tal="http://xml.zope.org/namespaces/tal"
          xmlns:metal="http://xml.zope.org/namespaces/metal"
          xmlns:i18n="http://xml.zope.org/namespaces/i18n"
          tal:omit-tag="not: view/is_project_milestone"
          metal:use-macro="view/macro:page/main_side"
          i18n:domain="launchpad">
        <html
          tal:omit-tag="view/is_project_milestone"
          metal:use-macro="view/macro:page/main_only">

But once we call the first one, the state is set.

The object state cannot be monkeyed with because we are talking to a
cached proxy that guards access to the real object. So I cannot get the
the object in python and pass it as a variable.

I think we could dismantle the insanity when we tear out the 1.0 and 2.0
support from the macro.

> > b) I could not reliably make a mock side bar in a main_only template --
> > If someone changed the yui-* definition in the CSS, the template would
> > be out of sync.
>
> Yep, good catch....

Read more...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/icing/style-3-0.css'
2--- lib/canonical/launchpad/icing/style-3-0.css 2009-09-14 10:13:55 +0000
3+++ lib/canonical/launchpad/icing/style-3-0.css 2009-09-17 03:28:21 +0000
4@@ -237,7 +237,10 @@
5 padding: 0 0 0.5em 0;
6 margin: 0 0 1em;
7 }
8-
9+.wide {
10+ z-index: 10;
11+ width: 131%;
12+ }
13 .warning.message {
14 margin-top: 17px;
15 }
16
17=== modified file 'lib/lp/registry/browser/tests/milestone-views.txt'
18--- lib/lp/registry/browser/tests/milestone-views.txt 2009-09-11 20:38:21 +0000
19+++ lib/lp/registry/browser/tests/milestone-views.txt 2009-09-17 02:38:00 +0000
20@@ -259,6 +259,29 @@
21
22 >>> login_person(person)
23
24+
25+Project milestones
26+------------------
27+
28+The projectgroup milestones are virtual and cannot be modified. The template
29+generates CSS that hides the space occupied by the side portlets.
30+
31+ >>> projectgroup = factory.makeProject(name='flock')
32+ >>> product.project = projectgroup
33+ >>> project_milestone = projectgroup.getMilestone('kakapo')
34+ >>> view = create_initialized_view(
35+ ... project_milestone, '+index', principal=person)
36+ >>> print find_tag_by_id(view.render(), 'hide-side-portlets')['type']
37+ text/css
38+
39+A normal milestone does not have the CSS rule.
40+
41+ >>> view = create_initialized_view(
42+ ... milestone, '+index', principal=person)
43+ >>> print find_tag_by_id(content, 'hide-side-portlets')
44+ None
45+
46+
47 Editing milestones
48 ------------------
49
50
51=== modified file 'lib/lp/registry/stories/milestone/object-milestones.txt'
52--- lib/lp/registry/stories/milestone/object-milestones.txt 2009-09-14 15:03:45 +0000
53+++ lib/lp/registry/stories/milestone/object-milestones.txt 2009-09-17 03:54:06 +0000
54@@ -122,13 +122,13 @@
55
56 >>> specs = find_tag_by_id(anon_browser.contents, 'milestone_specs')
57 >>> print extract_text(specs)
58- Blueprint Product Priority Assignee Delivery
59+ Blueprint Project Priority Assignee Delivery
60 Title evolution specification Evolution High Unknown
61 Title gnomebaker specification gnomebaker High Unknown
62
63 >>> bugtasks = find_tag_by_id(anon_browser.contents, 'milestone_bugtasks')
64 >>> print extract_text(bugtasks)
65- Bug report Product Importance Assignee Status ...
66+ Bug report Project Importance Assignee Status ...
67 Milestone test bug for evolution Evolution Undecided Confirmed ...
68 Milestone test bug for gnomebaker gnomebaker Undecided Confirmed ...
69 Milestone test bug for evolution series trunk Undecided Confirmed
70
71=== modified file 'lib/lp/registry/templates/milestone-index.pt'
72--- lib/lp/registry/templates/milestone-index.pt 2009-09-14 19:28:26 +0000
73+++ lib/lp/registry/templates/milestone-index.pt 2009-09-17 03:54:06 +0000
74@@ -6,6 +6,15 @@
75 metal:use-macro="view/macro:page/main_side"
76 i18n:domain="launchpad">
77
78+ <tal:css metal:fill-slot="head_epilogue"
79+ condition="view/is_project_milestone">
80+ <style id="hide-side-portlets" type="text/css">
81+ .side {
82+ background: #fff;
83+ }
84+ </style>
85+ </tal:css>
86+
87 <body>
88 <tal:heading metal:fill-slot="heading">
89 <h1 tal:content="view/milestone/title" >project 1.x series</h1>
90@@ -183,11 +192,11 @@
91 </div>
92 </div>
93
94- <tal:release
95- condition="view/release"
96- replace="structure view/milestone/@@+productrelease-data" />
97+ <div class="wide"
98+ tal:condition="view/release"
99+ tal:content="structure view/milestone/@@+productrelease-data" />
100
101- <div class="portlet">
102+ <div class="portlet wide">
103 <h2>
104 <span id="specification-count" style="color: #3594bb;"
105 tal:content="structure view/specification_count_text">2</span>
106@@ -205,7 +214,7 @@
107 <th colspan="2">Blueprint</th>
108 <th style="width: 14em"
109 tal:condition="view/is_project_milestone">
110- Product
111+ Project
112 </th>
113 <th style="width: 9em;">Priority</th>
114 <th style="width: 14em;">Assignee</th>
115@@ -261,7 +270,7 @@
116 <th colspan="4">Bug report</th>
117 <th style="width: 14em"
118 tal:condition="view/is_project_milestone">
119- Product
120+ Project
121 </th>
122 <th style="width: 9em;">Importance</th>
123 <th style="width: 14em;">Assignee</th>
124@@ -280,20 +289,6 @@
125 tal:content="bugtask/bug/title/fmt:shorten/65">
126 Bug Title Here
127 </a>
128- <tal:has-tags
129- condition="bugtask/bug/tags|nothing">
130- <br />
131- <span id="tag-list">
132- <a tal:repeat="tag bugtask/@@+index/official_tags"
133- tal:content="tag"
134- class="official-tag"
135- tal:attributes="href string:${context/target/fmt:url:bugs}/+bugs?field.tag=${tag}">tag</a>
136- <a tal:repeat="tag bugtask/@@+index/unofficial_tags"
137- tal:content="tag"
138- class="unofficial-tag"
139- tal:attributes="href string:${context/target/fmt:url:bugs}/+bugs?field.tag=${tag}">tag</a>
140- </span>
141- </tal:has-tags>
142 </td>
143 <td style="padding-right: 5px; text-align:right">
144 <img src="/@@/info" tal:replace="structure bugtask/image:badges" />
145@@ -355,8 +350,7 @@
146 </div>
147 </div>
148
149- <tal:side metal:fill-slot="side"
150- define="overview_menu context/menu:overview">
151+ <tal:side metal:fill-slot="side">
152 <tal:menu replace="structure view/milestone/@@+global-actions" />
153 </tal:side>
154 </body>
155