{
const element = event.currentTarget as HTMLInputElement
- const file = element.files?.[0]
+ const files = Array.from(element.files ?? [])
element.value = ''
- if (!file) return
- const current = ++generation
- loading = true
- error = ''
- try {
- if (file.size > FREQUENCY_FILE_LIMIT) throw new Error('Frequency file exceeds the 16 MiB limit.')
- const parsed = read_frequency_cjson(await file.text())
- if (disposed || current !== generation) return
- data = parsed
- filename = file.name
- modeIndex = 0
- amplitude = DEFAULT_FREQUENCY_AMPLITUDE
- step = 0
- } catch (reason) {
- if (!disposed && current === generation) error = reason instanceof Error ? reason.message : String(reason)
- } finally {
- if (!disposed && current === generation) loading = false
- }
+ sceneError = ''
+ await queue.replace(files)
}
const set_amplitude = (event: Event): void => {
@@ -63,8 +67,8 @@
const previous = document.activeElement instanceof HTMLElement ? document.activeElement : null
dialog.showModal()
return () => {
- disposed = true
- generation++
+ queue.dispose()
+ exportController.abort()
dialog.close()
queueMicrotask(() => { if (previous?.isConnected) previous.focus() })
}
@@ -77,10 +81,23 @@
- input.click()} disabled={loading}>{$t('Open frequency file')}
-
- {loading ? $t('Loading…') : filename}
+ input.click()}>{$t('Open frequency file')}
+
+ {filename}
+ {#if queueState.loading}{$t('Loading…')} {/if}
+ {#if queueState.files.length}
+
+ queue.select(queueState.index - 1)}>‹
+ {$t('Frequency files')}
+ queue.select(Number(event.currentTarget.value))}>
+ {#each queueState.files as file, index}{index + 1}. {file.name} {/each}
+
+
+ = queueState.files.length - 1} onclick={() => queue.select(queueState.index + 1)}>›
+ {#if data}{$t('Showing')}: {filename} {/if}
+
+ {/if}
{#if error}{$t(error)}
{/if}
{#if data && mode && trajectory}
@@ -96,25 +113,31 @@
{#if mode.ir !== undefined}IR: {mode.ir.toFixed(2)} km/mol {/if}
+ {$t('Displacement arrows')}
{$t('Amplitude and playback speed are visual settings.')}
{#key data}
{ error = event.error_msg ?? 'Unable to display this normal mode.' }}
+ on_error={event => { sceneError = event.error_msg ?? 'Unable to display this normal mode.' }}
/>
{/key}
@@ -132,7 +155,7 @@
.frequency-viewer { position: fixed; inset: 0; width: min(1100px, calc(100vw - 32px)); height: min(820px, calc(100dvh - 32px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--ui-border); border-radius: 12px; background: var(--ui-background, white); color: var(--ui-foreground, #172b3a); overflow: hidden; }
.frequency-viewer[open] { display: flex; flex-direction: column; }
.frequency-viewer::backdrop { background: #15253488; }
- header, .file-row, .mode-row { display: flex; align-items: center; gap: 16px; padding: 12px 18px; flex-shrink: 0; }
+ header, .file-row, .mode-row, .queue-row { display: flex; align-items: center; gap: 16px; padding: 12px 18px; flex-shrink: 0; }
header { justify-content: space-between; border-bottom: 1px solid var(--ui-border); }
h2 { font-size: 18px; margin: 0; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--ui-border); border-radius: 6px; background: var(--ui-background, white); color: inherit; font: inherit; cursor: pointer; }
@@ -141,6 +164,11 @@
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--ui-ring); outline-offset: 2px; }
.file-row button { flex-shrink: 0; }
.filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+ .queue-row { gap: 8px; flex-wrap: wrap; padding-top: 0; }
+ .queue-row label { min-width: 0; max-width: calc(100% - 90px); }
+ .queue-row select { min-width: 0; max-width: 100%; }
+ .showing { font-size: 12px; overflow-wrap: anywhere; }
+ .arrow-toggle { padding: 8px 18px 0; }
.mode-row { flex-wrap: wrap; padding-top: 0; padding-bottom: 0; }
label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
select, input[type=number] { color: inherit; background: var(--ui-background, white); font: inherit; border: 1px solid var(--ui-border); border-radius: 5px; padding: 6px; }
diff --git a/frontend/matterviz-viewer/src/frequency-queue.ts b/frontend/matterviz-viewer/src/frequency-queue.ts
new file mode 100644
index 00000000..e03e57a8
--- /dev/null
+++ b/frontend/matterviz-viewer/src/frequency-queue.ts
@@ -0,0 +1,50 @@
+import { read_frequency_cjson, FREQUENCY_FILE_LIMIT, type FrequencyData } from './frequency'
+
+export type FrequencyFile = Pick
+export interface FrequencyQueueState {
+ files: readonly FrequencyFile[]
+ index: number
+ data?: FrequencyData
+ displayedName: string
+ error: string
+ loading: boolean
+}
+
+/** Only the selected file is decoded. Every navigation/replacement/close retires old reads. */
+export function create_frequency_queue(onchange: (state: FrequencyQueueState) => void = () => {}) {
+ let state: FrequencyQueueState = { files: [], index: -1, displayedName: '', error: '', loading: false }
+ let generation = 0
+ let disposed = false
+ const publish = (change: Partial) => {
+ state = { ...state, ...change }
+ onchange(state)
+ }
+ async function select(index: number): Promise {
+ if (disposed || !Number.isInteger(index) || !state.files[index]) return
+ const current = ++generation
+ const file = state.files[index]
+ publish({ index, error: '', loading: true })
+ try {
+ if (file.size > FREQUENCY_FILE_LIMIT) throw new Error('Frequency file exceeds the 16 MiB limit.')
+ const text = await file.text()
+ if (disposed || current !== generation) return
+ const data = read_frequency_cjson(text)
+ publish({ data, displayedName: file.name })
+ } catch (reason) {
+ if (!disposed && current === generation) publish({ error: reason instanceof Error ? reason.message : String(reason) })
+ } finally {
+ if (!disposed && current === generation) publish({ loading: false })
+ }
+ }
+ return {
+ get state() { return state },
+ async replace(files: readonly FrequencyFile[]): Promise {
+ if (disposed || !files.length) return
+ generation++
+ publish({ files: [...files], index: 0 })
+ await select(0)
+ },
+ select,
+ dispose() { disposed = true; generation++ },
+ }
+}
diff --git a/frontend/matterviz-viewer/src/frequency-save.ts b/frontend/matterviz-viewer/src/frequency-save.ts
new file mode 100644
index 00000000..cef26921
--- /dev/null
+++ b/frontend/matterviz-viewer/src/frequency-save.ts
@@ -0,0 +1,27 @@
+export type FrequencyDownload = (data: Blob | string, filename: string, mime: string) => Promise
+type SaveFetch = (url: URL, init: RequestInit) => Promise
+export const FREQUENCY_EXPORT_LIMIT = 64 * 1024 * 1024
+
+/** An instance-scoped byte sink. The native host alone chooses a destination path. */
+export function create_frequency_save(page: URL, request: SaveFetch = (url, init) => fetch(url, init), signal?: AbortSignal): FrequencyDownload {
+ return async (data, filename, mime) => {
+ const capability = page.searchParams.get('cap')
+ if (!capability) throw new Error('Saving requires the native host. Open this viewer from BaneWfn.')
+ signal?.throwIfAborted()
+ const body = typeof data === 'string' ? new Blob([data], { type: mime }) : data
+ if (!body.size || body.size > FREQUENCY_EXPORT_LIMIT) throw new Error('Export must be nonempty and at most 64 MiB.')
+ const endpoint = new URL('/api/viewer-export', page)
+ endpoint.searchParams.set('cap', capability)
+ endpoint.searchParams.set('filename', filename)
+ const response = await request(endpoint, { method: 'POST', headers: { 'Content-Type': mime }, body, signal })
+ const text = await response.text()
+ let result: { status?: string; message?: string }
+ try { result = JSON.parse(text) }
+ catch { throw new Error(response.ok ? 'Native host returned an invalid save result.' : text || 'Unable to save this export.') }
+ if (!result || typeof result !== 'object' || Array.isArray(result)) throw new Error('Native host returned an invalid save result.')
+ if (!response.ok) throw new Error(result.message || 'Unable to save this export.')
+ if (result.status === 'cancelled') throw new DOMException('Save cancelled.', 'AbortError')
+ if (result.status !== 'saved') throw new Error('Native host returned an invalid save result.')
+ signal?.throwIfAborted()
+ }
+}
diff --git a/frontend/matterviz-viewer/src/frequency.ts b/frontend/matterviz-viewer/src/frequency.ts
index 0aa1e5f7..557d40a7 100644
--- a/frontend/matterviz-viewer/src/frequency.ts
+++ b/frontend/matterviz-viewer/src/frequency.ts
@@ -107,10 +107,13 @@ export function frequency_trajectory(data: FrequencyData, modeIndex: number, amp
return {
structure: {
...data.structure,
- sites: data.structure.sites.map((site, atom) => ({
- ...site,
- xyz: site.xyz.map((coordinate, axis) => coordinate + excursion * (mode.displacement[atom][axis] / extent)) as Vec3,
- })),
+ sites: data.structure.sites.map((site, atom) => {
+ const xyz = site.xyz.map((coordinate, axis) => coordinate + excursion * (mode.displacement[atom][axis] / extent)) as Vec3
+ // Use the exact floating-point shift applied to coordinates, not a force or
+ // mass-weighted proxy. No per-frame recentering changes these vectors.
+ const displacement = xyz.map((coordinate, axis) => coordinate - site.xyz[axis]) as Vec3
+ return { ...site, xyz, properties: { ...site.properties, displacement } }
+ }),
},
step: index,
}
diff --git a/frontend/matterviz-viewer/src/messages.ts b/frontend/matterviz-viewer/src/messages.ts
index b11ca233..9dcc8fec 100644
--- a/frontend/matterviz-viewer/src/messages.ts
+++ b/frontend/matterviz-viewer/src/messages.ts
@@ -1,5 +1,10 @@
/** Application-owned UI text. Keep scientific data, identifiers and user labels unchanged. */
export const zh = {
+ 'Previous frequency file': '上一个频率文件',
+ 'Next frequency file': '下一个频率文件',
+ 'Frequency files': '频率文件列表',
+ 'Showing': '当前显示',
+ 'Displacement arrows': '位移箭头',
'Vibrational modes': '振动模式',
'Loading…': '正在载入…',
'Close vibration viewer': '关闭振动查看器',
diff --git a/frontend/matterviz-viewer/tests/browser/frequency-controls.mjs b/frontend/matterviz-viewer/tests/browser/frequency-controls.mjs
new file mode 100644
index 00000000..0cb9a082
--- /dev/null
+++ b/frontend/matterviz-viewer/tests/browser/frequency-controls.mjs
@@ -0,0 +1,167 @@
+// Production UI + native MatterViz acceptance. Saving is an HTTP-boundary stub;
+// actual host writes/cancellation/validation are covered by the Rust harness.
+import assert from 'node:assert/strict'
+import { readFile, readdir, mkdir, writeFile } from 'node:fs/promises'
+import { fileURLToPath } from 'node:url'
+import { preview } from 'vite'
+import { chromium } from 'playwright'
+
+const artifacts = process.env.ARTIFACT_DIR || '/tmp/multiwfn-frequency-controls-browser'
+await mkdir(artifacts, { recursive: true })
+const server = await preview({ preview: { host: '127.0.0.1', port: 0, strictPort: true } })
+const address = server.httpServer.address()
+let browser, page
+const errors = [], checks = [], exports = []
+let result = 'saved', pendingVideo
+const record = message => { checks.push(message); console.log('PASS', message) }
+const fixture = name => fileURLToPath(new URL(`../fixtures/frequency/${name}.cjson`, import.meta.url))
+try {
+ browser = await chromium.launch({ executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE, headless: true, args: ['--no-sandbox', '--use-angle=swiftshader', '--enable-unsafe-swiftshader'] })
+ page = await browser.newPage({ viewport: { width: 1280, height: 950 }, locale: 'en-US' })
+ page.on('pageerror', error => errors.push(error.message))
+ page.on('download', () => errors.push('Unexpected global browser download'))
+ await page.addInitScript(() => {
+ window.recordedSteps = []
+ const capture = HTMLCanvasElement.prototype.captureStream
+ HTMLCanvasElement.prototype.captureStream = function (...args) {
+ const stream = capture.apply(this, args)
+ for (const track of stream.getVideoTracks()) {
+ const request = track.requestFrame?.bind(track)
+ track.requestFrame = () => {
+ window.recordedSteps.push({ step: Number(document.querySelector('dialog .step-input')?.value), positions: window.frequencyPositions?.() })
+ request?.()
+ }
+ }
+ return stream
+ }
+ })
+ await page.route('**/api/workflows/**', route => route.fulfill({ contentType: 'application/json', body: JSON.stringify({ format: 'multiwfn-workflows', version: 1, available: true, scripts: [], session: null, runner: 'unused', library: '/unused', results: '/unused', wavefunction: null, multiwfn: 'unused', catalogError: null, job: null }) }))
+ await page.route('**/api/viewer-export?**', async route => {
+ const request = route.request(), url = new URL(request.url()), bytes = request.postDataBuffer()
+ assert.equal(url.searchParams.get('cap'), 'test-capability')
+ assert.equal(url.searchParams.has('path'), false)
+ exports.push({ filename: url.searchParams.get('filename'), mime: request.headers()['content-type'], bytes })
+ if (request.headers()['content-type'] === 'video/webm') await new Promise(resolve => { pendingVideo = resolve })
+ await route.fulfill({ status: result === 'failure' ? 500 : 200, contentType: 'application/json', body: JSON.stringify(result === 'failure' ? { message: 'native write failed' } : { status: result }) })
+ })
+ await page.goto(`http://127.0.0.1:${address.port}/?workbench=1&cap=test-capability`)
+ await page.getByRole('button', { name: 'Vibrational modes', exact: true }).click()
+ const dialog = page.getByRole('dialog', { name: 'Vibrational modes', exact: true })
+ const file = dialog.getByLabel('Frequency file', { exact: true })
+ await file.setInputFiles([{ name: 'water.cjson', mimeType: 'application/json', buffer: await readFile(fixture('gaussian16-water')) }, { name: 'bad.cjson', mimeType: 'application/json', buffer: Buffer.from('{}') }, { name: 'orca.cjson', mimeType: 'application/json', buffer: await readFile(fixture('orca42-dvb')) }])
+ await dialog.locator('canvas').waitFor()
+ const queue = dialog.getByRole('combobox', { name: 'Frequency files', exact: true })
+ assert.deepEqual(await queue.locator('option').allTextContents(), ['1. water.cjson', '2. bad.cjson', '3. orca.cjson'])
+ await dialog.getByRole('button', { name: 'Next frequency file', exact: true }).click()
+ await dialog.getByRole('alert').waitFor()
+ assert.equal(await dialog.locator('.filename').textContent(), 'water.cjson')
+ assert.equal(await queue.inputValue(), '1')
+ await dialog.getByRole('button', { name: 'Next frequency file', exact: true }).click()
+ await page.waitForFunction(() => document.querySelector('dialog .filename')?.textContent === 'orca.cjson')
+ assert.equal(await dialog.getByRole('spinbutton', { name: 'Step input', exact: true }).inputValue(), '0')
+ assert.equal(await dialog.locator('.play-button.playing').count(), 0)
+ await queue.selectOption('0')
+ await page.waitForFunction(() => document.querySelector('dialog .filename')?.textContent === 'water.cjson')
+ record('Ordered queue, malformed middle item preserves identity, switching starts paused at equilibrium')
+
+ const chunks = (await readdir(new URL('../../dist/assets/', import.meta.url))).filter(name => name.startsWith('structure-') && name.endsWith('.js'))
+ await page.evaluate(async chunk => {
+ const canvas = document.querySelector('dialog canvas'), module = await import(`/assets/${chunk}`)
+ const registry = Object.values(module).find(value => (value instanceof Map || value instanceof WeakMap) && value.get(canvas)?.camera)
+ window.frequencyScene = registry.get(canvas)
+ window.frequencyPositions = () => {
+ const positions = []
+ window.frequencyScene.scene.traverse(object => { if (object.isInstancedMesh && object.geometry.type === 'SphereGeometry') for (let index = 0; index < object.count; index++) positions.push(...object.instanceMatrix.array.slice(index * 16 + 12, index * 16 + 15)) })
+ return positions
+ }
+ }, chunks[0])
+ const arrows = dialog.getByRole('checkbox', { name: 'Displacement arrows', exact: true })
+ assert.equal(await arrows.isChecked(), false)
+ const step = dialog.getByRole('spinbutton', { name: 'Step input', exact: true })
+ await step.fill('12'); await arrows.check()
+ await page.waitForTimeout(150)
+ const countMeshes = () => page.evaluate(() => { let count = 0; window.frequencyScene.scene.traverse(object => { if (object.isMesh) count++ }); return count })
+ const withArrows = await countMeshes()
+ await arrows.uncheck(); await page.waitForTimeout(100)
+ assert.ok(withArrows > await countMeshes())
+ record('Initially-off displacement toggle controls native arrow meshes')
+
+ await dialog.locator('.structure-export-toggle').click()
+ // Deliberately do not wait for the requested frame to render before clicking.
+ await dialog.getByRole('combobox', { name: 'Normal mode', exact: true }).selectOption('1')
+ await dialog.getByRole('spinbutton', { name: 'Visual amplitude (Å)', exact: true }).fill('0.6')
+ await dialog.getByRole('spinbutton', { name: 'Visual amplitude (Å)', exact: true }).press('Tab')
+ await step.fill('36')
+ const jsonSaved = page.waitForResponse(response => new URL(response.url()).pathname === '/api/viewer-export')
+ await dialog.getByRole('button', { name: 'Download JSON', exact: true }).click()
+ await jsonSaved
+ await page.waitForFunction(() => !document.querySelector('dialog .step-input')?.disabled)
+ const exported = JSON.parse(exports.at(-1).bytes.toString('utf8'))
+ const source = JSON.parse(await readFile(fixture('gaussian16-water'), 'utf8'))
+ const vectors = source.vibrations.displacement[1], extent = Math.max(...vectors.map(vector => Math.hypot(...vector)))
+ exported.sites.forEach((site, atom) => site.xyz.forEach((coordinate, axis) => assert.ok(Math.abs(coordinate - (source.atoms.coords['3d'][atom * 3 + axis] - .6 * vectors[atom][axis] / extent)) < 1e-9)))
+ record('Immediate structure export waits for the selected current mode, amplitude and lazy frame')
+
+ const pngSaved = page.waitForResponse(response => new URL(response.url()).pathname === '/api/viewer-export')
+ await dialog.getByRole('button', { name: 'Download PNG', exact: true }).click()
+ await pngSaved
+ await page.waitForFunction(() => !document.querySelector('dialog .step-input')?.disabled)
+ const png = exports.at(-1)
+ assert.equal(png.mime, 'image/png'); assert.deepEqual([...png.bytes.subarray(0,8)], [137,80,78,71,13,10,26,10])
+ result = 'cancelled'
+ await dialog.getByRole('button', { name: 'Download XYZ', exact: true }).click()
+ await dialog.getByRole('status').filter({ hasText: 'Save cancelled' }).waitFor()
+ result = 'failure'
+ await dialog.getByRole('button', { name: 'Download XYZ', exact: true }).click()
+ await dialog.getByRole('status').filter({ hasText: 'native write failed' }).waitFor()
+ record('Native byte sink receives PNG; cancellation and write failure remain visible and never succeed')
+ result = 'saved'
+ await dialog.locator('.structure-export-toggle').click()
+ await dialog.locator('.trajectory-export-toggle').click()
+ assert.equal(await dialog.getByRole('button', { name: 'Download MP4', exact: true }).count(), 0)
+ const supported = await page.evaluate(() => typeof MediaRecorder !== 'undefined' && MediaRecorder.isTypeSupported('video/webm;codecs=vp9'))
+ if (supported) {
+ await dialog.locator('label').filter({ hasText: 'End Frame' }).locator('input[type=number]').fill('2')
+ const before = await step.inputValue()
+ const pose = () => page.evaluate(() => { const c = window.frequencyScene.camera; return [...c.position.toArray(), ...c.quaternion.toArray(), c.zoom] })
+ const camera = await pose()
+ await dialog.getByRole('button', { name: 'Download WebM', exact: true }).click()
+ for (let attempt = 0; !pendingVideo && attempt < 1500; attempt++) await page.waitForTimeout(20)
+ assert.ok(pendingVideo, 'recording must reach the bounded native save endpoint')
+ assert.equal(await dialog.getByRole('button', { name: 'Download WebM', exact: true }).isDisabled(), true)
+ const webm = exports.at(-1)
+ assert.equal(webm.mime, 'video/webm'); assert.deepEqual([...webm.bytes.subarray(0,4)], [26,69,223,163])
+ const captured = await page.evaluate(() => window.recordedSteps)
+ assert.deepEqual(captured.map(frame => frame.step), [0,1,2])
+ for (const frame of captured) {
+ assert.equal(frame.positions.length, 9)
+ frame.positions.forEach((coordinate, index) => {
+ const atom = Math.floor(index / 3), axis = index % 3
+ const expected = source.atoms.coords['3d'][index] + .6 * Math.sin(2 * Math.PI * frame.step / 48) * vectors[atom][axis] / extent
+ assert.ok(Math.abs(coordinate - expected) < 1e-5, `captured geometry must match requested lazy frame ${frame.step}`)
+ })
+ }
+ pendingVideo(); pendingVideo = null
+ await page.waitForFunction(index => document.querySelector('dialog .step-input')?.value === index, before)
+ assert.ok((await pose()).every((value,index) => Math.abs(value - camera[index]) < 1e-7))
+ record('Actual WebM frame geometry captured in order; completion awaits native save and restores step/camera')
+ await page.waitForFunction(() => !document.querySelector('button[aria-label="Download WebM"]')?.disabled)
+ await dialog.locator('.play-button').click()
+ await dialog.getByRole('button', { name: 'Download WebM', exact: true }).click()
+ for (let attempt = 0; !pendingVideo && attempt < 1500; attempt++) await page.waitForTimeout(20)
+ assert.ok(pendingVideo)
+ pendingVideo(); pendingVideo = null
+ await dialog.locator('.play-button.playing').waitFor()
+ await dialog.locator('.play-button').click()
+ record('A previously playing trajectory resumes after export')
+ } else {
+ assert.equal(await dialog.getByRole('button', { name: 'Download WebM', exact: true }).isDisabled(), true)
+ record('Unsupported WebM codec leaves recording disabled')
+ }
+ await page.screenshot({ path: `${artifacts}/controls.png` })
+ assert.deepEqual(errors, [])
+} finally {
+ pendingVideo?.()
+ await writeFile(`${artifacts}/verification.json`, JSON.stringify({ checks, errors, exports: exports.map(({ filename, mime, bytes }) => ({ filename, mime, size: bytes.length })) }, null, 2))
+ await browser?.close(); await new Promise(resolve => server.httpServer.close(resolve))
+}
diff --git a/frontend/matterviz-viewer/tests/frequency-controls.test.ts b/frontend/matterviz-viewer/tests/frequency-controls.test.ts
new file mode 100644
index 00000000..e893ffec
--- /dev/null
+++ b/frontend/matterviz-viewer/tests/frequency-controls.test.ts
@@ -0,0 +1,81 @@
+import assert from 'node:assert/strict'
+import { readFile } from 'node:fs/promises'
+import test from 'node:test'
+import { createServer } from 'vite'
+
+let server: Awaited>
+let frequency: typeof import('../src/frequency.ts')
+const source = await readFile(new URL('./fixtures/frequency/gaussian16-water.cjson', import.meta.url), 'utf8')
+const deferred = () => { let resolve!: (value: T) => void; const promise = new Promise(r => { resolve = r }); return { promise, resolve } }
+const file = (name: string, text = async () => source, size = source.length) => ({ name, size, text })
+test.before(async () => {
+ server = await createServer({ server: { middlewareMode: true, hmr: false }, appType: 'custom', cacheDir: 'node_modules/.vite-frequency-controls-tests' })
+ frequency = await server.ssrLoadModule('/src/frequency.ts')
+})
+test.after(async () => { await server?.close() })
+
+test('native displacement vectors exactly equal each rendered xyz shift, retaining sign and atom ratios', async () => {
+ const data = frequency.read_frequency_cjson(source)
+ const trajectory = frequency.frequency_trajectory(data, 0, .35)
+ const { get_all_site_vectors } = await server.ssrLoadModule('/node_modules/matterviz/dist/structure/index.js')
+ for (const idx of [0, 12, 36]) {
+ const frame = (await trajectory.frame_loader!.load_frame('', idx))!
+ for (const [atom, site] of frame.structure.sites.entries()) {
+ const vector = site.properties?.displacement
+ assert.deepEqual(vector, site.xyz.map((v, axis) => v - data.structure.sites[atom].xyz[axis]))
+ assert.deepEqual(get_all_site_vectors(site), [{ key: 'displacement', vec: vector }])
+ }
+ }
+})
+
+test('ordered queue parses only selected files and preserves displayed data/identity on malformed middle item', async () => {
+ const { create_frequency_queue } = await server.ssrLoadModule('/src/frequency-queue.ts')
+ const reads: string[] = []
+ const queue = create_frequency_queue()
+ const files = [file('first', async () => { reads.push('first'); return source }), file('bad', async () => { reads.push('bad'); return '{}' }), file('last', async () => { reads.push('last'); return source })]
+ await queue.replace(files)
+ assert.deepEqual(reads, ['first'])
+ const valid = queue.state.data
+ await queue.select(1)
+ assert.equal(queue.state.index, 1)
+ assert.match(queue.state.error, /cclib/)
+ assert.equal(queue.state.data, valid)
+ assert.equal(queue.state.displayedName, 'first')
+ assert.equal(queue.state.files[1].name, 'bad')
+ await queue.select(2)
+ assert.equal(queue.state.displayedName, 'last')
+ assert.deepEqual(reads, ['first', 'bad', 'last'])
+ assert.deepEqual(queue.state.files.map((item: File) => item.name), ['first', 'bad', 'last'])
+})
+
+test('replacement, rapid navigation and close invalidate delayed reads without stale publishing', async () => {
+ const { create_frequency_queue } = await server.ssrLoadModule('/src/frequency-queue.ts')
+ const old = deferred(), middle = deferred(), closed = deferred()
+ const updates: unknown[] = []
+ const queue = create_frequency_queue((state: unknown) => updates.push(state))
+ const pending = queue.replace([file('old', () => old.promise)])
+ await queue.replace([file('new'), file('middle', () => middle.promise), file('last')])
+ old.resolve(source); await pending
+ assert.equal(queue.state.displayedName, 'new')
+ const changing = queue.select(1)
+ await queue.select(2)
+ middle.resolve(source); await changing
+ assert.equal(queue.state.displayedName, 'last')
+ const closing = queue.replace([file('closed', () => closed.promise)])
+ queue.dispose(); const count = updates.length
+ closed.resolve(source); await closing
+ assert.equal(updates.length, count)
+ assert.equal(queue.state.displayedName, 'last')
+})
+
+test('queue rejects oversized files before reading and handles read failures without losing valid scene', async () => {
+ const { create_frequency_queue } = await server.ssrLoadModule('/src/frequency-queue.ts')
+ const queue = create_frequency_queue()
+ await queue.replace([file('valid')]); const data = queue.state.data
+ await queue.replace([file('large', async () => { throw Error('must not read') }, frequency.FREQUENCY_FILE_LIMIT + 1)])
+ assert.match(queue.state.error, /16 MiB/)
+ await queue.replace([file('unreadable', async () => { throw Error('disk read failed') })])
+ assert.equal(queue.state.data, data)
+ assert.equal(queue.state.displayedName, 'valid')
+ assert.match(queue.state.error, /disk read failed/)
+})
diff --git a/frontend/matterviz-viewer/tests/frequency-export-race.test.ts b/frontend/matterviz-viewer/tests/frequency-export-race.test.ts
new file mode 100644
index 00000000..6e5951a3
--- /dev/null
+++ b/frontend/matterviz-viewer/tests/frequency-export-race.test.ts
@@ -0,0 +1,115 @@
+import assert from 'node:assert/strict'
+import { readFile } from 'node:fs/promises'
+import { runInNewContext } from 'node:vm'
+import test from 'node:test'
+import ts from 'typescript'
+
+const source = await readFile(new URL('../node_modules/matterviz/dist/trajectory/Trajectory.svelte', import.meta.url), 'utf8')
+// Execute the exact production transaction functions. Only TS syntax is removed;
+// their loader/tick/RAF/scene boundaries are deterministic test dependencies.
+const functions = ts.transpile(source.slice(source.indexOf(' async function go_to_export_step('), source.indexOf(' // Handle plot point clicks')), { target: ts.ScriptTarget.ES2022 })
+function harness() {
+ const frame = { structure: { sites: [] } }, owner = { frames: [frame], frame_loader: {} }, canvas = {}
+ let raf: (() => void) | undefined
+ const calls = { save: 0, render: 0, camera: 0, resume: 0 }
+ const context: any = {
+ trajectory: owner, disposed: false, current_step_idx: 0, current_frame: frame,
+ frame_cache: new Map([[0, frame]]), frame_cache_owner: owner, displayed_frame_owner: owner, displayed_frame_idx: 0,
+ export_snapshot: { owner, index: 0, playing: true, camera: { copy() { calls.camera++ } }, pose: {} },
+ go_to_step(index: number) { context.current_step_idx = index },
+ async tick() {}, clear_frame_load_timeout() {}, async load_frame_on_demand() {},
+ requestAnimationFrame(callback: () => void) { raf = callback }, DOMException, Promise,
+ wrapper: { querySelector() { return canvas } },
+ scene_registry: new Map([[canvas, { scene: {}, camera: {} }]]),
+ renderer_registry: new Map([[canvas, { render() { calls.render++; context.onRender?.() } }]]),
+ start_playback() { calls.resume++ },
+ }
+ const api = runInNewContext(`${functions}\n({ go_to_export_step, finish_export })`, context)
+ return { context, calls, api, frame, async ready() { await new Promise(setImmediate); assert.ok(raf); return raf! } }
+}
+
+test('replacement, close, index or ready-frame change during the final RAF never renders or saves', async () => {
+ for (const change of [
+ (state: any) => { state.trajectory = { frames: [] } },
+ (state: any) => { state.disposed = true },
+ (state: any) => { state.current_step_idx = 1 },
+ (state: any) => { state.current_frame = { structure: {} } },
+ ]) {
+ const h = harness()
+ const result = h.api.go_to_export_step(0).then(() => { h.calls.save++; return 'saved' }, (error: Error) => error.name)
+ const render = await h.ready(); change(h.context); render()
+ assert.equal(await result, 'AbortError')
+ assert.deepEqual(h.calls, { save: 0, render: 0, camera: 0, resume: 0 })
+ }
+})
+
+test('restore cannot copy an old camera or resume a replacement owner during its final RAF', async () => {
+ const h = harness()
+ const result = h.api.finish_export().then(() => 'finished', (error: Error) => error.name)
+ const render = await h.ready(); h.context.trajectory = { frames: [] }; render()
+ await result
+ assert.equal(h.calls.camera, 0); assert.equal(h.calls.resume, 0)
+})
+
+test('restore rechecks after its await and never clears a newer transaction', async () => {
+ const h = harness(), replacement = { frames: [] }
+ const next = { owner: replacement, index: 0, playing: false }
+ h.context.onRender = () => queueMicrotask(() => { h.context.trajectory = replacement; h.context.export_snapshot = next })
+ const pending = h.api.finish_export()
+ const render = await h.ready(); render(); await pending
+ assert.equal(h.calls.camera, 0); assert.equal(h.calls.resume, 0)
+ assert.equal(h.context.export_snapshot, next)
+})
+
+test('Structure save keeps its initiating sink and cleanup while waiting for frame readiness', async () => {
+ const pane = await readFile(new URL('../node_modules/matterviz/dist/structure/StructureExportPane.svelte', import.meta.url), 'utf8')
+ const save = ts.transpile(pane.slice(pane.indexOf(' async function save_export('), pane.indexOf(' async function handle_3d_export(')), { target: ts.ScriptTarget.ES2022 })
+ let release!: () => void
+ const wait = new Promise(resolve => { release = resolve })
+ const calls = { oldSink: 0, newSink: 0, oldEnd: 0, newEnd: 0 }
+ const context: any = {
+ is_exporting: false, export_error: null, Error,
+ before_export: () => wait, on_export_start: () => () => {},
+ on_download: async () => { calls.oldSink++ },
+ on_export_end: async () => { calls.oldEnd++ },
+ }
+ const api = runInNewContext(`${save}\n({ save_export })`, context)
+ const pending = api.save_export(async (sink: (...args: any[]) => Promise) => { await sink('bytes', 'frame.xyz', 'text/plain') })
+ context.on_download = async () => { calls.newSink++ }
+ context.on_export_end = async () => { calls.newEnd++ }
+ release(); await pending
+ assert.deepEqual(calls, { oldSink: 1, newSink: 0, oldEnd: 1, newEnd: 0 })
+})
+
+test('Structure never saves through live replacement props after the ready-frame promise resolves', async () => {
+ const h = harness()
+ const begin = ts.transpile(source.slice(source.indexOf(' function begin_export()'), source.indexOf(' // Await the requested data')), { target: ts.ScriptTarget.ES2022 })
+ h.context.export_snapshot = undefined
+ h.context.is_playing = true
+ h.context.pause_playback = () => { h.context.is_playing = false }
+ const canvas = h.context.wrapper.querySelector()
+ h.context.scene_registry.set(canvas, { scene: {}, camera: { clone() { return {} }, copy() { h.calls.camera++ } } })
+ const api = runInNewContext(`${begin}\n${functions}\n({ begin_export, go_to_export_step, finish_export })`, h.context)
+ const pane = await readFile(new URL('../node_modules/matterviz/dist/structure/StructureExportPane.svelte', import.meta.url), 'utf8')
+ const save = ts.transpile(pane.slice(pane.indexOf(' async function save_export('), pane.indexOf(' async function handle_3d_export(')), { target: ts.ScriptTarget.ES2022 })
+ Object.assign(h.context, {
+ is_exporting: false, export_error: null, Error,
+ on_export_start: api.begin_export, before_export: () => api.go_to_export_step(0), on_export_end: api.finish_export,
+ on_download: async () => { h.calls.save++ },
+ onRender: () => queueMicrotask(() => { h.context.trajectory = { frames: [] }; h.context.on_download = async () => { h.calls.save++ } }),
+ })
+ const paneApi = runInNewContext(`${save}\n({ save_export })`, h.context)
+ const pending = paneApi.save_export(async (sink: (...args: any[]) => Promise) => { await (sink ?? h.context.on_download)('bytes', 'frame.xyz', 'text/plain') })
+ const render = await h.ready(); render(); await pending
+ assert.equal(h.calls.save, 0); assert.equal(h.calls.camera, 0); assert.equal(h.calls.resume, 0)
+ assert.match(h.context.export_error, /interrupted/)
+})
+
+test('a published Svelte-proxied frame remains ready even when the cache holds its raw object', async () => {
+ const h = harness()
+ h.context.current_frame = new Proxy(h.frame, {})
+ const pending = h.api.go_to_export_step(0).then(() => 'ready', (error: Error) => error.name)
+ const render = await h.ready(); render()
+ assert.equal(await pending, 'ready')
+ assert.equal(h.calls.render, 1)
+})
diff --git a/frontend/matterviz-viewer/tests/frequency-export-types.test.ts b/frontend/matterviz-viewer/tests/frequency-export-types.test.ts
new file mode 100644
index 00000000..42422d76
--- /dev/null
+++ b/frontend/matterviz-viewer/tests/frequency-export-types.test.ts
@@ -0,0 +1,32 @@
+import assert from 'node:assert/strict'
+import test from 'node:test'
+import ts from 'typescript'
+import { fileURLToPath } from 'node:url'
+
+test('every async native export accepts an instance sink and returns Promise to typed consumers', () => {
+ const filename = fileURLToPath(new URL('../.dev-cache/export-consumer.ts', import.meta.url))
+ const source = `
+ import { export_structure_as, export_structure_as_glb, export_structure_as_obj } from '../node_modules/matterviz/dist/structure/export';
+ import { export_canvas_as_png, export_trajectory_video, type DownloadCallback } from 'matterviz/io';
+ import type { Scene } from 'three';
+ declare const scene: Scene;
+ declare const canvas: HTMLCanvasElement;
+ const sink: DownloadCallback = async (data: Blob | string, filename: string, mime: string) => {};
+ const work: Promise[] = [
+ export_structure_as('xyz', undefined, sink),
+ export_structure_as_glb(scene, undefined, sink),
+ export_structure_as_obj(scene, undefined, sink),
+ export_canvas_as_png(canvas, 'frame.png', 72, null, null, sink),
+ export_trajectory_video(canvas, 'frames.webm', { on_download: sink, on_step: async () => {} }),
+ ];
+ void work;
+ `
+ const options: ts.CompilerOptions = { noEmit: true, strict: true, skipLibCheck: true, target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.ESNext, moduleResolution: ts.ModuleResolutionKind.Bundler }
+ const host = ts.createCompilerHost(options), originalSource = host.getSourceFile, originalExists = host.fileExists, originalRead = host.readFile
+ host.fileExists = path => path === filename || originalExists(path)
+ host.readFile = path => path === filename ? source : originalRead(path)
+ host.getSourceFile = (path, languageVersion, onError, shouldCreateNewSourceFile) => path === filename ? ts.createSourceFile(path, source, languageVersion) : originalSource(path, languageVersion, onError, shouldCreateNewSourceFile)
+ const program = ts.createProgram([filename], options, host)
+ const diagnostics = ts.getPreEmitDiagnostics(program)
+ assert.deepEqual(diagnostics.map(diagnostic => `TS${diagnostic.code}: ${ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')}`), [])
+})
diff --git a/frontend/matterviz-viewer/tests/frequency-export.test.ts b/frontend/matterviz-viewer/tests/frequency-export.test.ts
new file mode 100644
index 00000000..10d97408
--- /dev/null
+++ b/frontend/matterviz-viewer/tests/frequency-export.test.ts
@@ -0,0 +1,175 @@
+import assert from 'node:assert/strict'
+import test from 'node:test'
+import { realpathSync } from 'node:fs'
+import { createRequire } from 'node:module'
+import { createServer } from 'vite'
+
+let server: Awaited>
+let structures: any, io: any, three: any
+const deferred = () => { let resolve!: () => void; const promise = new Promise(r => { resolve = r }); return { promise, resolve } }
+test.before(async () => {
+ server = await createServer({ server: { middlewareMode: true, hmr: false }, appType: 'custom', cacheDir: 'node_modules/.vite-frequency-export-tests' })
+ structures = await server.ssrLoadModule('/node_modules/matterviz/dist/structure/export.js')
+ io = await server.ssrLoadModule('/node_modules/matterviz/dist/io/export.js')
+ three = createRequire(realpathSync(new URL('../node_modules/matterviz/dist/structure/export.js', import.meta.url)))('three')
+})
+test.after(async () => { await server?.close() })
+const molecule = { sites: [{ species: [{ element: 'H', occu: 1 }], xyz: [1,2,3], abc: [0,0,0], label: 'H1' }] }
+
+test('native text sinks are isolated per call, return serialized current structure, and await saves/errors', async () => {
+ const a: any[] = [], b: any[] = [], wait = deferred()
+ let settled = false
+ const first = structures.export_structure_as('xyz', molecule, async (...args: any[]) => { a.push(args); await wait.promise }).then(() => { settled = true })
+ await structures.export_structure_as('json', molecule, async (...args: any[]) => { b.push(args) })
+ assert.equal(a.length, 1); assert.equal(b.length, 1); assert.equal(settled, false)
+ assert.equal(a[0][0], structures.structure_to_xyz_str(molecule))
+ assert.equal(b[0][0], structures.structure_to_json_str(molecule))
+ assert.equal(a[0][2], 'text/plain'); assert.equal(b[0][2], 'application/json')
+ wait.resolve(); await first
+ await assert.rejects(structures.export_structure_as('xyz', molecule, async () => { throw new DOMException('cancelled', 'AbortError') }), { name: 'AbortError' })
+ await assert.rejects(structures.export_structure_as('xyz', molecule, async () => { throw Error('write failed') }), /write failed/)
+})
+
+test('PNG callback receives actual blob bytes and completion waits for its save', async () => {
+ const bytes = new Uint8Array([137,80,78,71,13,10,26,10])
+ const canvas = { toBlob(callback: (blob: Blob) => void) { callback(new Blob([bytes], { type: 'image/png' })) } }
+ const wait = deferred(); let saved: any[] = [], settled = false
+ const pending = io.export_canvas_as_png(canvas, 'water.png', 72, null, null, async (...args: any[]) => { saved = args; await wait.promise }).then(() => { settled = true })
+ await new Promise(resolve => setTimeout(resolve, 0))
+ assert.equal(settled, false)
+ assert.equal(saved[1], 'water-72dpi.png'); assert.equal(saved[2], 'image/png')
+ assert.deepEqual(new Uint8Array(await saved[0].arrayBuffer()), bytes)
+ wait.resolve(); await pending
+})
+
+test('OBJ waits for both ordered saves and propagates companion cancellation/failure', async () => {
+ const scene = new three.Scene()
+ scene.add(new three.InstancedMesh(new three.BoxGeometry(), new three.MeshStandardMaterial({ color: 'red' }), 1))
+ const wait = deferred(), calls: any[][] = []
+ const pending = structures.export_structure_as_obj(scene, molecule, async (...args: any[]) => { calls.push(args); if (calls.length === 1) await wait.promise })
+ await new Promise(resolve => setTimeout(resolve, 0))
+ assert.equal(calls.length, 1, 'must not open/save the MTL before OBJ completes')
+ wait.resolve(); await pending
+ assert.equal(calls.length, 2)
+ assert.match(await calls[0][0].text(), new RegExp(`^mtllib ${calls[1][1].replace('.', '\\.')}`))
+ assert.match(await calls[1][0].text(), /newmtl/)
+ for (const failure of [new DOMException('MTL save cancelled', 'AbortError'), Error('MTL write failed')]) {
+ let count = 0
+ await assert.rejects(structures.export_structure_as_obj(scene, molecule, async () => { if (++count === 2) throw failure }), (error: Error) => error.name === failure.name && error.cause === failure && /companion MTL was not saved/.test(error.message))
+ assert.equal(count, 2)
+ }
+})
+
+test('WebM waits for requested asynchronous frames and native save, then stops every track', async () => {
+ const original = { MediaRecorder: globalThis.MediaRecorder, requestAnimationFrame: globalThis.requestAnimationFrame }
+ const frames: number[] = [], loaded: number[] = [], saved: any[] = [], wait = deferred()
+ let stopped = 0, current = -1
+ const canvas = { width: 32, height: 32, captureStream() { return { getVideoTracks: () => [{ requestFrame() { frames.push(current) }, stop() { stopped++ } }], getTracks() { return this.getVideoTracks() } } } }
+ class Recorder extends EventTarget {
+ static isTypeSupported() { return true }
+ state = 'inactive'
+ start() { this.state = 'recording' }
+ stop() { this.state = 'inactive'; queueMicrotask(() => { const event = new Event('dataavailable'); Object.assign(event, { data: new Blob([new Uint8Array([26,69,223,163]), 'webm'], { type: 'video/webm' }) }); this.dispatchEvent(event); this.dispatchEvent(new Event('stop')) }) }
+ }
+ Object.assign(globalThis, { MediaRecorder: Recorder, requestAnimationFrame: (callback: () => void) => setTimeout(callback, 0) })
+ try {
+ let settled = false
+ const pending = io.export_trajectory_video(canvas, 'water.webm', {
+ fps: 1000, total_frames: 3,
+ on_step: async (index: number) => { await new Promise(resolve => setTimeout(resolve, 30)); current = index; loaded.push(index) },
+ on_download: async (...args: any[]) => { saved.push(args); await wait.promise },
+ }).then(() => { settled = true })
+ for (let attempt = 0; !saved.length && attempt < 150; attempt++) await new Promise(resolve => setTimeout(resolve, 10))
+ assert.equal(saved.length, 1)
+ assert.deepEqual(loaded, [0,1,2]); assert.deepEqual(frames, [0,1,2]); assert.equal(settled, false)
+ assert.equal(saved[0][1], 'water.webm'); assert.equal(saved[0][2], 'video/webm')
+ assert.deepEqual(new Uint8Array((await saved[0][0].arrayBuffer()).slice(0,4)), new Uint8Array([26,69,223,163]))
+ wait.resolve(); await pending; assert.equal(stopped, 1)
+ await assert.rejects(io.export_trajectory_video(canvas, 'fail.webm', { total_frames: 1, on_step: async () => { throw Error('frame failed') } }), /frame failed/)
+ assert.equal(stopped, 2, 'frame failure must stop the capture track too')
+ Recorder.isTypeSupported = () => false
+ await assert.rejects(io.export_trajectory_video(canvas, 'unsupported.webm'), /not supported/)
+ assert.equal(stopped, 2)
+ } finally { Object.assign(globalThis, original) }
+})
+
+test('public components forward instance sinks and recording awaits its own exact lazy-frame/render boundary', async () => {
+ const { readFile } = await import('node:fs/promises')
+ const read = (path: string) => readFile(new URL(`../node_modules/matterviz/dist/${path}`, import.meta.url), 'utf8')
+ for (const component of ['structure/Structure', 'structure/StructureExportPane', 'trajectory/Trajectory', 'trajectory/TrajectoryExportPane']) {
+ assert.match(await read(`${component}.svelte.d.ts`), /on_download\?\s*:/)
+ assert.match(await read(`${component}.svelte`), /on_download/)
+ }
+ const trajectory = await read('trajectory/Trajectory.svelte')
+ assert.match(trajectory, /on_step_change=\{go_to_export_step\}/)
+ assert.match(trajectory, /await load_frame_on_demand\(idx\)/)
+ assert.match(trajectory, /await tick\(\)/)
+ assert.match(trajectory, /renderer\.render\(registered\.scene, registered\.camera\)/)
+ const originalDownload = await read('io/fetch.js')
+ const { execFileSync } = await import('node:child_process')
+ const base = execFileSync('tar', ['-xOf', 'vendor/matterviz-0.4.2-multiwfn.d8719d12.r25.freq1.tgz', 'package/dist/io/fetch.js'], { cwd: new URL('../', import.meta.url), encoding: 'utf8' })
+ assert.equal(originalDownload, base, 'global download behavior must remain byte-identical')
+})
+
+test('GLB native sink gets a complete binary GLTF and its save error is propagated', async () => {
+ const Original = globalThis.FileReader
+ // GLTFExporter uses browser FileReader only to turn its already-produced Blob
+ // into an ArrayBuffer; preserve the real exporter, geometry and binary bytes.
+ class Reader {
+ result: ArrayBuffer | null = null
+ onloadend?: () => void
+ readAsArrayBuffer(blob: Blob) { void blob.arrayBuffer().then(result => { this.result = result; this.onloadend?.() }) }
+ }
+ Object.assign(globalThis, { FileReader: Reader })
+ try {
+ const scene = new three.Scene()
+ scene.add(new three.InstancedMesh(new three.BoxGeometry(), new three.MeshStandardMaterial({ color: 'red' }), 1))
+ let payload!: Blob
+ await structures.export_structure_as_glb(scene, molecule, async (blob: Blob, name: string, mime: string) => {
+ payload = blob; assert.match(name, /\.glb$/); assert.equal(mime, 'model/gltf-binary')
+ })
+ const bytes = await payload.arrayBuffer(), view = new DataView(bytes)
+ assert.equal(new TextDecoder().decode(bytes.slice(0,4)), 'glTF')
+ assert.equal(view.getUint32(4, true), 2); assert.equal(view.getUint32(8, true), bytes.byteLength)
+ await assert.rejects(structures.export_structure_as_glb(scene, molecule, async () => { throw Error('native write failed') }), /native write failed/)
+ } finally { Object.assign(globalThis, { FileReader: Original }) }
+})
+
+test('cancelling OBJ first save never starts the companion save', async () => {
+ const scene = new three.Scene(); let calls = 0
+ await assert.rejects(structures.export_structure_as_obj(scene, molecule, async () => { calls++; throw new DOMException('cancelled', 'AbortError') }), { name: 'AbortError' })
+ assert.equal(calls, 1)
+})
+
+test('interrupting an unresolved lazy frame stops recording without saving or waiting for its loader', async () => {
+ const original = { MediaRecorder: globalThis.MediaRecorder, requestAnimationFrame: globalThis.requestAnimationFrame }
+ const wait = deferred(), controller = new AbortController()
+ let stopped = 0, saved = 0, requested = 0
+ class Recorder extends EventTarget {
+ static isTypeSupported() { return true }
+ state = 'inactive'
+ start() { this.state = 'recording' }
+ stop() { this.state = 'inactive'; this.dispatchEvent(new Event('stop')) }
+ }
+ const track = { requestFrame() { requested++ }, stop() { stopped++ } }
+ const canvas = { width: 2, height: 2, captureStream() { return { getVideoTracks: () => [track], getTracks: () => [track] } } }
+ Object.assign(globalThis, { MediaRecorder: Recorder, requestAnimationFrame: (callback: () => void) => setTimeout(callback, 0) })
+ try {
+ const pending = io.export_trajectory_video(canvas, 'cancelled.webm', { total_frames: 2, signal: controller.signal, on_step: () => wait.promise, on_download: async () => { saved++ } })
+ controller.abort()
+ const outcome = await Promise.race([pending.then(() => 'saved', (error: Error) => error.name), new Promise(resolve => setTimeout(() => resolve('still waiting'), 100))])
+ assert.equal(outcome, 'AbortError')
+ assert.equal(stopped, 1); assert.equal(saved, 0); assert.equal(requested, 0)
+ } finally { wait.resolve(); Object.assign(globalThis, original) }
+})
+
+test('structure exports use the same awaited current-frame transaction and only restore transactions they started', async () => {
+ const { readFile } = await import('node:fs/promises')
+ const read = (path: string) => readFile(new URL(`../node_modules/matterviz/dist/${path}`, import.meta.url), 'utf8')
+ const structure = await read('structure/StructureExportPane.svelte')
+ assert.match(structure, /await callbacks\.before_export\?\.\(\)/)
+ assert.ok(structure.indexOf('await callbacks.before_export?.()') < structure.indexOf('await action(sink)'))
+ assert.match(structure, /if \(started\) await callbacks\.on_export_end\?\.\(\)/)
+ assert.match(await read('trajectory/Trajectory.svelte'), /before_export=\{\(\) => go_to_export_step\(current_step_idx\)\}/)
+ assert.match(await read('trajectory/TrajectoryExportPane.svelte'), /if \(started\) await callbacks\.on_export_end\?\.\(\)/)
+})
diff --git a/frontend/matterviz-viewer/tests/frequency-save.test.ts b/frontend/matterviz-viewer/tests/frequency-save.test.ts
new file mode 100644
index 00000000..491d2cbf
--- /dev/null
+++ b/frontend/matterviz-viewer/tests/frequency-save.test.ts
@@ -0,0 +1,44 @@
+import assert from 'node:assert/strict'
+import test from 'node:test'
+import { createServer } from 'vite'
+let server: Awaited>
+const deferred = () => { let resolve!: (value: T) => void; const promise = new Promise(r => { resolve = r }); return { promise, resolve } }
+test.before(async () => {
+ server = await createServer({ server: { middlewareMode: true, hmr: false }, appType: 'custom', cacheDir: 'node_modules/.vite-frequency-save-tests' })
+})
+test.after(async () => { await server?.close() })
+
+test('native save sends exact bytes/capability and awaits saved, cancellation and failure distinctly', async () => {
+ const { create_frequency_save } = await server.ssrLoadModule('/src/frequency-save.ts')
+ const response = deferred()
+ let request!: { url: URL; init: RequestInit }
+ const sink = create_frequency_save(new URL('http://127.0.0.1:1234/?workbench=1&cap=secret'), async (url: URL, init: RequestInit) => { request = { url: new URL(String(url)), init }; return response.promise })
+ const blob = new Blob([new Uint8Array([137,80,78,71,13,10,26,10,1])], { type: 'image/png' })
+ let settled = false
+ const pending = sink(blob, 'water.png', 'image/png').then(() => { settled = true })
+ await new Promise(resolve => setTimeout(resolve, 0))
+ assert.equal(settled, false)
+ assert.equal(request.url.pathname, '/api/viewer-export')
+ assert.equal(request.url.searchParams.get('cap'), 'secret')
+ assert.equal(request.url.searchParams.get('filename'), 'water.png')
+ assert.deepEqual(new Uint8Array(await (request.init.body as Blob).arrayBuffer()), new Uint8Array(await blob.arrayBuffer()))
+ response.resolve(Response.json({ status: 'saved' })); await pending
+ const cancelled = create_frequency_save(new URL('http://localhost/?cap=x'), async () => Response.json({ status: 'cancelled' }))
+ await assert.rejects(cancelled('text', 'water.xyz', 'text/plain'), { name: 'AbortError' })
+ const failed = create_frequency_save(new URL('http://localhost/?cap=x'), async () => Response.json({ message: 'write failed' }, { status: 500 }))
+ await assert.rejects(failed('text', 'water.xyz', 'text/plain'), /write failed/)
+ await assert.rejects(create_frequency_save(new URL('http://localhost/'), async () => { throw Error('must not fetch') })('text', 'x.xyz', 'text/plain'), /native host/i)
+})
+
+test('save exposes bounded host rejection text and never submits after its viewer is closed', async () => {
+ const { create_frequency_save, FREQUENCY_EXPORT_LIMIT } = await server.ssrLoadModule('/src/frequency-save.ts')
+ const rejected = create_frequency_save(new URL('http://localhost/?cap=x'), async () => new Response('Payload Too Large', { status: 413 }))
+ await assert.rejects(rejected('text', 'water.xyz', 'text/plain'), { message: 'Payload Too Large' })
+ let requests = 0
+ const controller = new AbortController()
+ const closed = create_frequency_save(new URL('http://localhost/?cap=x'), async () => { requests++; return Response.json({ status: 'saved' }) }, controller.signal)
+ controller.abort()
+ await assert.rejects(closed('text', 'water.xyz', 'text/plain'), { name: 'AbortError' })
+ assert.equal(requests, 0)
+ assert.equal(FREQUENCY_EXPORT_LIMIT, 64 * 1024 * 1024)
+})
diff --git a/frontend/matterviz-viewer/tests/vendor-frequency.test.ts b/frontend/matterviz-viewer/tests/vendor-frequency.test.ts
new file mode 100644
index 00000000..261510d2
--- /dev/null
+++ b/frontend/matterviz-viewer/tests/vendor-frequency.test.ts
@@ -0,0 +1,53 @@
+import assert from 'node:assert/strict'
+import { execFileSync } from 'node:child_process'
+import { createHash } from 'node:crypto'
+import { mkdtemp, readdir, readFile, rm, mkdir } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join, relative } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import test from 'node:test'
+
+const vendor = fileURLToPath(new URL('../vendor/', import.meta.url))
+const version = 'matterviz-0.4.2-multiwfn.d8719d12.r25'
+const tree = async (root: string): Promise> => {
+ const files: Record = {}
+ for (const entry of await readdir(root, { withFileTypes: true, recursive: true })) {
+ if (entry.isFile()) {
+ const path = join(entry.parentPath, entry.name)
+ files[relative(root, path)] = createHash('sha256').update(await readFile(path)).digest('hex')
+ }
+ }
+ return files
+}
+
+test('freq2 is an exact, allowlisted layer on retained byte-identical freq1, never a global download override', async () => {
+ const root = await mkdtemp(join(tmpdir(), 'frequency-export-replay-'))
+ try {
+ const base = join(root, 'base'), target = join(root, 'target')
+ await mkdir(base); await mkdir(target)
+ execFileSync('tar', ['-xzf', join(vendor, `${version}.freq1.tgz`), '-C', base])
+ execFileSync('tar', ['-xzf', join(vendor, `${version}.freq2.tgz`), '-C', target])
+ const before = await tree(base)
+ execFileSync('patch', ['--batch', '-p1', '-d', join(base, 'package')], { input: await readFile(join(vendor, 'patches', `${version}.freq2.patch`)) })
+ const after = await tree(base)
+ assert.deepEqual(after, await tree(target))
+ assert.deepEqual(Object.keys(after).sort(), Object.keys(before).sort(), 'no new runtime, dependency or helper package')
+ assert.deepEqual(Object.keys(before).filter(path => before[path] !== after[path]).sort(), [
+ 'package/package.json',
+ 'package/dist/io/export.js', 'package/dist/io/export.d.ts',
+ 'package/dist/structure/index.js', 'package/dist/structure/index.d.ts',
+ 'package/dist/structure/export.js', 'package/dist/structure/export.d.ts',
+ 'package/dist/structure/Structure.svelte', 'package/dist/structure/Structure.svelte.d.ts',
+ 'package/dist/structure/StructureExportPane.svelte', 'package/dist/structure/StructureExportPane.svelte.d.ts',
+ 'package/dist/trajectory/Trajectory.svelte', 'package/dist/trajectory/Trajectory.svelte.d.ts',
+ 'package/dist/trajectory/TrajectoryExportPane.svelte', 'package/dist/trajectory/TrajectoryExportPane.svelte.d.ts',
+ ].sort())
+ assert.equal(after['package/dist/io/fetch.js'], before['package/dist/io/fetch.js'])
+ const archive = await readFile(join(vendor, `${version}.freq2.tgz`))
+ const integrity = `sha512-${createHash('sha512').update(archive).digest('base64')}`
+ assert.ok((await readFile(new URL('../pnpm-lock.yaml', import.meta.url), 'utf8')).includes(`integrity: ${integrity}, tarball: file:vendor/${version}.freq2.tgz`))
+ const installed = await tree(fileURLToPath(new URL('../node_modules/matterviz/', import.meta.url)))
+ const packaged = await tree(join(target, 'package'))
+ for (const [path, digest] of Object.entries(packaged)) assert.equal(installed[path], digest, `installed ${path}`)
+ } finally { await rm(root, { recursive: true, force: true }) }
+})
diff --git a/frontend/matterviz-viewer/vendor/matterviz-0.4.2-multiwfn.d8719d12.r25.freq2.tgz b/frontend/matterviz-viewer/vendor/matterviz-0.4.2-multiwfn.d8719d12.r25.freq2.tgz
new file mode 100644
index 0000000000000000000000000000000000000000..915123fff09bf58efe1312825850f5c26e486da6
G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