Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix([rich-text-editor-for-prose-stage-replace-plain]): keep focus outline caller-controlled

[._.]/ Adam Eivy4e5e69c3210e
diff --git a/client/src/components/ui/ProseEditor.jsx b/client/src/components/ui/ProseEditor.jsx
index f3b8fd76fd..644c8d6ba1 100644
--- a/client/src/components/ui/ProseEditor.jsx
+++ b/client/src/components/ui/ProseEditor.jsx
@@ -9,8 +9,12 @@ import { forwardRef } from 'react';
//
// This component owns ONLY the prose typography (serif + leading) + spellcheck
// + the optional light "reading paper" theme. Host chrome — width, height,
-// border, background, padding, text size, rows — comes through `className` (and
-// any other passthrough props), so each caller keeps its own frame.
+// border, background, padding, text size, rows, AND focus treatment — comes
+// through `className` (and any other passthrough props), so each caller keeps
+// its own frame. (Focus is deliberately NOT baked in: a shared primitive that
+// silently strips the focus outline is an a11y footgun — a full-bleed host like
+// WorkEditor opts into `focus:outline-none`, while a bordered field keeps the
+// browser default unless it supplies its own ring.)
const DEFAULT_PLACEHOLDER = 'Start writing… Use # Chapter, ## Scene, ### Beat headings to outline.';
@@ -35,7 +39,7 @@ const ProseEditor = forwardRef(function ProseEditor({
style={readingTheme === 'light'
? { '--port-input-bg': 'var(--wr-reading-paper)', color: '#1a1a1a' }
: undefined}
- className={`font-serif leading-relaxed focus:outline-none ${className}`.trim()}
+ className={`font-serif leading-relaxed ${className}`.trim()}
{...rest}
/>
);
diff --git a/client/src/components/ui/ProseEditor.test.jsx b/client/src/components/ui/ProseEditor.test.jsx
index 220424e358..d9898966c0 100644
--- a/client/src/components/ui/ProseEditor.test.jsx
+++ b/client/src/components/ui/ProseEditor.test.jsx
@@ -21,6 +21,13 @@ describe('ProseEditor', () => {
expect(screen.getByPlaceholderText('Draft here')).toBeTruthy();
});
+ it('does not bake in focus:outline-none (focus treatment is the caller’s)', () => {
+ // A shared primitive must not silently strip the focus outline — bordered
+ // callers rely on the browser default unless they opt into their own ring.
+ render(<ProseEditor value="" onChange={() => {}} />);
+ expect(screen.getByRole('textbox').className).not.toContain('outline-none');
+ });
+
it('forwards onChange events', () => {
const onChange = vi.fn();
render(<ProseEditor value="" onChange={onChange} />);
diff --git a/client/src/components/writers-room/WorkEditor.jsx b/client/src/components/writers-room/WorkEditor.jsx
index 92fa4ed348..ecf40414a4 100644
--- a/client/src/components/writers-room/WorkEditor.jsx
+++ b/client/src/components/writers-room/WorkEditor.jsx
@@ -809,7 +809,7 @@ export default function WorkEditor({ work, onChange, onToggleExercise, exerciseO
value={body}
onChange={(e) => setBody(e.target.value)}
readingTheme={readingTheme}
- className="w-full h-full resize-none px-6 py-6 text-base"
+ className="w-full h-full resize-none px-6 py-6 text-base focus:outline-none"
/>
)}
<div