feat(desktop): add spellcheck suggestions to context menu#500
feat(desktop): add spellcheck suggestions to context menu#500t3dotgg merged 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Wire up Electron's context-menu event on webContents to surface dictionary suggestions for misspelled words. Standard edit actions (Cut, Copy, Paste, Select All) appear in all context menus. Related to pingdotgg#473
|
I hate this and it sucks for code because so many variables are "spelled incorrectly". If we get more reports I will reconsider |
|
maybe have a setting to turn this on or off? |
|
OH I misunderstood, reopening |
What
Surface spellcheck correction suggestions in the right-click context menu on the Electron desktop app.
Why
Chromium's spellchecker already detects and underlines misspelled words, but Electron does not automatically populate the context menu with dictionary suggestions. Users expect right-click spelling corrections, consistent with other desktop applications.
Key Changes
context-menuevent handler onwebContentsincreateWindow()replaceMisspelling()editFlagsgatingCloses to #473
Note
Add spellcheck suggestions to the desktop window context menu and invoke
Electron.WebContents.replaceMisspellingfor up to five items in main.tsRegister a
webContentscontext-menulistener to render a custom menu with up to five spelling suggestions, a fallback disabled "No suggestions" item, a separator, and edit role items (cut,copy,paste,selectAll) with states fromparams.editFlags.📍Where to Start
Start at the
createWindowinitializer where thewebContents.on('context-menu', ...)handler is added in main.ts.Macroscope summarized 1e6e78e.