Closed Bug 1009561 Opened 9 years ago Closed 2 years ago

Consider adding ItemType options to panels

Categories

(Firefox for Android Graveyard :: Awesomescreen, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: lucasr, Unassigned)

References

Details

Right now, we define the itemtype for a view by using the Item 'enum':

{
  title: gStrings.GetStringFromName("title"),
  views: [
    { type: Home.panels.View.GRID,
      itemType: Home.panels.Item.IMAGE,
      dataset: DATASET_ID }
  ]
};

It would be nice if we could set certain options to configure the items in a view instead of having to create separate item types with small layout veriations. One way to go about this could be to allow add-on developers to optionally define itemType as an object:


{
  title: gStrings.GetStringFromName("title"),
  views: [
    { type: Home.panels.View.GRID,
      itemType: {
         type: Home.panels.Item.IMAGE,
         defaultTitle: gStrings.GetStringFromName("defaultTitle"),
         maxDescriptionLength: 30 
      },
      dataset: DATASET_ID }
  ]
};

Thoughts?
I think this sounds like a good idea. My only concern is bogging down the API with more complicated options, but we can use sensible defaults to counteract that, like how you can omit itemType entirely right now.

I like the idea of default title, but what about other defaults, like a default icon? Adding yet another nested object sounds we might be taking things too far. Perhaps we shouldn't include default data types and leave it up to the add-on's storage logic to take care of that.

I think a good way to start would be just implementing a maximum description length, which would fix the issue reported in bug 1010359. I'm not sure if we should set a specific maximum description, or just disable ellipsizing. I think disabling ellipsizing would be better, since add-on developers could just enforce a max description length when storing their data.
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.