Merge lp:~jcsackett/launchpad/package-pickers-navigation-jumps into lp:launchpad

Proposed by j.c.sackett
Status: Merged
Approved by: j.c.sackett
Approved revision: no longer in the source branch.
Merged at revision: 13265
Proposed branch: lp:~jcsackett/launchpad/package-pickers-navigation-jumps
Merge into: lp:launchpad
Diff against target: 37 lines (+9/-0)
2 files modified
lib/canonical/launchpad/icing/style-3-0.css (+4/-0)
lib/lp/app/browser/tales.py (+5/-0)
To merge this branch: bzr merge lp:~jcsackett/launchpad/package-pickers-navigation-jumps
Reviewer Review Type Date Requested Status
Benji York (community) code Approve
Review via email: mp+65222@code.launchpad.net

This proposal supersedes a proposal from 2011-06-17.

Commit message

[r=benji][bug=698020,698024] Fixes a few minor UI issues with package picker.

Description of the change

Summary
=======
Package pickers have a variety of visual issues.

* Navigation links change position as you navigate through batches because the picker can resize for longer package names
* BinaryAndSourcePackageNames aren't recognized as a type of Package name, so they get the bullet point sprite css, instead of package sprite css.

This fixes those two issues.

Proposed Fix
============
* Set the picker widget to use a fixed width, so that it doesn't resize as the batch loads.
* Update the code selecting the sprite css to provide the package sprite for IBinaryAndSourcePackageName

Preimplementation
=================
Spoke with Curtis Hovey about the CSS fixes for the picker.

Implementation
==============
lib/lp/app/browser/tales.py
---------------------------
* Updated the code that provides sprite_css to provide the appropriate sprite for IBInaryAndSourcePackageNames

lib/canonical/launchpad/icing/style-3-0.css
-------------------------------------------
* Changed yui3-picker's width to 40%, to closely mimic its previous 'auto' behavior but have a fixed width at a given window size.

Tests
=====
No new tests, as these were trivial cosmetic changes.

QA
==
Follow through the instructions on the linked bugs, which provide "What should happen" examples for QA.

Lint
====
make lint was not generating output for me. I will get it running and fix any lint before landing.

To post a comment you must log in.
Revision history for this message
Benji York (benji) wrote : Posted in a previous version of this proposal

The building of JavaScript via a page template in form-picker-macros.pt
looks like a JS injection hazard.

In particular the strings inserted verbatim from the view. The JS
should really be just a string literal (or even better, moved to its own
file) and the data can be exposed to the browser using the JSON request
cache (see IJSONRequestCache).

Revision history for this message
j.c.sackett (jcsackett) wrote : Posted in a previous version of this proposal

I concur, but I think that's a separate bug; I proposed this based on a rollback of something else since I needed that rollback to be able to do this, but as it has since landed I think the diff is out of date and confusing the issue.

I'm going to update and resubmit this MP.

Revision history for this message
Benji York (benji) :
review: Approve (code)

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 2011-06-09 13:49:54 +0000
3+++ lib/canonical/launchpad/icing/style-3-0.css 2011-06-20 15:52:47 +0000
4@@ -1939,6 +1939,10 @@
5 }
6
7 /* Picker styles */
8+.yui3-picker {
9+ width: 40%;
10+ }
11+
12 .yui3-picker-results div.badge {
13 position: absolute;
14 top: 3px;
15
16=== modified file 'lib/lp/app/browser/tales.py'
17--- lib/lp/app/browser/tales.py 2011-06-01 13:25:21 +0000
18+++ lib/lp/app/browser/tales.py 2011-06-20 15:52:47 +0000
19@@ -64,6 +64,9 @@
20 from lp.soyuz.enums import ArchivePurpose
21 from lp.soyuz.interfaces.archive import IPPA
22 from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet
23+from lp.soyuz.interfaces.binarypackagename import (
24+ IBinaryAndSourcePackageName,
25+ )
26 from lp.registry.interfaces.distribution import IDistribution
27 from lp.registry.interfaces.distributionsourcepackage import (
28 IDistributionSourcePackage,
29@@ -741,6 +744,8 @@
30 return 'sprite branch'
31 elif ISpecification.providedBy(context):
32 return 'sprite blueprint'
33+ elif IBinaryAndSourcePackageName.providedBy(context):
34+ return 'sprite package-source'
35 return None
36
37 def default_logo_resource(self, context):