fix: keep raw editor full width

This commit is contained in:
lucaronin
2026-04-27 11:54:15 +02:00
parent da13cb38ac
commit b1a97834c9
2 changed files with 26 additions and 14 deletions

View File

@@ -108,4 +108,18 @@ describe('EditorContentLayout', () => {
expect(container.firstElementChild).toHaveClass('editor-content-layout--left')
expect(screen.getByTestId('breadcrumb-bar')).toHaveAttribute('data-note-layout', 'left')
})
it('keeps raw mode out of the centered rich-editor content wrapper', () => {
render(<EditorContentLayout {...createModel({
effectiveRawMode: true,
showEditor: false,
noteLayout: 'centered',
})} />)
const rawEditor = screen.getByTestId('raw-editor-view')
const findScope = rawEditor.closest('[data-editor-find-scope="true"]')
expect(findScope).toHaveClass('editor-scroll-area')
expect(rawEditor.closest('.editor-content-wrapper')).toBeNull()
})
})

View File

@@ -90,20 +90,18 @@ function RawModeEditorSection({
return (
<EditorFindScope className="editor-scroll-area">
<div className="editor-content-wrapper editor-content-wrapper--raw">
<RawEditorView
key={activeTab.entry.path}
content={rawModeContent ?? activeTab.content}
path={activeTab.entry.path}
entries={entries}
findRequest={findRequest}
onContentChange={onRawContentChange ?? (() => {})}
onSave={onSave ?? (() => {})}
latestContentRef={rawLatestContentRef}
vaultPath={vaultPath}
locale={locale}
/>
</div>
<RawEditorView
key={activeTab.entry.path}
content={rawModeContent ?? activeTab.content}
path={activeTab.entry.path}
entries={entries}
findRequest={findRequest}
onContentChange={onRawContentChange ?? (() => {})}
onSave={onSave ?? (() => {})}
latestContentRef={rawLatestContentRef}
vaultPath={vaultPath}
locale={locale}
/>
</EditorFindScope>
)
}