Skip to content

Commit dcbc4fa

Browse files
authored
Merge pull request #258 from beNative/tisi/set-new-document-default-to-plain-text
Set new document default to plain text
2 parents 27c17e4 + 0c9ce50 commit dcbc4fa

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ export const MainApp: React.FC = () => {
17931793
const handleNewDocument = useCallback(async (parentId?: string | null) => {
17941794
addLog('INFO', 'User action: Create New Document.');
17951795
const effectiveParentId = parentId !== undefined ? parentId : getParentIdForNewItem();
1796-
const newDoc = await addDocument({ parentId: effectiveParentId, doc_type: 'rich_text', language_hint: 'html' });
1796+
const newDoc = await addDocument({ parentId: effectiveParentId, doc_type: 'prompt', language_hint: 'plaintext' });
17971797
ensureNodeVisible(newDoc);
17981798
activateDocumentTab(newDoc.id);
17991799
setSelectedIds(new Set([newDoc.id]));

hooks/usePrompts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const useDocuments = () => {
6161
const allNodesFlat = useMemo(() => flattenNodes(nodes), [nodes]);
6262
const items: DocumentOrFolder[] = useMemo(() => allNodesFlat.map(nodeToDocumentOrFolder), [allNodesFlat]);
6363

64-
const addDocument = useCallback(async ({ parentId, title = 'New Document', content = '', doc_type = 'prompt', language_hint = 'markdown' }: { parentId: string | null, title?: string, content?: string, doc_type?: DocType, language_hint?: string | null }) => {
64+
const addDocument = useCallback(async ({ parentId, title = 'New Document', content = '', doc_type = 'prompt', language_hint = 'plaintext' }: { parentId: string | null, title?: string, content?: string, doc_type?: DocType, language_hint?: string | null }) => {
6565
const targetDocType = doc_type ?? 'prompt';
6666
const resolvedLanguage = targetDocType === 'rich_text'
6767
? 'html'

0 commit comments

Comments
 (0)