diff --git a/apps/x/KNOWLEDGE_FILE_VIEWER.md b/apps/x/KNOWLEDGE_FILE_VIEWER.md new file mode 100644 index 00000000..55d0f688 --- /dev/null +++ b/apps/x/KNOWLEDGE_FILE_VIEWER.md @@ -0,0 +1,246 @@ +# Knowledge File Viewer — Research & Implementation Plan + +## Current State + +The gap is a single `
` fallback in `App.tsx:4523–4527`. The decision tree today:
+
+```
+selectedPath ends in .md  →  MarkdownEditor (full ProseMirror, works great)
+selectedPath is anything else  →  
 raw text dump  ← THIS IS THE ENTIRE GAP
+```
+
+Everything else needed already exists:
+
+| What's needed | What exists | Where |
+|---|---|---|
+| Read binary files | `shell:readFileBase64` IPC handler | `apps/main/src/ipc.ts:648–667` |
+| Read text files | `workspace:readFile` with `encoding` param | `packages/shared/src/ipc.ts:55–67` |
+| File type detection | `attachment-presentation.ts` utilities | `renderer/src/lib/attachment-presentation.ts` |
+| Audio player component | `AudioFileCard` (base64 → `