Address beta feedback
* Use signal blue for search box focus outline * Reduce debounce for draft saves * Be less aggressive in our scrolling corrections * Lightbox: Ensure that a tall image is still fully visible * Fix spell checking after Electron API breaking changes * Fix link preview image generation * Message highlight: Move to border in signal blue
This commit is contained in:
parent
eec0fce62a
commit
b19659f5ac
9 changed files with 108 additions and 89 deletions
|
@ -96,11 +96,12 @@ if (process.platform === 'linux') {
|
|||
}
|
||||
|
||||
const simpleChecker = {
|
||||
spellCheck(text) {
|
||||
return !this.isMisspelled(text);
|
||||
spellCheck(words, callback) {
|
||||
const mispelled = words.filter(word => this.isMisspelled(word));
|
||||
callback(mispelled);
|
||||
},
|
||||
isMisspelled(text) {
|
||||
const misspelled = spellchecker.isMisspelled(text);
|
||||
isMisspelled(word) {
|
||||
const misspelled = spellchecker.isMisspelled(word);
|
||||
|
||||
// The idea is to make this as fast as possible. For the many, many calls which
|
||||
// don't result in the red squiggly, we minimize the number of checks.
|
||||
|
@ -109,7 +110,7 @@ const simpleChecker = {
|
|||
}
|
||||
|
||||
// Only if we think we've found an error do we check the locale and skip list.
|
||||
if (locale.match(EN_VARIANT) && _.contains(ENGLISH_SKIP_WORDS, text)) {
|
||||
if (locale.match(EN_VARIANT) && _.contains(ENGLISH_SKIP_WORDS, word)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -118,14 +119,14 @@ const simpleChecker = {
|
|||
getSuggestions(text) {
|
||||
return spellchecker.getCorrectionsForMisspelling(text);
|
||||
},
|
||||
add(text) {
|
||||
spellchecker.add(text);
|
||||
add(word) {
|
||||
spellchecker.add(word);
|
||||
},
|
||||
};
|
||||
|
||||
const dummyChecker = {
|
||||
spellCheck() {
|
||||
return true;
|
||||
spellCheck(words, callback) {
|
||||
callback([]);
|
||||
},
|
||||
isMisspelled() {
|
||||
return false;
|
||||
|
|
|
@ -186,7 +186,7 @@
|
|||
this.maybeGrabLinkPreview.bind(this),
|
||||
200
|
||||
);
|
||||
this.debouncedSaveDraft = _.debounce(this.saveDraft.bind(this), 2000);
|
||||
this.debouncedSaveDraft = _.debounce(this.saveDraft.bind(this), 500);
|
||||
|
||||
this.render();
|
||||
|
||||
|
@ -2668,18 +2668,18 @@
|
|||
);
|
||||
}
|
||||
|
||||
const data = await this.makeChunkedRequest(imageUrl);
|
||||
const chunked = await this.makeChunkedRequest(imageUrl);
|
||||
|
||||
// Ensure that this file is either small enough or is resized to meet our
|
||||
// requirements for attachments
|
||||
const withBlob = await this.autoScale({
|
||||
contentType: data.contentType,
|
||||
file: new Blob([data.data], {
|
||||
type: data.contentType,
|
||||
contentType: chunked.contentType,
|
||||
file: new Blob([chunked.data], {
|
||||
type: chunked.contentType,
|
||||
}),
|
||||
});
|
||||
|
||||
const attachment = await this.arrayBufferFromFile(withBlob);
|
||||
const data = await this.arrayBufferFromFile(withBlob.file);
|
||||
objectUrl = URL.createObjectURL(withBlob.file);
|
||||
|
||||
const dimensions = await Signal.Types.VisualAttachment.getImageDimensions(
|
||||
|
@ -2690,7 +2690,8 @@
|
|||
);
|
||||
|
||||
image = {
|
||||
...attachment,
|
||||
data,
|
||||
size: data.byteLength,
|
||||
...dimensions,
|
||||
contentType: withBlob.file.type,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue