Skip to content

Commit f3035ab

Browse files
committed
improvement(rich-md-editor): show the formatting toolbar in the mothership file view
1 parent dffce52 commit f3035ab

3 files changed

Lines changed: 1 addition & 13 deletions

File tree

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ interface FileViewerProps {
9494
isAgentEditing?: boolean
9595
disableStreamingAutoScroll?: boolean
9696
previewContextKey?: string
97-
showBubbleMenu?: boolean
9897
}
9998

10099
export function FileViewer({
@@ -111,7 +110,6 @@ export function FileViewer({
111110
isAgentEditing,
112111
disableStreamingAutoScroll = false,
113112
previewContextKey,
114-
showBubbleMenu = true,
115113
}: FileViewerProps) {
116114
const category = resolveFileCategory(file.type, file.name)
117115

@@ -154,7 +152,6 @@ export function FileViewer({
154152
isAgentEditing={isAgentEditing}
155153
disableStreamingAutoScroll={disableStreamingAutoScroll}
156154
previewContextKey={previewContextKey}
157-
showBubbleMenu={showBubbleMenu}
158155
/>
159156
)
160157
}

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ interface RichMarkdownEditorProps {
4646
isAgentEditing?: boolean
4747
disableStreamingAutoScroll?: boolean
4848
previewContextKey?: string
49-
showBubbleMenu?: boolean
5049
}
5150

5251
/** Inline WYSIWYG markdown editor: agent output streams in read-only, then the same instance becomes editable on settle. */
@@ -62,7 +61,6 @@ export const RichMarkdownEditor = memo(function RichMarkdownEditor({
6261
isAgentEditing,
6362
disableStreamingAutoScroll = false,
6463
previewContextKey,
65-
showBubbleMenu = true,
6664
}: RichMarkdownEditorProps) {
6765
const {
6866
content,
@@ -103,7 +101,6 @@ export const RichMarkdownEditor = memo(function RichMarkdownEditor({
103101
canEdit={canEdit}
104102
autoFocus={autoFocus}
105103
disableStreamingAutoScroll={disableStreamingAutoScroll}
106-
showBubbleMenu={showBubbleMenu}
107104
onChange={setDraftContent}
108105
onSaveShortcut={saveImmediately}
109106
/>
@@ -120,7 +117,6 @@ interface LoadedRichMarkdownEditorProps {
120117
canEdit: boolean
121118
autoFocus?: boolean
122119
disableStreamingAutoScroll?: boolean
123-
showBubbleMenu: boolean
124120
onChange: (markdown: string) => void
125121
onSaveShortcut: () => Promise<void>
126122
}
@@ -144,7 +140,6 @@ export function LoadedRichMarkdownEditor({
144140
canEdit,
145141
autoFocus,
146142
disableStreamingAutoScroll,
147-
showBubbleMenu,
148143
onChange,
149144
onSaveShortcut,
150145
}: LoadedRichMarkdownEditorProps) {
@@ -354,9 +349,7 @@ export function LoadedRichMarkdownEditor({
354349
ref={containerRef}
355350
className={cn('flex flex-1 flex-col overflow-y-auto', isEditable && 'cursor-text')}
356351
>
357-
{showBubbleMenu && editor && (
358-
<EditorBubbleMenu editor={editor} scrollContainerRef={containerRef} />
359-
)}
352+
{editor && <EditorBubbleMenu editor={editor} scrollContainerRef={containerRef} />}
360353
<EditorContent
361354
editor={editor}
362355
className='mx-auto flex w-full max-w-[48rem] flex-1 flex-col px-8 py-6 selection:bg-[var(--selection-bg)] selection:text-[var(--text-primary)] dark:selection:bg-[var(--selection-dark)] dark:selection:text-white'

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
@@ -197,7 +197,6 @@ export const ResourceContent = memo(function ResourceContent({
197197
isAgentEditing={isAgentEditing}
198198
disableStreamingAutoScroll={disableStreamingAutoScroll}
199199
previewContextKey={previewContextKey}
200-
showBubbleMenu={false}
201200
/>
202201
</div>
203202
)
@@ -660,7 +659,6 @@ function EmbeddedFile({
660659
isAgentEditing={isAgentEditing}
661660
disableStreamingAutoScroll={disableStreamingAutoScroll}
662661
previewContextKey={previewContextKey}
663-
showBubbleMenu={false}
664662
/>
665663
</div>
666664
)

0 commit comments

Comments
 (0)