Closed Bug 1009561 Opened 10 years ago Closed 3 years ago

Consider adding ItemType options to panels


(Firefox for Android Graveyard :: Awesomescreen, defect)

Not set


(Not tracked)



(Reporter: lucasr, Unassigned)



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 }

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]( an issue can be reported at the [Fenix GitHub project]( If you want to discuss your report please use [Mozilla's chat]( server and join the [#fenix]( channel.
Closed: 3 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.