feat(desktop): enable native spellcheck in message composer#1515
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90dd051183
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Flips the Tiptap editor's spellcheck attribute from "false" to "true" so macOS provides the red underline on misspelled words and the standard right-click → spelling suggestions context menu. autocorrect remains off to avoid unwanted inline auto-replacement.
90dd051 to
40d669f
Compare
wesbillman
left a comment
There was a problem hiding this comment.
Review (Brain, agent review on Wes's behalf) — LGTM
One-line flip, full CI green including all desktop e2e shards. I checked the history: spellcheck: "false" came in with #1000 ("Polish channel modal forms") with no recorded rationale — it looks incidental, not a deliberate product decision, so enabling it is safe. Note autocorrect: "off" stays as-is, which is the right split: red squiggles without the browser rewriting your text.
Only real risk is cosmetic — squiggles inside code spans/blocks in the ProseMirror doc — and that's easy to revisit if it annoys anyone.
wesbillman
left a comment
There was a problem hiding this comment.
Follow-up (Brain): Wes flagged a concern from history — before spellcheck was disabled, squiggles appeared under @mentions and #channel-names while typing.
I checked how mentions render in the composer: mentionHighlightExtension.ts decorates @Name / #channel matches with Decoration.inline(..., { class: "mention-chip" }) — they stay plain text nodes in the ProseMirror doc, not atomic mention nodes. So with spellcheck: "true" on the editable, the native spellchecker will absolutely treat @Pinky or #wes-code-reviews as misspelled words and squiggle them. Same applies to code spans/blocks.
The fix is cheap and surgical: add spellcheck: "false" to the attributes of those inline decorations (ProseMirror applies decoration attributes to the rendered span), e.g.
Decoration.inline(from, to, { class: className, spellcheck: "false" });…and equivalently for the code-mark ranges if we want to spare code spans too.
Suggest this PR either includes that decoration attribute or holds until it does — otherwise we reintroduce the exact noise that got spellcheck turned off last time. Downgrading my earlier LGTM to "needs the mention-decoration exclusion first."
Add spellcheck="false" to mention/channel inline decorations in mentionHighlightExtension.ts so the native spellchecker skips @name and #channel-name tokens. Also set spellcheck="false" on inline code and code block HTMLAttributes to prevent squiggles on identifiers. Addresses review feedback from wesbillman — without these exclusions, enabling spellcheck reintroduces the noise that got it disabled in #1000.
|
Addressed the feedback — pushed 943f467:
All desktop tests pass. Ready for re-review @wesbillman. |
Flips the Tiptap editor's
spellcheckattribute fromfalsetotrueso macOS provides the red underline on misspelled words and the standard right-click → spelling suggestions context menu.autocorrectremainsoffto avoid unwanted inline auto-replacement.Changes
desktop/src/features/messages/lib/useRichTextEditor.ts:spellcheck: "false"" →spellcheck: "true"`Testing