fix(transcription): accept every filename extension a decodable type declares (#868) - #873
fix(transcription): accept every filename extension a decodable type declares (#868)#873yzxcj797 wants to merge 2 commits into
Conversation
…declares (altic-dev#868) supportedFileExtensions kept only each UTType's preferredFilenameExtension. The Ogg audio type (org.xiph.ogg-audio) declares the extensions [ogg, oga, opus] with ogg preferred, so .opus (WhatsApp voice notes) and .oga were rejected by the drop zone and the file picker even though macOS decodes them natively — renaming the same file to .ogg made it work. The set is now built from all of a type's filename-extension tags (plus the preferred one, which is occasionally missing from tags), keeping the property that everything accepted is something AVFoundation can actually decode. Four tests: the Ogg family extensions are accepted, well-known formats stay accepted, the set exactly equals the full tag-derived set (no hand-maintained drift), and non-media extensions stay rejected.
|
The PR Policy check is blocking this PR because required template information is missing. Please update the PR description with:
Screenshots or video are required for UI, UX, settings, onboarding, overlay, menu bar, or visual behavior changes. If this PR has no visual changes, check the no-visual-change box in the template. If this remains incomplete for 48 hours after opening, the PR may be closed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d61092c438
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| /// `["ogg", "oga", "opus"]` with `ogg` preferred, so a preferred-only set | ||
| /// rejected WhatsApp `.opus` voice notes (and `.oga`) even though macOS | ||
| /// decodes them natively. | ||
| final class SupportedFileExtensionsTests: XCTestCase { |
There was a problem hiding this comment.
Add the test file to the Xcode test target
This directory is represented by an explicit PBXGroup, not a filesystem-synchronized group, and Fluid.xcodeproj/project.pbxproj contains no file reference, build-file entry, or sources-phase entry for SupportedFileExtensionsTests.swift. Consequently, the xcodebuild test workflow will never compile or execute this new suite, so the regression coverage added here is ineffective until the file is included in FluidDictationIntegrationTests target membership.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed and pushed: the directory is an explicit PBXGroup, so the file now has all four entries in project.pbxproj (file reference, build-file entry, group child, sources-phase entry), mirroring the AudioBufferConverterTests pattern. The xcodebuild test workflow will compile and run it.
Greptile SummaryThe PR expands meeting-transcription format validation to include every filename extension declared by each AVFoundation-decodable audio or movie type, fixing
|
The FluidDictationIntegrationTests directory is an explicit PBXGroup, so a test file not referenced in project.pbxproj is never compiled or run. Adds the file reference, build-file entry, group child, and sources-phase entry for SupportedFileExtensionsTests.swift, mirroring the existing AudioBufferConverterTests entries.
Closes #868.
Root cause
supportedFileExtensionskept only each UTType'spreferredFilenameExtension. The Ogg audio type (org.xiph.ogg-audio) declares the extensions["ogg", "oga", "opus"]withoggpreferred — so.opus(WhatsApp voice notes arrive as Ogg Opus) and.ogawere rejected by both the drop zone and the file picker, even though macOS decodes them natively (AVAudioFile/AVAssetread them fine; renaming the same file to.oggmade it work).Fix
The set is now built from all of a type's filename-extension tags (
utType.tags.filter { $0.isFilenameExtension }), plus the preferred one as a safety net for types where it is occasionally absent fromtags. The defining property is preserved: everything accepted is somethingAVURLAsset.audiovisualTypes()says AVFoundation can decode — the set just no longer loses decodable extensions to the preferred-only projection.Tests
Four in
Tests/FluidDictationIntegrationTests/SupportedFileExtensionsTests.swift(XCTest, matching the existing integration-test target):ogg,opus,oga) is accepted;wav,mp3,m4a,mp4,mov) stay accepted;txt,pdf) stay rejected.(No Swift toolchain on this Windows machine, so the compile/test gate is CI; the change uses only
UTType.tags/isFilenameExtension, both publicUniformTypeIdentifiersAPI on macOS 11+.)