release: prepare OpenNexus 0.5.2-alpha1

This commit is contained in:
OpenNexus Release Bot
2026-09-18 20:41:21 +08:00
parent 32bc2ddccb
commit 5c3cb8003c
51 changed files with 590 additions and 9327 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ async function openFolderPicker() {
</div>
<div class="footer-info">
<span>v0.5.1-alpha</span>
<span>v0.5.2-alpha1</span>
<button class="theme-toggle" @click="themeStore.toggleTheme()">
<AppIcon :icon="themeStore.isDark ? Sunny : Moon" :size="15" />
{{ themeStore.isDark ? t('浅色', 'Light') : t('深色', 'Dark') }}
@@ -1,7 +1,9 @@
// @vitest-environment jsdom
import {webcrypto} from 'node:crypto'
import {describe,it,expect,vi,afterEach} from 'vitest'
const native=vi.hoisted(()=>({isDesktop:vi.fn(()=>false),hostInvoke:vi.fn()}))
vi.mock('./apiClient',()=>({apiClient:{post:vi.fn(),get:vi.fn()}}))
vi.mock('./platform/desktop',()=>native)
vi.mock('./mermaidService',()=>({renderMermaid:vi.fn()}))
vi.mock('./pdfSnapshotService',()=>({preparePdfSnapshot:vi.fn().mockResolvedValue('<html>theme snapshot</html>')}))
import {preparePdfSnapshot} from './pdfSnapshotService'
@@ -26,6 +28,14 @@ describe('export snapshot contract',()=>{
const reviewOptions={theme_id:'light',include_title:true,page_size:'A4'}
const queued={job_id:'review-job',status:'queued',warnings:[],file:null,error:null}
afterEach(()=>{vi.restoreAllMocks();vi.unstubAllGlobals();vi.clearAllMocks()})
it('uses the native save dialog for desktop export downloads',async()=>{
native.isDesktop.mockReturnValue(true)
native.hostInvoke.mockResolvedValue('D:/Exports/note.pdf')
await exportService.download({id:'export_0123456789ab',status:'completed',warnings:[],error:null,fileName:'note.pdf'})
expect(native.hostInvoke).toHaveBeenCalledWith('export_save',{jobId:'export_0123456789ab',fileName:'note.pdf'})
expect(apiClient.get).not.toHaveBeenCalled()
native.isDesktop.mockReturnValue(false)
})
it('cancels a created server job after an in-flight submission is aborted',async()=>{
let finish!:(value:unknown)=>void
vi.mocked(apiClient.post).mockImplementationOnce(()=>new Promise(resolve=>{finish=resolve}) as never).mockResolvedValue({status:'completed'})
+5
View File
@@ -1,4 +1,5 @@
import { apiClient } from './apiClient'
import { hostInvoke, isDesktop } from './platform/desktop'
import { Marked } from 'marked'
import { renderMermaid } from './mermaidService'
@@ -102,6 +103,10 @@ export const exportService = {
async list() { const response = await apiClient.get<{ items: JobWire[] }>('/api/exports'); return response.items.map(mapJob) },
cancel(id: string) { return apiClient.post(`/api/exports/${encodeURIComponent(id)}/cancel`) },
async download(job: ExportJob) {
if (isDesktop()) {
await hostInvoke<string | null>('export_save', { jobId: job.id, fileName: job.fileName ?? 'export' })
return
}
const response = await apiClient.get<Response>(`/api/exports/${encodeURIComponent(job.id)}/file`)
const url = URL.createObjectURL(await response.blob())
const link = document.createElement('a'); link.href = url; link.download = job.fileName ?? 'export'
+1 -1
View File
@@ -6,7 +6,7 @@ import paper from '@/assets/themes/paper-moments.theme?raw'
afterEach(() => vi.unstubAllGlobals())
it('uses the desktop release version for compatibility checks', () => {
expect(THEME_APP_VERSION).toBe('0.5.1-alpha')
expect(THEME_APP_VERSION).toBe('0.5.2-alpha1')
})
it.each(['999.0.0', 'bad', '0.2'])('rejects unsupported minimum app version %s at inspection and install', async version => {
const source = paper.replace(/min_app_version:.*\r?\n/, `min_app_version: ${version}\n`)