:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(desktop): enable native prompt spellcheck (#76642)
Peter Kirkham10c6d18495bd
diff --git a/products/desktop/packages/ui/src/features/message-editor/tiptap/promptEditorAttributes.test.ts b/products/desktop/packages/ui/src/features/message-editor/tiptap/promptEditorAttributes.test.tsnew file mode 100644index 000000000000..d1f3fb655ee8--- /dev/null+++ b/products/desktop/packages/ui/src/features/message-editor/tiptap/promptEditorAttributes.test.ts@@ -0,0 +1,8 @@+import { describe, expect, it } from "vitest";+import { getPromptEditorAttributes } from "./promptEditorAttributes";++describe("getPromptEditorAttributes", () => {+ it("enables native spell checking", () => {+ expect(getPromptEditorAttributes()).toMatchObject({ spellcheck: "true" });+ });+});diff --git a/products/desktop/packages/ui/src/features/message-editor/tiptap/promptEditorAttributes.ts b/products/desktop/packages/ui/src/features/message-editor/tiptap/promptEditorAttributes.tsnew file mode 100644index 000000000000..bb0ecbaabe21--- /dev/null+++ b/products/desktop/packages/ui/src/features/message-editor/tiptap/promptEditorAttributes.ts@@ -0,0 +1,6 @@+const EDITOR_CLASS =+ "cli-editor min-h-[1.5em] w-full break-words border-none bg-transparent pr-2 text-[14px] text-[var(--gray-12)] outline-none [overflow-wrap:break-word] [white-space:pre-wrap] [word-break:break-word]";++export function getPromptEditorAttributes(): Record<string, string> {+ return { class: EDITOR_CLASS, spellcheck: "true" };+}diff --git a/products/desktop/packages/ui/src/features/message-editor/tiptap/useTiptapEditor.ts b/products/desktop/packages/ui/src/features/message-editor/tiptap/useTiptapEditor.tsindex a904f7912592..088e5ec65687 100644--- a/products/desktop/packages/ui/src/features/message-editor/tiptap/useTiptapEditor.ts+++ b/products/desktop/packages/ui/src/features/message-editor/tiptap/useTiptapEditor.ts@@ -43,6 +43,7 @@ import { usePasteUndoStore } from "../pasteUndoStore";import { usePromptHistoryStore } from "../promptHistoryStore";import { findChipRangeById } from "../tiptap/chipRange";import { getEditorExtensions } from "../tiptap/extensions";+import { getPromptEditorAttributes } from "../tiptap/promptEditorAttributes";import {type DraftContext,editorContentToTiptapJson,@@ -82,9 +83,6 @@ export interface UseTiptapEditorOptions {onBlur?: () => void;}-const EDITOR_CLASS =- "cli-editor min-h-[1.5em] w-full break-words border-none bg-transparent pr-2 text-[14px] text-[var(--gray-12)] outline-none [overflow-wrap:break-word] [white-space:pre-wrap] [word-break:break-word]";-interface TrackedAutoConvertedPaste extends AutoConvertedPaste {kind: "file" | "github-ref";status: "pending" | "inserted" | "canceled";@@ -361,7 +359,7 @@ export function useTiptapEditor(options: UseTiptapEditorOptions) {editable: !disabled,autofocus: autoFocus ? "end" : false,editorProps: {- attributes: { class: EDITOR_CLASS, spellcheck: "false" },+ attributes: getPromptEditorAttributes(),handleDOMEvents: {click: (_view, event) => {const target = (event.target as HTMLElement).closest("a");