TOML files not previewed: public.toml UTI is never declared
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start by reading Pique's app Info.plist and find its existing UTExportedTypeDeclarations for other file formats. Add a TOML declaration matching the suggested type identifier, plain-text conformance, and filename extension; then check the built app's Info.plist and confirm macOS resolves a .toml file to public.toml and Quick Look previews it.
Written by the indexing model from the issue text.
Description
Problem
.toml files are not previewed by Pique on macOS 26.6 (Apple silicon), even though the README lists TOML as supported and the extension is registered and enabled. JSON and Python previews work fine. This may be what #25 ran into.
Cause
PiquePreview's QLSupportedContentTypes lists public.toml, but nothing on a stock macOS install declares that UTI, and Pique's own Info.plist doesn't declare it either (it only exports/imports types such as PowerShell, TypeScript, AsciiDoc, NDJSON). So .toml files get a dynamic UTI:
$ mdls -name kMDItemContentType file.toml
kMDItemContentType = "dyn.ah62d4rv4ge81k55rru"
Quick Look matches on the content type, so the extension is never offered the file. QLFileExtensions contains toml, but that didn't help in my case. Having VS Code installed doesn't help either, since it doesn't declare a TOML UTI.
Workaround
A tiny stub app that exports public.toml (conforming to public.plain-text, extension toml), registered with lsregister -f, followed by qlmanage -r && qlmanage -r cache. After that:
$ mdls -name kMDItemContentType file.toml
kMDItemContentType = "public.toml"
and Pique previews .toml files correctly.
Suggested fix
Add an exported type declaration to Pique's app Info.plist (UTExportedTypeDeclarations), as is already done for the other formats:
<dict>
<key>UTTypeIdentifier</key><string>public.toml</string>
<key>UTTypeDescription</key><string>TOML</string>
<key>UTTypeConformsTo</key><array><string>public.plain-text</string></array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key><array><string>toml</string></array>
</dict>
</dict>
(Using UTImportedTypeDeclarations is also an option if you'd rather not claim ownership of the identifier. Other candidates may have the same problem, e.g. .lock, .env, .conf, and .hcl; it's worth checking which of the listed extensions resolve to a dynamic UTI on a clean install.)
- Dominant language
- Swift
- Stars
- 197
- Forks
- 10
- Avg merge
- 18m
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from macadmins/pique
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Similar issues
-
accessibility bug medium-priority mobile
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
lognorman20/monaco#6247 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
swiftlang/swift-format#1312 ·