feat(transformations): add file output step for saving to disk #1092
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.
Disclaimer
Fair warning: I'm not familiar with the tauri ecosystem, and only have casual experience with svelte.
I took a guess at what this might look like and have manually tested it on my mac machine (though I had to change the cargo lock to get the build to work (excluded from the pr though as I think thats a rust environment issue), happy to make any changes.
Description
This adds a new "File Output" transformation step that writes the transformed text to a file on disk, addressing the workflow automation use case described in #1071.
The step includes a directory picker, filename templating with multiple variables (date, time, recording title, transformation title), and configurable file extensions. Files are written using Tauri's filesystem API with automatic directory creation, and filenames are sanitized to remove invalid characters like
<>:"/\|?*.The implementation adds the step type to the transformation constants, extends the schema to V3 with three new fields (outputDirectory, filenameTemplate, fileExtension), and implements the file-writing logic in the transformer with proper error handling. The UI provides a folder browser button on desktop and shows a warning on web that the step will be skipped (since file system access requires Tauri).
Desktop-only limitation is enforced by checking for
window.__TAURI_INTERNALS__. The step gracefully skips on web and logs a warning rather than failing the entire transformation.Closes #1071