Empty cards attributes are ignored

Bug #1355901 reported by David Callé
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-scopes-shell
Invalid
Undecided
Unassigned
unity8 (Ubuntu)
Fix Released
High
Michał Sawicz
unity8 (Ubuntu RTM)
Fix Released
Undecided
Unassigned

Bug Description

Empty cards attributes, which should be used for attributes layouting, are currently ignored.

[{"style": "highlighted", "value": "$0.55"}, {"value": " "}, {"value": " "}, {"value": "10m"}] shows only one line of attributes instead of the expected two.

Related branches

Revision history for this message
Michał Sawicz (saviq) wrote :

The same works in tryCard, so something must be flattening them somehow.

Changed in unity8:
status: New → Triaged
importance: Undecided → High
Michał Sawicz (saviq)
Changed in unity-scopes-shell:
status: New → Invalid
Changed in unity8:
status: Triaged → In Progress
assignee: nobody → Michał Sawicz (saviq)
Revision history for this message
Michał Sawicz (saviq) wrote :

With the attached branch I was able to get all the expected combinations to work.

There's one caveat though: first row is the king. That's what decides on column widths for the whole set of attributes.

To achieve a 1 per line effect, you need to remember that you need to also send the trailing empty attributes, otherwise it'll lay out 3 in a row.

Revision history for this message
David Callé (davidc3) wrote :

Works great, thanks!

Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
status: New → In Progress
Changed in unity8 (Ubuntu RTM):
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity8 - 8.00+14.10.20140827.2-0ubuntu1

---------------
unity8 (8.00+14.10.20140827.2-0ubuntu1) utopic; urgency=low

  [ Michał Sawicz ]
  * Implement scope header customization options
  * Don't ignore empty attributes in CardAttributes.qml and improve its
    encapsulation (LP: #1355901)
  * Add support for preview button color customization. Deprecate
    support for action icons.
  * Add table preview widget
  * Make "See Less" get stuck at the bottom of the view
  * Support alternative navigation in the dash.
  * Add scope settings UI
  * Add scope favoriting support
  * Passcode, not PIN (LP: #1361114)

  [ Jussi Pakkanen ]
  * Use nullptr instead of NULL.

  [ Albert Astals ]
  * Add table preview widget
  * Make "See Less" get stuck at the bottom of the view
  * Support alternative navigation in the dash.
  * Make the PageHeaderLabelTest pass under valgrind

  [ Benjamin Zeller ]
  * Add support for scope:// url in the dash (LP: #1361349)

  [ Marcus Tomlinson ]
  * Handle the openScope signal in "tempScopeItem" (ScopesOverview.qml)
    as is done with "scopeItem" (Dash.qml) (LP: #1356410)

  [ Daniel d'Andrada ]
  * Make "See Less" get stuck at the bottom of the view

  [ Andrea Cimitan ]
  * Fix right padding on overlay card
  * Add scope settings UI

  [ Michael Zanetti ]
  * use a smaller asset for the app's dropshadow (LP: #1359157)
 -- Ubuntu daily release <email address hidden> Wed, 27 Aug 2014 15:37:05 +0000

Changed in unity8 (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity8 - 8.00+14.10.20140827.2-0ubuntu1

---------------
unity8 (8.00+14.10.20140827.2-0ubuntu1) 14.09; urgency=low

  [ Michał Sawicz ]
  * Implement scope header customization options
  * Don't ignore empty attributes in CardAttributes.qml and improve its
    encapsulation (LP: #1355901)
  * Add support for preview button color customization. Deprecate
    support for action icons.
  * Add table preview widget
  * Make "See Less" get stuck at the bottom of the view
  * Support alternative navigation in the dash.
  * Add scope settings UI
  * Add scope favoriting support
  * Passcode, not PIN (LP: #1361114)

  [ Jussi Pakkanen ]
  * Use nullptr instead of NULL.

  [ Albert Astals ]
  * Add table preview widget
  * Make "See Less" get stuck at the bottom of the view
  * Support alternative navigation in the dash.
  * Make the PageHeaderLabelTest pass under valgrind

  [ Benjamin Zeller ]
  * Add support for scope:// url in the dash (LP: #1361349)

  [ Marcus Tomlinson ]
  * Handle the openScope signal in "tempScopeItem" (ScopesOverview.qml)
    as is done with "scopeItem" (Dash.qml) (LP: #1356410)

  [ Daniel d'Andrada ]
  * Make "See Less" get stuck at the bottom of the view

  [ Andrea Cimitan ]
  * Fix right padding on overlay card
  * Add scope settings UI

  [ Michael Zanetti ]
  * use a smaller asset for the app's dropshadow (LP: #1359157)
 -- Ubuntu daily release <email address hidden> Wed, 27 Aug 2014 15:37:05 +0000

Changed in unity8 (Ubuntu RTM):
status: In Progress → Fix Released
Changed in unity8:
status: In Progress → Fix Released
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

I needed to have a second attribute display on a new line so I added the center tuple (with Value as empty string) and the result was that only first attribute displays instead of the final attribute (time_s) displaying on a new line as I wanted:

        us::VariantBuilder attrs;
        attrs.add_tuple({
            {"value", us::Variant(date_s.toStdString())}
        });
        attrs.add_tuple({
            {"value", us::Variant("")}
        });
        attrs.add_tuple({
            {"value", us::Variant(time_s.toStdString())}
        });
        res["attributes"] = attrs.end()

phablet@ubuntu-phablet:/tmp$ apt-cache policy libunity-scopes3
libunity-scopes3:
  Installed: 0.6.4+14.10.20140828.1-0ubuntu

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

learned on irc one needs to have declare the attributes like this:
"attributes": {"field": "attributes", "max-count": 4},

And then have a tuple with an empty "Value" key to act I guess like a newline, like this, which works:
        us::VariantBuilder attrs;
        attrs.add_tuple({
            {"value", us::Variant(date_s.toStdString())}
        });
        attrs.add_tuple({
            {"value", us::Variant("")}
        });
        attrs.add_tuple({
            {"value", us::Variant(time_s.toStdString())}
        });
        attrs.add_tuple({
            {"value", us::Variant("")}
        });
        res["attributes"] = attrs.end()

Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
assignee: nobody → Michał Sawicz (saviq)
importance: Undecided → High
no longer affects: unity8
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.