diff --git a/ui/src/components/NewIssueDialog.tsx b/ui/src/components/NewIssueDialog.tsx index 6797bd0b..dc2d73c7 100644 --- a/ui/src/components/NewIssueDialog.tsx +++ b/ui/src/components/NewIssueDialog.tsx @@ -168,12 +168,14 @@ function clearDraft() { localStorage.removeItem(DRAFT_KEY); } -function isMarkdownFile(file: File) { +function isTextDocumentFile(file: File) { const name = file.name.toLowerCase(); return ( name.endsWith(".md") || name.endsWith(".markdown") || - file.type === "text/markdown" + name.endsWith(".txt") || + file.type === "text/markdown" || + file.type === "text/plain" ); } @@ -266,7 +268,6 @@ export function NewIssueDialog() { const [moreOpen, setMoreOpen] = useState(false); const [companyOpen, setCompanyOpen] = useState(false); const descriptionEditorRef = useRef(null); - const attachInputRef = useRef(null); const stageFileInputRef = useRef(null); const assigneeSelectorRef = useRef(null); const projectSelectorRef = useRef(null); @@ -580,27 +581,12 @@ export function NewIssueDialog() { } } - async function handleAttachImage(evt: ChangeEvent) { - const file = evt.target.files?.[0]; - if (!file) return; - try { - const asset = await uploadDescriptionImage.mutateAsync(file); - const name = file.name || "image"; - setDescription((prev) => { - const suffix = `![${name}](${asset.contentPath})`; - return prev ? `${prev}\n\n${suffix}` : suffix; - }); - } finally { - if (attachInputRef.current) attachInputRef.current.value = ""; - } - } - function stageFiles(files: File[]) { if (files.length === 0) return; setStagedFiles((current) => { const next = [...current]; for (const file of files) { - if (isMarkdownFile(file)) { + if (isTextDocumentFile(file)) { const baseName = fileBaseName(file.name); const documentKey = createUniqueDocumentKey(slugifyDocumentKey(baseName), next); next.push({ @@ -1277,23 +1263,6 @@ export function NewIssueDialog() { Labels - {/* Attach image chip */} - - - - Upload attachment + Upload {/* More (dates) */}