Skip to content

feat(desktop): add spellcheck suggestions to context menu#500

Merged
t3dotgg merged 1 commit intopingdotgg:mainfrom
chuks-qua:fix/spellcheck-context-menu
Mar 9, 2026
Merged

feat(desktop): add spellcheck suggestions to context menu#500
t3dotgg merged 1 commit intopingdotgg:mainfrom
chuks-qua:fix/spellcheck-context-menu

Conversation

@chuks-qua
Copy link
Contributor

@chuks-qua chuks-qua commented Mar 8, 2026

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

  • Add context-menu event handler on webContents in createWindow()
  • Show up to 5 dictionary suggestions when right-clicking a misspelled word, clicking a suggestion calls replaceMisspelling()
  • Show "No suggestions" placeholder when the word is misspelled but the dictionary has no matches
  • Always include standard edit actions (Cut, Copy, Paste, Select All) with proper editFlags gating

Closes to #473

Note

Add spellcheck suggestions to the desktop window context menu and invoke Electron.WebContents.replaceMisspelling for up to five items in main.ts

Register a webContents context-menu listener 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 from params.editFlags.

📍Where to Start

Start at the createWindow initializer where the webContents.on('context-menu', ...) handler is added in main.ts.

Macroscope summarized 1e6e78e.

@coderabbitai
Copy link

coderabbitai bot commented Mar 8, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 17515e8d-d5a5-4253-944c-5dca108b83e0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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
@t3dotgg
Copy link
Member

t3dotgg commented Mar 8, 2026

I hate this and it sucks for code because so many variables are "spelled incorrectly". If we get more reports I will reconsider

@t3dotgg t3dotgg closed this Mar 8, 2026
@official-notfishvr
Copy link

maybe have a setting to turn this on or off?

@t3dotgg
Copy link
Member

t3dotgg commented Mar 9, 2026

OH I misunderstood, reopening

@t3dotgg t3dotgg reopened this Mar 9, 2026
@t3dotgg t3dotgg merged commit 18b6590 into pingdotgg:main Mar 9, 2026
4 checks passed
@dbalders dbalders mentioned this pull request Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants