Repository navigation
feat: native frequency controls and exports (supersedes #77, targets main) - #80
Closed
KaguraSayuki wants to merge 5 commits into
Closed
KaguraSayuki wants to merge 5 commits into
KaguraSayuki wants to merge 5 commits into
Conversation
Add CJSON queues, displacement arrows, native export transactions and bounded workbench save handling on top of the native frequency viewer. Includes export ownership, pre-auth body limits and async API regressions. Snapshot matches locally reviewed tree 0b05285ca7ca07af7127feebfbae898ba4f657da.
Review fixes on top of the native frequency controls PR: - Save sink: an abort only prevents new submissions. The in-flight request is no longer aborted and a host "saved" result is no longer turned into an AbortError, since the native dialog cannot be cancelled from the page. - Displacement arrows use the mode's constant peak excursion instead of the per-frame shift, which was zero on the default equilibrium frame. - Host: viewer save dialogs use their own mutex instead of the workflow execution gate, so batch control is not blocked while a dialog is open. - Host: write via a sibling temporary file and rename, so a failed write never truncates an overwritten file. - Host: append the expected suffix when the chooser returns a name without it, refusing to replace an unconfirmed existing file. - Host: drop the route-level re-validation duplicated from the pre-body header check; save_with now distinguishes invalid (400) from failed (500). - Remove the invalid allowBuilds key that made pnpm 11.5.0 reject the workspace; the existing `matterviz: true` entry covers the package.
- Structure passes its rendered element to child panes. Trajectory spreads
fresh structure_props, which reset Structure's unbound `wrapper` prop to
undefined, so the export pane never saw the canvas and PNG stayed disabled.
- The trajectory export pane tracks its canvas with the DOM observer instead
of a derived query that ran once before the canvas existed ("Canvas not
ready" for WebM).
- Export panes guard only before submitting a save. A submitted native save
(saved, cancelled or failed) is reported as returned, even if the mode
changed meanwhile; restore-time AbortErrors no longer replace that result,
and OBJ's companion MTL is still refused for a replaced owner.
- WebM no longer races its submitted save against the abort signal.
- Bound structure filename stems to 96 characters so long formulas fit the
host's 128-byte limit; OBJ and MTL share the bounded stem.
- FrequencyViewer passes one stable save sink. Recreating it per mode change
re-spread Structure's props and reset the native camera zoom, failing the
existing test:frequency camera check.
The freq2 patch and archive are regenerated reproducibly from freq1 (same
file allowlist); the lockfile integrity is updated. New
frequency-export-transaction tests run the exact pane, Trajectory transaction
and native sink code together; they fail on the previous archive.
test:frequency-controls now completes PNG and WebM and checks a save that
completes after a mode change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195VKS46ScdD4A2Ai3skx3k
When the chooser returns a name without the expected suffix, the host appends it. The dialog never confirmed that adjusted path, so it is now created exclusively (create_new) instead of renamed over the target; a file that appears after the existence check is never replaced. Paths the dialog confirmed keep the atomic temporary-file-and-rename write. Also apply rustfmt to the viewer export changes, which failed the matterviz-gui `cargo fmt --check` step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0195VKS46ScdD4A2Ai3skx3k
Run `pnpm test:frequency-controls` after `test:frequency` in matterviz-gui and upload its failure artifacts. Document that submitted native saves are reported as returned, the bounded filenames, the exclusive write for adjusted names, the canvas fixes and the current validation coverage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0195VKS46ScdD4A2Ai3skx3k
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Collaborator
Author
|
Superseded by #81: the same commits, moved to a branch without the Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supersedes #77 and targets
main(#75 is merged). It contains #77's two commits unchanged (b8d6ebbby @yyywaa from #76, andec0e03a), plus three commits that address the requested changes in the #77 review and CodeRabbit's open comments.1. PNG export was disabled; WebM never started (
e3cb28a)structure_propsobject into Structure. That reset Structure's unboundwrapperbindable prop toundefined, soStructureExportPanenever saw the canvas, andDownload PNGstayed disabled from the start. Structure now passes its rendered element to child panes; the bindable prop is still synced for parents that bind it.TrajectoryExportPanecomputedcanvasas a$derivedofwrapper.querySelector('canvas'). That ran once, before the canvas existed, so the pane reported "Canvas not ready". The pane now tracks the canvas with the same DOM observer that setshas_canvas.2. A successful save was reported as interrupted (
e3cb28a)finish_exporttreats anAbortErrorduring restore as "nothing to restore", so cleanup can no longer replace a completed result with an interruption.3. Existing
test:frequencycamera check regressed (e3cb28a)This regression was already present in #77, and CI would have caught it after retargeting.
FrequencyViewerrebuilt itson_downloadsink on every mode change. Trajectory then re-spread Structure's props, which reset the native camera zoom (244 → 227 in the "switching modes must preserve the camera" check). The viewer now passes one stable sink. On the same machine,test:frequencypasses 7/7 on the #75 base, fails on the #77 head, and passes 7/7 on this branch.4. CodeRabbit findings
e3cb28a): the stem of generated structure filenames is now capped at 96 characters, so they fit the host's 128-byte limit with a DPI suffix and extension. OBJ and MTL share the stem, so themtllibreference still matches.3f946ee): when the host appends a suffix the dialog never confirmed, it creates the file exclusively withcreate_new, so a file that appears after the existence check is never replaced. Paths the dialog confirmed keep the atomic temp-file-and-rename write.docs/frequency-viewer.md.5. CI (
6151b9b)matterviz-gui.ymlnow runspnpm test:frequency-controlsaftertest:frequencyand uploads its failure artifacts.cargo fmt --checkfailed on the feat: extend native frequency controls and exports (depends on #75) #76/feat: native frequency controls and exports, with review fixes (supersedes #76) #77 Rust changes; rustfmt has been applied.Vendor archive
The freq2 patch and archive are regenerated reproducibly from the retained freq1 archive. Before editing, the recipe reproduced both existing files byte for byte. The changed-file allowlist is the same, and the lockfile integrity is updated.
vendor-frequency.test.tspasses.Validation
All runs are local, on Node 24.11.1, pnpm 11.5.0 and Rust 1.88.0 (the CI versions).
pnpm test337 passed, 1 pre-existing skip.svelte-check0 errors.VITE_MATTERVIZ_PRERELEASE_UPDATER=1 pnpm buildpassed.tests/frequency-export-transaction.test.tsruns the exact production code of the export pane, the Trajectory transaction and the native sink together. It covers saved, cancelled and failed results after an owner change, OBJ saved then owner change (MTL not submitted), MTL cancelled or failed (partial result), owner change before submission (refused), WebM after an owner change plus pane abort, and long-formula filenames. 4 of its 6 tests fail on the feat: native frequency controls and exports, with review fixes (supersedes #76) #77 archive; all pass here.test:frequency7/7.test:frequency-controls7/7, which now includes PNG bytes, WebM frame geometry plus camera/step restore, resume after export, and a new check that a save completed after a mode change is reported as saved. In that browser test the save endpoint is stubbed at the HTTP boundary.cargo fmt --check,cargo test --locked(167 passed),cargo clippy -D warningsandcargo build --releaseall passed.noGUI/matterviz_file_dialog.cbuilds with-Wall -Wextra -Werror.file_dialog.rsinvokes it. Accept returns the path (exit 0). Escape returns exit 1. On an existing file the overwrite confirmation appears; Replace returns the path and Cancel returns exit 1. A name with the suffix removed comes back without the suffix, which confirms the host-side append is needed.Generated by Claude Code