|
|
DescriptionAdd empty list indicator for Physical Web WebUI.
Before if there is no Physical Web url, WebUI will give an empty page.
Add a indicator message to let the user know there is no result.
BUG=692789
Review-Url: https://codereview.chromium.org/2698503004
Cr-Commit-Position: refs/heads/master@{#456091}
Committed: https://chromium.googlesource.com/chromium/src/+/ffaccf2fc7b8ff03cb3e4a8aa496aae6ccf03317
Patch Set 1 #Patch Set 2 : fix ios build #Patch Set 3 : match string in android_chrome_strings.grd #Patch Set 4 : rebase #Patch Set 5 : remove unused string #Patch Set 6 : rebase #
Total comments: 13
Patch Set 7 : fix #Patch Set 8 : remove alert #Patch Set 9 : remove scanning indicator #
Total comments: 9
Patch Set 10 : change visibility to display #
Total comments: 4
Patch Set 11 : fix style #
Total comments: 2
Patch Set 12 : add hidden attribute #
Total comments: 2
Patch Set 13 : access hidden attr directly #
Total comments: 1
Messages
Total messages: 97 (63 generated)
Description was changed from ========== Make a notification message when doing scanning and automaticlly disappear after 6s, show a message if there is no result instead of empty page. BUG= ========== to ========== When doing scanning, make a notification message and automatically disappear after 6s, show a message if there is no result instead of empty page. BUG= ==========
ranj@chromium.org changed reviewers: + cco3@chromium.org, mattreynolds@chromium.org, mmocny@chromium.org
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
The CQ bit was unchecked by ranj@chromium.org
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== When doing scanning, make a notification message and automatically disappear after 6s, show a message if there is no result instead of empty page. BUG= ========== to ========== When doing scanning, make a notification message and automatically disappear after 6s, show a message if there is no result instead of empty page. BUG=692789 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
The CQ bit was unchecked by ranj@chromium.org
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
The CQ bit was unchecked by ranj@chromium.org
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
The CQ bit was unchecked by ranj@chromium.org
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
The CQ bit was unchecked by ranj@chromium.org
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
The CQ bit was unchecked by ranj@chromium.org
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
The CQ bit was unchecked by ranj@chromium.org
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== When doing scanning, make a notification message and automatically disappear after 6s, show a message if there is no result instead of empty page. BUG=692789 ========== to ========== Add notification messages for scanning and empty result page. When doing scanning, display a message, automatically disappear after 6s if it's still doing scanning. Display a notification message if there is no Physical Web result. BUG=692789 ==========
Description was changed from ========== Add notification messages for scanning and empty result page. When doing scanning, display a message, automatically disappear after 6s if it's still doing scanning. Display a notification message if there is no Physical Web result. BUG=692789 ========== to ========== Add notification messages for scanning and empty result page. When doing scanning, display a message, automatically disappear after 6s if it's still doing scanning. Display a notification message if there is no Physical Web result. BUG=692789 ==========
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Commit subjects should not have a full stop (period) and should be no more than 50 columns wide. https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... File components/physical_web/webui/resources/physical_web.html (right): https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.html:41: <div id="empty-container" i18n-content="emptyMessage" style="visibility:hidden"> Is there a reason we should do visibility:hidden instead of display:none? Same with below for display:block Also, I think the css should be in physical_web.css https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.js:24: function clearScanNotification() { I think the language of "notification" is a bit confusing. Maybe we could call this a scan indicator? https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.js:25: var scanningContainer = $('scan-container'); This selector isn't going to work. You need the # If we are using jquery, just use hide() or css(): $('#scan-container').hide(); same below for .show() https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.js:43: setTimeout(clearScanNotification, 6000); Since we always return nearbyurls right away, this doesn't do anything yet, right? If not, we should remove it.
https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.js:34: clearScanNotification(); How long does it normally take to receive the URLs? Will the user realistically have a chance to read the scanning message before it's replaced with the URL list or empty message? https://codereview.chromium.org/2698503004/diff/100001/ios/chrome/browser/ui/... File ios/chrome/browser/ui/webui/physical_web_ui.cc (right): https://codereview.chromium.org/2698503004/diff/100001/ios/chrome/browser/ui/... ios/chrome/browser/ui/webui/physical_web_ui.cc:34: IDS_PHYSICAL_WEB_UI_SCANNING_MESSAGE); nit: please fix the line wrapping so the args are aligned
https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... File components/physical_web/webui/resources/physical_web.html (right): https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.html:41: <div id="empty-container" i18n-content="emptyMessage" style="visibility:hidden"> On 2017/02/23 20:07:31, cco3 wrote: > Is there a reason we should do visibility:hidden instead of display:none? Same > with below for display:block > > Also, I think the css should be in physical_web.css Moved css to physical_web.css. For visibility over display, I was referring the "body-container" and try to make it consistent. https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.js:24: function clearScanNotification() { On 2017/02/23 20:07:31, cco3 wrote: > I think the language of "notification" is a bit confusing. Maybe we could call > this a scan indicator? Done. https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.js:25: var scanningContainer = $('scan-container'); On 2017/02/23 20:07:31, cco3 wrote: > This selector isn't going to work. You need the # > > If we are using jquery, just use hide() or css(): > $('#scan-container').hide(); > > same below for .show() I was referring the "body-container". If I add the # it does not work. I don't think it uses jquery here. https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.js:34: clearScanNotification(); On 2017/02/23 20:18:42, mattreynolds wrote: > How long does it normally take to receive the URLs? Will the user realistically > have a chance to read the scanning message before it's replaced with the URL > list or empty message? It's very fast, when I am doing test, I did't see the scanning message. https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.js:43: setTimeout(clearScanNotification, 6000); On 2017/02/23 20:07:31, cco3 wrote: > Since we always return nearbyurls right away, this doesn't do anything yet, > right? If not, we should remove it. Removed. when I test, it gives the nearbyurls right way, just not sure if it is always the case. https://codereview.chromium.org/2698503004/diff/100001/ios/chrome/browser/ui/... File ios/chrome/browser/ui/webui/physical_web_ui.cc (right): https://codereview.chromium.org/2698503004/diff/100001/ios/chrome/browser/ui/... ios/chrome/browser/ui/webui/physical_web_ui.cc:34: IDS_PHYSICAL_WEB_UI_SCANNING_MESSAGE); On 2017/02/23 20:18:42, mattreynolds wrote: > nit: please fix the line wrapping so the args are aligned Done.
https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... components/physical_web/webui/resources/physical_web.js:34: clearScanNotification(); On 2017/02/23 20:59:46, Ran wrote: > On 2017/02/23 20:18:42, mattreynolds wrote: > > How long does it normally take to receive the URLs? Will the user > realistically > > have a chance to read the scanning message before it's replaced with the URL > > list or empty message? > > It's very fast, when I am doing test, I did't see the scanning message. With the current behavior it should always be instant since we're just pulling the current values from the PhysicalWebDataSource and don't need to wait for any scanning or URL resolution. I'd consider it a bug if this took long enough for the user to read the scanning message. I think we shouldn't try to show a message in this case since it will only be frustrating to the user, if they notice it at all.
Description was changed from ========== Add notification messages for scanning and empty result page. When doing scanning, display a message, automatically disappear after 6s if it's still doing scanning. Display a notification message if there is no Physical Web result. BUG=692789 ========== to ========== Display a notification message if there is no Physical Web pages to show. BUG=692789 ==========
On 2017/02/23 22:58:19, mattreynolds wrote: > https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... > File components/physical_web/webui/resources/physical_web.js (right): > > https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... > components/physical_web/webui/resources/physical_web.js:34: > clearScanNotification(); > On 2017/02/23 20:59:46, Ran wrote: > > On 2017/02/23 20:18:42, mattreynolds wrote: > > > How long does it normally take to receive the URLs? Will the user > > realistically > > > have a chance to read the scanning message before it's replaced with the URL > > > list or empty message? > > > > It's very fast, when I am doing test, I did't see the scanning message. > > With the current behavior it should always be instant since we're just pulling > the current values from the PhysicalWebDataSource and don't need to wait for any > scanning or URL resolution. I'd consider it a bug if this took long enough for > the user to read the scanning message. I think we shouldn't try to show a > message in this case since it will only be frustrating to the user, if they > notice it at all. Done. Removed the scanning indicator.
https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... File components/physical_web/webui/resources/physical_web.css (right): https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... components/physical_web/webui/resources/physical_web.css:55: visibility:visible; This is default, so I don't think it's needed. https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... components/physical_web/webui/resources/physical_web.css:59: visibility:hidden; I think we should be using display:none, because otherwise this will take up space you shouldn't be taking up. https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... File components/physical_web/webui/resources/physical_web.html (right): https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... components/physical_web/webui/resources/physical_web.html:41: <div id="empty-container" i18n-content="emptyMessage"> We should probably call this something other than empty-container (because it's not an empty container). Let's call it something like empty-list-message https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... components/physical_web/webui/resources/physical_web.js:27: bodyContainer.style.visibility = 'visible'; Just use the appropriate jquery method: $('#body-container').show()
https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... components/physical_web/webui/resources/physical_web.js:27: bodyContainer.style.visibility = 'visible'; On 2017/02/23 23:36:54, cco3 wrote: > Just use the appropriate jquery method: > $('#body-container').show() I saw your other comment. This is definitely using some kind of jquery; `$` is the jquery function. You should be able to call show or .css('display, 'none'). I'm not sure why it would work without the #, but not with the hash.
Also, I would suggest changing the commit subject to: "Add empty list indicator for Physical Web WebUI"
On 2017/02/23 22:58:19, mattreynolds wrote: > https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... > File components/physical_web/webui/resources/physical_web.js (right): > > https://codereview.chromium.org/2698503004/diff/100001/components/physical_we... > components/physical_web/webui/resources/physical_web.js:34: > clearScanNotification(); > On 2017/02/23 20:59:46, Ran wrote: > > On 2017/02/23 20:18:42, mattreynolds wrote: > > > How long does it normally take to receive the URLs? Will the user > > realistically > > > have a chance to read the scanning message before it's replaced with the URL > > > list or empty message? > > > > It's very fast, when I am doing test, I did't see the scanning message. > > With the current behavior it should always be instant since we're just pulling > the current values from the PhysicalWebDataSource and don't need to wait for any > scanning or URL resolution. I'd consider it a bug if this took long enough for > the user to read the scanning message. I think we shouldn't try to show a > message in this case since it will only be frustrating to the user, if they > notice it at all. It can show up if you open PW list explicitly from the PW settings page, or if you turn on your phone immediately to chrome and Nearby still hasn't found anything. Indeed there are situations where we will claim we are scanning when indeed we are not, but as we move to foreground subscribe, those should be remedied.
On 2017/02/23 23:39:33, cco3 wrote: > https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... > File components/physical_web/webui/resources/physical_web.js (right): > > https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... > components/physical_web/webui/resources/physical_web.js:27: > bodyContainer.style.visibility = 'visible'; > On 2017/02/23 23:36:54, cco3 wrote: > > Just use the appropriate jquery method: > > $('#body-container').show() > > I saw your other comment. This is definitely using some kind of jquery; `$` is > the jquery function. You should be able to call show or .css('display, 'none'). > > I'm not sure why it would work without the #, but not with the hash. $ can be assigned to any variable, just happens to be jQuery convention. Chrome uses $ often inside inspector etc just as an alias for document.querySelector. It could also be some lightweight library -- I'm not sure, but we certainly aren't importing jQuery specifically and seems unlikely we do so automatically for all webui pages.
Description was changed from ========== Display a notification message if there is no Physical Web pages to show. BUG=692789 ========== to ========== Display a indicator message if there is no Physical Web pages to show. BUG=692789 ==========
https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... File components/physical_web/webui/resources/physical_web.css (right): https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... components/physical_web/webui/resources/physical_web.css:55: visibility:visible; On 2017/02/23 23:36:54, cco3 wrote: > This is default, so I don't think it's needed. Done. https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... components/physical_web/webui/resources/physical_web.css:59: visibility:hidden; On 2017/02/23 23:36:54, cco3 wrote: > I think we should be using display:none, because otherwise this will take up > space you shouldn't be taking up. Done. https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... File components/physical_web/webui/resources/physical_web.html (right): https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... components/physical_web/webui/resources/physical_web.html:41: <div id="empty-container" i18n-content="emptyMessage"> On 2017/02/23 23:36:54, cco3 wrote: > We should probably call this something other than empty-container (because it's > not an empty container). Let's call it something like empty-list-message Done. https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/160001/components/physical_we... components/physical_web/webui/resources/physical_web.js:27: bodyContainer.style.visibility = 'visible'; On 2017/02/23 23:36:54, cco3 wrote: > Just use the appropriate jquery method: > $('#body-container').show() The show and hide() function is not available, I guess it's not jQuery here.
lgtm
lgtm
ranj@chromium.org changed reviewers: + nyquist@chromium.org
Description was changed from ========== Display a indicator message if there is no Physical Web pages to show. BUG=692789 ========== to ========== Before if there is no Physical Web pages, WebUI will give an empty page. Add a indicator message if there is no Physical Web pages to show. BUG=692789 ==========
Description was changed from ========== Before if there is no Physical Web pages, WebUI will give an empty page. Add a indicator message if there is no Physical Web pages to show. BUG=692789 ========== to ========== Before if there is no Physical Web page, WebUI will give an empty page. Add a indicator message if there is no Physical Web pages to show. BUG=692789 ==========
Description was changed from ========== Before if there is no Physical Web page, WebUI will give an empty page. Add a indicator message if there is no Physical Web pages to show. BUG=692789 ========== to ========== Add empty list indicator for Physical Web WebUI Before if there is no Physical Web page, WebUI will give an empty page. Add a indicator message if there is no Physical Web pages to show. BUG=692789 ==========
Description was changed from ========== Add empty list indicator for Physical Web WebUI Before if there is no Physical Web page, WebUI will give an empty page. Add a indicator message if there is no Physical Web pages to show. BUG=692789 ========== to ========== Add empty list indicator for Physical Web WebUI Before if there is no Physical Web page, WebUI will give an empty page. Add a indicator message to let the user know there is no result. BUG=692789 ==========
Description was changed from ========== Add empty list indicator for Physical Web WebUI Before if there is no Physical Web page, WebUI will give an empty page. Add a indicator message to let the user know there is no result. BUG=692789 ========== to ========== Add empty list indicator for Physical Web WebUI. Before if there is no Physical Web page, WebUI will give an empty page. Add a indicator message to let the user know there is no result. BUG=692789 ==========
Description was changed from ========== Add empty list indicator for Physical Web WebUI. Before if there is no Physical Web page, WebUI will give an empty page. Add a indicator message to let the user know there is no result. BUG=692789 ========== to ========== Add empty list indicator for Physical Web WebUI. Before if there is no Physical Web url, WebUI will give an empty page. Add a indicator message to let the user know there is no result. BUG=692789 ==========
+nyquist
https://codereview.chromium.org/2698503004/diff/180001/components/physical_we... File components/physical_web/webui/resources/physical_web.css (right): https://codereview.chromium.org/2698503004/diff/180001/components/physical_we... components/physical_web/webui/resources/physical_web.css:55: display:none; Optional nit: Sometimes we write 'display:none' and other times 'display: none' in our code base. This file in general though seems to prefer the latter. Would you want to update this to match the style of the rest of the file? Totally up to you. I won't judge. https://codereview.chromium.org/2698503004/diff/180001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/180001/components/physical_we... components/physical_web/webui/resources/physical_web.js:31: emptyMessage.style.display = 'block'; If this page stays open for a bit, does it automatically refresh? If so, I guess this should be hidden again when length != 0? If all of these things are one-off though, you should be good to go with this.
https://codereview.chromium.org/2698503004/diff/180001/components/physical_we... File components/physical_web/webui/resources/physical_web.css (right): https://codereview.chromium.org/2698503004/diff/180001/components/physical_we... components/physical_web/webui/resources/physical_web.css:55: display:none; On 2017/03/02 19:01:27, nyquist wrote: > Optional nit: Sometimes we write 'display:none' and other times 'display: none' > in our code base. This file in general though seems to prefer the latter. Would > you want to update this to match the style of the rest of the file? Totally up > to you. I won't judge. Done. https://codereview.chromium.org/2698503004/diff/180001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/180001/components/physical_we... components/physical_web/webui/resources/physical_web.js:31: emptyMessage.style.display = 'block'; On 2017/03/02 19:01:28, nyquist wrote: > If this page stays open for a bit, does it automatically refresh? > If so, I guess this should be hidden again when length != 0? > > If all of these things are one-off though, you should be good to go with this. The function only gets called when the page loaded, it won't automatically refresh (although we hope we can make it do that someday).
lgtm
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ranj@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from cco3@chromium.org, mattreynolds@chromium.org Link to the patchset: https://codereview.chromium.org/2698503004/#ps200001 (title: "fix style")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
ranj@chromium.org changed reviewers: + jam@chromium.org
+jam for chrome/browser/ui/webui/physical_web/physical_web_ui.cc ios/chrome/browser/ui/webui/physical_web_ui.cc
On 2017/03/02 21:18:26, Ran wrote: > +jam for > > chrome/browser/ui/webui/physical_web/physical_web_ui.cc > ios/chrome/browser/ui/webui/physical_web_ui.cc why is chromium-reviews mailing list removed? please pick a specific owner when possible, i.e. chrome/browser/ui/webui/owners
ranj@chromium.org changed reviewers: + dbeam@chromium.org, eugenebut@chromium.org - jam@chromium.org
+eugenebut for ios/chrome/browser/ui/webui/physical_web_ui.cc +dbeam for chrome/browser/ui/webui/physical_web/physical_web_ui.cc
ios/chrome/browser/ui/webui/physical_web_ui.cc lgtm
ranj@chromium.org changed reviewers: + bauerb@chromium.org - dbeam@chromium.org
+bauerb for chrome/browser/ui/webui/physical_web/physical_web_ui.cc
https://codereview.chromium.org/2698503004/diff/200001/components/physical_we... File components/physical_web/webui/resources/physical_web.html (right): https://codereview.chromium.org/2698503004/diff/200001/components/physical_we... components/physical_web/webui/resources/physical_web.html:41: <div id="empty-list-container" i18n-content="emptyMessage"> I think I would set a `hidden` attribute on this div and setting it to false from Javascript as required, instead of adjusting the style.
https://codereview.chromium.org/2698503004/diff/200001/components/physical_we... File components/physical_web/webui/resources/physical_web.html (right): https://codereview.chromium.org/2698503004/diff/200001/components/physical_we... components/physical_web/webui/resources/physical_web.html:41: <div id="empty-list-container" i18n-content="emptyMessage"> On 2017/03/09 09:25:13, Bernhard Bauer wrote: > I think I would set a `hidden` attribute on this div and setting it to false > from Javascript as required, instead of adjusting the style. I was not previously aware of hidden attribute even though it seems ancient. Quick SO article (http://stackoverflow.com/questions/6708247/what-is-the-difference-between-the...) search shows there may be advantage to hidden attribute over CSS style, specifically impact on accessiblity features like screenreaders. Interesting!
lgtm https://codereview.chromium.org/2698503004/diff/220001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/220001/components/physical_we... components/physical_web/webui/resources/physical_web.js:27: bodyContainer.removeAttribute("hidden"); You can actually directly access the .hidden attribute on the element.
+mmocny https://codereview.chromium.org/2698503004/diff/220001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/220001/components/physical_we... components/physical_web/webui/resources/physical_web.js:27: bodyContainer.removeAttribute("hidden"); On 2017/03/09 22:10:04, Bernhard Bauer wrote: > You can actually directly access the .hidden attribute on the element. Done.
Much better, lgtm with one Nit. https://codereview.chromium.org/2698503004/diff/240001/components/physical_we... File components/physical_web/webui/resources/physical_web.js (right): https://codereview.chromium.org/2698503004/diff/240001/components/physical_we... components/physical_web/webui/resources/physical_web.js:27: bodyContainer.hidden = false; Nit: I know that if the result length is 0 that this body will be empty, but should we really be showing it? If yes, why did we make it hidden in the first place? if no, could we make this hidden = false inside an else block below?
On 2017/03/09 23:22:32, mmocny wrote: > Much better, lgtm with one Nit. > > https://codereview.chromium.org/2698503004/diff/240001/components/physical_we... > File components/physical_web/webui/resources/physical_web.js (right): > > https://codereview.chromium.org/2698503004/diff/240001/components/physical_we... > components/physical_web/webui/resources/physical_web.js:27: bodyContainer.hidden > = false; > Nit: I know that if the result length is 0 that this body will be empty, but > should we really be showing it? > > If yes, why did we make it hidden in the first place? > > if no, could we make this hidden = false inside an else block below? The body is only showed when renderTemplate() is done. I think the reason to make it hidden is we don't want the users see the render process, so show it after we done rendering. The original code is confused, in html it set to 'visible' then in js it set to 'visible' again... I guess the first 'visible' should be 'hidden'. https://cs.corp.google.com/clankium/src/components/physical_web/webui/resourc... https://cs.corp.google.com/clankium/src/components/physical_web/webui/resourc...
The CQ bit was checked by ranj@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ranj@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from eugenebut@chromium.org, mattreynolds@chromium.org, nyquist@chromium.org, cco3@chromium.org, bauerb@chromium.org Link to the patchset: https://codereview.chromium.org/2698503004/#ps240001 (title: "access hidden attr directly")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 240001, "attempt_start_ts": 1489166853000650, "parent_rev": "64862913dee380c55d7b6b37f48219c77838ff86", "commit_rev": "ffaccf2fc7b8ff03cb3e4a8aa496aae6ccf03317"}
Message was sent while issue was closed.
Description was changed from ========== Add empty list indicator for Physical Web WebUI. Before if there is no Physical Web url, WebUI will give an empty page. Add a indicator message to let the user know there is no result. BUG=692789 ========== to ========== Add empty list indicator for Physical Web WebUI. Before if there is no Physical Web url, WebUI will give an empty page. Add a indicator message to let the user know there is no result. BUG=692789 Review-Url: https://codereview.chromium.org/2698503004 Cr-Commit-Position: refs/heads/master@{#456091} Committed: https://chromium.googlesource.com/chromium/src/+/ffaccf2fc7b8ff03cb3e4a8aa496... ==========
Message was sent while issue was closed.
Committed patchset #13 (id:240001) as https://chromium.googlesource.com/chromium/src/+/ffaccf2fc7b8ff03cb3e4a8aa496... |