Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Mergedchuks-qua(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/500/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

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.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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.
    2. I hate this and it sucks for code because so many variables are "spelled incorrectly". If we get more reports I will reconsider

    3. maybe have a setting to turn this on or off?

    4. OH I misunderstood, reopening

    5. @t3dotgg Agree that this should be disabled or made optional. On Linux it cannot even recognize "codebase" as a word.

Sign in to join this conversation.