feat(linux): add WebKitGTK spellcheck options#5087
feat(linux): add WebKitGTK spellcheck options#5087arcofs wants to merge 1 commit intowailsapp:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe pull request adds spell-check configuration support to the Linux desktop frontend. It introduces two new configuration options to the Linux Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.16.5)v2/internal/frontend/desktop/linux/window.c┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m v2/internal/frontend/desktop/linux/window.go┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m v2/internal/frontend/desktop/linux/window.h┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m
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 |
Summary
Add Linux WebKitGTK spellcheck support to Wails v2 by exposing spellcheck settings through
options.Linuxand wiring them into the WebKit web context.Problem
Wails currently exposes the browser default context menu, but on Linux there is no way for an app to explicitly enable WebKitGTK spellchecking or set spellcheck languages. For editors built on
contenteditableor<textarea spellcheck>, this prevents native misspelling underlines and spelling suggestions from working reliably.This addresses #3534.
Changes
SpellCheckEnabled booltooptions.LinuxSpellCheckLanguages []stringtooptions.Linuxwebkit_web_context_set_spell_checking_enabled()webkit_web_context_set_spell_checking_languages()when languages are providedScope
This PR only changes the Linux WebKitGTK implementation. It does not add Windows or macOS spellcheck support.
Validation
Used this patch from a downstream Wails app and confirmed:
go test ./...wails buildNotes
Language handling is intentionally minimal here: Wails accepts a list of language tags and passes them straight to WebKitGTK after filtering empty values.
Summary by CodeRabbit