Closed Bug 1168061 Opened 11 years ago Closed 11 years ago

[Statusbar] Icons should use own .view property instead of being rendered by the statusbar

Categories

(Firefox OS Graveyard :: Gaia::System::Status bar, Utility tray, Notification, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.2 S13 (29may)

People

(Reporter: apastor, Assigned: apastor)

References

Details

(Whiteboard: [systemsfe])

Attachments

(1 external file, 1 obsolete file)

Right now, the statusbar is rendering all the icons on startup [1]. Given that each icon is now inheriting from base_icon, we should make use of the view and render methods from base_ui in order to rendering them. That would avoid to each icon waiting for the statusbar rendering the HTML. [1] https://github.com/mozilla-b2g/gaia/blob/70311d04235f4b093ceea9f2d746b31d9d3b0471/apps/system/js/statusbar.js#L81
Assignee: nobody → apastor
Comment on attachment 8610083 [details] [review] [gaia] albertopq:1168061-statusbar-icons > mozilla-b2g:master Several files changed, but most of them are only to move the view and fixing tests. The important ones: - statusbar.js - base_icon.js Thanks!
Attachment #8610083 - Flags: review?(alive)
Comment on attachment 8610083 [details] [review] [gaia] albertopq:1168061-statusbar-icons > mozilla-b2g:master Very good cleanup patch. I am having a big concern about module dependency as I mentioned in github. Welcome to talk to me if you disagree. Briefly, instead of freezing the dependency of statusbar and all other modules who owns the icon, what we should do is: BaseIcon.render will call Service.request('Statusbar:renderIcon', this).then(() => { this.element = .....; }); And Statusbar will have a service: Statusbar.renderIcon = function(icon) { this.prioirty[icon.name].icon = icon; this.element.appendChild(icon.view()); .... }; And it does not need to listen to rendered event which may miss if statusbar is started after certain module. What do you think?
Attachment #8610083 - Flags: review?(alive) → feedback+
Thanks :alive! I do agree we need to make async the icon and statusbar dependency but, is not already happening the same with the iconcreated event? I think statusbar could miss a iconcreated event and then, that icon wouldn't be taken into account for the priorities. Am I wrong? Thanks!
Flags: needinfo?(alive)
(In reply to Alberto Pastor [:albertopq] from comment #4) > Thanks :alive! > > I do agree we need to make async the icon and statusbar dependency but, is > not already happening the same with the iconcreated event? I think statusbar > could miss a iconcreated event and then, that icon wouldn't be taken into > account for the priorities. Am I wrong? > > Thanks! Yeah...you are right. iconcreated event now is just 'working'. It's having the same dependency issues, I admit. So I hope we could fix the dependency in the patch. Or you like, the followup patch. If you could fix that let's get this patch r+ and file a followup. Thanks!
Flags: needinfo?(alive)
Comment on attachment 8610083 [details] [review] [gaia] albertopq:1168061-statusbar-icons > mozilla-b2g:master After thinking, r+ and let's address followup dependency issue.
Attachment #8610083 - Flags: review+
Blocks: 1169229
Keywords: checkin-needed
Keywords: checkin-needed
Autolander could not locate a review from a user within the suggested reviewer list. Either the patch author or the reviewer should be in the suggested reviewer list.
Status: NEW → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Keywords: checkin-needed
Autolander could not locate a review from a user within the suggested reviewer list. Either the patch author or the reviewer should be in the suggested reviewer list.
/home/tester/git_checkout/apps/system/test/marionette/statusbar_icon_network_activity_test.js failed. Will retry. .. /home/tester/git_checkout/apps/system/test/marionette/statusbar_icon_network_activity_test.js failed. Will retry. .. /home/tester/git_checkout/apps/system/test/marionette/statusbar_icon_network_activity_test.js failed. Will retry. .. /home/tester/git_checkout/apps/system/test/marionette/statusbar_icon_network_activity_test.js failed. Will retry. .. /home/tester/git_checkout/apps/system/test/marionette/statusbar_icon_network_activity_test.js failed. Will retry. .. Failing on master frequently after your changes. Can we back this out?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: --- → 2.2 S13 (29may)
Comment on attachment 8612352 [details] [review] [gaia] albertopq:1168061-statusbar-icons > mozilla-b2g:master Michael, this is the same patch r+'d by alive, but fixing a remaining test. Would you mind r+ yourself (as you are in the suggested reviewers) in order to make it work properly with autolander? Thanks!
Attachment #8612352 - Flags: review?(mhenretty)
Comment on attachment 8612352 [details] [review] [gaia] albertopq:1168061-statusbar-icons > mozilla-b2g:master Thanks!
Attachment #8612352 - Flags: review?(mhenretty) → review+
Keywords: checkin-needed
Keywords: checkin-needed
Autolander could not locate a review from a user within the suggested reviewer list. Either the patch author or the reviewer should be in the suggested reviewer list.
Attachment #8610083 - Attachment is obsolete: true
Keywords: checkin-needed
Keywords: checkin-needed
http://docs.taskcluster.net/tools/task-graph-inspector/#YFZqTAugThGypQF1_nXLOA The pull request failed to pass integration tests. It could not be landed, please try again.
Keywords: checkin-needed
Keywords: checkin-needed
http://docs.taskcluster.net/tools/task-graph-inspector/#QhdDgltlRuOxx-GSC18sDw The pull request failed to pass integration tests. It could not be landed, please try again.
Keywords: checkin-needed
Keywords: checkin-needed
http://docs.taskcluster.net/tools/task-graph-inspector/#a7IKXapwT8a2-AwLVl-d9w The pull request failed to pass integration tests. It could not be landed, please try again.
Keywords: checkin-needed
Keywords: checkin-needed
http://docs.taskcluster.net/tools/task-graph-inspector/#zosqZAZMQQ6cDFcRwRfDOg The pull request failed to pass integration tests. It could not be landed, please try again.
Keywords: checkin-needed
Keywords: checkin-needed
http://docs.taskcluster.net/tools/task-graph-inspector/#r-Q1420KQyuCGZbvSCA1RQ The pull request failed to pass integration tests. It could not be landed, please try again.
Keywords: checkin-needed
Keywords: checkin-needed
http://docs.taskcluster.net/tools/task-graph-inspector/#PwUEpV4RRmqDy7YZAT3yxg The pull request failed to pass integration tests. It could not be landed, please try again.
Blocks: 1171490
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: