Description was changed from ========== MD Settings: add empty list message for spell-check edit page. ...
3 years, 10 months ago
(2017-02-13 22:46:24 UTC)
#1
Description was changed from
==========
MD Settings: add empty list message for spell-check edit page.
Also move the word list to a template dom-if, and fix auto-scroll when new words
are added.
BUG=684152
==========
to
==========
MD Settings: add empty list message for spell-check edit page.
Also move the word list to a template dom-if, and fix auto-scroll when new words
are added.
BUG=684152
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
==========
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js File chrome/browser/resources/settings/languages_page/edit_dictionary_page.js (left): https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js#oldcode24 chrome/browser/resources/settings/languages_page/edit_dictionary_page.js:24: chrome.languageSettingsPrivate.getSpellcheckWords(function(words) { This change is needed so that the ...
3 years, 10 months ago
(2017-02-15 19:34:46 UTC)
#3
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html File chrome/browser/resources/settings/languages_page/edit_dictionary_page.html (right): https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html#newcode56 chrome/browser/resources/settings/languages_page/edit_dictionary_page.html:56: <iron-list id="list" items="{{words_}}" on-created="onListLoad_"> is the on-created="onListLoad_" part still ...
3 years, 10 months ago
(2017-02-15 20:36:37 UTC)
#6
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/119740)
3 years, 10 months ago
(2017-02-15 21:16:59 UTC)
#8
3 years, 10 months ago
(2017-02-22 21:42:25 UTC)
#9
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
File chrome/browser/resources/settings/languages_page/edit_dictionary_page.html
(right):
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
chrome/browser/resources/settings/languages_page/edit_dictionary_page.html:56:
<iron-list id="list" items="{{words_}}" on-created="onListLoad_">
On 2017/02/15 20:36:37, dpapad wrote:
> is the on-created="onListLoad_" part still relevant? I don't see such a
function
> in the JS file.
oops left over from test code, removing.
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
File chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
(right):
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
chrome/browser/resources/settings/languages_page/edit_dictionary_page.js:110:
var index = this.words_.indexOf(word);
On 2017/02/15 20:36:37, dpapad wrote:
> Unrelated to your fix: I hope real users don't have too many words. Otherwise
> linear search is not the best choice here.
Acknowledged.
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
chrome/browser/resources/settings/languages_page/edit_dictionary_page.js:127: *
@return {!boolea}
On 2017/02/15 20:36:37, dpapad wrote:
> Typo (should cause compilation error).
Done.
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
chrome/browser/resources/settings/languages_page/edit_dictionary_page.js:130:
return !!(this.words_ && this.words_.length);
On 2017/02/15 20:36:37, dpapad wrote:
> words_ is initialized to the empty array. Why do we need to check if it
exists?
I was thinking just in case languageSettingsPrivate.getSpellcheckWords(cb) calls
cb with null or undefined for whatever reason (or in the future). Or do you
think its not necessary to pre-error-prevent?
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
File chrome/browser/resources/settings/languages_page/languages_page.js (left):
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
chrome/browser/resources/settings/languages_page/languages_page.js:463: */
On 2017/02/15 20:36:37, dpapad wrote:
> On 2017/02/15 at 19:34:46, scottchen wrote:
> > This is fixed now so we can remove it.
>
> Can you elaborate how you verified that this works without the iron-resize?
michaelpg@ says the iron list used to not show up when you navigate to the
subpage, but this doesn't happen anymore, and the iron-list displays as expected
with this function removed.
https://codereview.chromium.org/2690263002/diff/60001/chrome/test/data/webui/...
File chrome/test/data/webui/settings/edit_dictionary_page_test.js (right):
https://codereview.chromium.org/2690263002/diff/60001/chrome/test/data/webui/...
chrome/test/data/webui/settings/edit_dictionary_page_test.js:6:
On 2017/02/15 20:36:37, dpapad wrote:
> Nit (optional): Remove unnecessary blank line?
Done.
https://codereview.chromium.org/2690263002/diff/60001/chrome/test/data/webui/...
chrome/test/data/webui/settings/edit_dictionary_page_test.js:85: === 'none'); //
Make sure add-word button actually clickable.
On 2017/02/15 20:36:37, dpapad wrote:
> https://google.github.io/styleguide/jsguide.html#formatting-where-to-break
>
> Line break should be after the operator.
Done.
https://codereview.chromium.org/2690263002/diff/60001/chrome/test/data/webui/...
chrome/test/data/webui/settings/edit_dictionary_page_test.js:90:
editDictPage.words_ = [];
On 2017/02/15 20:36:37, dpapad wrote:
> Can we improve this test? Currently it is accessing private state, as well as
> shortcutting code that should be tested.
>
> Inside the ready() lifecycle method a call to getSpellcheckWords() is made. We
> should our fake languagePrivate implementation provide the empty list, instead
> of assigning to words_ directly. So this way the ready() callback is tested
> itself. TestBrowserProxy can be used to notify the test when a method was
> walled, something as follows (assuming that fakePrivateApi extends
> TestBrowserProxy).
>
> test('mytest', function() {
> // setup fake data
> fakePrivateApi.setWords([]);
> // attach element to DOM ...
>
> // Wait for the |getSpellheckWords| method to be called.
> return fakePrivateApi.whenCalled('getSpellcheckWords').then(function() {
> // Do assertions here.
> });
> });
Done.
https://codereview.chromium.org/2690263002/diff/100001/chrome/browser/ui/webu...
File chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
(left):
https://codereview.chromium.org/2690263002/diff/100001/chrome/browser/ui/webu...
chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc:929:
LocalizedString localized_strings[] = {
presubmit asked me to run `git cl format .` and this happened.
scottchen
The CQ bit was checked by scottchen@chromium.org to run a CQ dry run
3 years, 10 months ago
(2017-02-22 21:42:34 UTC)
#10
Description was changed from ========== MD Settings: add empty list message for spell-check edit page. ...
3 years, 10 months ago
(2017-02-22 22:42:12 UTC)
#15
Description was changed from
==========
MD Settings: add empty list message for spell-check edit page.
Also move the word list to a template dom-if, and fix auto-scroll when new words
are added.
BUG=684152
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
==========
to
==========
MD Settings: add empty list message for spell-check edit page.
Also move the word list to a template dom-if, and fix auto-scroll when new words
are added.
BUG=684152
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
==========
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js File chrome/browser/resources/settings/languages_page/edit_dictionary_page.js (right): https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js#newcode130 chrome/browser/resources/settings/languages_page/edit_dictionary_page.js:130: return !!(this.words_ && this.words_.length); On 2017/02/22 at 21:58:52, dpapad ...
3 years, 10 months ago
(2017-02-23 00:32:03 UTC)
#18
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
File chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
(right):
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
chrome/browser/resources/settings/languages_page/edit_dictionary_page.js:130:
return !!(this.words_ && this.words_.length);
On 2017/02/22 at 21:58:52, dpapad wrote:
> On 2017/02/22 at 21:42:25, scottchen wrote:
> > On 2017/02/15 20:36:37, dpapad wrote:
> > > words_ is initialized to the empty array. Why do we need to check if it
exists?
> >
> > I was thinking just in case languageSettingsPrivate.getSpellcheckWords(cb)
calls cb with null or undefined for whatever reason (or in the future). Or do
you think its not necessary to pre-error-prevent?
>
> I don't think this is necessary to be defensive in that way. The JSDoc at [1],
should be reflecting the implementation, and therefore no null/undefined should
be returned. We are defensive by trusting the JSDoc and the JSCompiler to catch
errors.
>
> [1]
https://cs.chromium.org/chromium/src/third_party/closure_compiler/externs/lan...
Ping ^. Can we remove the check for this.words_? Then you can probably get rid
of hasWords_() helper completely and directly use words_.length in the binding.
https://codereview.chromium.org/2690263002/diff/140001/chrome/test/data/webui...
File chrome/test/data/webui/settings/edit_dictionary_page_test.js (right):
https://codereview.chromium.org/2690263002/diff/140001/chrome/test/data/webui...
chrome/test/data/webui/settings/edit_dictionary_page_test.js:1: // Copyright
2016 The Chromium Authors. All rights reserved.
2017
3 years, 10 months ago
(2017-02-23 01:00:20 UTC)
#19
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
File chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
(right):
https://codereview.chromium.org/2690263002/diff/60001/chrome/browser/resource...
chrome/browser/resources/settings/languages_page/edit_dictionary_page.js:130:
return !!(this.words_ && this.words_.length);
On 2017/02/23 00:32:03, dpapad wrote:
> On 2017/02/22 at 21:58:52, dpapad wrote:
> > On 2017/02/22 at 21:42:25, scottchen wrote:
> > > On 2017/02/15 20:36:37, dpapad wrote:
> > > > words_ is initialized to the empty array. Why do we need to check if it
> exists?
> > >
> > > I was thinking just in case languageSettingsPrivate.getSpellcheckWords(cb)
> calls cb with null or undefined for whatever reason (or in the future). Or do
> you think its not necessary to pre-error-prevent?
> >
> > I don't think this is necessary to be defensive in that way. The JSDoc at
[1],
> should be reflecting the implementation, and therefore no null/undefined
should
> be returned. We are defensive by trusting the JSDoc and the JSCompiler to
catch
> errors.
> >
> > [1]
>
https://cs.chromium.org/chromium/src/third_party/closure_compiler/externs/lan...
>
> Ping ^. Can we remove the check for this.words_? Then you can probably get rid
> of hasWords_() helper completely and directly use words_.length in the
binding.
It appears that I cannot to [[!!boolean]] in template so I think I still need a
middleman function. Removed the null check.
https://codereview.chromium.org/2690263002/diff/140001/chrome/test/data/webui...
File chrome/test/data/webui/settings/edit_dictionary_page_test.js (right):
https://codereview.chromium.org/2690263002/diff/140001/chrome/test/data/webui...
chrome/test/data/webui/settings/edit_dictionary_page_test.js:1: // Copyright
2016 The Chromium Authors. All rights reserved.
On 2017/02/23 00:32:03, dpapad wrote:
> 2017
Done.
CQ is committing da patch. Bot data: {"patchset_id": 180001, "attempt_start_ts": 1487880354429830, "parent_rev": "c8d527fa602efdd841ab3d4bfbcec0e7d02a35fd", "commit_rev": "08b33480b93950a0153c179f5336aeaf382ff8d5"}
3 years, 10 months ago
(2017-02-23 21:19:41 UTC)
#25
CQ is committing da patch.
Bot data: {"patchset_id": 180001, "attempt_start_ts": 1487880354429830,
"parent_rev": "c8d527fa602efdd841ab3d4bfbcec0e7d02a35fd", "commit_rev":
"08b33480b93950a0153c179f5336aeaf382ff8d5"}
commit-bot: I haz the power
Description was changed from ========== MD Settings: add empty list message for spell-check edit page. ...
3 years, 10 months ago
(2017-02-23 21:20:22 UTC)
#26
Message was sent while issue was closed.
Description was changed from
==========
MD Settings: add empty list message for spell-check edit page.
Also move the word list to a template dom-if, and fix auto-scroll when new words
are added.
BUG=684152
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
==========
to
==========
MD Settings: add empty list message for spell-check edit page.
Also move the word list to a template dom-if, and fix auto-scroll when new words
are added.
BUG=684152
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Review-Url: https://codereview.chromium.org/2690263002
Cr-Commit-Position: refs/heads/master@{#452633}
Committed:
https://chromium.googlesource.com/chromium/src/+/08b33480b93950a0153c179f5336...
==========
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/chromium/src/+/08b33480b93950a0153c179f5336aeaf382ff8d5
3 years, 10 months ago
(2017-02-23 21:20:23 UTC)
#27
Issue 2690263002: MD Settings: add empty list message for spell-check edit page.
(Closed)
Created 3 years, 10 months ago by scottchen
Modified 3 years, 10 months ago
Reviewers: dpapad
Base URL:
Comments: 36