Open Brain documents from their title

Clicking a document's title fetches the original file from the engine:
viewable formats open in a new tab, the rest (or a blocked tab) download
under the original name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Iqbal
2026-10-23 12:48:07 +07:00
parent c294e91253
commit 7c17191b8b
4 changed files with 38 additions and 2 deletions

View File

@@ -49,6 +49,7 @@ function asSource(d: EngineDocument): Source {
export const listDocuments = async () => (await request<EngineDocument[]>('/upload/list')).map(asSource)
export const documentStatus = (id: number) => request<EngineDocument>(`/upload/${id}`)
export const deleteDocument = (id: number) => request<null>(`/upload/${id}`, { method: 'DELETE' })
export const documentFile = (id: number) => request<Blob>(`/upload/${id}/file`, { as: 'blob' })
export async function supportedExtensions(): Promise<Set<string>> {
const f = await request<{ extensions: string[] }>('/upload/supported-formats')