customize default window size of responsive web design

RESOLVED FIXED

Status

Firefox OS
Gaia::Build
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: johnhu, Assigned: johnhu)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

We may want to have a responsive design view of tablet/tv size UI when GAIA_DEVICE_TYPE is tablet or tv.

Currently, the window size is hardcoded at [1]. This issue is for adding the support of default window size based on current device build.

I found the responsive design module already reads the pref value to customize its default size[2]. We may leverage this feature to enable it.

[1] https://github.com/mozilla-b2g/gaia/blob/master/tools/extensions/browser-helper%40gaiamobile.org/bootstrap.js#L120-L135
More information for comment 0:

[2] http://dxr.mozilla.org/mozilla-central/source/browser/devtools/responsivedesign/responsivedesign.jsm#192,143-144
Assignee: nobody → im
Created attachment 8463895 [details] [review]
patch for this bug

Hi Yuren and Alex,

This is the patch to use customWidth and customHeight prefs to configure the responsive design UI. Please give me some feedbacks. Thanks.
Attachment #8463895 - Flags: feedback?(yurenju.mozilla)
Attachment #8463895 - Flags: feedback?(poirot.alex)
Attachment #8463895 - Flags: feedback?(shchen)
Comment on attachment 8463895 [details] [review]
patch for this bug

Looks good and I agree with this idea, this can give us more flexibility to customize preferences for different device type.
Attachment #8463895 - Flags: feedback?(shchen) → feedback+
Comment on attachment 8463895 [details] [review]
patch for this bug

offline discuss with john, we should fix bug 1039219 first.
Attachment #8463895 - Flags: feedback?(yurenju.mozilla)
Depends on: 1039219
Comment on attachment 8463895 [details] [review]
patch for this bug

Looks good, I'll let Yuren review this patch.
My only concern in using these prefs is that, if we tweak the responsive design layout and modify the padding/border sizes, we would have to manually modify all these prefs. But that's something I can live with.
Attachment #8463895 - Flags: feedback?(poirot.alex)
Thanks for this feedback.

Yuren had blocked this bug with bug 1039219. We had discussed similar thing offline. After bug 1039219 landed, I will move the tweak to preferences.js. And others don't need to apply the tweak when they want to modify the prefs.
Created attachment 8471332 [details] [review]
pr for this bug

This is the patch for this issue and changes:
1. add custom-prefs to device type folders
2. load pref files to memory
3. customize the pref value while loading
4. separate prefs and user_prefs
5. modify the tests and create one for pref value customization.


Please review it. Thanks.
Attachment #8463895 - Attachment is obsolete: true
Attachment #8471332 - Flags: review?(yurenju.mozilla)
Comment on attachment 8471332 [details] [review]
pr for this bug

code looks good but after offline discussion, John wants to wrap script loader for node.js, so cancel review request and please set me review again when you get updated pull request.
Attachment #8471332 - Flags: review?(yurenju.mozilla)
Comment on attachment 8471332 [details] [review]
pr for this bug

Hi Yuren,

I had finished the script loader in utils-node.js. The related codes are also updated. But I don't know how to test it in node.js. So, please tell how to do it and review the code. Thanks.
Attachment #8471332 - Flags: review?(yurenju.mozilla)
Comment on attachment 8471332 [details] [review]
pr for this bug

looks good, thank you!
Attachment #8471332 - Flags: review?(yurenju.mozilla) → review+
merged to master:
https://github.com/mozilla-b2g/gaia/commit/b204365db8a6aea4d52c40dc572a7e3e9700172e
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Reverted for B2G desktop build failures on windows:
https://tbpl.mozilla.org/php/getParsedLog.php?id=45922620&tree=B2g-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=45920651&tree=B2g-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=45923725&tree=B2g-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=45924444&tree=B2g-Inbound

https://github.com/mozilla-b2g/gaia/commit/2eeed1537be7719412506c083ad02da988037231
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Created attachment 8473561 [details] [review]
pr with windows supported

Waiting for Gaia-Try and Gecko-Try before setting review.
Gaia try passed:
https://tbpl.mozilla.org/?rev=78c5cf9770722a6591988ca41ddf020949bbbc9e&tree=Gaia-Try
Gecko try passed:
https://tbpl.mozilla.org/?tree=Try&rev=938ad9b0608d
Comment on attachment 8473561 [details] [review]
pr with windows supported

Yuren,

Please review this patch. I had included the windows parts and tested in Window box. The both gecko and gaia try had passed. Thanks.
Attachment #8473561 - Flags: review?(yurenju.mozilla)
Attachment #8473561 - Flags: review?(yurenju.mozilla) → review+
Attachment #8471332 - Attachment is obsolete: true
merged to master:
https://github.com/mozilla-b2g/gaia/commit/ae1fee6112b4206b3a8be8644321207991948308
Status: REOPENED → RESOLVED
Last Resolved: 3 years ago3 years ago
Resolution: --- → FIXED
Duplicate of this bug: 1037395
You need to log in before you can comment on or make changes to this bug.