bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Allow distributions to customize the initial panel config

RESOLVED FIXED in Firefox 41

Status

()

Firefox for Android
General
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Margaret, Assigned: Margaret)

Tracking

Trunk
Firefox 41
All
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox41 fixed, fennec40+)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
The home panel config is stored in SharedPreferences, so if we want distributions to be able to customize the initial set of panels, they'll need a way to set Java-based preferences.

Since we wouldn't want distributions poking around directly in the JSON we store for these panels, we should probably just provide some sort of API to do this, perhaps another JSON file in the distribution to specify a set of home panels. Then Distribution.java can do the dirty work of actually setting the right prefs for HomeConfigPrefsBackend to do its thing.
(Assignee)

Updated

3 years ago
Assignee: nobody → margaret.leibovic
(Remind me why we don't have a Distributions component yet?)

Concur that making this a narrowly scoped JSON file makes sense, but bear in mind that each additional file we stat impacts our first-run perf. We might consider sacrificing a little modularity here, or processing a stream of JarEntries instead of individual files.
Status: NEW → ASSIGNED
OS: Unspecified → Android
Hardware: Unspecified → All
Version: Firefox 35 → Trunk
(Assignee)

Comment 2

3 years ago
We could also make a new section of preferences.json. I was worried that we would accidentally slurp up everything in there into gecko preferences, but there's already some structure to help prevent that.

Maybe something like:

{
  "Global": {
     ...
  },
  "Preferences": {
     ...
  },
  "LocalizablePreferences": {
     ...
  },
  "HomeConfig": {
    "default": "our.panel@distribution.org",
    "order": [
      "bookmarks",
      "history",
      "our.panel@distribution.org",
      "recent_tabs",
      "remote_tabs
    ]
  }
}
(Assignee)

Comment 3

3 years ago
(In reply to :Margaret Leibovic from comment #2)

>   "HomeConfig": {
>     "default": "our.panel@distribution.org",
>     "order": [
>       "bookmarks",
>       "history",
>       "our.panel@distribution.org",
>       "recent_tabs",
>       "remote_tabs
>     ]
>   }

Actually, supporting this fine level of granularity would be quite a pain. Maybe we should just allow distributions to replace the top sites panel with their own default panel.

The main challenge with this is that if the panel is bundled as an add-on (which is the way to add a new panel), we would need to wait for that panel to be installed before we would know how to deal with it in the HomeConfig code.

Maybe a better solution here would be to allow home panel add-ons to specify that they are designed to replace the top sites panel, and we can take care of all this customization from within the add-on.

The down side to this is that any add-on developer could create add-ons that would replace the default top sites panel, but maybe this is something users would like.
(Assignee)

Comment 4

3 years ago
Created attachment 8602429 [details] [diff] [review]
Allow home panel add-ons to specify order and make themselves default

Here's a pretty simple patch that allows home panel add-ons to make themselves the default and specify their order. This wouldn't give distributions the ability to disable any of our built-in panels, but this does solve the issue of creating a new default "speed dial" panel without needing to muck around in distribution land.

https://github.com/leibovic/speed-dial/commit/3ea7a905d4165bad7a9e3c40dc866272e0cedf97
Attachment #8602429 - Flags: feedback?(mark.finkle)
Comment on attachment 8602429 [details] [diff] [review]
Allow home panel add-ons to specify order and make themselves default

Looks pretty sane
Attachment #8602429 - Flags: feedback?(mark.finkle) → feedback+
tracking-fennec: ? → 40+
(Assignee)

Comment 6

3 years ago
Comment on attachment 8602429 [details] [diff] [review]
Allow home panel add-ons to specify order and make themselves default

Review of attachment 8602429 [details] [diff] [review]:
-----------------------------------------------------------------

This has been doing what I want locally, let's land it.
Attachment #8602429 - Flags: review?(mark.finkle)
Attachment #8602429 - Flags: review?(mark.finkle) → review+
(Assignee)

Comment 7

3 years ago
https://hg.mozilla.org/integration/fx-team/rev/43512d4631b7

I tested locally to verify this wouldn't cause any problems with previously customized configurations.
https://hg.mozilla.org/mozilla-central/rev/43512d4631b7
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox41: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 41
(Assignee)

Updated

3 years ago
Depends on: 1192788
You need to log in before you can comment on or make changes to this bug.