From 3a50e00b29ee93483d8b3b2f36a177f400a3eb0c Mon Sep 17 00:00:00 2001 From: "[._.]/ Adam Eivy" Date: Wed, 9 Sep 2026 05:04:05 +0000 Subject: [PATCH 1/2] fix: collapse Writers Room controls for focused editing and stabilize Save --- .../components/writers-room/WorkEditor.jsx | 35 ++++----- .../writers-room/WorkEditor.test.jsx | 54 ++++++++++++++ client/src/pages/WritersRoom.jsx | 73 +++++++++---------- 3 files changed, 104 insertions(+), 58 deletions(-) diff --git a/client/src/components/writers-room/WorkEditor.jsx b/client/src/components/writers-room/WorkEditor.jsx index 3dd6fec67e..f03d0f7d93 100644 --- a/client/src/components/writers-room/WorkEditor.jsx +++ b/client/src/components/writers-room/WorkEditor.jsx @@ -103,7 +103,7 @@ function readSidebarTab() { return STORYBOARD_TAB_VALUES.includes(stored) ? stored : STORYBOARD_TAB.BOARDS; } -export default function WorkEditor({ work, onChange, onToggleExercise, exerciseOpen, onDirtyChange }) { +export default function WorkEditor({ work, onChange, onToggleExercise, exerciseOpen, onDirtyChange, headerCollapsed = false }) { const navigate = useNavigate(); const [body, setBody] = useState(work.activeDraftBody || ''); const [title, setTitle] = useState(work.title); @@ -734,20 +734,13 @@ export default function WorkEditor({ work, onChange, onToggleExercise, exerciseO const runObjects = useCallback(() => runAnalysis(ANALYSIS_KIND.OBJECTS), [runAnalysis]); return ( -
- {/* - Header — one wrapping row on desktop, two compact rows on phones (#3568). - Under `sm` the status select and view-mode toggle move to a full-width - sub-bar of their own (`order-last`) so the first row is just title, Save, - Snapshot and the Work menu; at `sm+` the sub-bar is `display: contents`, - generating no box, so its children are direct flex items of the header - row again. DOM order is therefore the desktop order — no `order` classes - on the controls themselves — which keeps desktop tab order matching what - is on screen. Every control stays visible at every width; nothing was - pushed into the overflow menu to buy the space. - */} +
+ {/* Keep the editor mounted when collapsing controls so unsaved prose, + selection and active view survive focused writing. */}
+ {headerCollapsed && {title}} setTitle(e.target.value)} onBlur={commitTitle} @@ -758,7 +751,7 @@ export default function WorkEditor({ work, onChange, onToggleExercise, exerciseO {/* Secondary controls. `w-full order-last` gives them their own compact row below the primary actions under `sm`; `sm:contents` dissolves the wrapper so they sit inline — in this DOM order — on desktop. */} -
+