-
Notifications
You must be signed in to change notification settings - Fork 975
Conversation
working on migrating old custom dictionary data |
app/browser/menu.js
Outdated
@@ -266,6 +266,7 @@ const createViewSubmenu = () => { | |||
label: locale.translation('toggleDeveloperTools'), | |||
accelerator: isDarwin ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', | |||
click: function () { | |||
const appStore = require('../../js/stores/appStore') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already fixed, so if you rebase to the master, you can remove this code 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I forgot to remove the workaround. thanks
e394659
to
309e703
Compare
js/constants/messages.js
Outdated
@@ -77,7 +77,6 @@ const messages = { | |||
RELOAD: _, | |||
DETACH: _, | |||
IS_MISSPELLED: _, /** @arg {string} word, the word to check */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should also be removed
@@ -35,13 +35,6 @@ module.exports.init = () => { | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this whole file go away?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 yeah, I forgot to remove
js/contextMenus.js
Outdated
webviewActions.replace(selection) | ||
click: (item, focusedWindow) => { | ||
if (focusedWindow) { | ||
focusedWindow.webContents.addWord(selection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
focusedWindow
should be deprecated and context menu items should use actions by default. I would use something like appActions.learnSpelling
and appActions.forgetLearnedSpelling
and pass the tabId (always set in muon HandleContextMenu
and retrieved from nodeProps.properties)
const {getWebContents} = require('../webContentsCache') | ||
const spellChecker = require('../../spellChecker') | ||
|
||
const migrate = (state) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the other data migrations are in session store. We don't want it to get too bloated, but if we don't remove dictionary
from the saved state this migration will run on every restart
Will check this out once Muon 4.4.0 prebuilt is ready to go 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having issues with this; I built locally (macOS), ensured I am using Muon 4.4.0... the wrong spelling (ex: braave
) does get underlined red. However, picking from the drop down does not work (both correct spelling and learn spelling)
fixes #9880 Auditors: @bridiver, @bbondy, @bsclifton Test plan: a. Suggestions 1. Go to `about:styles` 2. Type `braave` in textbox 3. There should be redline under `braave` 4. Open context menu on `braave` 5. You can see `bravo`, `brave`, `Brava` 6. Click on `brave` 7. The text should be replaced with `brave` with no redline b. Learn Spelling 1. Go to `about:styles` 2. Type `braave` in textbox 3. There should be redline under `braave` 4. Open context menu on `braave` 5. Click `Learn Spelling` 6. `braave` will no longer be redlined 7. Next time you type `braave`, you will not see redline c. Forget Learned Spelling 1. Go to `about:styles` 2. Type `braave` in textbox 3. There should be redline under `braave` 4. Open context menu on `braave` 5. Click `Learn Spelling` 6. `braave` will no longer be redlined 7. Open context menu on `braave` 8. Click `Forget Learned Spelling` 9. Next time you type `braave`, you will see redline under it d. Legacy data migration 1. Use older Brave to `Learn Spelling` for `braave` and `Ignore Spelling` for `braaave` 2. Update to the version with chromium spellchecker 3. There will be no `dictionary` structure in session store 4. You can see those two words will be added to `Custom Dictionary.txt` under user folder 5. And try to type `braave` and `braaave` in `about:styles` 6. They should be valid words
Auditors: @darkdh Test Plan: `npm run unittest -- --grep="spellCheckerReducer unit tests"`
Auditors: @darkdh
4bcde36
to
166b321
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found issues with immutable that we fixed together 😄 I added unit tests for the spellCheckerReducer to help prevent that in the future. Also, I found/fixed a context menu test which failed because the code goes down a previous branch than before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
// are incorrectly marked as spelling errors. This lets people get away with | ||
// incorrectly spelled contracted words, but it's the best we can do for now. | ||
const contractions = [ | ||
"ain't", "aren't", "can't", "could've", "couldn't", "couldn't've", "didn't", "doesn't", "don't", "hadn't", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pfft new spell checker ain't got these words, y'all
Using Chromium's spellchecker
Using Chromium's spellchecker
This fixed #7967 thank you guys so so much 👍 |
Test Plan:
a. Suggestions
about:styles
braave
in textboxbraave
braave
bravo
,brave
,Brava
brave
brave
with no redlineb. Learn Spelling
about:styles
braave
in textboxbraave
braave
Learn Spelling
braave
will no longer be redlinedbraave
, you will not see redlinec. Forget Learned Spelling
about:styles
braave
in textboxbraave
braave
Learn Spelling
braave
will no longer be redlinedbraave
Forget Learned Spelling
braave
, you will see redline under itd. Legacy data migration
Learn Spelling
forbraave
andIgnore Spelling
forbraaave
dictionary
structure in session storeCustom Dictionary.txt
under user folderbraave
andbraaave
inabout:styles
Auditors: @bridiver, @bbondy, @bsclifton
fixes #9880
requires brave/muon#244
Submitter Checklist:
git rebase -i
to squash commits (if needed).Reviewer Checklist:
Tests