Skip to content

Commit ce582c0

Browse files
committed
Revert "fix(mothership): use the inline markdown editor in the chat resource view"
This reverts commit 9430aa7.
1 parent dc48ea8 commit ce582c0

3 files changed

Lines changed: 2 additions & 10 deletions

File tree

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/file-viewer.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,7 @@ export function FileViewer({
143143
return <CsvTablePreview key={file.id} file={file} workspaceId={workspaceId} />
144144
}
145145

146-
// In an inline-markdown surface, idle markdown is the rich editor; while the agent streams,
147-
// show the rendered preview (never the raw Monaco view) until the content settles.
148-
const isInlineMarkdown = inlineMarkdownEditor && isMarkdownFile(file)
149-
if (isInlineMarkdown && streamingContent === undefined) {
146+
if (inlineMarkdownEditor && isMarkdownFile(file) && streamingContent === undefined) {
150147
return (
151148
<MarkdownFileEditor
152149
key={file.id}
@@ -166,7 +163,7 @@ export function FileViewer({
166163
file={file}
167164
workspaceId={workspaceId}
168165
canEdit={canEdit}
169-
previewMode={isInlineMarkdown ? 'preview' : (previewMode ?? 'editor')}
166+
previewMode={previewMode ?? 'editor'}
170167
autoFocus={autoFocus}
171168
onDirtyChange={onDirtyChange}
172169
onSaveStatusChange={onSaveStatusChange}

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ export const ResourceContent = memo(function ResourceContent({
142142
streamingMode='replace'
143143
disableStreamingAutoScroll={disableStreamingAutoScroll}
144144
previewContextKey={previewContextKey}
145-
inlineMarkdownEditor
146145
/>
147146
</div>
148147
)
@@ -606,7 +605,6 @@ function EmbeddedFile({
606605
streamingContent={streamingContent}
607606
disableStreamingAutoScroll={disableStreamingAutoScroll}
608607
previewContextKey={previewContextKey}
609-
inlineMarkdownEditor
610608
/>
611609
</div>
612610
)

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/mothership-view.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { getFileExtension } from '@/lib/uploads/utils/file-utils'
77
import type { PreviewMode } from '@/app/workspace/[workspaceId]/files/components/file-viewer'
88
import {
99
isCsvStreamOnly,
10-
isMarkdownFile,
1110
RICH_PREVIEWABLE_EXTENSIONS,
1211
} from '@/app/workspace/[workspaceId]/files/components/file-viewer'
1312
import { useMothershipResources } from '@/app/workspace/[workspaceId]/home/components/mothership-resources-context'
@@ -99,8 +98,6 @@ export const MothershipView = memo(
9998
canEdit &&
10099
active?.type === 'file' &&
101100
RICH_PREVIEWABLE_EXTENSIONS.has(getFileExtension(active.title)) &&
102-
// Markdown uses the single-surface inline editor, which has no raw/split/preview modes.
103-
!isMarkdownFile({ type: '', name: active.title }) &&
104101
// Only a CSV's previewability depends on its size (large = read-only, no editor). Wait for
105102
// the record before deciding so the toggle doesn't flash on for a large CSV — but don't gate
106103
// other rich types (markdown, html, svg, …) on the file list loading.

0 commit comments

Comments
 (0)